Professional Documents
Culture Documents
04_IRC5_ProgramStructure_RW6_M1015_en
04_IRC5_ProgramStructure_RW6_M1015_en
04_IRC5_ProgramStructure_RW6_M1015_en
Program Structure
—
Goal
Data Data
Routine Routine
• Data • Instructions
• instructions Routine Routine
• Data • Instructions
• instructions
Routine
• Data Routine
• Instructions
• Data
• Instructions
Structuring Example 2
Article1_Specific MainProgram
Article2_Specific Communication
SystemData
Overview
– Data is information stored in memory, accessed by its name
– The data declaration declares the name of the data and the initial
value Data declaration
If predefined data don’t cover your needs, you can create your own dataMN2
CONST robtarget pPosition:=[[x, y, z], [q1, q2, q3, q4], [cf1, cf4, cf6, cfx], [eax_a, eax_b, eax_c, eax_d, eax_e, eax_f]];
Information Examples
Instructions are commands you can give the controller:
– MoveJ .….
– Incr …..
– Set …..
– + thousands more
Example
A set of instructions that can be called from the program typing the
name of the routine
Can be either a Procedure or a Function
Can be called from anywhere* in the task by typing its name followed
by a semicolon e.g., RoutineExample;
– Add a system module – Add a procedure call to your routine in the – Increase the value of the data in your
main-routine routine (Add Incr instruction)
– Test run the program from main – Check the new value
(PP to main) (Debug -> View value)
– In what type of module would you put a routine that moves a part from a fixture to a pallet?
– Why?
– In what type of module would you store the definition of a pallet work object?
– Why?
– If you have a program that is stacking boxes on a pallet and it can only stack 5 boxes on top of each other, would you use variable or persistent
data to keep track of the current amount of stacked boxes?
– Why?