C5G Plus - PDL2 - Programing Language Manual
C5G Plus - PDL2 - Programing Language Manual
C5G Plus - PDL2 - Programing Language Manual
Language
System Software
C5GPlus - R1C
Rel. 4.20.xxx
Language Components, Program Structure, Data
Representation, Motion Control, Execution Control,
Ports, Statements List, Routines, Condition Handlers,
Communication, Built-in Routines, Predefined
Variables, Power failure recovery.
CR00758144_en-05/2021.03
Instruction Handbook
The information contained in this manual is the property of COMAU S.p.A.
Reproduction of text and illustrations is not permitted without prior written approval by COMAU S.p.A.
COMAU S.p.A. reserves the right to alter product specifications at any time without notice or obligation.
SUMMARY
SUMMARY
PREFACE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32
Symbols used in the manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Reference documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Modification History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3
Comau Robotics Product Instruction
SUMMARY
POSITION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Frames of reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63
JOINTPOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
XTNDPOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
NODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
PATH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
SEMAPHORE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
CONSTANT declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
TYPE declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
VARIABLE declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Shared types, variables and routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
EXPORTED FROM clause. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71
GLOBAL attribute and IMPORT statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .72
Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Arithmetic Operations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Relational Operations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Logical Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Bitwise Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
VECTOR Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
POSITION Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Data Type conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Operator precedence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Assignment Statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Typecasting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
4
Comau Robotics Product Instruction
SUMMARY
$FLY_TYPE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .96
$DFT_ADVANCE and $ADVANCE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .98
$FLY_PER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99
Timing and Synchronization considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99
Lookahead optional functionality considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101
Motion along a PATH. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
ARM Clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
NODE RANGE Clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Optional Clauses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
ADVANCE Clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .108
WITH Clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .108
Continuous Motion (MOVEFLY). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Stopping and Restarting motions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
CANCEL MOTION Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
LOCK, UNLOCK, and RESUME Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
SIGNAL SEGMENT Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
HOLD Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
ATTACH and DETACH Statements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
HAND Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
5. PORTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...117
General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
User-defined and Appl-defined Ports. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
$DIN and $DOUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
$IN and $OUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
$AIN and $AOUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
$FMI and $FMO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
System-defined Ports. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
$SLI and $SLO. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
$BDI and $BDO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
$GI and $GO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
$FDIN and $FDOUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
$HDIN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
$TIMER, $TIMER_S . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
$PROG_TIMER_xx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Other Ports. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
$BIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
$WORD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
System State After Restart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Cold Start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Power Failure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
5
Comau Robotics Product Instruction
SUMMARY
7. ROUTINES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..151
Procedures and Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
Declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
Declaring a Routine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .153
Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .154
Parameter List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Constant and Variable Declarations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Stack Size. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .155
Function Return Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
Functions as procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .156
RETURN Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
Shared Routines. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
Passing Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Passing By Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
Passing By Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
Optional parameters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Variable arguments (Varargs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Argument identifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
6
Comau Robotics Product Instruction
SUMMARY
9. COMMUNICATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...186
Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
WINDOW Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
FILE Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
PIPE Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
PDL2 Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
NULL Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
Logical Unit Numbers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
Socket use via PDL2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
TCP Socket . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
TCP Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .190
TCP Server. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .191
UDP Socket . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
UDP Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .193
UDP Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .193
7
Comau Robotics Product Instruction
SUMMARY
8
Comau Robotics Product Instruction
SUMMARY
9
Comau Robotics Product Instruction
SUMMARY
10
Comau Robotics Product Instruction
SUMMARY
11
Comau Robotics Product Instruction
SUMMARY
12
Comau Robotics Product Instruction
SUMMARY
13
Comau Robotics Product Instruction
SUMMARY
14
Comau Robotics Product Instruction
SUMMARY
15
Comau Robotics Product Instruction
SUMMARY
16
Comau Robotics Product Instruction
SUMMARY
17
Comau Robotics Product Instruction
SUMMARY
18
Comau Robotics Product Instruction
SUMMARY
19
Comau Robotics Product Instruction
SUMMARY
20
Comau Robotics Product Instruction
SUMMARY
21
Comau Robotics Product Instruction
SUMMARY
22
Comau Robotics Product Instruction
SUMMARY
23
Comau Robotics Product Instruction
SUMMARY
24
Comau Robotics Product Instruction
SUMMARY
25
Comau Robotics Product Instruction
SUMMARY
26
Comau Robotics Product Instruction
SUMMARY
27
Comau Robotics Product Instruction
SUMMARY
28
Comau Robotics Product Instruction
SUMMARY
29
Comau Robotics Product Instruction
SUMMARY
30
Comau Robotics Product Instruction
SUMMARY
15. APPENDIX A -
CHARACTERS SET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...630
Characters Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631
31
Comau Robotics Product Instruction
PREFACE
PREFACE
– Symbols used in the manual
– Reference documents
– Modification History
This symbol indicates operating procedures, technical information and precautions that
if ignored and/or are not performed correctly could cause injuries.
This symbol indicates operating procedures, technical information and precautions that
if ignored and/or are not performed correctly could cause damage to the equipment.
This symbol indicates operating procedures, technical information and precautions that
it are important to highlight.
32
Comau Robotics Product Instruction
PREFACE
Reference documents
This document refers to C5GPlus and R1C Control Units.
The complete set of manuals for C5GPlus and R1C consists of:
33
Comau Robotics Product Instruction
PREFACE
Modification History
– In the current 02/2019.05 version, the following modifications have been made:
• improved MOVE FROM REPLAY statement description both in par. 4.2.3.9
MOVE FROM REPLAY on page 89 and par. 10.30 MOVE Statement on
page 218
• added description for RPL_GET_DATA Built-In Procedure and
RPL_GET_POS Built-In Procedure
• improved description for $RPL_DIR_PATH: Moni replay log file base path for
MOVE REPLAY, $RPL_PROGRESS: MOVE REPLAY progress,
$RPL_SPD_OVR: Speed override for MOVE REPLAY predefined variables
• added description for TIME and DISTANCE BEFORE HALFFLY conditions
in par. 8.3.10 MOTION Events on page 177.
– In the current 03/2019.12 version, the following modifications have been made:
• improved description for the following predefined variables
• $EMT_STRESS: eMotion stress,
• $FLY_DBUG: Cartesian Fly Debug,
• $FLY_DIST: Distance in fly motion,
• $FLY_PER: Percentage of fly motion,
• $FLY_TRAJ: Type of control on cartesian fly,
• $FLY_TYPE: Type of fly motion,
• $FMI: Flexible Multiple Analog/Digital Inputs,
• $FMO: Flexible Multiple Analog/Digital Outputs
• $STRESS_PER: Stress percentage in cartesian fly
• added more details and an example about the use of $FMI and $FMO ports
and the related $FMI_BIT and $FMO_BIT digital ports.
– In the current 05/2021.03 version, the following modifications have been made:
• added description for the following new predefined variables to handle the
Backward Interpretation functionality
• $PROG_IDE_EXEC: Programs IDE execution,
• $PROG_STEP_BACK: Program step backward mode
• modified $CNTRL_CNFG2: Control Unit configuration mode (second
longword) predefined variable description, to handle MODAL motion
instructions in the Backward Interpretation functionality
• added the following paragraphs to describe the new Lookahead option:
• par. 4.1 Motion instructions interpretation and execution on page 82,
• par. 4.2.6.3 Lookahead optional functionality considerations on
page 101,
• par. 4.2.6.1 Involved predefined variables on page 96,
• added description for the following new predefined variables to handle the
Lookahead option
• par. 12.14 $ADVANCE: Motion advance on page 425,
• par. 12.97 $DFT_ADVANCE: Default advance on page 460
• modified the following paragraphs to add notes and examples related to the
Lookahead option:
• par. 4.1 Motion instructions interpretation and execution on page 82,
• par. 4.2.4.1 ADVANCE Clause on page 90,
• par. 4.2.6.3 Lookahead optional functionality considerations on
page 101,
• par. 8.3.10 MOTION Events on page 177,
• par. 10.26 HOLD Statement on page 216,
• par. 10.30 MOVE Statement on page 218,
34
Comau Robotics Product Instruction
PREFACE
35
Comau Robotics Product Instruction
This chapter deals with general specifications that apply to the whole Robot System.
Considering its importance, this chapter is referred to unconditionally in every instruction
handbook of the system.
36
Comau Robotics Product Instruction
37
Comau Robotics Product Instruction
– Connect the Robot to the ground through the Control Unit or specific terminals,
according to the prearrangements present on Robot and/or Control Unit.
– Where provided, check that the Control Unit door/s is/are closed with the
appropriate key.
– A wrong connection of the connectors may cause permanent damage to the
Control Unit components.
– The Control Unit manages internally the main safety interlocks (gates, enabling
push-buttons, etc.). Connect the Control Unit safety interlocks to the line safety
circuits, taking care to connect them as required by the Safety Standards. The
safety of the interlock signals coming from the transfer line (emergency stop, safety
fences etc.), i.e. the making of correct and safe circuits, is the responsibility of the
Robot and Control System integrator.
In the cell/line emergency stop circuit it is necessary to include the contacts of the
emergency stop push-buttons of the Control Unit available on the appropriate connector
(for details, refer to the electrical circuit diagrams and the specific Instruction Handbooks
according to the Unit Control model). The push-buttons are not interlocked inside the
emergency stop circuit of the Control Unit.
Setting the emergency stop in category 0 can result in mechanical damages to the tools
and loss of load if they are not properly designed.
– When preparing protection barriers (when required), especially for light curtains
and access doors, take into consideration the Robot stopping times and distances
according to the stop category (according to IEC 60204-1) and the weight of the
Robot.
The stop circuit timer is normally set to 1.5 seconds. This parameter can be changed if
heavy-duty implements (e.g. rotary tables, positioners, etc.) are matched with the Robot.
The stop circuit timer can be modified by changing its setting within the control logic of
the Control Unit safety aspects. For further details, refer to the paragraph “Safety stop
circuit timer” in the Control Unit Instruction Handbooks.
– Check that the environmental and operating conditions do not exceed the limits
specified in the specific Instruction Handbooks.
– The calibration operations must be carried out with utmost attention, as indicated
in the Instruction Handbooks of the specific product, and must be concluded by
checking the correct position of the machine.
– To load or update the system software (for example after boards replacing), use
only the original software handed over by COMAU. Scrupulously follow the system
software loading procedure described in the Instruction Handbooks supplied with
38
Comau Robotics Product Instruction
the specific product. After loading, always make some Robot motion tests at low
speed remaining outside the Robot action radius.
– Check that the barriers of the Protected Zone (when present) are correctly
positioned.
39
Comau Robotics Product Instruction
The integrator is responsible for the correct integration of the collaborative Robot in the
complete cell/machine.
Before using manual brake releasing devices, it is recommended to sling the Robot, or
hook it to an overhead traveling crane.
– The brake releasing operation can generate crash risks caused by:
40
Comau Robotics Product Instruction
Where required, the replaced safety components must be configured with the same
parameters as those removed.
41
Comau Robotics Product Instruction
– If necessary, during troubleshooting, intervene with the Control Unit powered; all
the precautions specified by Safety Standards must be observed when operating
in presence of dangerous voltages.
– At the end of the maintenance and troubleshooting operations, all the deactivated
safety devices must be reset (panels, protection shields, interlocks, etc.).
– The maintenance, repair and troubleshooting intervention must be completed by
verifying the correct operation of the Robotic system (Robot and Control Unit) and
all safety devices performed outside the Protected Zone / Collaborative Zone.
– During the software loading phases (for example after replacement of electronic
boards) use only the original software handed over by COMAU. Scrupulously
follow the system software loading procedure described in the specific Instruction
Handbooks; after loading, always run a test cycle, remaining outside the Protected
Zone.
– The disassembly of Robot components (e.g. motors, balancing cylinders, etc.) may
cause uncontrolled movements of the axes in different directions: before starting a
disassembly procedure, refer to the warning plates affixed on the Robot and to the
supplied Instruction Handbooks.
– On Robots equipped with balancing springs, it is forbidden to remove the protection
cover of the springs.
– Where fitted, always restore the protective casing if previously installed.
42
Comau Robotics Product Instruction
– Remove the Robot and the Control Unit from the workspace, taking all the
requirements indicated in the products Instruction Handbooks; if lifting is
necessary, check the eyebolts proper fixing and use only suitable slings and
equipment.
The disposal operations must be carried out in compliance with the legislation in force
in the country where the Robotic system is installed; dispose of the batteries, oils and
other chemical liquids in an environmentally correct way and in accordance with the
regulations in force transferring them to specific waste collection centres.
– Consign the Robot and the Control Unit to a centre responsible for the dismantling
and disposal.
43
Comau Robotics Product Instruction
1.6 Responsibilities
The integrator is responsible for the correct integration of the robotic system or its parts
in accordance with the applicable legislation.
Comau is not responsible for any improper use of the robotic system or its parts.
44
Comau Robotics Product Instruction
INTRODUCTION TO PDL2
2. INTRODUCTION TO PDL2
– Peculiarities of PDL2 Language
– Syntax notation
– Language components
– Statements
– Program structure
– Units of measure.
Refer to the Appendix - End User License Agreement in C5GPlus Control Unit Use
manual, for any information about the Licence Agreement for the Comau System
Software.
45
Comau Robotics Product Instruction
INTRODUCTION TO PDL2
Non-holdable programs cannot contain motion statements, however, they can use
positional variables for other purposes. The motion statements which are not
allowed in non-holdable programs are RESUME, CANCEL, LOCK, UNLOCK, and
MOVE.
item1 item3
item1 item2 item3
– items that occur one or more times are followed by three dots. For example, the
description:
item1 item2...
item1 item2
item1 item2 item2
item1 item2 item2 item2 etc.
– vertical bars separate choices. If at least one item must be chosen, the whole set
of choices is enclosed in double vertical bars. For example, the description:
|| item1 | item2 ||
has the following possible results:
item1
item2
Combinations of these notations provide powerful, but sometimes tricky, syntax
descriptions. They are extremely helpful in understanding what can be done in the PDL2
language. A few examples follow
46
Comau Robotics Product Instruction
INTRODUCTION TO PDL2
@ < > = / * + - _ , ; . # $ [] % {} \ : !
Symbols:
() ‘ “
Special Characters: blank (space), tab
47
Comau Robotics Product Instruction
INTRODUCTION TO PDL2
48
Comau Robotics Product Instruction
INTRODUCTION TO PDL2
49
Comau Robotics Product Instruction
INTRODUCTION TO PDL2
Predefined variables have preassigned data types and uses All predefined variables
begin with a dollar sign ($). Predefined Variables List chapter is an alphabetical
reference of predefined variables.
Predefined fields provide access to individual components of structured data types.
Each field is explained in Data Representation chapter under the data type to which it
relates.
Predefined routines, also called built-in routines, are provided to handle commonly
required programming tasks. BUILT-IN Routines List chapter is an alphabetical
reference of built-in routines.
50
Comau Robotics Product Instruction
INTRODUCTION TO PDL2
– variables;
– constants;
– routines;
– labels;
– types;
– fields.
A user-defined identifier must start with a letter. It can contain any number of letters,
digits, and underscore (_) characters. A user-defined identifier can have only one
meaning within a given scope. The scope of an identifier indicates the section of a
program that can reference the identifier.
Program identifiers are contained in a separate scope which means the user can define
a variable having the same name as a program.
A user-defined variable is a name that can represent any value of a particular type. The
programmer declares a variable by associating a name with a data type. That name can
then be used in the program to represent any value of that type.
A user-defined constant is a name that represents a specific value. The programmer
declares a constant by equating a name to a value. That name can then be used in the
program to represent the value. Data Representation chapter explains variable and
constant declarations.
A user-defined routine is a set of instructions represented by a single name. The
programmer can define routines that handle specific parts of the overall job. The routine
name can be used in a program to represent the actual instructions. Routines chapter
describes user-defined routines.
User-defined labels are used to mark the destination of a GOTO statement. Execution
Control chapter describes the use of labels and GOTO statements.
A user-defined type is a set of field definitions represented by a single name. The
programmer declares a type in order to define a new data type which is a sequence of
existing data types. The type name can then be used in the declaration of a variable or
routine. Data Representation chapter explains type and field declarations.
2.4 Statements
PDL2 programs are composed of statements. Statements are a combination of the
following:
– reserved words, symbols, and operators;
– predefined identifiers;
– user-defined identifiers.
Statements must be syntactically correct; that is, they must be constructed according to
the syntax rules of PDL2. The program editor helps provide the correct syntax as
statements are entered. Statements List chapter contains an alphabetical reference of
PDL2 statements.
51
Comau Robotics Product Instruction
INTRODUCTION TO PDL2
required, between operators and their operands (a + b or a+b). Blanks can also be used
to indent statements. However, the editor automatically produces standard spacing and
indentation, regardless of what the programmer uses.
2.4.2 Comments
A comment is text in a program that is not part of the program instructions. Comments
have no effect on how the Control Unit executes statements. A comment begins with two
hyphens (—). The Control Unit will ignore any text that follows the two hyphens, up to a
maximum length of 255 characters. Typically, comments are used by a programmer to
explain something about the program.
A program starts with the PROGRAM statement. This statement identifies the program
with a user-defined name. The same name identifies the file in which the program is
stored. Optional program attributes, explained with the PROGRAM statement in
Statements List chapter, can also be included.
Programs are divided into a declaration section and an executable section. The
declaration section is a list of all the user-defined data items and routines the program
will use. The executable section is a list of statements the Control Unit will execute to
perform a task.
The BEGIN statement separates the declaration section from the executable section.
The programmer can include the CYCLE option with the BEGIN statement to create a
continuous cycle. The END statement marks the end of the program and also includes
the program name.
In this manual, reserved words and predefined identifiers are capitalized, user-defined
identifiers are italicized, and optional items are enclosed in angle brackets <>. A
complete description of syntax notation is provided at the end of this chapter.
PROGRAM pack
VAR
52
Comau Robotics Product Instruction
INTRODUCTION TO PDL2
1. Feeder
2. Robot
3. Discard Bin
4. Table
53
Comau Robotics Product Instruction
INTRODUCTION TO PDL2
54
Comau Robotics Product Instruction
DATA REPRESENTATION
3. DATA REPRESENTATION
This chapter explains each PDL2 data type, how data is declared, and how it can be
manipulated within a program.
Data Types determine the following:
– the kinds of values associated with a data item;
– the operations that can be performed on the data.
PDL2 programs can include the following kinds of data items:
– VARIABLES, representing values that can change;
– CONSTANTS, representing values that cannot change;
– LITERALS, actual values.
The following information are supplied:
– Data Types
– Declarations
– Expressions
– Assignment Statement
– Typecasting
Variables and constants are defined by an identifier and a data type.
Declaring a variable associates an identifier with a data type.
Different values of that type can be assigned to the identifier throughout the program
(unless they have been declared with the CONST attribute - see par. – CONST attribute
on page 70). VARIABLES can be declared to be of any data type.
Declaring a CONSTANT associates a value with an identifier. That value cannot be
changed within the program. The data type of the identifier is determined by the value.
INTEGER, REAL, BOOLEAN, and STRING values can be associated with constant
identifiers.
LITERAL values are actual values used in the program. They can be INTEGER, REAL,
or STRING values.
PDL2 uses expressions to manipulate data in a program. Expressions are composed of
operands and operators. Operands are the data items being manipulated. Operators
indicate what kind of manipulation is performed.
55
Comau Robotics Product Instruction
DATA REPRESENTATION
– ARRAY
– RECORD
– VECTOR
– POSITION
– JOINTPOS
– XTNDPOS
– NODE
– PATH
– SEMAPHORE
3.1.1 INTEGER
The INTEGER data type represents whole number values in the range -2147483647
through +2147483647. The following predefined constants represent the maximum and
minimum INTEGER values:
– MAXINT;
– MININT.
An INTEGER can be represented as decimal (base 10), octal (base 8), hexadecimal (base
16) or binary (base 2). The default base for INTEGERs is decimal. To represent a based
INTEGER literal, precede the number with 0o to specify octal (0o72), Ox to specify
hexadecimal (0xFF), or Ob to specify binary (0b11011).
PDL2 can perform the following operations on INTEGER data:
– arithmetic (+, -, *, /, DIV, MOD, **, +=, -=);
– relational (<, >, =, <>, <=, >=);
– bitwise (AND, OR, XOR, NOT, SHR, SHL, ROR, ROL).
The += and -= operators are used for incrementing and decrementing integer program
variables. They are not permitted to be used on system variables.
The amount of increment can be espressed by a constant or by another integer variable.
For example:
VAR i, j: INTEGER
i += 5 -- It is equivalent to i:=i+5
i -= j -- It is equivalent to i:=i-j
This operator can also be used in condition actions.
At run time, an INTEGER PDL2 variable will assume the value of uninitialized if it
becomes greater than MAXINT.
In addition, PDL2 provides built-in routines to access individual bits of an INTEGER
value and to perform other common INTEGER functions (refer to BUILT-IN Routines
List chapter).
3.1.2 REAL
The REAL data type represents numeric values that include a decimal point and a
fractional part or numbers expressed in scientific notation.
Fig. 3.1 - Range of REAL Data on page 57 shows the range for REAL data.
56
Comau Robotics Product Instruction
DATA REPRESENTATION
3.1.3 BOOLEAN
The BOOLEAN data type represents the Boolean predefined constants TRUE (ON) and
FALSE (OFF).
PDL2 can perform the following operations on BOOLEAN data:
– relational (=, <>);
– Boolean (AND, OR, XOR, NOT).
3.1.4 STRING
The STRING data type represents a series of characters (either ASCII or UNICODE),
treated as a single unit of data.
Single quotes mark the beginning and the end of an ASCII string value.
For example:
‘this is an ASCII string value‘
Double quotes mark the beginning and the end of a UNICODE string value.
For example:
“this is a UNICODE string value”
As far as ASCII strings, in addition to printable characters, they can also contain control
sequences.
An ASCII control sequence consists of a backslash (\) followed by any three digit ASCII
code.
For example:
ASCII Literal: ‘ASCII code 126 is a tilde: \126‘
ASCII Value: ASCII code 126 is a tilde: ~
As far as UNICODE, since it includes a unique code for any type of existing symbols,
strings can contain any type of worldwide used characters.
Each of them can also be indicated by means of \u followed by its UNICODE code.
For example:
UNICODE Literal: “UNICODE 8A89 is \u0x8A89”
57
Comau Robotics Product Instruction
DATA REPRESENTATION
All characters in a STRING value, not represented in the above formats, are replaced
with blanks.
To produce either the backslash (\) or the single (‘) or double (“) quotes characters in a
STRING literal, use two in a row.
For example:
Literal: ‘Single quote‘‘
Value: Single quote ‘
Note that for UNICODE strings, the required length is double + 4, compared with ASCII
strings.
Each UNICODE character is internally represented by means of 2 bytes, whereas each
ASCII character is represented by means of 1 byte only. The +4 is because there are
two bytes, BOM and the end character is \0\0
3.1.5 ARRAY
The ARRAY data type represents an ordered collection of data items, all of the same
type.
The programmer can declare that type to be one of the following:
INTEGER VECTOR
REAL POSITION
BOOLEAN JOINTPOS
STRING XTNDPOS
RECORD SEMAPHORE
58
Comau Robotics Product Instruction
DATA REPRESENTATION
3.1.6 RECORD
The RECORD data type represents a collection of one or more data items grouped
together using a single name. Each item of a record is called a field and can be of any
PDL2 data type except SEMAPHORE, RECORD, NODE, or PATH.
The predefined data types VECTOR, POSITION, and XTNDPOS are examples of
record types. The user can define new record data types in the TYPE section of a
program.
A RECORD type definition creates a user-defined data type that is available to the entire
system. This means that it is possible to have conflicts between RECORD definitions
that have the same name but different fields. Such conflicts are detected when the
programs are loaded. It is recommended that the programmer use a unique naming
convention for RECORD definitions.
A RECORD type definition can be referred to in other programs if it is defined with the
GLOBAL attribute and if it is IMPORTed in such programs by means of the IMPORT
statement (for further details see par. 3.2.2 TYPE declarations on page 67 and
par. 3.2.4.2 GLOBAL attribute and IMPORT statement on page 72)
The programmer can define a RECORD to have as many fields as needed, however,
the maximum size for a record value is 65535 bytes.
Individual fields in a RECORD are referenced by separating the record variable name
and the field name by a period. This is called field notation. For example:
59
Comau Robotics Product Instruction
DATA REPRESENTATION
rec_var.field_name := exp
All of the operations that are available for a particular data type can be performed on
individual fields of that type. An entire RECORD can be used as an argument in a routine
call or used in an assignment statement. When using records in assignment statements,
both records must be of the same RECORD definition.
3.1.7 VECTOR
The VECTOR data type represents a quantity having both direction and magnitude. It
consists of three REAL components. Vectors usually represent a location or direction in
Cartesian space, with the components corresponding to x, y, z coordinates. Fig. 3.3
- Representing Vectors on page 60 shows an example of a vector.
PDL2 can perform the following operations on VECTOR data:
– arithmetic (+, -);
– arithmetic (*, /) VECTOR-INTEGER, VECTOR-REAL, and vice-versa;
– relational (=, <>);
– vector (#, @).
Individual components of a VECTOR are referenced using field notation with the
predefined fields X, Y, and Z. For example:
vec_var.X := 0.65
3.1.8 POSITION
The POSITION data type is used to describe the position of a Cartesian frame of
reference with respect to another (called starting frame).
Generally a position is used to specify the final point for a MOVE statement that is the
position to be reached by the end-of-arm tooling with respect to the user frame.
POSITIONs also define the system frames of reference: for example the position of the
base of the robot ($BASE), the dimensions of the end-of-arm tooling ($TOOL) and the
user frame linked to the workpiece ($UFRAME) (see par. 3.1.8.1 Frames of reference
60
Comau Robotics Product Instruction
DATA REPRESENTATION
61
Comau Robotics Product Instruction
DATA REPRESENTATION
The turn flags are useful for robot axes that can rotate for more than one turn (multi-turn
axes). For this type of robots the same position can be reached in different axis
configurations that differ for one or more turns (360 degrees). There are four turn flags
called: T1, T2, T3, T4.
The syntax inside the configuration string is Ta:b, where ‘a’ represents the flag code (1
to 4) and ‘b’ represents the number of turns (-8 to +7).
The link between the flag name and the axis is shown in the following table:
Tab. 3.1 - Link between flags and axes for different robots
NORMAL CONFIGURATION
Any combination of S, E, W, A, B and Ta:b can be used in the configuration string and
in any order.
An example of valid configuration string follows.
S E W A T1:1 T2:-1 T3:2
62
Comau Robotics Product Instruction
DATA REPRESENTATION
PROGRAM postest
VAR
pos_var : POSITION
BEGIN
pos_var := POS(294, 507, 1492, 13, 29, 16, )
END pos
The world frame is predefined for each arm. The programmer can define the base frame
($BASE) as a position, relative to the world frame. The programmer also can define the
end-of-arm tooling ($TOOL) as a position, relative to the faceplate of the arm.
$UFRAME is a transformation used to describe the position of the workpiece with
respect to the world.
Relative frames can be used to compensate for changes in the workcell, without having
to reteach positional data. For example, $BASE can be changed if the arm is relocated
in the workcell or $TOOL can be changed if the end-of-arm tooling changes. Relative
frames can also be assigned to parts, such as a car body. Positional data can then be
63
Comau Robotics Product Instruction
DATA REPRESENTATION
taught relative to that part, for example, particular weld spots. If the position of the car
body changes, only the frame needs to be retaught to correct all of the weld spots.
3.1.9 JOINTPOS
The JOINTPOS data type represents the actual arm joint positions, in degrees. One real
component corresponds to each joint of the arm.
JOINTPOS data is used to position the end-of-arm tooling using a particular set of joint
movements. Each real value is the actual distance a joint must move from its predefined
“zero” position. Each JOINTPOS variable is associated with a particular arm and cannot
be used with a different arm.
Individual components of a JOINTPOS, like ARRAY components, are referenced by
index numbers.
For example:
PROGRAM jnt_test
VAR
real_var, real_exp : REAL
jointpos_var : JOINTPOS
BEGIN
jointpos_var := ARM_JNTP
real_var := jointpos_var[5]
real_exp := 3.8
jointpos_var[3] := real_exp
END jnt_test
There are no operations for the entire JOINTPOS data type. PDL2 provides built-in
routines to perform JOINTPOS manipulations (refer to BUILT-IN Routines List chapter).
3.1.10 XTNDPOS
The XTNDPOS data type represents an arm position that involves a greater number of
axes than is included in the basic configuration of the robot. It is used for integrated
motion of a group of axes, made up of a robot arm and some additional auxiliary axes,
treated as a single unit in the system. For example, an XTNDPOS could be used to
represent a robot mounted on a rail. The robot and rail would be treated as a single arm
by the system. Each XTNDPOS variable is associated with a particular arm and cannot
be used with a different arm.
The XTNDPOS data type is composed of a Cartesian position for the robot and an
ARRAY of joint values for the remaining axes.
Individual components of an XTNDPOS are referenced using field notation with the
predefined fields POS, a POSITION, and AUX, an ARRAY of REAL. For example:
PROGRAM auxaxis
VAR
plxtn : XTNDPOS
BEGIN
plxtn.POS := POS(294, 507, 1492, 13, 29, 16, ’’)
plxtn.AUX[1] := 100
plxtn.AUX[2] := 150
END auxaxis
There are no operations for the entire XTNDPOS data type.
64
Comau Robotics Product Instruction
DATA REPRESENTATION
3.1.11 NODE
The NODE data type is similar to a RECORD in that it represents a collection of one or
more data items grouped together using a single name. Each item of a node is called a
field and can be of any PDL2 data type except SEMAPHORE, RECORD, NODE, or
PATH.
The difference between a NODE and a RECORD is that a NODE can include a group
of predefined node fields in addition to user-defined fields. The predefined node fields
begin with a $ and have a meaning known to the system identical to the corresponding
predefined variable. The collection of predefined node fields contains a destination and
description of a single motion segment (motion segments are described in Chap.4. -
Motion Control on page 82).
Node data types are defined in the TYPE section of a program. A node type definition
creates a user-defined data type that is available to the entire system. This means that
it is possible to have conflicts between RECORD and NODE definitions that have the
same name but different fields. Such conflicts are detected when the programs are
loaded. It is recommended that the programmer use a unique naming convention for
RECORD and NODE definitions.
Like for RECORD data types, a NODE type definition can be referred to in other
programs if it is defined with the GLOBAL attribute and if it is IMPORTed in such
programs by means of the IMPORT statement (for further details see par. 3.2.2 TYPE
declarations on page 67 and par. 3.2.4.2 GLOBAL attribute and IMPORT statement on
page 72)
The programmer can define a node to have as many fields as needed, however, the
maximum size for a node value is 65535 bytes.
Individual fields in a node are referenced by separating the node variable name and the
field name by a period. This is called field notation. For example:
3.1.12 PATH
The PATH data type represents a sequence of nodes to be interpreted in a single
motion. The PATH data type is a predefined record containing the fields NODE,
FRM_TBL, and COND_TBL.
The NODE field is an ARRAY of nodes representing the sequence of nodes. It is
dynamic in length which means nodes can be added and deleted from the table during
execution. The maximum number of nodes in a path is 65535 but the amount of memory
on the system may not permit this many nodes.
The structure of the nodes in the NODE array is determined by the user-defined node
definition declared in the TYPE section of the program. Each node contains a
destination and description for a single motion segment (motion is described in Motion
Control chapter). This provides the programmer with the ability to customize the node
65
Comau Robotics Product Instruction
DATA REPRESENTATION
definitions for different applications. Please note that it is possible to have different paths
use different node definitions, however, all nodes within the same path will have the
same node definition.
The node type is available to the entire system. This means that it is possible to have
conflicts between node types that have the same name but different field definitions. It
is recommended that the programmer use a unique naming convention for node
definitions in order to avoid such conflicts.
Individual nodes of a path are referenced by indexing the NODE field of the path
variable.
For example:
path_var.NODE[3] := path_var.NODE[5]
path_var.NODE[4] := node_var
Individual fields in a path node are referenced using field notation. For example:
path_var.NODE[3].field_name := exp
All of the operations that are available for a particular data type can be performed on
individual fields of that type.
The FRM_TBL field is an ARRAY of POSITIONs representing reference and/or tool
frames to be used during the processing of the path nodes. The FRM_TBL array
contains 7 elements. The usage of the FRM_TBL field is described in the PATH Motion
section of Chap.4. - Motion Control on page 82.
The COND_TBL field is an ARRAY of INTEGERs representing condition handler
numbers to be used during the processing of the path nodes. The COND_TBL array
contains 32 elements. The usage of the COND_TBL field is described in the PATH
Motion section of Chap.4. - Motion Control on page 82.
There are no operations for the entire PATH type. An entire path can be used in the
MOVE ALONG statement or as an argument in a routine call. PDL2 provides built-in
routines to insert, delete, and append nodes to a path. Additional built-ins are provided
to obtain the number of nodes in a path and assign/obtain a node identifier (refer to
Chap.4. - Motion Control on page 82).
3.1.13 SEMAPHORE
The SEMAPHORE data type represents an aid for synchronization when there are
multiple programs running that share the same resources. The SEMAPHORE, or an
array of SEMAPHOREs is used to provide mutual exclusion of a resource so that
separate programs cannot act on that resource at the same time.
There are no operations for the SEMAPHORE data type, but the following statements
use SEMAPHORE variables:
– WAIT Statement;
– SIGNAL Statement.
Execution Control chapter provides more information about using SEMAPHOREs.
3.2 Declarations
This section describes
– CONSTANT declarations,
66
Comau Robotics Product Instruction
DATA REPRESENTATION
– VARIABLE declarations,
– TYPE declarations.
– Shared types, variables and routines
CONST
num_parts = 4
max_angle = 180.0
part_mask = 0xF3
test_flag = TRUE
error = ‘An error has occurred.‘
PDL2 provides predefined constants for representing commonly used values. These
predefined constants are listed in Tab. 2.3 - Predefined Constants on page 49 of
Introduction to PDL2 chapter.
67
Comau Robotics Product Instruction
DATA REPRESENTATION
full details.
The fld_name identifiers indicate the user-defined fields of the RECORD or NODE type.
The predefined_name identifiers in a node definition indicate the set of motion segment
characteristics contained in each node. As indicated above, the predefined node fields
must be specified before the user-defined node fields.
Each predefined_name can be one of the following:
The meaning of each predefined node field is identical to the predefined variable having
the same name. These are described in the Motion Control chapter and Predefined
Variables List chapter.
The $MAIN_POS, $MAIN_JNTP, and $MAIN_XTND fields indicate the main destination
of a motion segment. A node definition can include only one of the $MAIN_ predefined
fields. The particular one chosen indicates the data type of the main destination.
If a predefined node field is used in the program and not included in the node definition,
the program editor will automatically insert that field in the declaration. This is called an
implicit declaration.
The NOTEACH clause is used to indicate that the fields declared in that declaration
should not be permitted to be changed while a path is being modified in the teaching
environment (MEMORY TEACH Command). (Refer to the C5G Control Unit Use
manual for more information on the teaching environment.)
Type declarations appear in a type declaration section, following the reserved word
TYPE. For example:
TYPE
ddd_part = RECORD GLOBAL -- declared to be IMPORTable by
-- other programs
name : STRING[15]
count : INTEGER
params : ARRAY[5] OF REAL
ENDRECORD
lapm_pth1 = NODEDEF
$MAIN_POS, $SEG_TERM_TYPE
$MOVE_TYPE
$SEG_WAIT NOTEACH
weld_sch : ARRAY[8] OF REAL
gun_on : BOOLEAN
ENDNODEDEF
The type declaration is just a definition for a new data type. This new data type can be
used for variable and parameter declarations.
68
Comau Robotics Product Instruction
DATA REPRESENTATION
INTEGER
REAL
BOOLEAN
STRING [length]
ARRAY[rows <,columns>] OF item_type (par. 3.1.5 ARRAY on page 58)
record_type
node_type
VECTOR
POSITION
JOINTPOS <FOR ARM[number]>
XTNDPOS <FOR ARM[number]>
PATH OF node_type
SEMAPHORE
The possible values and ranges for length, rows, columns, and item_type are explained
in par. 3.1 Data Types on page 55 of current chapter.
The length of a STRING or the size(s) of an ARRAY can be specified with an * instead
of an actual value. If the * notation is used with a two-dimensional ARRAY, then two *
must be used (*, *). The * notation is used when importing STRING or ARRAY variables
from another program. The program owning the variable should specify the actual size
of the variable while the importing program(s) use the * notation (refer to the example in
the Shared Variables and Routines section of this chapter). If the variable is accessed
before an actual size for it has been determined, an error will occur. The actual size is
determined when a program or variable file specifying the actual size is loaded. The
importing programs can obtain the actual size using built-in routines (refer to BUILT-IN
Routines List chapter).
The * notation is not allowed in local routine variables or field definitions.
Arm designations are set up at the system level by associating an arm number with a
group of axes. They are not required for single arm systems (refer to the C5G Controll
Unit Use manual).
If an arm designation is not specified in the declaration of a JOINTPOS or XTNDPOS,
the program attribute PROG_ARM is used. If PROG_ARM is not specified in the
program, the default arm ($DFT_ARM) is used.
The valid var_options are as follows:
– EXPORTED FROM clause and GLOBAL attribute
See par. 3.2.4 Shared types, variables and routines on page 71 for full details.
– initial_value
69
Comau Robotics Product Instruction
DATA REPRESENTATION
VAR
count, total : INTEGER (0) NOSAVE
timing : INTEGER (4500)
angle, distance : REAL
job_complete, flag_check, flag_1, flag_2 : BOOLEAN
error_msg : STRING[30] GLOBAL
menu_choices : ARRAY[4] OF STRING[30]
matrix : ARRAY[2, 10] OF INTEGER
offset : VECTOR
part_rec : ddd_part
pickup, perch : POSITION
safety_pos : JOINTPOS FOR ARM[2]
door_frame : XTNDPOS FOR ARM[3]
weld_node : lapm_pth1
weld_pth : PATH OF lapm_pth1
70
Comau Robotics Product Instruction
DATA REPRESENTATION
PROGRAM a
VAR p: POSITION -- local
VAR x : INTEGER EXPORTED FROM a GLOBAL -- can be imported by others
VAR ary : ARRAY[5] OF REAL EXPORTED FROM a GLOBAL -- can be imported by others
ROUTINE rout (x:REAL) EXPORTED FROM a GLOBAL -- can be imported by others
ROUTINE rout (x:REAL)
BEGIN
-- write here the body of rout
END rout
71
Comau Robotics Product Instruction
DATA REPRESENTATION
BEGIN
-- write here the main body of program a
END a
The EXPORTED FROM clause does not apply to routine local variables. In addition, the
initial value clause cannot be included when the EXPORTED FROM clause specifies a
program name different from the name of the program in which the statement resides.
variable_name GLOBAL
variable_name indicates the name of the declared variable. In such a way, the
declared variable can be accessed by other programs.
– The syntax for declaring a routine to be public, is as follows:
The IMPORT statement must be used to import ANY GLOBAL types, variables and/or
routines from another program (see par. 10.28 IMPORT Statement on page 217).
The syntax for importing them is as follows:
IMPORT ‘prog_name‘
prog_name is the name of the program which owns the types, variables and routines to
72
Comau Robotics Product Instruction
DATA REPRESENTATION
be imported. They all are imported in the current program without explicitly declaring
them.
NOTE that PDL2 Programs using the IMPORT statement cannot be opened in Program
Edit environment.
The following example shows how to use the IMPORT clause and the GLOBAL
attribute, for shared variables.
PROGRAM a
IMPORT ‘b‘ -- causes just y to be imported from program b
VAR
x : INTEGER GLOBAL -- declared to be public
ary : ARRAY [5] OF REAL GLOBAL -- declared to be public
ROUTINE rout(x:REAL) EXPORTED FROM a GLOBAL -- declared to be
-- public
BEGIN
. . .
END rout
BEGIN
. . .
END a
PROGRAM b
IMPORT ‘a‘ -- causes x, ary and rout to be imported from program a
VAR
y : REAL GLOBAL -- declared to be public
i : INTEGER -- declared to be local to program b (not public)
BEGIN
. . .
END b
3.3 Expressions
Expressions are combinations of any number of constants, variables, function routines,
and literals joined with operators to represent a value. For example:
count + 1 -- arithmetic
VEC(a, b, c) * 2 -- arithmetic
count >= total -- relational
flag_1 AND flag_2 -- BOOLEAN
An expression has both a type and a value. The type is determined by the operators and
operands used to form it. Tab. 3.2 - Operation Result Types on page 74 shows which
operand data types are allowed for which operators and what data types result. The
resulting value can be assigned to a variable of the same type using an assignment
statement.
In Tab. 3.2 - Operation Result Types on page 74, the following abbreviations are used:
I INTEGER V VECTOR
R REAL P POSITION
B BOOLEAN
73
Comau Robotics Product Instruction
DATA REPRESENTATION
(1) Only the operators = and <> may be used to compare VECTOR values.
+= INTEGER increment
-= INTEGER decrement
74
Comau Robotics Product Instruction
DATA REPRESENTATION
VECTOR addition and subtraction require VECTOR operands and produce a VECTOR
result whose components are the sum or difference of the corresponding elements of
the operands.
VECTOR scaler multiplication and division require a VECTOR operand and an
INTEGER or REAL operand and produce results obtained by performing the operation
on each element in the vector (an INTEGER operand is treated as a REAL). If an
INTEGER or REAL number is divided by the VECTOR, that value is multiplied by the
reciprocal of each element of the VECTOR.
PDL2 provides built-in routines to perform common mathematical manipulations,
including rounding and truncating, trigonometric functions, and square roots (refer to
BUILT-IN Routines List chapter).
= equal
75
Comau Robotics Product Instruction
DATA REPRESENTATION
result. The left operand is the value to be shifted or rotated and the right operand
specifies the number of bits to shift or rotate. The shift operators perform an arithmetic
shift which causes the shifted bits to be discarded, zeros to be shifted into the vacated
slots on a shift left, and a copy of the signed bit (bit 32) from the original value to be
shifted into the vacated positions on a shift right. The rotate operators cause the shifted
bit(s) to be wrapped around to the opposite end of the value. Fig. 3.6 and Fig. 3.7 show
an example of the shift left and rotate left operations. Fig. 3.8 shows an example of a
shift right instruction. Fig. 3.6 shows the result of the following PDL2 statement:
x := -122704229 SHL 1
x := -122704229 ROL 1
NOTE that the Shift Left operation might cause the variable to become UNINIT: at run
time, an INTEGER PDL2 variable will assume the value of UNINIT (uninitialized) if it
becomes greater than MAXINT.
x := -122704229 SHR 1
76
Comau Robotics Product Instruction
DATA REPRESENTATION
The operations performed by BOOLEAN, rotation, and shift operators are listed below.
Refer to BUILT-IN Routines List chapter for explanations of BIT_TEST, BIT_SET, and
BIT_CLEAR.
77
Comau Robotics Product Instruction
DATA REPRESENTATION
NOTE THAT the relative position operator (:), applied to two POSITION operands, does
not handle Multiturn flags.
Three PDL2 program follow showing some examples of using the relative position
operator:
78
Comau Robotics Product Instruction
DATA REPRESENTATION
If parentheses are not used in an expression, the user should be aware of the exact
order in which the operators are performed. In addition, those parentheses that are not
required in the expression will automatically be removed by the system. For example,
the first IF statement below will actually produce the following IF statement because the
parentheses do not override normal operator precedence
79
Comau Robotics Product Instruction
DATA REPRESENTATION
If the FALSE test of $DIN[6] is to be ANDed with $DIN[5], parentheses must be used to
override operator precedence:
variable := expression
Examples of assignment statements:
count := count + 1
offset := VEC(a, b, c) * 2
menu_choices[7] := 7. Return to previous menu
part_rec.params[1] := 3.14
part_mask := 0xE4
weld_pth.NODE[3].$SEG_WAIT := FALSE
$MOVE_TYPE := LINEAR
The PATH and SEMAPHORE data types cannot be assigned values.
If the same value is assigned to more than one user-defined variable of the same data
type, multiple assignements can be put on the same line. System variables, predefined
node fields and path nodes are not allowed. For example:
3.5 Typecasting
This PDL2 feature involves INTEGER, BOOLEAN and REAL variables and values. It is
a very specific feature and it is used in very particular applications.
The case in which only INTEGER and REAL data types are involved differs from the one
in which also BOOLEAN data type is used. In both cases typecasting is expressed by
specifying in round brackets the data type to apply to the casting operation.
In case of typecasting between INTEGER and REAL data types, the variable or value
associated to the casting operation is read in the Control Unit memory and the bit pattern
80
Comau Robotics Product Instruction
DATA REPRESENTATION
that forms this value is considered; this bit pattern is then assigned to the destination of
the assignement or compared with the other operator of the expression.
Then used in assignements, casting can only be specified on the right hand side. When
used in relational expressions, it can be specified in any side. This feature is allowed in
program statements, condition actions and condition expressions. INTEGER variables,
ports or values, and REAL variables or values are used.
Consider for example the numbers 0x40600000 and 0x3f99999A that are the
hexadecimal representation of the bit pattern of 3.5 and 1.2 numbers in the Control Unit
memory.
CONDITION[5] :
-- if real_var values 5.5 and int_var 0x3f99999A
-- the condition will trigger
WHEN (INTEGER)real_var> int_var DO
real_var := (REAL)3
WHEN $AOUT[13] < (INTEGER) real_var DO
int_var := (INTEGER)5.6
WHEN real_var > (REAL)int_var DO
$AOUT[7] := (INTEGER)5.6
WHEN real_var > (REAL)$AOUT[4] DO
int_var := (INTEGER)real_var
ENDCONDITION
In case of typecasting between INTEGER and BOOLEAN or REAL and BOOLEAN data
types, the typecasting consists in assigning the value of 1 or 1.0 to the destination
INTEGER or REAL variable respectively if the BOOLEAN variable (or port or value) is
TRUE, 0 otherwise.
This aspect of typecasting is not allowed in conditions handlers.
For example:
int_var := (INTEGER)bool_var
int_var := (INTEGER)$DOUT[5]
real_var := (REAL)bool_var
real_var := (REAL)$FDOUT[6]
81
Comau Robotics Product Instruction
MOTION CONTROL
4. MOTION CONTROL
This chapter describes the PDL2 statements that control arm motion and direct hand
operations.
Information are supplied about the following topics:
– Motion instructions interpretation and execution
– MOVE Statement
– Motion along a PATH
– Stopping and Restarting motions
– ATTACH and DETACH Statements
– HAND Statements
For any further information, refer to par. 4.2.4.1 ADVANCE Clause on page 90 and
related Example, as well as par.5.10.2 Continuous motion modes (FLY), Motion
programming manual.
82
Comau Robotics Product Instruction
MOTION CONTROL
– SYNCMOVE Clause
– Continuous motion (MOVEFLY).
The syntax of the MOVE statement is as follows:
LINEAR
CIRCULAR
JOINT
83
Comau Robotics Product Instruction
MOTION CONTROL
The trajectory, when specified with the MOVE statement, only affects the motion for
which it is designated.
If a trajectory clause is not included in the MOVE statement, the value of the predefined
variable $MOVE_TYPE is used.
The programmer can change the value of $MOVE_TYPE (JOINT by default) by
assigning one of the trajectory predefined constants, as follows:
84
Comau Robotics Product Instruction
MOTION CONTROL
4.2.3.1 MOVE TO
MOVE TO moves the designated arm to a specified destination.
The destination can be any expression resulting in one of the following types:
POSITION
JOINTPOS
XTNDPOS
For example:
MOVE TO initial
MOVE CIRCULAR TO destination VIA arc
85
Comau Robotics Product Instruction
MOTION CONTROL
POSITION
JOINTPOS
XTNDPOS
For example:
Note that if one or more optional clauses (arm_clause, trajectory_clause, etc.) are not
specified, the corresponding default value is used.
For example:
86
Comau Robotics Product Instruction
MOTION CONTROL
87
Comau Robotics Product Instruction
MOTION CONTROL
4.2.3.7 MOVE BY
MOVE BY allows the programmer to specify a destination as a list of REAL expressions,
with each item corresponding to an incremental move for the joint of an arm.
For rotational axes, the units are degrees, and for transitional, they are millimeters.
For example:
POSITION
JOINTPOS
XTNDPOS
Fig. 4.5 shows an example of a MOVE FOR followed by a MOVE TO.
88
Comau Robotics Product Instruction
MOTION CONTROL
NOTE that the only way to re-execute (replay) a previously recorded trajectory from a
file, is to use a MOVE FROM .. REPLAY statement: such a statement cannot be split
into two parts, meaning a joint movement and previously recorded movements! It is a
single statement.
Syntax:
The REPLAY clause causes the robot to re-execute a previously recorded trajectory. It
is mandatory and it can only be used in MOVE FROM statement.
With reference to the previous example, the robot moves towards the specified
start_pos position, then continues executing the previously recorded trajectory included
in rec_file.log file.
It is also allowed to use the WITH clause for controlling speed in such movements
execution (see previous example).
In order to make the use of such a statement easier, the following predefined variables
are available:
– $RPL_DIR_PATH: Moni replay log file base path for MOVE REPLAY - it is useful
to specify the search path for the file containing the previously taught movements
sequence. It can be assigned before using MOVE FROM..REPLAY statement
– $RPL_PROGRESS: MOVE REPLAY progress - it contains the progress
percentage of the MOVE FROM..REPLAY execution
– $RPL_SPD_OVR: Speed override for MOVE REPLAY - it is a speed factor to
control the speed of the MOVE FOR..REPLAY statement execution. It is a modal
value.
None of the other optional clauses are allowed with MOVE FROM statement.
89
Comau Robotics Product Instruction
MOTION CONTROL
MOVE TO pnt0001p
MyRoutine1() -- executed after move is completed
MOVE TO pnt0002p ADVANCE
MyRoutine2() -- executed while move is in progress
MOVE TO pnt0003p
Starting from 4.20.xxx system software version, the use of the ADVANCE clause
combined with the $ADVANCE: Motion advance predefined variable, makes available
an improved “looking ahead” OPTIONAL functionality of the Interpreter.
For further detailed information, see also par. 4.2.6.1.2 $DFT_ADVANCE and
$ADVANCE on page 98 and par. 5.10.2 Continuous motion modes (FLY) in Motion
Programming manual.
Note that the following sample program can be appied to the systems with Lookahead
option only.
4.2.4.1.1 Example
PROGRAM p_Jstar PROG_ARM = 1
VAR
vp_cal_user, p11 : POSITION
vj_cal_user : JOINTPOS
vr_scale : REAL
ray : REAL
ray2 : REAL
si_i : INTEGER
p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p12 : POSITION
BEGIN
-- $UFRAME := POS(-200, -500, 661, 0, 0, $ARM_DATA[1].CAL_USER[1] * -1) --uf04
-- adjusting to more robots
$UFRAME := POS(0)
90
Comau Robotics Product Instruction
MOTION CONTROL
vj_cal_user := $ARM_DATA[1].CAL_USER
vj_cal_user[5] := 90
JNTP_TO_POS(vj_cal_user, vp_cal_user)
CONDITION[1] :
WHEN AT END DO
HOLD
ENDCONDITION
CONDITION[5] :
WHEN AT END DO
ru_print(5)
ENDCONDITION
CONDITION[12] :
WHEN AT END DO
ru_print(12)
ENDCONDITION
$FLY_DIST := -1
$TIMER[1] := 0
MOVE JOINT TO vp_cal_user -- cal_user is the starting position
FOR si_i := 1 TO 100 DO
MOVEFLY JOINT TO p1 ADVANCE WITH CONDITION[1]
WRITE LUN_CRT ('Print after MOVEFLY TO P1 ', $TIMER[1], NL)
MOVEFLY JOINT TO p2 ADVANCE
MOVEFLY JOINT TO p3 ADVANCE
MOVEFLY JOINT TO p4 ADVANCE
MOVEFLY JOINT TO p5 ADVANCE WITH CONDITION[5]
WRITE LUN_CRT ('Print after MOVEFLY TO P5 ', $TIMER[1], NL)
MOVEFLY JOINT TO p6 ADVANCE
MOVEFLY JOINT TO p7 ADVANCE
MOVEFLY JOINT TO p8 ADVANCE
MOVEFLY JOINT TO p9 ADVANCE
MOVEFLY JOINT TO p10 ADVANCE
MOVEFLY JOINT TO p11 ADVANCE
MOVEFLY JOINT TO p12 ADVANCE WITH CONDITION[12]
WRITE LUN_CRT ('Print after MOVEFLY TO P12 ', $TIMER[1], NL)
ENDFOR
91
Comau Robotics Product Instruction
MOTION CONTROL
MOVE JOINT TO p1
MOVE JOINT TO vp_cal_user
IF $CYCLE = 5 THEN
DEACTIVATE
ENDIF
END p_Jstar
Note that:
– the execution cursor is exactly 7 motion statements (or the $ADVANCE current
value) ahead of the motion cursor position (the WRITE statement is not taken into
account among the 7 looked ahead statements, since the motion statements only
are included in the amount specified by $ADVANCE)
– all the non motion statements included between the motion cursor and the
execution cursor (yellow one) has already been executed (the WRITE statement at
line 86 too, even if the motion statement at line 85 hasn’t been processed yet)
– all the motion statements included between the two cursors, are loaded into
memory and are displayed in the IDE -> Details -> View motions of program
page (see figure above on the right)
– routine ru_print(5) inserted in CONDITION[5] is executed when Motion Event AT
END of MOVEFLY to P5 triggers; TIMER[1] value is printed in order to underline
the time difference between the two highlited lines
– the HOLD statement, within CONDITION[1], is also executed when the AT END
Motion Event triggers for MOVEFLY TO P1 statement; if it had been inserted
among the lines, like the WRITE statements, it would have been processed in
92
Comau Robotics Product Instruction
MOTION CONTROL
advance, not synchronized with the previous motion execution but at the
Interpreter execution cursor passage instead.
AT VIA
TIME n AFTER START -- n is a time in milliseconds
TIME n BEFORE END
DISTANCE n AFTER START -- in cartesian movement only
DISTANCE n BEFORE END -- n is a distance in millimiters
DISTANCE n AFTER VIA
DISTANCE n BEFORE VIA
PERCENT n AFTER START -- in joint movement only
PERCENT n BEFORE END -- n is a number expressing a percentage
-- digital port events digital port states
93
Comau Robotics Product Instruction
MOTION CONTROL
94
Comau Robotics Product Instruction
MOTION CONTROL
When the ADVANCE clause is used, it must be placed in the MOVE section and not the
SYNCMOVE section.
If an arm is not specified in the SYNCMOVE clause, $SYNC_ARM is used.
The synchronized motion feature is not supported in systems with eMotion Trajectory
control.
The user is notified by a suitable message.
The synchronized motion feature is not supported in systems with eMotion Trajectory
control.
The user is notified by a suitable message.
For FLY to work properly, the ADVANCE clause must be used to permit interpretation
of the following MOVE statement as soon as the first motion begins.
It is not necessary for the two trajectories of the fly motion to have the same Base or
Frame, but it is necessary to have the same Tool!
For example:
MOVE TO a
MOVEFLY TO b ADVANCE
MOVE TO c
95
Comau Robotics Product Instruction
MOTION CONTROL
NOTE that in order to properly execute the fly trajectory, the MOVEFLY ADVANCE
statement must be always follwed by one more MOVE statement in the execution
context of the same program.
It is recommended to avoid leaving a MOVEFLY as last motion statement of a program.
4.2.6.1.1 $FLY_TYPE
The predefined variable $FLY_TYPE is used to indicate the connection type during the
fly motion.
The allowed values are:
– FLY_NORM
– FLY_PLUS (with Lookahead option only, available with eMotion 3.0 Control,
since 4.20.xxx system software version) - for Joint FLY only
– FLY_MULTI (with Lookahead option only, available with eMotion 3.0 Control,
since 4.20.xxx system software version) - both for Joint FLY and Cartesian FLY
– FLY_CART (NOT with eMotion Control).
FLY_NORM
If $FLY_TYPE predefined variable is set to FLY_NORM (normal fly), the arm speed will
vary during fly.
In case of eMotion trajectory control and cartesian motions, by default FLY_NORM
already includes an improved algorithm for keeping the arm speed constant, similarly to
the standard FLY_CART.
FLY_PLUS
This value of $FLY_TYPE, since 4.20.xxx system software version, is only available
with Lookahead option, for any situations with $ADVANCE >= 2.
It refers to Joint Motions only and allows executing in advance the preliminary
calculations and being able to plan a more evident joint connection than in case of
FLY_NORM.
For further detailed information, refer to par. 4.2.6.3 Lookahead optional functionality
considerations on page 101 and par. 12.143 $FLY_TYPE: Type of fly motion on
page 478 in the current manual and par.5.10.2.3.1 Using $FLY_TYPE and $FLY_PER
for the Joint FLY, in Motion programming manual.
96
Comau Robotics Product Instruction
MOTION CONTROL
FLY_MULTI
This value of $FLY_TYPE, since 4.20.xxx system software version, is only available
with Lookahead option, for any situations with $ADVANCE = 7.
Joint Motions: the final position of each MOVE statement is modified according to the
positions taken into account during the Interpreter lookahead.
For further detailed information, refer to par. 4.2.6.3 Lookahead optional functionality
considerations on page 101 and par. 12.143 $FLY_TYPE: Type of fly motion on
page 478 in the current manual and par.5.10.2.3.1 Using $FLY_TYPE and $FLY_PER
for the Joint FLY, in Motion programming manual.
Cartesian Motions: it generates the same geometry as the FLY_NORM, but the looked
ahead movements will be taken into consideration for the speed profile, in order to
improve keeping constant speed during a sequence of FLY movement.
For further detailed information, refer to par.5.10.2.4.1 Geometry and Speed Profile in
the Cartesian FLY: FLY_NORM vs FLY_MULTI, in Motion Programming manual.
FLY_CART
FLY_CART modality only refers to cartesian motions and cannot be used in case of
eMotion Control.
For further information refer to Motion Programming manual, par. 6.10.2 Continuous
motion (FLY).
97
Comau Robotics Product Instruction
MOTION CONTROL
$DFT_ADVANCE and $ADVANCE predefined variables are only available with the
Lookahead OPTIONAL functionality, starting from 4.20.xxx system software version.
The current section only applies to systems with Lookahead option.
For further detailed information refer to par. 4.2.6.3 Lookahead optional functionality
considerations on page 101, par. 12.97 $DFT_ADVANCE: Default advance on
page 460, par. 12.14 $ADVANCE: Motion advance on page 425 in the current manual
and par.5.10.2.1. Lookahead functionality (optional feature) in Motion
Programming manual.
– $DFT_ADVANCE
– $ADVANCE.
$DFT_ADVANCE
This predefined variable represents the global default setting for the $ADVANCE
predefined variable, for all the HOLDable programs. It is the lookahead level to be used
by the Interpreter, referred to the motion statements.
It is defined at system level. Its default value is 1.
Allowed values are:
– 1 - lookahead of 1 motion statement. The Interpreter behaviour is unchanged for
system software versions before 4.20.xxx one
– 2 - lookahead of 2 motion statements. Only available with Lookahead option, since
4.20.xxx system software version
– 7 - lookahead of 7 motion statements. Only available with Lookahead option, since
4.20.xxx system software version.
$ADVANCE
This predefined variable is defined at program level only. It represents the currently set
lookahead level for the owning program.
At the program beginning it is automatically set to the current value of $DFT_ADVANCE
predefined variable.
The user is allowed to modify it, in order to customize the lookahead level for the current
program interpretation.
Allowed values are:
– 1 - lookahead of 1 motion statement. The Interpreter behaviour is unchanged for
system software versions before 4.20.xxx one
– 2 - lookahead of 2 motion statements. Only available with Lookahead option, since
4.20.xxx system software version
– 7 - lookahead of 7 motion statements. Only available with Lookahead option, since
4.20.xxx system software version.
98
Comau Robotics Product Instruction
MOTION CONTROL
4.2.6.1.3 $FLY_PER
$FLY_PER predefined variable, can be used to reduce the time in fly, to bring the
trajectory closer to the taught position, or to specify how far from the target position can
be the actual destination.
$FLY_PER affects FLY between JOINT movements only.
– If $FLY_TYPE is set to FLY_NORM, $FLY_PER predefined variable only affects
the arm speed.
When $FLY_PER is used, the fly motion starts at the deceleration beginning, plus
a time equal to 100% minus the percentage specified in $FLY_PER.
For example, if $FLY_PER value is 100, then the fly segment starts at the fly
motion deceleration beginning. If $FLY_PER value is 75, then the fly segment
starts after 25% of the decleration is accomplished (75% will be combined with the
next movement).
– If $FLY_TYPE is set to FLY_PLUS, which means systems with Lookahead option,
$FLY_PER predefined variable represents the overlap percentage of the MOVE
statements, similar to FLY_NORM. It applies to Joint FLY only.
– If $FLY_TYPE is set to FLY_MULTI, which means systems with Lookahead
option, $FLY_PER predefined variable indicates how much the destination position
of each individual MOVE statement belonging to the fly chain, can be far from the
original one. It applies to both Joint and Cartesian FLY.
For any detailed information, refer to par.5.10.2.3.1 Using $FLY_TYPE and $FLY_PER
for the Joint FLY and par.5.10.2.4.1 Geometry and Speed Profile in the Cartesian
FLY: FLY_NORM vs FLY_MULTI, in Motion programming manual.
When regular non-fly motions are used (MOVE), the stopping characteristics of the
movement are determined by $TERM_TYPE predefined variable.
The FLY option must be specified using MOVEFLY. It cannot be specified in the
SYNCMOVE section. The program editor will replace SYNCMOVEFLY with
SYNCMOVE in case of mismatch.
The synchronized motion feature is not supported in systems with eMotion Trajectory
control.
The user is notified by a suitable message.
99
Comau Robotics Product Instruction
MOTION CONTROL
PROGRAM flycond1
VAR p1, p2, p3 : POSITION
BEGIN
$DOUT[17] := FALSE
CONDITION[1] :
WHEN AT END DO
$DOUT[17] := TRUE
ENDCONDITION
p1 := POS(400, -400, 1900, -93, 78, -62, ‘‘)
p2 := POS(400, 400, 1900, -92, 79, -64, ‘‘)
p3 := POS(800, 400, 1900, -92, 79, -64, ‘‘)
MOVE LINEAR TO p1
MOVEFLY LINEAR TO p2 ADVANCE WITH CONDITION[1]
MOVE LINEAR TO p3
END flycond1
The output will not be set at p2 because the MOVEFLY does not reach such a position.
Instead, the output will be set where the fly segment ends.
To set an output when the fly begins, use a WITH clause on the next MOVE statement
to activate a condition handler that sets the output at the fly motion start (AT START
condition). For example:
PROGRAM flycond2
VAR p1, p2, p3 : POSITION
BEGIN
$DOUT[17] := FALSE
CONDITION[1] :
WHEN AT START DO
$DOUT[17] := TRUE
ENDCONDITION
p1 := POS(400, -400, 1900, -93, 78, -62, ‘‘)
p2 := POS(400, 400, 1900, -92, 79, -64, ‘‘)
p3 := POS(800, 400, 1900, -92, 79, -64, ‘‘)
MOVE LINEAR TO p1
MOVEFLY LINEAR TO p2 ADVANCE
MOVE LINEAR TO p3 WITH CONDITION[1]
100
Comau Robotics Product Instruction
MOTION CONTROL
END flycond2
The output will not be set at p2, but at the beginning of the fly segment.
With eMotion Control, in case of trajectory control fly, the exact times in which AT
START and AT END conditions are triggered, are not defined by the fly segment length.
Furthermore, they are different depending on the MOVE types so that they cannot be
exactly predictable (see the left below figure.)
To indicate when the fly segment begins and when the fly segment ends, the user
should use WHEN PERCENT int_expr AFTER STARTFLY motion event: it applies to
any kind of motions, for eMotion Control, meaning
int_expr=1 --> begin of FLY segment
int_expr=100 --> end of FLY segment.
For further details see par. 8.3.10 MOTION Events on page 177 and Motion
Programming manual, par.5.10.2.4.2 - Events related to FLY movements with
trajectory control (constant speed or specified FLY_DIST)
101
Comau Robotics Product Instruction
MOTION CONTROL
– improving cycle times and further smoothing trajectories nearby the FLY positions.
(in case of Joint FLY)
– optimizing the speed profiles (in case of Cartesian FLY) without modifying the
connections geometry helping to keep constant speeds, sometimes in spite of the
cycle times.
So, such an improvement is advisable for processes requiring to keep a specified
process speed and its usage is recommended in case of Programs at defined
speed.
This optional functionality belongs to the Program Interpreter.
When used in the user programs, it allows advanced performances by the Motion
Interpolator, as explained in the FLY_PLUS and FLY_MULTI modalities description.
However the user should be aware that, due to the Program Interpreter lookahead, the
synchronization criticalities in the user programs are more amplified, so it is needed to
carefully handle the statements sequence and their mutual synchronization, both for non
motion and motion ones.
For further detailed information, also refer to par.5.10.2.3 Joint FLY and par.5.10.2.4
Cartesian FLY, in Motion Programming manual.
The MOVE ALONG statement specifies movements to the nodes of a PATH variable.
The syntax of the MOVE ALONG statement is as follows:
102
Comau Robotics Product Instruction
MOTION CONTROL
If the node definition does not include a predefined node field, the value specified in a
WITH clause is used at each node. If a value is also not specified in a WITH clause, the
current value of the corresponding predefined motion variable is used. For example:
PROGRAM pth_motn
TYPE lapm_pth = NODEDEF
$MAIN_POS
$SEG_OVR
. . .
ENDNODEDEF
VAR pth1 : PATH OF lapm_pth
BEGIN
. . .
$TERM_TYPE := COARSE
$MOVE_TYPE := LINEAR
MOVE ALONG pth1 WITH $SEG_TERM_TYPE = FINE
. . .
END pth_motn
In the above example, the segment override ($SEG_OVR) used in each path segment
will be obtained from each path node since this field is included in the node definition.
The termination type used in each path segment will be FINE due to the WITH clause.
However, the termination type of the last node segment will be COARSE since the value
of $TERM_TYPE applies to the last path node. The motion type ($MOVE_TYPE) will be
LINEAR for the entire path since $MOVE_TYPE is not a field in the node definition and
it is not specified in the WITH clause.
The $MAIN_POS, $MAIN_JNTP, and $MAIN_XTND fields indicate the main destination
of a path segment. A node definition can include only one of the $MAIN_ predefined
fields. The particular one chosen indicates the data type of the main destination. In order
to use a path in the MOVE ALONG statement, the node definition must include a main
103
Comau Robotics Product Instruction
MOTION CONTROL
PROGRAM pth_motn
TYPE lapm_pth = NODEDEF
$MAIN_POS
$SEG_OVR
. . .
ENDNODEDEF
VAR pth1 : PATH OF lapm_pth
BEGIN
. . .
$TERM_TYPE := FINE
MOVE ALONG pth1
. . .
END pth_motn
In the shown above example, since $SEG_TERM_TYPE is not a field of lapm_pth and
it is not included in a WITH clause, the value of $TERM_TYPE (FINE) is used at each
segment of the path motion.
The $SEG_FLY field has the same meaning as the FLY option on the MOVE keyword.
It is a boolean and if the value is TRUE, motion to the next node will FLY. This field does
not apply to the last node since the FLY option on the MOVE ALONG statement is used.
104
Comau Robotics Product Instruction
MOTION CONTROL
PROGRAM pth
TYPE nd = NODEDEF -- PATH node definition
$MAIN_POS
$MOVE_TYPE
$COND_MASK
$COND_MASK_BACK
i : INTEGER
b : BOOLEAN
ENDNODEDEF
-- The nodes of this path should either be taught or NODE_APPended
VAR p : PATH OF nd
BEGIN
CONDITION[10]:
WHEN TIME 10 AFTER START DO
......
ENDCONDITION
105
Comau Robotics Product Instruction
MOTION CONTROL
CONDITION[30] :
WHEN TIME 20 BEFORE END DO
......
ENDCONDITION
CONDITION[20] :
WHEN AT START DO
......
ENDCONDITION
......
p.COND_TBL[1] := 10 -- Initialization of COND_TBL
p.COND_TBL[2] := 15
p.COND_TBL[3] := 20
p.NODE[1].$COND_MASK := 5
p.NODE[4].$COND_MASK_BACK := 2
CYCLE
....
MOVE ALONG p -- move forward
MOVE ALONG p[5..1] -- move backward
....
END pth
In the example above, node 1 has the $COND_MASK set to 5. Bit 1 and 3 form the value
of 5. Therefore, for node 1, the conditions specified in element 1 and 3 of COND_TBL
(condition 10 and 20) will be used when moving forward from node 1 to node 2. Node 4
has the $COND_MASK_BACK set to 2. This means that the condition 15 specified in
COND_TBL element 2 will be used when moving backward from node 5 to node 4. Note
that the condition handler that are enabled are those corresponding to the program
executing the MOVE ALONG statement and not the program containing the MOVE
ALONG statement.
Refer also to Chap. Condition Handlers on page 161.
The $SEG_WAIT field is a boolean indicating whether or not processing of the path
should be suspended until the path is signalled. This field is used to obtain
synchronization between path segment processing and other aspects of the application
such as sensor detection, mutual exclusion, etc. If the value of the $SEG_WAIT field is
FALSE, path processing is not suspended at that node. If the value is TRUE, motion for
that node will complete but processing of following nodes will be suspended until the
path is signalled.
The $SEG_OVR field indicates the acceleration, deceleration, and speed override for
the path segment in a similar way as the $PROG_ACC_OVR, $PROG_DEC_OVR and
$PROG_SPD_OVR variables. If $SEG_OVR is not included in the node definition and
the WITH clause of the MOVE ALONG statement, the values of $PROG_ACC_OVR,
$PROG_DEC_OVR, and $PROG_SPD_OVR are used for each segment of the path
motion.
The $SEG_TOL field indicates the tolerance for the path segment. This has the same
meaning as $TOL_FINE or $TOL_COARSE depending on whether the termination type
of the path segment is FINE or COARSE. This field does not apply to the last node since
the $TOL_FINE or $TOL_COARSE will be used based on the value of $TERM_TYPE
which is also applied to the last node.
The $SEG_DATA field indicates whether the data of the node should be used for the
last node segment. If the value is TRUE, the values of the $SEG_TERM_TYPE,
$SEG_FLY_TYPE, $SEG_FLY_PER, $SEG_FLY, and $SEG_TOL fields are used for
the last node segment instead of the values of the corresponding predefined variables.
106
Comau Robotics Product Instruction
MOTION CONTROL
This format allows a path to be executed in any order desired. For example,
107
Comau Robotics Product Instruction
MOTION CONTROL
motion_variable = value
The following predefined motion variables can be used in a WITH clause of a MOVE
ALONG statement (refer to the Chap. Predefined Variables List on page 391 for their
meanings):
108
Comau Robotics Product Instruction
MOTION CONTROL
109
Comau Robotics Product Instruction
MOTION CONTROL
The portion of the first motion that is not covered before the fly begins is determined by
the predefined variable $FLY_PER. The predefined variable $FLY_TYPE determines
whether the motion during the fly will be at a constant speed (FLY_CART - not allowed
in case of eMotion Control) or not (FLY_NORM).
The motion variable $TERM_TYPE determines the stopping characteristics of the arm
for non-continuous motions.
110
Comau Robotics Product Instruction
MOTION CONTROL
CANCEL CURRENT
CANCEL CURRENT SEGMENT
CANCEL CURRENT FOR ARM[1], ARM[2]
CANCEL CURRENT SEGMENT FOR ARM[3]
CANCEL CURRENT FOR ALL
CANCEL CURRENT SEGMENT FOR ALL
CANCEL ALL and CANCEL ALL SEGMENT cause both the current motion/segment
and any pending motions/segments to be canceled. Optionally, the programmer can
specify that all motion/segment is to be canceled for the default arm, a list of arms, or
for all arms.
CANCEL ALL
CANCEL ALL SEGMENT
CANCEL ALL FOR ARM[1], ARM[2]
CANCEL ALL SEGMENT FOR ARM[3]
CANCEL ALL FOR ALL
CANCEL ALL SEGMENT FOR ALL
111
Comau Robotics Product Instruction
MOTION CONTROL
When LOCK is executed, the arm smoothly decelerates until the motion ceases.
For example:
LOCK
LOCK ARM[1], ARM[2]
LOCK ALL
Unlike CANCEL, LOCK prevents pending motions or new motions from starting on the
locked arm. The motion can be resumed only by issuing an UNLOCK statement from
the same program that issued the LOCK followed by a RESUME statement. The
RESUME can be issued from any program. Please note that there shouldn’t be any
program which attached the arm!
For example:
112
Comau Robotics Product Instruction
MOTION CONTROL
113
Comau Robotics Product Instruction
MOTION CONTROL
ATTACH ARM
ATTACH ARM[1], ARM[2]
ATTACH ARM ALL
Once a program has attached an arm, only that program can initiate motion for the
attached arm. If a MOVE or RESUME statement is issued from a different program, it
is an error causing the program to be paused.
In addition to the ATTACH statement, a program can attach an arm using the ATTACH
attribute on the PROGRAM statement. In this case, the PROG_ARM is attached when
the program is activated. If that arm is currently attached to another program or it is
currently being used in a motion, the program will not be activated. If the programmer
doesn’t want the PROG_ARM to be attached when the program is activated, the
DETACH attribute must be specified on the PROGRAM statement. The default is to
attach the PROG_ARM. (Refer to Chap.10. - Statements List on page 195 chapter for
further details on the PROGRAM statement and its attributes.)
The DETACH statement terminates exclusive motion control of the default arm, a list of
arms, or all arms currently attached by the program.
DETACH ARM
DETACH ARM[1], ARM[2]
DETACH ARM ALL
CANCEL motion statements can be issued by any program while the arm is attached.
114
Comau Robotics Product Instruction
MOTION CONTROL
OPEN HAND 1
CLOSE HAND 2
RELAX HAND 2
The programmer can also designate a particular arm, a list of arms, or all arms as
follows:
Note that, if the HAND has not been configured yet, pressing Hand 1 and Hand 2 will
not set any output by default.
For any details on Hands configuration, refer to C5GPlus Control Unit Use manual,
par.5.17.1.2 HAND in chapter SETUP Page.
115
Comau Robotics Product Instruction
MOTION CONTROL
Step
– OPEN sets line 1 to the active value, waits a delay time, and sets line 2 to the active
value;
– CLOSE sets line 2 to the inactive value, waits a delay time, and sets line 1 to the
inactive value;
– RELAX is the same as CLOSE.
116
Comau Robotics Product Instruction
PORTS
5. PORTS
5.1 General
Configuration and access to I/O points, is based on a Device-centric architecture (i.e.
this Device has these I/O points) as opposed to an I/O-centric architecture (i.e. this Input
point is mapped to this Device).
The configuration is based on a hierarchical approach, as opposed to a “fixed” array.
The System I/O configuration information, is decribed by a tree structure, assigned to
$CIO_TREEID: Tree identifier for the configure I/O tree predefined variable.
The configuration tree is used by the System at the powerup, to initialize all predefined
variables related to Devices and I/Os ($IO_DEV: I/O Device Table, $NUM_IO_DEV:
Number of I/O Devices, $IO_STS: I/O point StatusTable, $NUM_IO_STS: Number of
I/O points).
Current chapter explains the existing types of ports used in PDL2, associated to the I/O
points of the Devices connected to the Control Unit.
The available Port types are as follows:
– digital, flexible, and analog Ports, configured by the user to accommodate specific
application I/Os (par. 5.2 User-defined and Appl-defined Ports on page 119);
– system-defined Ports, internally mapped for system Devices such as operator
devices, arms, and timers (par. 5.3 System-defined Ports on page 121);
– other Ports used by PDL2 programs to communicate one another (par. 5.4 Other
Ports on page 131).
The following Tab. 5.1 - Ports table on page 117 lists the I/O-related Ports used by
PDL2.
117
Comau Robotics Product Instruction
PORTS
Depending on the type of array, each item in a Port array represents a particular input
or output signal, or a shared memory location. For user-defined Ports, the signal that
corresponds to a particular item depends on how the I/O is configured.
Also refer to Predefined Variables List chapter for further details about these variables.
As with any array, individual items are accessed using an index, as shown in the
following examples:
REPEAT
check_routine
UNTIL $AIN[34] > max
body_type := $FMI[3]
SELECT body_type OF
CASE(1):
$FMO[1] := four_door
CASE(2):
$FMO[2] := two_door
CASE(3):
$FMO[3] := hatch_back
ELSE:
type_error
ENDSELECT
A program can always obtain the value of a Port. The value received from reading an
Output Port corresponds to the last value that was written to that Port.
A program can assign values to user-defined Output Ports and the system-defined
$FDOUT Ports.
118
Comau Robotics Product Instruction
PORTS
NOTE THAT the user is allowed to access the help string definition of a port via PDL2
program, by means of the DV_CNTRL Built-In Procedure, code 14, which returns an
index to access the related $IS_HELP_STR field within $IO_STS: I/O point StatusTable
structure.
Example:
s := 'DOUT_5'
DV_CNTRL(14, (s), i)
WRITE LUN_CRT ($IO_STS[i].IS_HELP_STR, NL)
119
Comau Robotics Product Instruction
PORTS
$FMI and $FMO Ports are always referred to as groups of 32 bits, not depending on
whether they are mapped or not and on the corresponding mapped dimension, if any.
This means that BITs belonging to $FMx Ports are to be referred to in the following way:
– $FMx_BIT[1]..$FMx_BIT[32] are included in $FMx[1],
– $FMx_BIT[33]..$FMx_BIT[64] are included in $FMx[2],
– etc.
The index of the i-th $FMx_BIT belonging to the n-th $FMx port is:
index = 32 x (n-1) + i
Note that $FMx Ports are analog Ports, whereas $FMx_BIT Ports are digital ones.
Usage example
The following sample program displays the content of $FMO[11] less significant 8 bits.
To do so, the proper $FMO_BIT index is calculated.
120
Comau Robotics Product Instruction
PORTS
$SLI Meaning
121
Comau Robotics Product Instruction
PORTS
$SLI Meaning
23 V24 DRIVEON
24 Local Stop Monitor
$SLO Meaning
$BDI Meaning
1 24V IN is present
2 Battery voltage is present
3 Line OverLoad V24 Backup
4 Line OverLoad V24 Internal
5 Line OverLoad V24 TP
6 Line OverLoad V24 Fan
7 Line OverLoad V24 Robot
8 Line OverLoad V24 DriveOff
9 Line OverLoad V24 I/O
10 Line OverLoad V24 DriveOn
11 The battery charge level is above 75%
12 UPS Buffering mode
13 UPS Replace Battery
14 .. 20 reserved
$BDO Meaning
1 reserved
2 Switch off the related V24INT and V24TP power supply output
3 Enable the related V24FAN power supply output
4 Switch off the related V24ROBOT power supply output
5 Switch off the related V24DROFF power supply output
122
Comau Robotics Product Instruction
PORTS
$BDO Meaning
$GI Meaning
1..8 reserved
9 IESK ARM 1 enabled
10 IESK ARM 2 enabled
11 IESK ARM 3 enabled
12 IESK ARM 4 enabled
13..16 reserved
17 DRIVE ON
18 DRIVE OFF
19 START
20 HOLD
21 U1
22 U2
23 U3
24 U4
25 CANCEL ALARM
26 Safety speed
27..32 reserved
123
Comau Robotics Product Instruction
PORTS
$GI Meaning
$GO Meaning
124
Comau Robotics Product Instruction
PORTS
$GO Meaning
13..16 reserved
17 alarm
18 DRIVE ON status
19 START/HOLD on mot prog
20 REMOTE
21 teach enabled(DRI.ON+T1)
22 U1
23 U2
24 U3
25 U4
26 NO active latch alarm
27 Safety speed (for Remote)enabled
28 programming mode(PROGR)
29 reserved
30 state selector in local or remote
31 system ready
32 Heart Bit
33 system in STANDBY
34 active JOG
35 motion program in execution
36 EME/GEN/AUTO STOP active
37 WinCRC on PC connected
38 kind of TP
39 TP disconnected in PROGR state
40 system state on T1P
41 recovery from power down
42 TP on cabinet
43 enabling device pressed
44-45 reserved
46 state selector on REMOTE
47 state selector on AUTO
48 state selector on T1
49 HOLD from remote
50 HOLD pressed on TP
51 reserved
52 DRIVE OFF from REMOTE
53 DRIVE OFF pressed on TP
54 reserved
55 TP connected
56 ALARM state due to high severity
57 REMOTE state
58 START key pressed
59 system in ALARM state
60 system in programming state
125
Comau Robotics Product Instruction
PORTS
$GO Meaning
61 system in automatic
62 system in HOLD
63 DRIVEs state
64 reserved
65 reference position 1
66 reference position 2
67 reference position 3
68 reference position 4
69 reference position 5
70 reference position 6
71 reference position 7
72 reference position 8
73..80 reserved
81 Collision alarm
82 CollisionDetect enabled
83 Collision alarm (2)
84 CollisionDetect enabled(2)
85..96 reserved
97 IESK 1st AUX ARM 1 enable
98 IESK 2nd AUX ARM 1 enable
99 IESK 3rd AUX ARM 1 enable
100 IESK 4th AUX ARM 1 enable
101 IESK 1st AUX ARM 2 enable
102 IESK 2nd AUX ARM 2 enable
103 IESK 3rd AUX ARM 2 enable
104 IESK 4th AUX ARM 2 enable
105 IESK 1st AUX ARM 3 enable
106 IESK 2nd AUX ARM 3 enable
107 IESK 3rd AUX ARM 3 enable
108 IESK 4th AUX ARM 3 enable
109 IESK 1st AUX ARM 4 enable
110 IESK 2nd AUX ARM 4 enable
111 IESK 3rd AUX ARM 4 enable
112 IESK 4th AUX ARM 4 enable
113 IEAK ARM 1 MOTOR ON
114 IEAK ARM 2 MOTOR ON
115 IEAK ARM 3 MOTOR ON
116 IEAK ARM 4 MOTOR ON
126
Comau Robotics Product Instruction
PORTS
selectors, function keys and LEDs on the Teach Pendant and the PC keyboard (when
WinCRC Program is active). PDL2 treats these data as BOOLEAN values.
The following tables list $FDIN and $FDOUT signal meanings.
When the word “Setup” is used in the following explanations, it refers to the REC Setup
functionality that can be activated from within the IDE Page environment on the Teach
Pendant - see Control Unit Use manual.
$FDOUTs related to the TP cannot be assigned at the PDL2 program level.
$FDIN Meaning
1..8 reserved
9 state selector on REMOTE
10 state selector on AUTO
11 state selector on T1
12..16 reserved
17 DRIVE ON softkey
18 DRIVE OFF softkey
19 START button
20 HOLD button
21 U1 softkey
22 U2 softkey
23 U3 softkey
24 U4 softkey
25 reserved
26 reserved
27 Enabling Device pressed
28..32 reserved
33 (**)
34 (**)
35 (**)
36 (**)
37 (**)
38 (**)
39 (**)
40 (**)
41 (**)
42 (**)
43 (**)
44 (**)
45 (**)
46 (**)
47 (**)
48 (**)
49 (**)
50 (**)
51 (**)
52 (**)
127
Comau Robotics Product Instruction
PORTS
$FDIN Meaning
53 (**)
54 (**)
55 (**)
56 (**)
57 (**)
58 (**)
59 (**)
60 (**)
61 (**)
62 (**)
63..64 reserved
65 COORD button
66 reserved
67 %+
68 %-
69..72 reserved
73 +1X
74 +2Y
75 +3Z
76 +4
77 +5
78 +6
79 +7
80 +8
81 -1X
82 -2Y
83 -3Z
84 -4
85 -5
86 -6
87 -7
88 -8
89 (**)
90 T1
91 T2
92 REC
93 (**)
94 BACK
95 (**)
96 reserved
97 (**)
98] (**)
99] (**)
100 (**)
101 (**)
128
Comau Robotics Product Instruction
PORTS
$FDIN Meaning
102 (**)
103 reserved
104 (**)
105 reserved
106 (**)
107 (**)
108 (**)
109 +9
110 +10
111 -9
112 -10
113..128 reserved
129 F1 on PC keyboard (WinCRC Program active)
130 F2 on PC keyboard (WinCRC Program active)
131 F3 on PC keyboard (WinCRC Program active)
132 F4 on PC keyboard (WinCRC Program active)
133 F5 on PC keyboard (WinCRC Program active)
134 F6 on PC keyboard (WinCRC Program active)
135 F7 on PC keyboard (WinCRC Program active)
136 F8 on PC keyboard (WinCRC Program active)
137..158 reserved
159 JPAD Up (along Z axis)
160 JPAD Down (along Z axis)
161 JPAD North (internal, approaching the user - along X axis)
162 JPAD South (external, moving away - along X axis)
163 JPAD East (right - along Y axis)
164 JPAD West (left - along Y axis)
$FDOUT Meaning
1..16 reserved
17 DRIVE ON led
18..20 reserved
21 U1
22 U2
23 U3
24 U4
25 ALARM led. When an alarm occurs, this led is lighted
26 T1 led for HAND 1 of the selected arm. It is lighted when the HAND is closed
27 T2 led for HAND 2 of the selected arm. It is lighted when the HAND is closed
28* (**)
29 reserved
30 reserved
31* (**)
32* (**)
129
Comau Robotics Product Instruction
PORTS
$FDOUT Meaning
33* (**)
34* (**)
35* (**)
36* (**)
(**) Not handled for TP5 Teach Pendant. This could cause some already existing PDL2 programs not to work
properly because such $FDINs/$FDOUTs would not be triggered.
5.3.5 $HDIN
The $HDIN Port allows a program read-only access to a motion event port. Items in the
array correspond to high speed digital input signals.
$HDIN is a special Port monitored by the motion environment. Any input on one of these
lines triggers a hardware interrupt signal. The motion environment reacts according to
how the port is set up. For example, it could cause an Arm to stop and/or record its
current position.
There are two $HDIN Ports for each Arm, in the System. Thus, it is possible to
simultaneously handle the available inputs for each Arm.
The user is responsible for installing the connection from the $HDIN Port to detection
devices to use with this Port.
The association between Arm and $HDIN index is as follows:
$HDIN[1] channel 1 for ARM 1
$HDIN[2] channel 1 for ARM 2
$HDIN[3] channel 1 for ARM 3
$HDIN[4] channel 1 for ARM 4
$HDIN[5] channel 2 for ARM 1
$HDIN[6] channel 2 for ARM 2
$HDIN[7] channel 2 for ARM 3
$HDIN[8] channel 2 for ARM 4
Such Ports are updated at the I/O scanning time (usually 10 ms).
The HDIN_SET Built-In Procedure and HDIN_READ Built-In Procedure are used for
handling the $HDIN from a PDL2 program. Also the $HDIN_SUSP: $HDIN suspend
system variable must be considered.
Refer to the BUILT-IN Routines List and Predefined Variables List chapters for further
details.
As far as concerns the association between HSI Inputs on the Control Unit and $HDIN
Ports in PDL2 Programs, please refer to the following Tab. 5.2.
130
Comau Robotics Product Instruction
PORTS
$TIMER is accessible by all running programs. The ATTACH Statement can be used to
disallow read and write access to a timer by other program code. When a timer is
attached, only code belonging to the same program containing the ATTACH Statement
can access the timer. The DETACH Statement is used to release exclusive control of a
timer. The value of the timer is not changed when it is attached or detached. For more
information, refer to the description of the ATTACH & DETACH statements in
Statements List chapter.
$TIMER values are preserved during Power Failure Recovery: no $TIMER value is lost.
A timer overflow generates trappable error 40077.
5.3.7 $PROG_TIMER_xx
These timers are similar to $TIMER and $TIMER_S, but they belong to PDL2 Programs.
The following PROG_TIMERs are available:
– $PROG_TIMER_O and $PROG_TIMER_OS - they belong to the program owner.
The first one is in milliseconds and the second one is in seconds.
– $PROG_TIMER_X and $PROG_TIMER_XS - they belong to the executing
program (calling program). The first one is in milliseconds and the second one is in
seconds
.
131
Comau Robotics Product Instruction
PORTS
5.4.1 $BIT
The $BIT Port allows a program to access to a bit; PDL2 treats this as BOOLEAN data.
The maximum index value for $BIT Ports is 1024.
5.4.2 $WORD
The $WORD Port allows a program to access to a word; PDL2 treats this as an
INTEGER data, where only the 16th significative bits of each word are meaningful.
These Ports can also be read as BITs: in such a situation they are named
– $WORD_BIT.
They are referred to as groups of 16 bits.
The bits of the $WORD Ports are to be referred to in the following way:
– for $WORD[1] - $WORD_BIT[1]..$WORD_BIT[16],
– for $WORD[2] - $WORD_BIT[17]..$WORD_BIT[32], etc.
Note that in case of $WORD_BIT, PDL2 treats them as BOOLEAN data.
$DIN/$DOUT/$IN/$OUT/$FMI/$FMO cleared
$BIT cleared
$AIN/$AOUT cleared
$WORD cleared
PDL2 program deactivated and erased from memory
132
Comau Robotics Product Instruction
PORTS
Note that forced $DIN, $DOUT, $IN, $OUT, $AIN, $AOUT, $FMI, $FMO are cleared also
if they were previously forced.
Forced $DIN, $DOUT, $IN, $OUT, $AIN, $AOUT, $FMI, $FMO are frozen upon a power
failure.
133
Comau Robotics Product Instruction
EXECUTION CONTROL
6. EXECUTION CONTROL
Current chapter describes PDL2 statements that control the order in which statements
are executed within a program and the order in which multiple programs are executed.
PDL2 language provides:
– Flow Control Statements
– Program Control Statements
– Program Synchronization Statements
– Program Scheduling facilities
It is strongly recommended to avoid using cycles in the program which stress too much
the CPU. For example, REPEAT..UNTIL cycle with an UNTIL condition which is always
FALSE (so that the cycle is always repeated) and WAIT FORs inside which the condition
is always true. A simplified representation of such situation is :
vb_flag := TRUE
vb_flag2 := FALSE
REPEAT
WAIT FOR vb_flag -- condition always true
UNTIL vb_flag2 -- infinite loop
Cycles like this can cause a nested activity of the processes in the system software
making it difficult to get the CPU by low priority tasks. If this situation lasts for a long
period, the error “65002-10 : system error Par 2573” can occur. It is recommended, in
this case, to change the logic of the program.
Within a program, execution normally starts with the first statement following the BEGIN
statement and proceeds until the END statement is encountered. PDL2 provides
statements to alter this sequential execution in the following ways:
– choosing alternatives:
• IF statement,
134
Comau Robotics Product Instruction
EXECUTION CONTROL
• SELECT statement;
– looping:
• FOR statement,
• WHILE statement,
• REPEAT statement;
– unconditional branching:
• GOTO statement.
6.1.1 IF Statement
The IF statement allows a program to choose between two possible courses of action,
based on the result of a BOOLEAN expression.
If the expression is TRUE, the statements following the IF clause are executed. Program
control is then transferred to the statement following the ENDIF.
If the expression is FALSE, the statements following the IF clause are skipped and
program control is transferred to the statement following the ENDIF.
Fig. 6.1 shows the execution of an IF statement.
An optional ELSE clause, placed between the last statement of the IF clause and the
ENDIF, can be used to execute some statements if the BOOLEAN expression is FALSE.
Fig. 6.2 shows the execution of an IF statement with the optional ELSE clause.
The syntax for an IF statement is as follows:
IF bool_exp THEN
<statement>...
<ELSE
<statement>...>
ENDIF
135
Comau Robotics Product Instruction
EXECUTION CONTROL
Any executable PDL2 statements can be nested inside of IF or ELSE clauses, including
other IF statements.
Examples of the IF statement:
IF car_num =3 THEN
num_wheels :=4
ENDIF
IF part_ok THEN
good_parts := good_parts + 1
ELSE
bad_parts := bad_parts + 1
ENDIF
136
Comau Robotics Product Instruction
EXECUTION CONTROL
An optional ELSE clause, placed between the last case and the ENDSELECT
statement, can be used to execute a series of statements if no match is found. Without
this ELSE clause, a failure to match a case value results in an error.
The syntax for a SELECT statement is as follows:
SELECT int_exp OF
CASE (int_val <, int_val>...):
<statement>...
<CASE (int_val <, int_val>...):
<statement>... >...
<ELSE:
<statement>...>
ENDSELECT
The either INTEGER or REAL or STRING values in each case can be predefined or
user-defined constants or literals. Expressions are not allowed. In addition, the same
either INTEGER or REAL or STRING value cannot be used in more than one case.
Example of a SELECT statement:
137
Comau Robotics Product Instruction
EXECUTION CONTROL
SELECT tool_type OF
CASE (1):
$TOOL := utool_weld
style_weld
CASE (2):
$TOOL := utool_grip
style_grip
CASE (3):
$TOOL := utool_paint
style_paint
ELSE:
tool_error
ENDSELECT
Before each loop iteration, the value of the INTEGER variable is compared to the ending
value. If the loop is written to count up, from the starting value TO the ending value, then
a test of less than or equal is used. If this test initially fails, the loop is skipped. If the
STEP value is one, the loop is executed the absolute value of (the ending value - the
starting value + 1) times.
If the loop is written to count down, from the starting value DOWNTO the ending value,
a test of greater than or equal is used. If this test initially fails, the loop is skipped. If the
STEP value is one, the loop is executed the absolute value of (the ending value - the
starting value - 1) times.
Even if the starting and ending values are equal, the loop is still executed one time
An optional STEP clause can be used to change the stepping value from one to a
different value. If specified, the INTEGER variable is incremented or decremented by
this value instead of by one each time through the loop. The STEP value, when using
either the TO or DOWNTO clause, should be a positive INTEGER expression to ensure
that the loop is interpreted correctly.
138
Comau Robotics Product Instruction
EXECUTION CONTROL
139
Comau Robotics Product Instruction
EXECUTION CONTROL
WHILE bool_exp DO
<statement>...
ENDWHILE
Example of a WHILE statement:
140
Comau Robotics Product Instruction
EXECUTION CONTROL
REPEAT
<statement>...
UNTIL bool_exp
Example of a REPEAT statement:
REPEAT
WRITE (‘Exiting program’, NL) -- statement list 1
WRITE (‘Are you sure? (Y/N) : ‘)
READ (ans)
UNTIL (ans = Y) OR (ans = N)
IF ans = Y THEN
DEACTIVATE prog_1 -- statement list 2
ENDIF
GOTO statement_label
GOTO statements should be used with caution. The label must be within the same
routine or program body as the GOTO statement. Do not use a GOTO statement to jump
into or out of a structured statement, especially a FOR loop, because this will cause a
run-time error.
141
Comau Robotics Product Instruction
EXECUTION CONTROL
PROGRAM prog_1
VAR jump : BOOLEAN
BEGIN
. . .
IF jump THEN
GOTO here
ENDIF
. . .
here:: WRITE (‘This is where the GOTO transfers to‘)
. . .
END prog_1
142
Comau Robotics Product Instruction
EXECUTION CONTROL
PROG_STATE (prog_name_str)
prog_name_str can be any valid string expression. This function returns an INTEGER
value indicating the program state of the program specified by prog_name_str. For a list
of the values returned by this function, refer to the “Built-In Routine List” chapter.
143
Comau Robotics Product Instruction
EXECUTION CONTROL
a non-holdable program, holdable programs are placed in the ready state and
non-holdable programs are placed in the running state. If the statement is issued from
a holdable program, the programs are placed in the running state.
The ACTIVATE statement syntax is as follows:
PAUSE
PAUSE weld_main, weld_util, weld_cntrl
PAUSE ALL
144
Comau Robotics Product Instruction
EXECUTION CONTROL
in the ready state and non-holdable programs are placed in the running state. If the
statement is issued from a holdable program, the programs are placed in the running
state.
The UNPAUSE statement syntax is as follows:
DEACTIVATE
DEACTIVATE weld_main, weld_util, weld_cntrl
DEACTIVATE ALL
145
Comau Robotics Product Instruction
EXECUTION CONTROL
CYCLE
The BEGIN statement syntax using the CYCLE option is as follows:
BEGIN CYCLE
The EXIT CYCLE statement causes program execution to skip the remainder of the
current cycle and immediately begin the next cycle. An exited cycle cannot be resumed.
Exiting a cycle cancels all pending and current motion, cancels all outstanding
asynchronous statements, and resets the program stack.
NOTE that the EXIT CYCLE statement does NOT reset the current working directory
and the $PROG_ARG predefined variable (which contains the line argument passed in
when the program was activated).
Exiting a cycle does NOT close files, detach resources, disable or purge condition
handlers, or unlock arms.
Consequently, it is more powerful than a simple GOTO statement.
The EXIT CYCLE statement can be used in the main program as well as routines.
The EXIT CYCLE statement syntax is as follows:
DELAY int_expr
The int_expr indicates the time to delay in milliseconds.
146
Comau Robotics Product Instruction
EXECUTION CONTROL
147
Comau Robotics Product Instruction
EXECUTION CONTROL
WAIT semaphore_var
SIGNAL semaphore_var
When a program wants a resource, it uses the WAIT statement. When the program
finishes with the resource it uses the SIGNAL statement. If another program is waiting
for that resource, that program can resume executing. Synchronization is done on a first
in first out basis.
Since PDL2 semaphores count, it is important to have a matching number of SIGNALs
and WAITs. Too many signals will violate mutual exclusion of the resource (unless
multiple instances of the resource exist). For example, when programs badsem1 and
badsem2 outlined below are activated, the mutual exclusion will function properly for the
first cycle. However, upon the second cycle of the programs, we lose mutual exclusion
because there is one too many SIGNALs in badsem1.
If the first SIGNAL statement of badsem1 were above the CYCLE statement, all would
be ok for the following cycles.
PROGRAM badsem1
VAR resource : SEMAPHORE EXPORTED FROM badsem1
BEGIN
CYCLE
SIGNAL resource --to initialize semaphore
. . .
WAIT resource
-- mutual exclusive area
SIGNAL resource
. . .
END badsem1
PROGRAM badsem2
VAR resource : SEMAPHORE EXPORTED FROM badsem1
BEGIN
CYCLE
148
Comau Robotics Product Instruction
EXECUTION CONTROL
. . .
WAIT resource
-- mutual exclusive area
SIGNAL resource
. . .
END badsem2
Another situation to avoid is called a deadlock. A deadlock occurs when all of the
programs are waiting for the resource at the same time. This means none of them can
signal to let a program go. For example, if there is only one program and it starts out
waiting for a resource, it will be deadlocked.
It is also important to reset semaphores when execution begins. This is done with the
CANCEL semaphore statement. The syntax is as follows:
CANCEL semaphore_var
The CANCEL semaphore statement resets the signal counter to 0. It results in an error
if programs are currently waiting on the SEMAPHORE variable. This statement is useful
for clearing out unused signals from a previous execution.
149
Comau Robotics Product Instruction
EXECUTION CONTROL
150
Comau Robotics Product Instruction
ROUTINES
7. ROUTINES
The following information are available about routines:
– Procedures and Functions
– Parameters
– Declarations
– Passing Arguments
A ROUTINE is structured like a program, although it usually performs a single task.
Routines are useful to shorten and simplify the main program. Tasks that are repeated
throughout a program or are common to different programs can be isolated in individual
routines.
A program can call more than one routine and can call the same routine more than once.
When a program calls a routine, program control is transferred to the routine and the
statements in the routine are executed. After the routine has been executed, control is
returned to the point from where the routine was called. Routines can be called from
anywhere within the executable section of a program or routine.
The programmer writes routines in the declaration section of a program. As shown in the
following example, the structure of a routine is similar to the structure of a program.
PROGRAM arm_check
-- checks three arm positions and digital outputs
VAR
perch, checkpt1, checkpt2, checkpt3 : POSITION
PDL2 also includes built-in routines. These are predefined routines that perform
commonly needed tasks.
They are listed and described in Chap.11. - BUILT-IN Routines List on page 251.
151
Comau Robotics Product Instruction
ROUTINES
PROGRAM input_check
7.2 Parameters
To make routines more general for use in different circumstances, the programmer can
use routine parameters rather than using constants or program variables directly.
Parameters are declared as part of the routine declaration. When the routine is called,
data is passed to the routine parameters from a list of arguments in the routine call. The
number of arguments passed into a routine must equal the number of parameters
declared for the routine. Arguments also must match the declared data type of the
parameters.
The following example shows how the time_out routine can be made more general by
including a parameter for the input signal index. The modified routine can be used for
checking any input signal.
PROGRAM input_check
152
Comau Robotics Product Instruction
ROUTINES
7.3 Declarations
PDL2 uses two different methods of declaring a routine, depending on whether the
routine is a procedure or function.
It is also allowed to implement Shared Routines.
The following topics are fully described in current paragraph:
– Declaring a Routine
– Parameter List
– Constant and Variable Declarations
– Function Return Type
– RETURN Statement
– Shared Routines
7.3.1.1 Procedure
The syntax of a procedure declaration is as follows:
153
Comau Robotics Product Instruction
ROUTINES
BEGIN
<statement...>
END proc_name
7.3.1.2 Function
The syntax of a function declaration includes a return data type and must include at least
one RETURN statement that will be executed, as follows:
154
Comau Robotics Product Instruction
ROUTINES
Variables and constants declared in the VAR and CONST section of the main program
can be used anywhere in the program, including within routines. They belong to the main
program context. NOTE that if a variable declared inside a routine has the same name
as a variable declared at the main program level, the routine will access the locally
declared variable.
For example:
PROGRAM example
VAR
x : INTEGER
ROUTINE test_a
VAR
x : INTEGER
BEGIN
x := 4
WRITE(‘Inside test_a x = ‘, x, NL)
END test_a
ROUTINE test_b
BEGIN
WRITE(‘Inside test_b x = ‘, x, NL)
END test_b
BEGIN
x := 10
WRITE(‘The initial value of x is ‘, x, NL)
test_a
WRITE(‘After test_a is called x = ‘, x, NL)
test_b
WRITE(‘After test_b is called x = ‘, x, NL)
END example
The distinction of belonging to the main program context vs local to a routine, is referred
to as the scope of a data item.
155
Comau Robotics Product Instruction
ROUTINES
RETURN <(value)>
The RETURN statement, with a return value, is required for functions. The value must
be an expression that matches the return data type of the function. If the program
Interpreter does not find a RETURN while executing a function, an error will occur when
the Interpreter reaches the END statement.
The RETURN statement can also be used in procedures. RETURN statements used in
procedures cannot return a value. If a RETURN is not used in a procedure, the END
statement transfers control back to the calling point.
Prog_name indicates the name of the external program owning the specified
routine.
156
Comau Robotics Product Instruction
ROUTINES
For example:
PROGRAM MyProg
. . .
ROUTINE error_check EXPORTED FROM utilities
– There are two different syntaxes for declaring a routine to be public for use by other
programs:
prog_name indicates the name of the current program, which owns the
specified routine.
For example:
PROGRAM utilities
ROUTINE error_check EXPORTED FROM utilities
PROGRAM prog_1
ROUTINE error_check EXPORTED FROM utilities -- error_check
-- routine is imported from program
-- utilities
prog_name indicates the name of the current program, which owns the
specified routine. This routine can be imported by another program, by means
of the IMPORT Statement.
For example:
PROGRAM utilities
. . .
ROUTINE error_check EXPORTED FROM utilities GLOBAL
PROGRAM prog_1
IMPORT ‘utilities‘ -- any variables and routines with GLOBAL
-- attribute, are imported from program utilities,
-- including error_check routine
The declaration and executable sections of the routine appear only in the program
that owns the routine.
Refer to par. 3.2.4 Shared types, variables and routines on page 71 for more
information.
157
Comau Robotics Product Instruction
ROUTINES
Note that a variable which has been declared with the CONST attribute cannot be
passed by reference to a routine!
The routine itself is executed in the same manner regardless of how the arguments were
passed to it
The following is an example of routines that use pass by reference and pass by value:
PROGRAM example
VAR
x : INTEGER
BEGIN
x := 10
WRITE(‘The initial value of x is ‘, x, NL)
test_a((x)) -- pass by value
WRITE(‘After pass by value x = ‘, x, NL)
test_a(x) -- pass by reference
WRITE(‘After pass by reference x = ‘, x, NL)
END example
158
Comau Robotics Product Instruction
ROUTINES
NOTEs:
– the values for optional parameters, when not passed as an argument, are
uninitialized except for arrays in which the dimensions are 0. For jointpos
and xtndpos the program executing Arm is used to initialize the value;
– the optional values in all declarations of the routines must be the same
unless the optional value is not defined in the EXPORTED FROM Clause;
– optional arguments can be used with CALLS Statement;
– optional arguments can be specified in Interrupt Service Routines (ISR); note
that value is setup when the routine is called.
r2(5, mypos)
159
Comau Robotics Product Instruction
ROUTINES
Example:
r2(5, mypos, , 6)
To handle the information about the variable arguments, inside the routine, some
specific built-ins are available:
– ARG_COUNT Built-In Function - to get the total amount of arguments supplied to
the routine
– ARG_INFO Built-In Function - to get information about the indexed argument
– ARG_GET_VALUE Built-in Procedure - to obtain the value of the indexed
argument
– ARG_SET_VALUE Built-in Procedure - to set a value to the indexed argument.
NOTEs:
– Optional parameters can be passed in Varargs routines; in this case the
returned datatype from ARG_INFO is 0;
– the ergument can be an ARRAY;
– Varargs routines can be used in Interrupt Service Routines and in CALLS
Statement, but only the defined arguments;
– Argument identifiers cannot be used as argument switch (because there is
no identifiers!) in Varargs routines.
NOTEs:
– all parameters preceding this argument must have been provided or must be
optional;
– argument identifiers cannot be used in Interrupt Service Routines.
160
Comau Robotics Product Instruction
CONDITION HANDLERS
8. CONDITION HANDLERS
Condition handlers allow a program to monitor specified conditions in parallel with
normal execution and, if the conditions occur, take corresponding actions in response.
Typical uses include monitoring and controlling peripheral equipment and handling
errors.
For example, the following condition handler checks for a PAUSE condition. When the
program is paused, the digital output $DOUT[21] is turned off. This example might be
used to signal a tool to turn off if a program is paused unexpectedly.
8.1 Operations
As shown in the previous example, using condition handlers is a two-step process. First
the condition handler is defined, and then it can be enabled. Condition handlers can also
be disabled and purged.
– Defining Condition Handlers
– Enabling, Disabling, and Purging
161
Comau Robotics Product Instruction
CONDITION HANDLERS
If the same CONDITION definition is repeated, error 25601 is returned. In order to avoid
the program being suspended, call ERR_TRAP_ON(40050).
Anyway, in case of real needs of defining the CONDITION again e.g. in each cycle,
when one of its parameters is changed, just use PURGE CONDITION Statement as the
last ACTION of the CONDITION which MUST necessarily be triggered during the cycle
execution.
In such a way, during the following cycle, such a CONDITION will not be defined again,
but simply defined, without any error message.
Usual situation:
BEGIN
-- condition definition
CYCLE
-- enabling / disabling condition
END
– use of ERR_TRAP_ON/ERR_TRAP_OFF:
BEGIN
CYCLE
ERR_TRAP_ON(40050)
-- condition definition
ERR_TRAP_OFF(40050)
-- enabling / disabling condition
END
BEGIN
CYCLE
-- condition definition
-- enabling / disabling / purging condition
END
Example:
BEGIN
CYCLE
MyIndex := new_value_from_PLC
…
CONDITION[1]:
WHEN $DIN[MyIndex]+ DO
$BIT[MyIndex] := ON
PURGE CONDITION[1]
ENDCONDITION
ENABLE CONDITION[1]
…
-- Something triggers CONDITION[1]
…
END
162
Comau Robotics Product Instruction
CONDITION HANDLERS
CONDITION[24]:
WHEN DISTANCE 60 BEFORE END DO
LOCK
ENDCONDITION
In CONDITION[23], the first WHEN clause and the LOCK apply to arm 2 as designated
by the FOR ARM clause. The second WHEN and LOCK apply to arm 4, as explicitly
designated in the condition and action.
In CONDITION[24], WHEN and LOCK clauses apply to the arm of the MOVE statement
to which the condition is associated.
163
Comau Robotics Product Instruction
CONDITION HANDLERS
VAR a, b: INTEGER
CONDITION[55] SCAN(2):
WHEN a = b DO
ENABLE CONDITION[4]
ENDCONDITION
If the regular scan time of condition handlers is 20 milliseconds (default value for
$TUNE[1]), the above defined condition is monitored every 40 milliseconds.
The SCAN clause is only useful if applied to conditions that are states and that do not
require to be scanned very frequently. The SCAN clause acts as a filter for reducing the
system overhead during the monitoring.
Note that, when the condition triggers, it is automatically disabled. Either use the
NODISABLE clause (trapping on the error 40016) or the ENABLE CONDITION
statement for mantaining the condition always enabled.
Events are not influenced by the SCAN clause.
Refer to other sections of this chapter for the definitions of states and events.
164
Comau Robotics Product Instruction
CONDITION HANDLERS
PROGRAM example
. . .
BEGIN
CONDITION[1]:
WHEN AT START DO
$DOUT[22] := ON
ENDCONDITION
. . .
MOVE TO p1 WITH CONDITION[1]
. . .
END example
Condition handlers are automatically disabled when they are triggered (unless the
NODISABLE clause is specified).
Globally enabled condition handlers can be disabled using the DISABLE CONDITION
statement or action. The syntax is as follows:
165
Comau Robotics Product Instruction
CONDITION HANDLERS
8.3 Conditions
A condition can be a state or an event. States remain satisfied as long as the state
exists. They are monitored at fixed intervals by a process called scanning. Events are
satisfied only at the instant the event occurs. Consequently, event conditions cannot be
joined by the AND operator in a condition expression.
The user should take care of the way in which his conditions are structured. Events must
be preferred to states; if a state, a condition should remain enabled only when needed,
because it is polled each scan time (10 or 20 ms); in case of events, the NODISABLE
clause is preferred to an ENABLE CONDITION action.
Multiple conditions can be combined into a single condition expression using the
BOOLEAN operators AND and OR The AND operator has a higher precedence which
means the condition expression
166
Comau Robotics Product Instruction
CONDITION HANDLERS
Please note that if the involved variables in states or events are uninitialized, no error
occurs.
WHEN bool_var DO
The BOOLEAN operator NOT can be used to specify the condition is satisfied when the
variable is FALSE. For example:
167
Comau Robotics Product Instruction
CONDITION HANDLERS
whether a specified bit of an INTEGER is ON or OFF. The first argument is the variable
to be tested, the second argument indicates the bit to be tested, and the third argument
indicates whether the bit is to be tested for ON or OFF. When used in a condition
expression, the third argument of BIT_TEST must be specified. In addition, variables
used as arguments must not be local or parameters. (Refer to the BIT_TEST section of
Chap.11. - BUILT-IN Routines List on page 251 for additional information on
BIT_TEST.) The following is an example using BIT_TEST in a condition expression:
WHEN a AND b DO
WHEN $DIN[1] DO
WHEN $DOUT[22] DO
The BOOLEAN operator NOT can be used to specify the condition is satisfied if the
signal is OFF during the scan. For example:
WHEN $DIN[1]+ DO
WHEN $DOUT[22]- DO
The BIT_FLIP built-in function can be used for monitoring the event of positive or
negative transition of a bit inside one of the following analogue port arrays : $AIN,
$AOUT, $GI, $GO, $WORD, $USER_BYTE, $USER_WORD, $USER_LONG,
$PROG_UBYTE, $PROG_UWORD, $PROG_ULONG. For further details about this
function, please refer to Chap.11. - BUILT-IN Routines List on page 251.
168
Comau Robotics Product Instruction
CONDITION HANDLERS
169
Comau Robotics Product Instruction
CONDITION HANDLERS
170
Comau Robotics Product Instruction
CONDITION HANDLERS
171
Comau Robotics Product Instruction
CONDITION HANDLERS
172
Comau Robotics Product Instruction
CONDITION HANDLERS
The use of events related to HDIN (209..216) should be preceded by HDIN_SET Built-In
Procedure call, so that monitoring of $HDIN transition is enabled.
The SEGMENT WAIT condition is triggered before the motion to a path node whose
$SEG_WAIT field is TRUE. At this time the path processing is suspended until a
SIGNAL SEGMENT statement or action is executed for such a path.
The WINDOW SELECT condition is triggered when a different window is selected for
input on the specified screen. A window is selected for input by the WIN_SEL Built-In
Procedure. After the condition triggers, the SCRN_GET Built-In Function should be
used to determine which window has been selected.
For example:
173
Comau Robotics Product Instruction
CONDITION HANDLERS
WHEN POWERUP DO
WHEN HOLD DO
WHEN START DO
WHEN EVENT AE_CALL DO
WHEN SEGMENT WAIT weld_path DO
WHEN WINDOW SELECT SCRN_USER DO
CONDITION[90]:
WHEN EVENT 50100 DO
$DOUT[25] := OFF
ENDCONDITION
<statements..>
SIGNAL EVENT 50100 -- this triggers condition[90]
The programmer can specify a program name or use the reserved word ANY to specify
which program the event must be caused by to trigger the user events.
The syntax is as follows:
174
Comau Robotics Product Instruction
CONDITION HANDLERS
The PC interface program can be used for getting the documentation related to the
Control Unit errors.
The programmer can specify a program name or use the reserved word ANY to specify
which program the error must be caused by to trigger the error events.
The syntax is as follows:
WHEN ANYERROR DO
WHEN ERRORCLASS EC_FILE BY ANY DO
WHEN ERRORNUM 36939 BY weld_prog DO
The value of $THRD_ERROR for interrupt service routines initiated as actions of error
events will be set to the error number that triggered the event.
WHEN ACTIVATE DO
WHEN DEACTIVATE weld_prog DO
WHEN PAUSE ANY DO
WHEN UNPAUSE DO
WHEN EXIT CYCLE DO
175
Comau Robotics Product Instruction
CONDITION HANDLERS
CONDITION [1]:
WHEN ERRORNUM 52230 BY MyProg DO -- interruption or Bypass on READ
executed from MyProg
PAUSE Prog2 -- pause program Prog2
WHEN ERRORNUM 52225 BY ANY DO -- interruption or Bypass on
PAUSE -- MOVE on ARM 2 executed by any pause this program
176
Comau Robotics Product Instruction
CONDITION HANDLERS
ENDCONDITION
ENABLE CONDITION [1]
Obviously, it is possible to use this events in a WAIT FOR statement too.
For example:
Starting from 4.20.xxx system software version, the use of Motion Events is strongly
recommended for systems with Lookahead option with $ADVANCE > 1 , in order to
prevent any synchronization problems among motion statements and non-motion ones.
Refer to par. 4.2.6.3 Lookahead optional functionality considerations on page 101 for
further information.
A motion event condition monitors an event related to a motion segment. The condition
is satisfied when the specified motion event occurs while the condition handler is
enabled. The condition expression is scanned only when a motion event occurs.
Motion events include the following:
– TIME int_expr AFTER START: time after the start of motion. int_expr represents
a time in milliseconds
– TIME int_expr BEFORE END: time before the end of motion. int_expr represents
a time in milliseconds
– TIME int_expr BEFORE HALFFLY: time before reaching the closest point of the
trajectory to the target position. int_expr represents a time in milliseconds
– DISTANCE real_expr AFTER START: distance after the start of motion.
real_expr representsa distance in millimiters
– DISTANCE real_expr BEFORE VIA: distance before VIA position. real_expr
represents a distance in millimiters
– DISTANCE real_expr AFTER VIA: distance after VIA position. real_expr represents
a distance in millimiters
– DISTANCE real_expr BEFORE END: distance before the end of motion.
real_expr represents a distance in millimiters
– DISTANCE int_expr BEFORE HALFFLY: distance before the closest point of the
trajectory to the target position. int_expr represents a distance in millimiters
– PERCENT int_expr AFTER START: % of distance traveled after start of motion
– PERCENT int_expr BEFORE END: % of distance traveled before end of motion
– PERCENT int_expr AFTER STARTFLY: % of distance traveled after starting the
FLY segment. It is just for eMotion Control usage
– AT START: start of motion; in case of eMotion Control, when used in a fly motion,
its meaning is different (see Events related to FLY movements with trajectory
control (constant speed or specified FLY_DIST))
– AT VIA: VIA position is reached
– AT END: end of motion; in case of eMotion Control, when used in a fly motion, its
meaning is different (see Motion Programming manual, par.5.10.2.4.2 - Events
177
Comau Robotics Product Instruction
CONDITION HANDLERS
The user is allowed to specify any percentage value between 0% and 100% (e.g. 50%,
178
Comau Robotics Product Instruction
CONDITION HANDLERS
meaning halfway of the fly segment, etc.) for the PERCENT AFTER STARTFLY integer
expression.
The condition will never trigger if any of the expression values are outside of the range
of the motion segment, for example, if the time before end is greater than the total
motion segment time.
Note that, when executing circular motion between PATH nodes, conditions must not be
associated to the VIA node as them will not trigger. For this reason the AT VIA condition
must be enabled with the destination node of the circular move and not with the via
node.
For example:
PROGRAM example
TYPE ndef = NODEDEF
$MAIN_POS
$MOVE_TYPE
$COND_MASK
ENDNODEDEF
VAR path_var : PATH OF ndef
int_var: INTEGER
BEGIN
CONDITION[5] : -- define the AT VIA condition
WHEN AT VIA DO
$FDOUT[5] := ON
ENDCONDITION
NODE_APP(path_var, 10) -- append 10 nodes to the PATH path_var
path_var.COND TBL[2] := 5 -- fill a condition table element
FOR int var := 1 TO 10 DO
-- assign values to path nodes using the POS built-in function
path_var.NODE[int_var].$MAIN_POS := POS(...)
path_var.NODE[int_var].$MOVE_TYPE := LINEAR
path_var.NODE[int_var].$COND_MASK := 0
ENDFOR
-- associate the AT VIA condition to node 5
path_var.NODE[5].$COND_MASK := 2
-- define node 4 as the VIA point
path_var.NODE[4].$MOVE_TYPE := SEG_VIA
-- define the circular motion between node 3 and 5
path_var.NODE[5].$MOVE_TYPE := CIRCULAR
CYCLE
-- execute the move along the path.
-- The interpolation through nodes will be LINEAR except
-- between nodes 3.. 5 that will be CIRCULAR.
MOVE ALONG path_var[1..9]
END example
Also refer to Chap.4. - Motion Control on page 82 for further detail about conditions in
PATH.
STOP, RESUME, AT START, and AT END motion event conditions can be used in
condition handlers which are globally enabled. An error is detected if the ENABLE
statement or action includes a condition handler containing other motion events.
Globally enabled motion events apply to all motion segments. This means they apply to
each MOVE statement and to each node segment of a path motion.
Note that STOP, RESUME, and AT END, if used locally in a MOVE statement, will not
trigger upon recovery of an interrupted trajectory if the recovery operation is done on the
final point.
To detect when the robot stops after a motion statement deactivation (interruption or
Bypass), it is necessary that the WHEN STOP condition be globally enabled. If it is locally
179
Comau Robotics Product Instruction
CONDITION HANDLERS
used with the MOVE statement, the condition would not trigger.
When the motion event triggers, the predefined variable $THRD_PARAM is set to the
node number associated to the triggered motion event.
8.4 Actions
The following actions can be included in an action_list:
– ASSIGNMENT Action
– INCREMENT and DECREMENT Action
– BUILT-IN Actions
– SEMAPHORE Action
– MOTION and ARM Actions
– ALARM Actions
– PROGRAM Actions
– CONDITION HANDLER Actions
– DETACH Action
– PULSE Action
– HOLD Action
– SIGNAL EVENT Action
– ROUTINE CALL Action
int_var := 4
$DOUT[22] := ON
int_var := other_int_var
In the example above, if other_int_var is uninitialized when the action takes place, int_var
will be set to uninitialized.
If an uninitialized boolean variable is assigned to an output port ($DOUT, $FDOUT, etc.)
the port is automatically set to TRUE. The example below is valid only inside condition
actions — an error would be returned in a normal program statement.
180
Comau Robotics Product Instruction
CONDITION HANDLERS
For example:
int_var += 4
int_var -= 4
int_var += other_int_var
int_var -= other_int_var
BIT_SET(int_var, 1)
BIT_CLEAR($WORD[12], int_var)
BIT_ASSIGN(int_var, 4, bool_var, TRUE, FALSE)
SIGNAL semaphore_var
CANCEL semaphore_var
The semaphore_var cannot be a local variable or parameter.
181
Comau Robotics Product Instruction
CONDITION HANDLERS
CANCEL CURRENT
CANCEL CURRENT SEGMENT
SIGNAL SEGMENT weld_path
DETACH ARM[1]
LOCK ARM[1], ARM[2]
RESUME ARM[1], ARM[2]
UNLOCK ALL
CANCEL ALARM
PAUSE
UNPAUSE
DEACTIVATE weld_prog
ACTIVATE util_prog
EXIT CYCLE prog_1, prog_2, prog_3
182
Comau Robotics Product Instruction
CONDITION HANDLERS
183
Comau Robotics Product Instruction
CONDITION HANDLERS
CONDITION[1] :
WHEN $DIN[1] DO
UNLOCK ARM[1] -- Unlock arm to allow restart of motion
RESUME ARM[1] -- Resume motion on the arm
$DOUT[1] := ON -- Signal the outside world we started motion
user_isr -- User defined routine
ENDCONDITION
The shown above example, if executed outside of a condition handler, would produce
184
Comau Robotics Product Instruction
CONDITION HANDLERS
the results expected by unlocking the arm, resuming the motion, setting the signal, and
then calling the routine. When such a code segment is executed inside the condition
statement, the digital output will be set before the RESUME action is executed. This is
because the RESUME action is always executed after all other actions except the
routine call.
185
Comau Robotics Product Instruction
COMMUNICATION
9. COMMUNICATION
This chapter explains the PDL2 facilities for handling stream input and output. Stream
I/O includes reading input from and writing output to operator devices, data files, and
communication ports. Depending on the device, the input and output can be in the form
of ASCII text or binary data.
9.1 Devices
PDL2 supports the following types of devices:
– WINDOW Devices
– FILE Devices
– PIPE Devices
– External;
– PDL2 Devices
– NULL Device
– Network Devices (Socket use via PDL2).
Devices are specified in a PDL2 program as a string value. Each device name consists
of one to four characters followed by a colon. For example, ‘CRT:’ which specifies the
PC interface Terminal Window.
186
Comau Robotics Product Instruction
COMMUNICATION
187
Comau Robotics Product Instruction
COMMUNICATION
– XDn: are eXternal devices which are recognized by the system when the USB flash
disk is inserted in the USB ports. There are n available eXternal devices: XD:,
XD2:.. XDn: depending on the Control Unit.
The TD: file device refers to the Control Unit RAM disk.
PDL2 provides built-in routines to perform file operations such as positioning a file
pointer or determining the number of remaining bytes in a file (refer to Chap.11. -
BUILT-IN Routines List on page 251).
COMP:
NET1: NET2: NETT: NETU:
188
Comau Robotics Product Instruction
COMMUNICATION
LUN Devices
LUN_TP TP:
LUN_CRT CRT:
LUN_NULL NULL:
The predefined variable $DFT_LUN indicates the default LUN for I/O operations.
The default LUN is the Teach Pendant, and remains the Teach Pendant even if the
Terminal of the PC interface program is active. CRT emulator protocol is mounted on a
port. If the PDL2 programmer wants to redirect the output to the CRT: device on the
Terminal, the $DFT_LUN predefined variable can be set to LUN_CRT value.
For further information about using LUNs, see Chap.10. - Statements List on page 195:
CLOSE FILE Statement,
OPEN FILE Statement,
READ Statement,
WRITE Statement.
189
Comau Robotics Product Instruction
COMMUNICATION
Socket use via PDL2 requires “PDL2 Read/Write on TCP/IP” software option.
Part Code: CR17926300.
190
Comau Robotics Product Instruction
COMMUNICATION
191
Comau Robotics Product Instruction
COMMUNICATION
192
Comau Robotics Product Instruction
COMMUNICATION
193
Comau Robotics Product Instruction
COMMUNICATION
In such a sample program the Server is listening on port 1102, waiting for a Client to
send a string. The program can be tested by running the Client side first: if the Server
receives a string within 5 seconds it displays it on the screen.
To obtain a communication as a Server, the following steps are to be executed:
– opening socket on UDP protocol
– associating port 1102 to socket by means of DV_CNTRL routine with code 29 (see
ki_dv_tcp_accept variable)
– displaying the received string, if the association is successful and a string is
received from the Client within 5 seconds
– closing socket file.
PROGRAM udp_srv NOHOLD
--
-- Socket UDP, Server - sample program
--
--
CONST
ki_dv_accept = 29
ki_dv_connect = 30
ki_dv_disconnect = 31
VAR
vi_netlun : INTEGER
vi_local_port : INTEGER
vs_rem_host : STRING[100] NOSAVE
vi_rem_port : INTEGER
vs_read_string : STRING[200] NOSAVE
BEGIN
-- Port where Server is listening
vi_local_port := 1101
-- Open UDP
OPEN FILE vi_netlun ('NETU:', 'rw')
-- Join it and wait for Client connection
DV_CNTRL(ki_dv_accept, (vi_netlun), (vi_local_port))
-- If accept successful
IF $DV_STS = 0 THEN
WRITE LUN_CRT ('[Server] Accept successful', NL)
-- Read string from Client
READ vi_netlun (vs_read_string)
-- Print the received string
WRITE LUN_CRT ('[Server] I read ', vs_read_string, NL)
-- Write answer to Client
WRITE vi_netlun ('Bye bye C5G', NL)
ENDIF
-- Close file
CLOSE FILE vi_netlun
END udp_srv
194
Comau Robotics Product Instruction
STATEMENTS LIST
10.1 Introduction
This chapter is an alphabetical reference of PDL2 statements. The following information
is provided for each statement:
– short description;
– syntax;
– comments concerning usage;
– example;
– list of related statements.
This chapter uses the syntax notation explained in the “Introduction to PDL2" chapter to
represent PDL2 statements.
The available PDL2 statements are:
– ACTIVATE Statement
– ATTACH Statement
– BEGIN Statement
– BYPASS Statement
– CALL Statement
– CALLS Statement
– CANCEL Statement
– CLOSE FILE Statement
– CLOSE HAND Statement
– CONDITION Statement
– CYCLE Statement
– CONST Statement
– DEACTIVATE Statement
– DECODE Statement
– DELAY Statement
– DETACH Statement
– DISABLE CONDITION Statement
– DISABLE INTERRUPT Statement
– ENABLE CONDITION Statement
– ENCODE Statement
– END Statement
– EXIT CYCLE Statement
– FOR Statement
195
Comau Robotics Product Instruction
STATEMENTS LIST
– GOTO Statement
– HOLD Statement
– IF Statement
– IMPORT Statement
– LOCK Statement
– MOVE Statement
– MOVE ALONG Statement
– OPEN FILE Statement
– OPEN HAND Statement
– PAUSE Statement
– PROGRAM Statement
– PULSE Statement
– PURGE CONDITION Statement
– READ Statement
– RELAX HAND Statement
– REPEAT Statement
– RESUME Statement
– RETURN Statement
– ROUTINE Statement
– SELECT Statement
– SIGNAL Statement
– TYPE Statement
– UNLOCK Statement
– UNPAUSE Statement
– VAR Statement
– WAIT Statement
– WAIT FOR Statement
– WHILE Statement
– WRITE Statement
196
Comau Robotics Product Instruction
STATEMENTS LIST
placed in the ready state and non-holdable programs are placed in the running
state. If the statement is issued from a holdable program, the programs are placed
in the running state.
The programs must be loaded in memory or an error results.Only one activation of
a given program is allowed at a given time.
When a program is activated, the following occurs for that program:
– initialized variables are set to their initial values.
– if prog_name is holdable and does not have the DETACH attribute, the arm
will be attached. If prog_name is non-holdable and has the ATTACH attribute
then the arm will be attached.
The ACTIVATE statement is permitted as a condition handler action. Refer to the
Condition Handlers chapter for further information.
Examples:
ACTIVATE weld_prog, weld_util, weld_cntrl
See also:
DEACTIVATE Statement
197
Comau Robotics Product Instruction
STATEMENTS LIST
When an I/O device is attached, other programs cannot open a LUN on that device.
An error occurs if a program attempts to attach a device on which LUNs are already
opened or to which another program is already attached.
In addition, if the attached device is a window, other programs cannot use that
window in the window related built-in routines.
When a condition handler is attached, only code belonging to the same program
containing the ATTACH can enable, disable, purge, detach, or redefine the
condition handler.
An error occurs if a program attempts to attach a condition handler that does not
exist.
When a timer is attached, it is attached to the program owning the ATTACH
statement. Only code belonging to the same program containing the ATTACH
statement can access the timer. The value of the timer is not changed when it is
attached.
To release an arm, device, condition handler, or timer for use by other programs,
the DETACH statement must be issued from the same program that issued the
ATTACH. This means the DETACH statement must be executed by the attaching
program for arms and devices and the DETACH statement must be owned by the
attaching program for condition handlers and timers.
When a program terminates or is deactivated, all attached resources are detached.
The following example and table illustrate the program considered to have the
attached resource:
PROGRAM p1 PROGRAM p2
ROUTINE r2 EXPORTED FROM p2 ROUTINE r2 EXPORTED FROM p2
ROUTINE r1 ROUTINE r2
BEGIN BEGIN
r2 -- ATTACH statement
END r1 END r2
BEGIN BEGIN
r1 END p2
END p1
Examples:
ATTACH ‘COM1:‘ -- attach a communication device
ATTACH ‘CRT2:‘ -- attach a window device
198
Comau Robotics Product Instruction
STATEMENTS LIST
See also:
DETACH Statement
PROGRAM Statement (ATTACH attributes)
PROGRAM Statement (DETACH attributes)
See also:
CYCLE Statement
DEACTIVATE Statement
END Statement
EXIT CYCLE Statement
199
Comau Robotics Product Instruction
STATEMENTS LIST
Syntax:
BYPASS <flags> <||prog_name <, <prog_name>...| ALL ||>
Comments:
flags is an integer mask used for indicating which kind of suspendable statement
should be bypassed. Possible mask values are:
These integer values are the same as those returned by the PROG_STATE built-in
function.
After having bypassed a MOVE statement, the START button need to be pressed
for continuing the execution of the bypassed program.
If prog_name or a list of names is specified, those programs are paused. If no
name is included, the suspendable statement of the program issuing the BYPASS
is bypassed.
In this case, the BYPASS should be issued from a condition handler action when
the main of the program is stopped on a suspendable statement.
The BYPASS statement is permitted as a condition handler action. Refer to the
Condition Handlers chapter for further details.
Examples:
BYPASS 0 ALL -- bypassed all programs that are executing a
-- suspendable statement
state:=PROG_STATE (Prog1)
IF state = 2048 THEN
BYPASS state Prog1 -- bypasses Prog1 if it is waiting on a semaphore
ENDIF
See also:
PROG_STATE Built-In Function
Condition Handlers chapter
200
Comau Robotics Product Instruction
STATEMENTS LIST
Upon CYCLE Statement in the called program, the $CYCLE predefined variable is not
incremented, which means that the statement is not executed.
201
Comau Robotics Product Instruction
STATEMENTS LIST
CANCEL CURRENT cancels only the current motion. If there is a pending motion
when the statement is issued, it is executed immediately. If the current motion is a
path motion, all path segments are canceled. CANCEL ALL cancels both the current
motion and any pending motions.
CANCEL CURRENT SEGMENT cancels only the current path segment. If
additional nodes remain in the path when the CANCEL CURRENT SEGMENT
statement is executed, they are processed immediately. If there are no remaining
nodes in the path or the CANCEL ALL SEGMENT statement was used, pending
motions (if any) are executed immediately. CANCEL ALL SEGMENT is equivalent
to canceling the current motion using CANCEL CURRENT.
The programmer can specify an arm, a list of arms, or all arms in a CANCEL motion
statement. If nothing is specified, motion for the default arm is canceled.
CANCEL ALARM clears the alarm state of the Control Unit. It has the same effect
as the SHIFT SCRN key on the keyboard. This statement will not execute properly
if the Control Unit is in a fatal state.
CANCEL semaphore_var clears all unused signals. The signal counter is set to
zero. This statement should be executed at the beginning of the program to clear
out any outstanding signals from a previous execution.
If programs are currently waiting on a SEMAPHORE, the CANCEL semaphore_var
statement will result in an error.
The CANCEL statement is permitted as a condition handler action. Refer to the
Condition Handlers chapter for further information.
Examples:
CANCEL ALL
CANCEL ALL SEGMENT
CANCEL ALL FOR ARM[1], ARM[2]
CANCEL ALL SEGMENT FOR ARM[1]
CANCEL ALL FOR ALL
CANCEL CURRENT
CANCEL CURRENT SEGMENT
CANCEL CURRENT FOR ARM[3]
CANCEL CURRENT SEGMENT FOR ARM[3], ARM[2]
CANCEL CURRENT FOR ALL
CANCEL ALARM
CANCEL resource
See also:
LOCK Statement
HOLD Statement
SIGNAL Statement
WAIT Statement
Motion Control Chapter
202
Comau Robotics Product Instruction
STATEMENTS LIST
203
Comau Robotics Product Instruction
STATEMENTS LIST
204
Comau Robotics Product Instruction
STATEMENTS LIST
WHEN $DOUT[20]=TRUE DO
PAUSE
ENDCONDITION
See also:
ENABLE CONDITION Statement
DISABLE CONDITION Statement
PURGE CONDITION Statement
ATTACH Statement
DETACH Statement
Condition Handlers Chapter
205
Comau Robotics Product Instruction
STATEMENTS LIST
See also:
BEGIN Statement
EXIT CYCLE Statement
206
Comau Robotics Product Instruction
STATEMENTS LIST
Comments:
If prog_name or a list of names is specified, those programs are deactivated. If no
prog_name is specified, the program issuing the statement is deactivated. If ALL is
specified, all executing programs are deactivated.
When a program is deactivated, the following occurs for that program:
DEACTIVATE ALL
See also:
ACTIVATE Statement
BOOLEAN INTEGER
JOINTPOS POSITION
REAL STRING
VECTOR XTNDPOS
207
Comau Robotics Product Instruction
STATEMENTS LIST
Optional Format Specifiers can be used with var_id as they are used in a READ
Statement.
Examples:
PROGRAM sample_OK
VAR
s, str : STRING[10]
i, x, y, z : INTEGER
BEGIN
READ(str) -- assume 4 6 8 is entered
DECODE(str, x, y, z) -- x = 4, y = 6, z = 8
DECODE(‘1234abcd‘, i, s) -- generates i = 1234, s = abcd
DECODE(‘-1234abcd‘, i) -- generates i = -1234
DECODE(‘+‘, i) -- trappable error
READ(str) -- assume 101214 is entered
DECODE(str, x::3, y::1, z::2) -- x = 101, y = 2, z = 14
END sample
See also:
ENCODE Statement
READ Statement
Communication Chapter
Examples:
MOVE TO pickup
DELAY 200
CLOSE HAND 1
See also:
WAIT FOR Statement
208
Comau Robotics Product Instruction
STATEMENTS LIST
Syntax:
DETACH || ARM <ALL> | ARM[n] <, ARM[n]>... ||
DETACH device_str <, device_str>...
DETACH CONDITION || ALL | [number] <, CONDITION [number]> ...
||
DETACH $TIMER[n] <, $TIMER[n]>...
Comments:
When an arm is detached, other programs will be permitted to cause motion on the
arm.
When the ARM ALL option is used, all arms currently attached to the program
executing the DETACH statement are detached.
It is only a warning if a program attempts to detach an arm that is currently not
attached to any program. An error occurs if a program attempts to detach an arm
that is currently attached by another program.
The device_str can be any I/O device name including the following predefined
window and communication devices:
When an I/O device is detached, other programs can open a LUN on that device
and if it is a window device, the window related built-ins can be applied to that
device.
An error occurs if a program attempts to detach a device that is currently attached
by another program.
When a condition handler is detached, other programs can enable, disable, purge,
or redefine the condition handler.
When a timer is detached, other programs will be permitted read and write access
to that timer.
The DETACH statement used to detach a condition handler or timer must be
contained in the same program owning the corresponding ATTACH statement. An
error occurs if the program attempts to execute a DETACH statement contained in
a different program. It is also an error if a program attempts to detach a condition
handler that does not exist.
When a program terminates or is deactivated, all attached resources are
automatically detached.
The DETACH statement is permitted as a condition handler action. Refer to
Condition Handlers chapter for further information.
Examples:
DETACH ‘COM1:‘ -- detach a communication device
DETACH ‘CRT2:‘ -- detach a window device
209
Comau Robotics Product Instruction
STATEMENTS LIST
210
Comau Robotics Product Instruction
STATEMENTS LIST
Syntax:
DISABLE INTERRUPT
<statements>
ENABLE INTERRUPT
Comments:
statements included between the DISABLE INTERRUPT and the ENABLE
INTERRUPT are prevented from interruption by Interrupt Service Routines
occurring in the same program. Those routines will be interpreted after the
ENABLE INTERRUPT statement is executed.
Only the following subset of PDL2 statements is allowed between the DISABLE
INTERRUPT and the ENABLE INTERRUPT instructions: ATTACH and DETACH
of arms, timers, conditions; OPEN, CLOSE and RELAX HAND; RETURN;
ENABLE, DISABLE, PURGE CONDITION; SIGNAL EVENT, SEGMENT,
semaphore; CANCEL ALARM, motion, semaphore; RESUME; LOCK and
UNLOCK; HOLD; assignement, increment and decrement of variables.
This statement should only be used when really necessary so to avoid the nesting
of thread levels in the program call chain. It is important to specify a minimum
amount of statements for not compromising a correct program interpretation.
PROGRAM example
ROUTINE user_isr
BEGIN
-- Interrupt Service routine statements
<statements....>
DISABLE INTERRUPT
ENABLE CONDITION[13]
$BIT[100] := ON
RETURN
ENABLE INTERRUPT
END user_isr
BEGIN -- main
CONDITION[13] :
WHEN $DIN[18] DO
user_isr
ENDCONDITION
ENABLE CONDITION[13]
-- Main statements
<statements..>
END example
See also:
Condition Handlers chapter.
211
Comau Robotics Product Instruction
STATEMENTS LIST
it will remain enabled when the motion finishes, instead of being disabled.
It is an error if the program attempts to enable a condition handler that is currently
attached in another program.
The ENABLE CONDITION statement is permitted as a condition handler action.
Refer to Condition Handlers chapter for further information.
Examples:
ENABLE CONDITION[3]
See also:
CONDITION Statement
DISABLE CONDITION Statement
MOVE Statement
PURGE CONDITION Statement
Condition Handlers Chapter
BOOLEAN INTEGER
JOINTPOS POSITION
REAL STRING
VECTOR XTNDPOS
Optional Format Specifiers can be used with expr as they are used in a WRITE
Statement. Note that, if expr is not left justified, the first character in string_id is a
blank one.
The maximum length of the STRING is determined by the declared length of
string_id. If the new STRING is longer then the declared length, then the new
STRING is truncated to fit into string_id.
Examples:
PROGRAM sample
VAR
str : STRING[20]
x,y : INTEGER
z : REAL
BEGIN
x := 23
y := 1234567
z := 32.86
ENCODE (str, x, y, z)
WRITE (str) -- outputs ‘23‘ ‘1234567‘ ‘32.860‘
ENCODE (str, x::4, y::8, z::4::1)
WRITE (str) -- outputs ‘23‘ ‘123456732.9‘
END sample
212
Comau Robotics Product Instruction
STATEMENTS LIST
See also:
DECODE Statement
WRITE Statement
Communication Chapter
See also:
BEGIN Statement
CYCLE Statement
EXIT CYCLE Statement
RETURN Statement
213
Comau Robotics Product Instruction
STATEMENTS LIST
214
Comau Robotics Product Instruction
STATEMENTS LIST
215
Comau Robotics Product Instruction
STATEMENTS LIST
Starting from 4.20.xxx system software version, in case ofsystems with Lookahead
option with $ADVANCE > 1 , the use of this instruction should be carefully handled in
order to prevent any synchronization issue with the motion statements.
Refer to par. 4.2.6.3 Lookahead optional functionality considerations on page 101 for
further information.
The HOLD statement places all running holdable programs in a ready state and causes
motion to decelerate to a stop.
Syntax:
HOLD
Comments:
The HOLD statement works exactly like the HOLD button on the TP and control
panel.
A HOLD causes the arm to decelerate smoothly until the motion ceases. The
predefined variable $HLD_DEC_PER indicates the rate of deceleration.
START button must be pressed to place holdable programs back into a running
state.
The HOLD statement can be used in both holdable and non-holdable programs.
HOLD is an asynchronous statement which means it continues while the program
is paused and condition handlers continue to be scanned. However, if a condition
handler triggers while a program is held, the actions are not performed until the
program is unheld.
The HOLD statement is permitted as a condition handler action. Refer to Condition
Handlers chapter for further information.
Examples:
HOLD
See also:
CANCEL Statement
LOCK Statement
PAUSE Statement
10.27 IF Statement
The IF statement is used to choose between two possible courses of action, based on
the result of a Boolean expression.
Syntax:
IF bool_expr THEN
<statement>...
<ELSE
<statement>... >
ENDIF
Comments:
216
Comau Robotics Product Instruction
STATEMENTS LIST
NOTE THAT:
the IMPORT clause must be after the PROGRAM clause and before any declaration
clause.
In general the order is:
– PROGRAM
– IMPORT
– TYPE
– VAR
– ROUTINES
– code.
Comments:
Importing from a program, causes the current program to be able to make use of
any GLOBAL identifiers (types, variables and routines) belonging to another
program.
prog_name is a STRING representing the name of the owning program (program
which owns the being imported GLOBAL variables and/or routines). It can also
contain a relative or absolute path.
Local variables of a global routine cannot be declared with the GLOBAL attribute.
Example:
IMPORT ‘tv_move‘
217
Comau Robotics Product Instruction
STATEMENTS LIST
See also:
– par. 3.2.4 Shared types, variables and routines on page 71
LOCK ALL
CONDITION[3]:
WHEN $DIN[3]+ DO
LOCK ARM[3]
ENDCONDITION
See also:
UNLOCK Statement
RESUME Statement
CANCEL Statement
218
Comau Robotics Product Instruction
STATEMENTS LIST
The synchronized motion feature (SYNCMOVE clause) is not supported in systems with
eMotion Trajectory control.
The user is notified by a suitable message.
The MOVE statement controls the arm motion. Different clauses and options allow for
many different kinds of motion, as described in Chap.4. - Motion Control on page 82.
Syntax:
MOVE <ARM[n]> <trajectory> dest_clause <opt_clauses> <sync_clause>
Comments:
The dest_clause specifies the kind of move and its destination. It can be any of the
following:
TO || destination | joint_list || <VIA_clause>
NEAR destination BY distance
AWAY distance
RELATIVE vector IN frame
ABOUT vector BY distance IN frame
BY relative_joint_list
FOR distance TO destination
FROM destination REPLAY filename <WITH_clause>
destination in the listed above clauses can be a POSITION, JOINTPOS,
XTNDPOS, or node expression. If it is a node, the standard node fields of that node
are used in the motion. Any constraints will be described in the following sections.
joint_list is a list of real expressions, with each item corresponding to the joint angle
of the arm being movedframe in the above clauses must be one of the predefined
constants BASE, TOOL, or UFRAME
The optional arm clause (ARM[n]) designates the arm to be moved. The
designated arm is used for the entire MOVE statement. If the ARM clause is not
included, the default arm is moved.
The optional trajectory clause designates a trajectory for the move. It can be any
of the following predefined constants:
JOINT
LINEAR
CIRCULAR
If the trajectory clause is not included, the value of $MOVE_TYPE is used.
opt_clauses provide more detailed instructions for the motion. Optional clauses
include the following:
219
Comau Robotics Product Instruction
STATEMENTS LIST
ADVANCE
TIL cond_expr <, TIL cond_expr>...
WITH designations <, designations>...
If both the TIL and WITH clauses are specified, all TIL clauses must be specified
before the WITH clauses.
The sync_clause allows two arms to be moved simultaneously using SYNCMOVE.
The arms start and stop together. The optional WITH and TIL clauses can be
included as part of a SYNCMOVE clause.
The synchronized motion feature is not supported in systems with eMotion Trajectory
control.
The user is notified by a suitable message.
NOTE that in order to properly execute the fly trajectory, the MOVEFLY ADVANCE
statement must be always follwed by one more MOVE statement in the execution
context of the same program.
It is recommended to avoid leaving a MOVEFLY as last motion statement of a program.
PROGRAM move_example
VAR pick_up, destination, middle, strt_pos: POSITION
slot, flange, end_part, arc, part, front : POSITION
dist , alpha, beta, gamma, delta, omega : REAL
part_sensor : INTEGER
BEGIN
MOVE NEAR pick_up BY 200.0
MOVE TO pick_up
MOVE AWAY 400.0
MOVE RELATIVE VEC(100, 0, 100) IN TOOL
MOVE ABOUT VEC(0, 100, 0) BY 90 IN BASE
MOVE BY {alpha, beta, gamma, delta, omega}
MOVE FOR dist TO destination
220
Comau Robotics Product Instruction
STATEMENTS LIST
$RPL_DIR_PATH := 'UD:\\USR\\'
MOVE FROM strt_pos REPLAY 'rec_file.log' WITH $RPL_SPD_OVR=50
-- The robot moves towards strt_pos destination and, from there,
-- executes the subsequent recorded trajectory, included
-- inside UD:\usr\rec_file.log file; the speed is controlled
-- by the defined value of $RPL_SPD_OVR
END move_example
See also:
MOVE ALONG Statement
Chap.4. - Motion Control on page 82
BEGIN
-- CIRCLES
221
Comau Robotics Product Instruction
STATEMENTS LIST
$TERM_TYPE := FINE
$SPD_OPT := SPD_LIN
$LIN_SPD := 1 -- [$LIN_SPD] = m/s
$FLY_TRAJ := FLY_AUTO
-- *******************************************
-- * circular path definitions *
-- *******************************************
222
Comau Robotics Product Instruction
STATEMENTS LIST
p3c.Y := p3c.Y + r
p5c.Y := p5c.Y - r
--
p6c := p2c
p6c.Z := p6c.Z + 30
--
p2pc := p2c
p2pc.Y := p2c.Y - r
p2pc.Z := p2c.Z + r
--
p25c := p2c
p25c.Y := p2pc.Y
p25c.X := p2pc.X + (r - r * SIN(45))
p25c.Z := p2pc.Z - r * SIN(45)
--
p4pc := p4c
p4pc.Y := p4c.Y + r
p4pc.Z := p4c.Z + r
p44c := p4pc
p44c.Y := p4c.Y + r * SIN(45)
p44c.Z := p4c.Z + (r - r * COS(45))
----
$MOVE_TYPE := LINEAR
---
MOVE JOINT TO p6c WITH $PROG_SPD_OVR = 100 -- approach table
--
FOR rag := 1 TO 4 DO
--
WRITE LUN_CRT (' CIRCLE RADIUS = ', r, ' mm')
--
-- *******************************************
-- * fixed execution speed rule *
-- *******************************************
--
-- spd := 8 -- [spd] = mm/s
--
-- *******************************************
-- * Adaptive execution speed rule *
-- *******************************************
--
-- THE EXECUTION SPEED MUST BE ADAPTED TO THE RADIUS DEFINITION: THE SMALLER THE
-- RADIUS, THE SMALLER THE SPEED!!!
--
-- y = mx + n
-- 8 = m*2 + n
-- 8*1.5 = m*4 + n
--
-- (8*1.5-8)/2 = m
-- n = 8-m*2
--
m := (12 * 1.5 - 12) / 2
n := 12 - m * 2
spd := ROUND(m * r + n) -- [spd] = mm/s
$LIN_SPD := spd / 1000 -- [$LIN_SPD] = m/s
DELAY 1000
--
WRITE LUN_CRT (' circular spd =', $LIN_SPD, ' m/s ', NL)
--
MOVE JOINT TO p6c WITH $PROG_SPD_OVR = 40 -- start from a point P6c "outside"...
MOVE JOINT TO p2pc WITH $PROG_SPD_OVR = 20 -- p2pc is the trajectory starting point
DELAY 1000
--
223
Comau Robotics Product Instruction
STATEMENTS LIST
-- TCP follows the "approaching" path ( P2pc -> p25c -> P5c )
-- ---------------------------------------------------------------------------
-- The trajectory becomes tangent to the circle in P5c
-- and stays on the circle till P4c
--
MOVEFLY CIRCULAR TO p5c VIA p25c ADVANCE WITH $LIN_SPD = spd / 1000
--
-- path starts to be circular on the plane
-- ---------------------------------------
MOVEFLY CIRCULAR TO p3c VIA p4c ADVANCE WITH $LIN_SPD = spd / 1000
MOVEFLY CIRCULAR TO p4c VIA p2c ADVANCE WITH $LIN_SPD = spd / 1000
--
-- TCP leaves the circle and follows the "leaving" path ( P4c -> P44c -> P4pc )
-- ----------------------------------------------------------------------------
MOVEFLY CIRCULAR TO p4pc VIA p44c ADVANCE WITH $LIN_SPD = spd / 1000
--
MOVE JOINT TO p6c WITH $PROG_SPD_OVR = 20 -- reach a point P6c "outside"...
--
r := r + 2 -- increase the radius r by 2 mm : [r] = mm
--
-- Let's define the circle points and the "approaching"/"leaving" trajectory parts
--
p2c := p1c
p3c := p1c
p4c := p1c
p5c := p1c
--
p2c.X := p2c.X - r
p4c.X := p4c.X + r
--
p3c.Y := p3c.Y + r
p5c.Y := p5c.Y - r
--
p6c := p2c
p6c.Z := p6c.Z + 30
--
p2pc := p2c
p2pc.Y := p2c.Y - r
p2pc.Z := p2c.Z + r
--
p25c := p2c
p25c.Y := p2pc.Y
p25c.X := p2pc.X + (r - r * SIN(45))
p25c.Z := p2pc.Z - r * SIN(45)
--
p4pc := p4c
p4pc.Y := p4c.Y + r
p4pc.Z := p4c.Z + r
--
p44c := p4pc
p44c.Y := p4c.Y + r * SIN(45)
p44c.Z := p4c.Z + (r - r * COS(45))
----
ENDFOR
END circles
224
Comau Robotics Product Instruction
STATEMENTS LIST
Syntax:
MOVE <ARM[n]> ALONG path_var<.NODE[node_range]> <opt_clauses>
Comments:
The optional arm clause (ARM[n]) designates the arm to be moved. The
designated arm is used for the entire MOVE ALONG statement. If the ARM clause
is not included, the default arm is moved.
The arm applies to the main destination field ($MAIN_POS, $MAIN_JNT,
$MAIN_XTND) only. If the main destination is a JOINTPOS ($MAIN_JNT) or an
XTNDPOS ($MAIN_XTND), the arm number must match the one used in the
NODEDEF definition.
If .NODE[node_range] is not present, motion proceeds to the first node of path_var,
then to each successive node until the end of path_var is reached.
If .NODE[node_range] is present, the arm can be moved along a range of nodes
specified within the brackets. The range can be in the following forms:
Opt_clauses provide more detailed instructions for the motion. Optional clauses
include the following:
ADVANCE
WITH designations <, designations>...
MOVEFLY can be used in place of the reserved word MOVE to specify continuous
motion. To execute the fly, the ADVANCE clause must also be included with the
MOVEFLY statement. Specifying MOVEFLY applies to the end of the path, not for
each node. In addition, $TERM_TYPE applies to the end of the path and not for
each node.
If a MOVE ALONG statement needs more than a single line, commas must be
used to end a line after the path_var or after each optional clause. The reserved
word ENDMOVE must then be used to indicate the end of the statement. Refer to
the examples below.
MOVE ALONG is an asynchronous statement which means it continues while the
program is paused and interrupt service routines can begin before the statement
completes.
Examples:
MOVE ALONG pth
MOVE ALONG pth[1..5]
MOVE ARM[2] ALONG pth
225
Comau Robotics Product Instruction
STATEMENTS LIST
R -- read only
W -- write only
RW -- read and write
WA -- write append
RWA -- read and write append
If a file is opened with write access (W or RW), other programs will be denied access to
that file. If a file is opened with read only access (R), other programs will also be allowed
to open that file with read only access. Write operations will be denied. If a file already
exists on the device and an OPEN FILE on that file is done, the same file is opened and
its contents can be added to if ‘RWA’ was specified. If opened with the ‘RW’ attributes,
the file must be present on the device upon which the file is being opened.
Examples of the OPEN FILE statement follow:
OPEN FILE crt1_lun (‘CRT1:‘, ‘RW‘) -- opens window CRT1:, read and write
OPEN FILE file_lun (‘stats.dat‘,‘R‘) -- opens stats.dat,read only
OPEN FILE comm_lun (‘COM1:‘,‘R‘) -- opens port COM1:, read only
OPEN FILE win_lun (‘abcd:‘,‘RW‘) -- opens user-defined window ABCD:
See also:
DV_CNTRL Built-In Procedure
CLOSE FILE Statement
READ Statement
WRITE Statement
Chap.9. - Communication on page 186
226
Comau Robotics Product Instruction
STATEMENTS LIST
$FL_ADLMT $FL_NUM_CHARS
$FL_BINARY $FL_PASSALL
$FL_DLMT $FL_RANDOM
$FL_ECHO $FL_RDFLUSH
$FL_SWAP
For example:
OPEN FILE file_lun (stats.log, R) WITH $FL_BINARY = TRUE
If a statement needs more than a single line, a comma is used to end the OPEN FILE
line. Each new line begins with the reserved word WITH and ends with a comma. The
reserved word ENDOPEN must be used to indicate the end of the OPEN FILE statement
if it spans more than one line.
For example:
227
Comau Robotics Product Instruction
STATEMENTS LIST
Examples:
OPEN HAND 1
OPEN HAND 2 FOR ARM[2]
See also:
CLOSE HAND Statement
RELAX HAND Statement
par. 4.6 HAND Statements on page 115.
228
Comau Robotics Product Instruction
STATEMENTS LIST
Examples:
PROGRAM example3
See also:
BEGIN Statement
229
Comau Robotics Product Instruction
STATEMENTS LIST
END Statement
230
Comau Robotics Product Instruction
STATEMENTS LIST
INTEGER VECTOR
REAL POSITION
BOOLEAN JOINTPOS
STRING XTNDPOS
However, the var_id cannot be a predefined variable which requires limit checking.
Chap.12. - Predefined Variables List on page 391 describes each predefined variable
including whether or not it requires limit checking.
The reserved word NL (new line) can also be used in the list of identifiers to the next
item to be read from a new line.
Each data item that is read is assigned to the corresponding variable from the list of
identifiers. Data items can be read in ASCII or binary format, depending on how the LUN
has been opened.
Examples of the READ statement follow:
In this case, if the operator entered the values 4, 50, and JOE, the READ statement
would make the following assignments:
body_type := 4
total_units := 50
231
Comau Robotics Product Instruction
STATEMENTS LIST
operator_id := JOE
The following examples indicate how to read data from a window and a file:
232
Comau Robotics Product Instruction
STATEMENTS LIST
233
Comau Robotics Product Instruction
STATEMENTS LIST
234
Comau Robotics Product Instruction
STATEMENTS LIST
235
Comau Robotics Product Instruction
STATEMENTS LIST
PROGRAM routine_example2
TYPE stack_type = RECORD
top: INTEGER
data: array[5] of position
ENDRECORD
ROUTINE positive (x : INTEGER) : BOOLEAN
BEGIN
RETURN (x >= 0)
END positive
BEGIN
END routine_example2
See also:
RETURN Statement
Chap.7. - Routines on page 151
236
Comau Robotics Product Instruction
STATEMENTS LIST
IMPORT 'vp2_lib'
237
Comau Robotics Product Instruction
STATEMENTS LIST
kws3 = "wconst3"
kr1 = 11.3
kr2 = 12.3
kr3 = 14.3
BEGIN
test_select(99, 100.0, 'localvars')
test_select(198, 192.89999, 'paramvars')
-- String SELECT
vs1 := 'a'
vs2 := 'bc'
238
Comau Robotics Product Instruction
STATEMENTS LIST
vs3 := ''
s_again::
-- Real SELECT
vr1 := 0
vr2 := 0
vr3 := 0
r_again::
SELECT vr1 + vr2 + vr3 OF
CASE (0, 1, -1): -- Integer literals
WRITE LUN_CRT ($PROG_LINE, NL)
vr1 := 1.1
GOTO r_again
CASE (1.1): -- Real literals
WRITE LUN_CRT ($PROG_LINE, NL)
vr1 := -2.0999999
GOTO r_again
239
Comau Robotics Product Instruction
STATEMENTS LIST
240
Comau Robotics Product Instruction
STATEMENTS LIST
-- Not allowed as wrong datatype. Only support INTEGER, REAL & STRING
-- SELECT ARM_POS OF
END select_usage
241
Comau Robotics Product Instruction
STATEMENTS LIST
See also:
IF Statement
242
Comau Robotics Product Instruction
STATEMENTS LIST
type_name = NODEDEF
<predefined_name <, predefined_name>... <NOTEACH> >...
<name <, name>... : data_type <NOTEACH> >...
ENDNODEDEF
Comments:
A type declaration establishes a new user-defined data type that can be used when
declaring variables and parameters.
type_name can be any user-defined identifier.
User-defined data types are available to the whole system. Make sure that unique
names are used to avoid conflicts.
Field names are local to the user-defined data type. This means two different
user-defined types can contain a field having the same name.
Valid field data types are explained in Chap.3. - Data Representation on page 55.
The TYPE statement is not allowed in ROUTINES.
The TYPE statement must come before any variable declaration that uses
user-defined fields.
A NODEDEF type defines a structure including both predefined_name fields and
user defined fields. Note that it could be very useful to define the structure of a
PATH NODE.
A NODEDEF type can contain any number of predefined_name fields and any
number of name fields. However, the NODEDEF must contain at least one field.
predefined_name is a standard node field having the same meaning as the
corresponding predefined variable. For example, $MOVE_TYPE can be used and
has the same meaning as described in Chap.12. - Predefined Variables List on
page 391.
The NOTEACH option in a NODEDEF type indicates that those fields are not
displayed in the teach environment. This disables the user from modifying those
fields while teaching.
Refer to Chap.3. - Data Representation on page 55 for a list of valid
predefined_name fields and further information about RECORD and NODEDEF
type definitions.
Examples:
PROGRAM main
TYPE
ddd_part = RECORD
name: STRING[15]
count: INTEGER
params: ARRAY[5] OF REAL
ENDRECORD
243
Comau Robotics Product Instruction
STATEMENTS LIST
lapm_pth1 = NODEDEF
$MAIN_POS
$MOVE_TYPE
$ORNT_TYPE
$SPD_OPT -- $SPD_EMT in case of eMotion Control
$SEG_TERM_TYPE
$SING_CARE
weld_sch : ARRAY[8] OF REAL
gun_on : BOOLEAN
ENDNODEDEF
VAR
count, index : INTEGER
part_rec : ddd_part
weld_pth : PATH OF lapm_pth1
BEGIN
-- Executable section
END main
See also:
VAR Statement
Chap.3. - Data Representation on page 55
UNLOCK ALL
See also:
LOCK Statement
RESUME Statement
244
Comau Robotics Product Instruction
STATEMENTS LIST
UNPAUSE ALL
See also:
PAUSE Statement
245
Comau Robotics Product Instruction
STATEMENTS LIST
by other programs using the optional EXPORTED FROM clause. For shared
variables, prog_name indicates the name of the program owning the variable.
If the NOSAVE clause is specified, the variables included in that declaration are not
saved to the variable file (.VAR file).
The NOSAVE and EXPORTED FROM clauses are not permitted on routine VAR
declarations.
The NODATA attribute allows to avoid displaying the corresponding variable on the
TP DATA Page.
The initial_value option is permitted on REAL, INTEGER, BOOLEAN, and STRING
declarations. It is used to indicate a value to be assigned to the variable before the
BEGIN of the program or routine is executed.
Examples:
PROGRAM main
VAR
count, index : INTEGER (0) NOSAVE
angle, dist : REAL
job_complete : BOOLEAN EXPORTED FROM main
error_msg : STRING[30] EXPORTED FROM error_chk
menu_choices : ARRAY[4] OF STRING[30]
matrix : ARRAY[2,10] OF INTEGER
offset : VECTOR
pickup, perch : POSITION EXPORTED FROM data1
option : STRING[10] (backup) NOSAVE
safety_pos : JOINTPOS FOR ARM[2]
door_frame : XTNDPOS FOR ARM[3]
work_area : SEMAPHORE NOSAVE
default_part : INTEGER (0xFF) NOSAVE
BEGIN
-- Executable section
END main
See also:
CONST Statement
TYPE Statement
Chap.3. - Data Representation on page 55
246
Comau Robotics Product Instruction
STATEMENTS LIST
See also:
SIGNAL Statement
247
Comau Robotics Product Instruction
STATEMENTS LIST
Examples:
WHILE num < num_errors DO
IF priority_index[num] < 2 THEN
WRITE(err_text[num],‘ (non critical)‘, NL)
ELSE
WRITE(err_text[num],‘ ***CRITICAL***‘, NL)
ENDIF
num := num + 1
ENDWHILE
See also:
FOR Statement
REPEAT Statement
Starting from 4.20.xxx system software version, in case ofsystems with Lookahead
option with $ADVANCE > 1 , the use of this instruction should be carefully handled in
order to prevent any synchronization issue with the motion statements.
Refer to par. 4.2.6.3 Lookahead optional functionality considerations on page 101 for
further information.
The WRITE statement writes output data from a program to the specified LUN.
The syntax of the WRITE statement is as follows:
INTEGER VECTOR
REAL POSITION
BOOLEAN JOINTPOS
STRING XTNDPOS
The reserved word NL (new line) can also be used as a data item. NL causes a new line
to be output.
Each data item is written out in the order that it is listed. Data items can be written in
ASCII or binary format, depending on how the LUN has been opened.
For example, the following statement writes out a string literal followed by a new line to
the default output device:
WRITE (‘Enter body style, units to process, and operator id.‘, NL)
Notice the string literal is enclosed in single quotes (‘), which are not written as part of
the output.
The WRITE statement is executed asynchronously when writing to certain types of
devices such as communication devices. This is done so other programs can execute
248
Comau Robotics Product Instruction
STATEMENTS LIST
simultaneously without having to wait for the statement to be completed. The predefined
variable $WRITE_TOUT indicates a timeout period for asynchronous writes.
249
Comau Robotics Product Instruction
STATEMENTS LIST
STRING: The format specifier indicates the number of characters to be written. The
specifier can be a positive or negative value. A positive value means right-justify the
string and is the default if no sign is used. A negative value means left-justify the string.
Only one specifier is allowed. Note that the quotes are not written.
If a format specifier greater than 143 characters is specified, the write operation will fail.
To avoid this, do not use a format specifier for large output strings.
VECTOR, POSITION, JOINTPOS, and XTNDPOS: The formats in which data is output
for each data type are as follows:
– in all cases, the left angle bracket (<) starts the value, the right angle bracket (>)
ends the value, and commas separate each component;
– for vectors and positions, x, y, and z represent Cartesian location components.
VECTOR: <x, y, z>
For positions, e1, e2, and e3 represent Euler angle components and cnfg_str
represents a configuration string. The configuration string is not enclosed in
quotes.
POSITION: <x, y, z, e1, e2, e3, cnfg_str>
For jointpos, components that have no meaning with the current arm are left blank,
but commas are used to mark the place. The arm number ‘n’ for jointpos and
xtndpos is preceded by the character ‘A’.
JOINTPOS: <j1, j2, j3, j4, j5, j6, An>
XTNDPOS: <<x, y, z, e1, e2, e3, cnfg_str> <x1, ...> An>
The format specifier indicates the maximum number of characters to be written for each
component of the item.
The second specifier, if positive, is the number of decimal places to use. A negative
number specifies scientific notation is to be used.
250
Comau Robotics Product Instruction
As far as concerns VP2 built-in routines, please refer to VP2 - Visual PDL2 Manual,
chapter 6.
251
Comau Robotics Product Instruction
252
Comau Robotics Product Instruction
253
Comau Robotics Product Instruction
254
Comau Robotics Product Instruction
255
Comau Robotics Product Instruction
Comments: – number specifies a positive or negative number. number must be in the normal
range for the data type.
– ret_val specifies the returned value: absolute value of number, same type. For
example, if number is a REAL then the returned value will be a REAL.
Examples: ABS(99.5) -- result is 99.5
ABS(-28.3) -- result is 28.3
ABS(-19) -- result is 19
ABS(324) -- result is 324
256
Comau Robotics Product Instruction
Parameters: – ret_val specifies the returned value: total amount of passed arguments to the current
routine.
VAR
vi : INTEGER
vr : REAL (3.1415901) NOSAVE
vs : STRING[10] ('variable') NOSAVE
vb : BOOLEAN (TRUE) NOSAVE
vp : POSITION
vx : XTNDPOS
vj : JOINTPOS
vm : SEMAPHORE NOSAVE
ve : aRec
wi : ARRAY[5] OF INTEGER
wr : ARRAY[5] OF REAL
ws : ARRAY[5] OF STRING[10]
wb : ARRAY[5] OF BOOLEAN
257
Comau Robotics Product Instruction
wp : ARRAY[5] OF POSITION
wx : ARRAY[5] OF XTNDPOS
wj : ARRAY[5] OF JOINTPOS
wm : ARRAY[5] OF SEMAPHORE
we : PATH OF aNode
vi_value : INTEGER
wm : ARRAY[5] OF SEMAPHORE
we : PATH OF aNode
vi_value : INTEGER
ROUTINE r2(ai_value: INTEGER; ...) : INTEGER EXPORTED FROM varargs global
ROUTINE r2(ai_value: INTEGER; ...) : INTEGER
VAR li_dtype, li_arr_dim1, li_arr_dim2 : INTEGER
li, lj, lk, li_value: INTEGER
lr_value : REAL
ls_value : STRING[20]
lb_value : BOOLEAN
lv_value : VECTOR
lp_value : POSITION
lx_value : XTNDPOS
lj_value : JOINTPOS
mi_value : ARRAY[5] OF INTEGER
mr_value : ARRAY[5] OF REAL
ms_value : ARRAY[5] OF STRING[10]
mb_value : ARRAY[5] OF BOOLEAN
mv_value : ARRAY[5] OF VECTOR
mp_value : ARRAY[5] OF POSITION
mx_value : ARRAY[5] OF XTNDPOS
mj_value : ARRAY[5] OF JOINTPOS
lb_byref : BOOLEAN
BEGIN
WRITE LUN_CRT ('In r2. Number of arguments', ARG_COUNT, NL)
FOR li := 1 TO ARG_COUNT DO
li_dtype := ARG_INFO(li,lb_byref, li_arr_dim1, li_arr_dim2)
WRITE LUN_CRT ('Index:', li, ' Datatype = ', li_dtype, '[',
li_arr_dim1, ',', li_arr_dim2, ']. By ref:', lb_byref, NL)
SELECT ARG_INFO(li) OF
CASE (1):
ARG_GET_VALUE(li, li_value)
WRITE LUN_CRT ('Int Value = ', li_value, NL)
ARG_GET_VALUE(li, ai_value)
WRITE LUN_CRT ('Int Value = ', ai_value, NL)
ARG_GET_VALUE(li, vi_value)
WRITE LUN_CRT ('Int Value = ', vi_value, NL)
li_value += 10
ARG_SET_VALUE(li, li_value)
CASE (2): -- Real
ARG_GET_VALUE(li, lr_value)
WRITE LUN_CRT ('Rea Value = ', lr_value, NL)
CASE (3): -- Boolean
ARG_GET_VALUE(li, lb_value)
WRITE LUN_CRT ('Boo Value = ', lb_value, NL)
CASE (4): -- String
ARG_GET_VALUE(li, ls_value)
WRITE LUN_CRT ('Str Value = ', ls_value, NL)
CASE (5): -- Vector
ARG_GET_VALUE(li, lv_value)
WRITE LUN_CRT ('Vec Value = ', lv_value, NL)
CASE (6): -- Position
ARG_GET_VALUE(li, lp_value)
WRITE LUN_CRT ('Pos Value = ', lp_value, NL)
lp_value := POS(0)
ARG_SET_VALUE(li, lp_value)
258
Comau Robotics Product Instruction
Calling Sequence: ret_val := ARG_INFO (idx<, by_ref> <, size_arr1> <, size_arr2>)
259
Comau Robotics Product Instruction
260
Comau Robotics Product Instruction
$SYNC_ARM := 2
-- enable cooperation between arm 2 ($SYNC_ARM)
-- and arm 1 ($PROG_ARM)
ARM_COOP(ON)
...
END coop
261
Comau Robotics Product Instruction
Comments: – flag is set to ON or OFF in order to switch the multi-cooperative motion on or off.
– aux_joint is the number of the auxiliary axis. It can be omitted if flag is set to OFF; on
the contrary, when flag is ON, aux_joint is needed.
– positioner_arm, if present, specifies the number of the positioner arm. If not present,
$SYNC_ARM is assumed.
– working_arm, if present, represents the number of the working arm. If not specified,
$PROG_ARM is used.
Examples: PROGRAM mcoop PROG_ARM = 2
VAR xtn0001X : XTNDPOS FOR ARM[2]
VAR jnta2_1 : JOINTPOS FOR ARM[2]
BEGIN
--
MOVE ARM[2] TO jnta2_1
262
Comau Robotics Product Instruction
263
Comau Robotics Product Instruction
Comments: – arm_value is the JOINTPOS or XTNDPOS for which the arm no. is to be returned
– ret_val contains the returned value: the arm number of arm_value (passed
JOINTPOS or XTNDPOS).
Examples: ROUTINE loader (dest:JOINTPOS)
BEGIN
...
MOVE ARM[ARM_NUM(dest)] TO dest
...
END loader
264
Comau Robotics Product Instruction
BEGIN
$JNT_MTURN := FALSE
ARM_PALLETIZING(ON,1)
MOVE JOINT NEAR pnt0002P BY 300
MOVEFLY LINEAR TO pnt0002P ADVANCE
265
Comau Robotics Product Instruction
266
Comau Robotics Product Instruction
Calling Sequence: ARM_SOFT (flag <, ax1, ax2, ax3, ax4, ax5, ax6, arm_num>)
$TOOL_MASS: Mass of the tool and $TOOL_CNTR: Tool center of mass of the tool of
the related arm must be properly initialized before enabling the Joint Soft Servo modality
otherwise the correctness of robot movements are not guaranteed.
267
Comau Robotics Product Instruction
Comments: – array_val must be a two dimensional array. If a one dimensional array is used an
error occurs
– ret_dim contains the returned value: size of the array second dimension.
Examples: ROUTINE print_2dim_ary(matrix : ARRAY[*, *] OF INTEGER)
VAR i, j, size1, size2 : INTEGER
BEGIN
size1 := ARRAY_DIM1(matrix)
size2 := ARRAY_DIM2(matrix)
FOR i := 1 TO size1 DO
FOR j := 1 TO size2 DO
WRITE(‘Element ‘, i, ‘ ‘, j, ‘ --> ‘, matrix[i, j], NL)
ENDFOR
ENDFOR
END print_2dim_ary
268
Comau Robotics Product Instruction
269
Comau Robotics Product Instruction
270
Comau Robotics Product Instruction
271
Comau Robotics Product Instruction
– If bool_test is equal to bool_value, bit_num in var_ref will assume the specified value
in op_set_clear; on the contrary, bit_num will be set to the negated value of
op_set_clear.
– op_set_clear and bool_value are optional parameters. If not specified, their default
value is TRUE.
The following figure shows the execution of the BIT_ASSIGN built-in procedure.
272
Comau Robotics Product Instruction
in one of the following analogue ports: $AIN, $AOUT, $WORD, $FMI, $FMO.
This function can be used as condition expression in a CONDITION handler or in a
WAIT FOR statement. The BIT_FLIP cannot be used as a normal statement in the
program body.
273
Comau Robotics Product Instruction
274
Comau Robotics Product Instruction
Default setting, for NODAL configured systems, is Collision 2.0 enabled, profile LOW.
275
Comau Robotics Product Instruction
Parameters none
Comments – The returned value is: current time in seconds counted from January 1, 1980. For
example, a value of 0 indicates midnight on December 31, 1979. CLOCK is typically
used to measure differences in time. If the value is negative, the hardware clock has
never been set. The value is actually incremented every other second.
Examples: cur_time := CLOCK
WRITE(CLOCK, NL) -- let’s suppose time is 1514682000
-- 30 second time interval
WRITE(CLOCK, NL) -- now time is 1514682030
276
Comau Robotics Product Instruction
277
Comau Robotics Product Instruction
x := SIN(angle1) * COS(angle2)
278
Comau Robotics Product Instruction
Comments: – date_in must be passed in integer format according to the table shown below. See the
example to better understand how to set up an input date value
YEAR: The passed value represents the desired year minus 1980. (To pass 1994
for example, the year field woud be 1994-1980, i.e. 14. To pass 1980, the
year field should be zero.)
MONTH: A value from 1 to 12
DAY: A value from 1 to 31
HOUR: A value from 0 to 23
MINS: A value from 0 to 59
SECS: A value from 0 to 29, the effective number of seconds divided by 2
If date_in is not specified, the current date is returned. Otherwise, the date
corresponding to date_in is returned.
ret_val specifies the returned value: the date is returned in the format
day-month-year. Where day is 2 characters, month is 3 characters and year is 2
characters. Each group of characters are separated by a hyphen (‘-’).
The minimum string size is 9 characters, needed for storing day, month and year.
For getting also hours, or minutes and seconds, the string must be declared of 20
characters.
If the returned value is assigned to a variable whose maximum length is less than 9,
the result will be truncated.
PROGRAM pr_date
VAR date_str : STRING[20]
old_time : INTEGER
BEGIN
old_time := 0b00011100111111000101110011001010
Examples:
. . .
date_str := DATE
WRITE(‘Current DATE (dd-mmm-yy) = ‘, date_str, NL)
WRITE(‘Old DATE = ‘, DATE(old_time), NL)-- should be 28-JUL-94
END pr_date
279
Comau Robotics Product Instruction
280
Comau Robotics Product Instruction
For creating a directory at the root of UD:, the user should write
DIR_SET(‘UD:\\‘)
In the example, a statement
SYS_CALL(‘FUDM‘,‘test‘)
will create the directory UD:\test.
281
Comau Robotics Product Instruction
The following outlines the valid values for code and their expected parameters:
1 Create a PIPE
Parameters:
– a STRING for the pipe name
– an INTEGER for the buffer size (default = 512)
– an INTEGER for the number of senders (default = 1)
– an INTEGER for the number of readers (default = 1)
– an INTEGER for flags (0x1 means deleting the pipe when no longer opened)
2 Delete a PIPE
Parameters:
– a STRING for the pipe name
3 Get the port characteristics
Parameters:
– a STRING for the port name
– an INTEGER for the port characteristics
4 Set the port characteristics
Parameters:
– a STRING for the port name
– an INTEGER for the port characteristics
5 Add a router to the network
Parameters:
– a STRING for the destination. Can be a name or an IP address (dotted notation
like 177.22.100.201). If this parameter is 0 it defines the default Gateway
282
Comau Robotics Product Instruction
14 This routine returns the index of the I/O entry in the $IO_STS table.
Parameters:
– a STRING which is the name of the I/O Point
– an INTEGER which is the index of the I/O entry in the $IO_STS table
15 This routine returns the index of the Device entry in $IO_DEV table
Parameters:
– a STRING which is the name of the Device
– an INTEGER which is the index of the Device entry in $IO_DEV table
16 Connect/Disconnet a device on a fieldbus network
Parameters:
– a STRING which is the name of the device
– an INTEGER which is the connect flag:
ConnectFlag = 1 --> Connect , ConnectFlag = 0 --> Disconnect
– an optional INTEGER which is the Timeout: if set to -1 asynch, if set to zero
default, if > 0 timeout value
17 Handling the Arm Data Sending Service
– 0 - deactivates the axes quotes Service in both modalities
283
Comau Robotics Product Instruction
284
Comau Robotics Product Instruction
25 Get an e-mail header. This command reads the e-mail header without downloading
the message from the server.
Parameters:
– An INTEGER containing the configuration ID
– An INTEGER containing the index of the e-mail whose header is to be read
– A STRING[63] containing the "From:" field address
– A STRING[1023] containing the e-mail title
– An INTEGER containing the server receipt date (ANSI TIME)
– An ARRAY[2,8] of STRINGs[63] which include "To:" and "CC:" fields contents:
• [1] array of "To:" contents
• [2] array of "CC:" contents
26 Close the e-mail channel (e-mail ID).
Parameters:
– An INTEGER containing the configuration ID
27 Get information about a network connection.
Parameters:
– An INTEGER which is the LUN (see OPEN FILE Statement) associated to the
channel of interest
– A STRING (by reference) for the session peer
– A STRING (by reference) for the accept peer
– A STRING (by reference) for the connect address
– An INTEGER (by reference) for the remote port
– An INTEGER (by reference) for the local port
– An INTEGER (by reference) for options
– An INTEGER (by reference) for the linger time
28 This code can be used for configuring different aspects of a TCP/IP channel. The
parameters to the routine are used for specifying which feature is to be enabled or
cleared or in fact not touched at all.
Parameters:
– An INTEGER which is the LUN (see OPEN FILE Statement) associated to the
channel of interest
– An INTEGER which is the value (either 0 or 1) to be assigned to the current bit.
See the Examples below.
– An INTEGER which indicates the features involved in the required modification
(-1 means restore to default values); see the Examples below.
– The following bits are available:
• 1 - NO_DELAY
• 2 - NOT_KEEPALIVE - do NOT send challenge packets to peer, if idle
• 4 - LINGER
• 8 - UDP_BROADCAST - permit sending of broadcast messages
• 16 - OOB - send out-of-band data
• 32 -DONT_ROUT - send without using routing tables
• 64 - NOT_REUSEADDR - do not reuse address
• 128 - SIZE_SENDBUF - specify the maximum size of the socket-level
“send buffer”
• 256 - SIZE_RCVBUF - specify the maximum size of the socket-level
“receive buffer”
• 512 - OOB_INLINE - place urgent data within the normal receive data
stream.
The listed above features are the standard ones for TCP/IP networks; for
further information, please refer to the descriptions provided on the Internet.
– An INTEGER for the linger time
– An INTEGER for the size of the “send buffer”
285
Comau Robotics Product Instruction
286
Comau Robotics Product Instruction
287
Comau Robotics Product Instruction
0 Default protocol
1 reserved
3 reserved
6-8 reserved
2 a file device
4 reserved
6 reserved
7 a pipe device
8 reserved
9 reserved
17-32 reserved
288
Comau Robotics Product Instruction
Comments: – lun_id can be any user-defined variable that represents an open logical unit number
(LUN).
– The returned value has the following meaning:
• TRUE -> last operation on lun_id was READ and the end of file was reached
before all specified variables were read. NOTE that if the end of file is reached
before READ statement completion, all not yet read variables are set to UNINIT.
• If lun_id is associated to a communication port, the end-of-file is not recognized,
and in this case it is necessary to define which character is assumed as the file
terminator in the program, and check when this character is encountered.
Examples: OPEN FILE lun_id (‘data.txt‘, ‘R‘)
READ lun_id (str)
WHILE NOT EOF(lun_id)
WRITE (str, NL)
READ lun_id (str)
ENDWHILE
OPEN FILE lun_id2 (‘COM1:‘, r) WITH $FL_NUM_CHARS = 1
bool_var := FALSE
WHILE NOT bool_var DO
READ lun_id2 (str::1)
IF str = ‘\033‘ THEN -- assume ‘!‘ as end of file
WRITE (‘Found EOF‘, NL)
CLOSE FILE lun_id2
ENDIF
ENDWHILE
289
Comau Robotics Product Instruction
Calling Sequence: ERR_POST (err_num, err_str, err_sev <, post_flags> <, resp_array>
<, alarm_id> <, resp_data> <, skip_n>)
Parameters: err_num : INTEGER [IN]
err_str : STRING [IN]
err_sev : INTEGER [IN]
post_flags : INTEGER [IN]
resp_array : ARRAY [4] OF INTEGER [IN]
alarm_id : INTEGER [OUT]
resp_data :INTEGER [OUT]
skip_n : INTEGER [IN/OUT]
Comments: – err_num can be any INTEGER expression whose value is in the range of 43008 to
44031. Such errors correspond to EC_USR1 and EC_USR2 class.
– err_str is a STRING expression that contains an error message to be displayed.
– err_sev is an INTEGER expression whose value is in the range of 2 to 10. The
severity specified in the ERR_POST call determines the effects on the state of the
system. Available error severities:
• 2 : Warning
• 4 : Pause, hold if holdable
• 6 : Pause all, hold if holdable
• 8 : Hold
• 10 : DRIVE OFF
The error is generally logged and can be monitored using error events (e.g. WHEN
ERRORNUM BY) inside CONDITIONs.
Note that $ERROR variable is NOT set for the program that calls the ERR_POST
built-in. For testing if the error specified in the ERR_POST occurred, the
$SYS_ERROR predefined variable can be used.
– post_flags is an INTEGER expression whose value consists of the following masks:
• Bit 1: Do not log the error in the binary log file (.lbe)
• Bit 2: Do not display the error on the status bar of the TP screen
• Bit 3: Do not trigger any enabled error event CONDITIONs
• Bit 4: Do not display the error on the scrolling window of the TP system screen
• Bit 5: Do not display the error on the scrolling window of WinCRC Terminal
• Bit 6: Do not cause effects on the general state of the System (based on error
severity)
• Bit 7: If this bit is set, the program state will have transitions based on error
severity
Bit 10: It is typically useful when the program execution is inside a routine. If set,it
causes the execution to immediately return from the called routine (bit 7 must
also be set).
It is recommended not to set bit 10 when severity is 2:
due to the fact that, upon ERR_POST execution, the control is returned to the
calling program, this could cause the routine to be infinitely called again until a
different situation occurs.
• Bit 13: Log the error in the binary log file (.lbe) even if the error is being posted
with severity 2
• Bit 14: Do not report on the Teach Pendant
• Bit 15: Generates a latched alarm. This will require an operation from the user
for unlatching the alarm itself, for example from the Alarm page on the Teach
Pendant.
• Bit 16: Generates a latched alarm which disables the possibility of DriveOn until
such an alarm is reset by the User
• Bit 17: Generates a latched alarm which disables the possibility of switching the
290
Comau Robotics Product Instruction
System to AUTO (LOCAL) state until such an alarm is reset by the UserBit 18 :
Do not set as an Active alarm
• Bit 19 : Do not add to the log of messages
• Bit 20: reserved
• Bit 21 : A process alarm - displayed in a different colour
• Bit 22 : An alarm that cannot be reset. After this you cannot remove the alarm
state.
• Bit 23 : Informational alarm
• Bit 27 : Add to the action log file (as opposed to error log file)
• Bit 28 : Indicates whether the associated severity 2 error (warning) is to be
displayed in the Notifications subpage of the Alarm Page
– resp_array is an ARRAY OF INTEGER of 4 elements specifying the returned values:
The meaning of each array element is described here below:
• [1] : response mask - this is a mask which represents the different responses
(e.g. Ok, Cancel, etc.) that the User can select. These responses will be shown
on the functional keys menu in the TP Alarm page.
Maximum number of allowed responses is 5.
An example of setting this response mask field is : (1 SHL ERR_OK - 1) OR (1
SHL ERR_CANCEL - 1) for showing OK and CANCEL in the bottom menu.
Each response can be defined referring to an ERR_xx predefined constant:
• ERR_OK - OK key
• ERR_CANCEL - Cancel key
• ERR_YES - Yes key
• ERR_NO - No key
• ERR_ABORT - Abort key
• ERR_RETRY - Retry key
• ERR_SKIP - Skip key
• ERR_ACK - Ack key
• ERR_IGNORE - Ignore key
• ERR_TRUE - True key
• ERR_FALSE - False key
• ERR_ON - On key
• ERR_OFF - Off key
• ERR_VOID - reserved
• ERR_SKIP_N - Skip_N key
• ERR_RETRACT - Retract key
• ERR_USRx - these predefined constants (ERR_USR1, ERR_USR2,
ERR_USR3) are to be used to customize the associated functional keys;
When an ERR_USRx is used, the string to be displayed in the Alarm Page
functional menu is taken from $PAGEALRMKEYSTRINGS: Page Alarm key
strings predefined array, respectively either [18] or [19] or [20] element.
• [2] : Default response
• 0 - Don’t do any action
• -1 - Cancel the alarm but do not perform any of the actions
• >0 - Do the alarm response specified in element [3]
• [3] : response action - after the user has acknowledged the alarm, it is possible
to display an event or set a variable with the following meaning:
• 0 - The alarm is cancelled in any case (this is the default)
• 1 - An event, specified in element [4], is raised and the variable, defined in
resp_data parameter, is set to the value explained below
• 2 - A variable, defined in the resp_data, is set to the value explained below.
• 16 - Error is program specific, so if the program is deactivated the alarm is
reset
291
Comau Robotics Product Instruction
292
Comau Robotics Product Instruction
293
Comau Robotics Product Instruction
294
Comau Robotics Product Instruction
Comments: – error_num1..error_num8 indicate the numbers of the errors to be trapped off. While
error trapping is turned off, error checking is performed by the system.
This is the most common case.
The maximum number is 8; negative numbers are allowed to invert ON/OFF.
Examples: PROGRAM flib NOHOLD
VAR s : STRING[30]
ROUTINE filefound(as_name : STRING) : BOOLEAN EXPORTED FROM flib
ROUTINE filefound(as_name : STRING) : BOOLEAN
BEGIN
ERR_TRAP_ON(39960) -- trap SYS_CALL errors
SYS_CALL(‘fv‘, as_name)
ERR_TRAP_OFF(39960)
IF $SYS_CALL_STS > 0 THEN -- check status of SYS_CALL
RETURN(FALSE)
ELSE
RETURN(TRUE)
ENDIF
END filefound
BEGIN
CYCLE
WRITE (‘Enter file name: ‘ )
READ (s)
IF filefound(s) = TRUE THEN
WRITE (‘*** file found ***‘, NL)
ELSE
WRITE (‘*** file NOT found ***‘, NL)
ENDIF
END flib
See also: ERR_TRAP_ON Built-In Procedure
295
Comau Robotics Product Instruction
Comments: – err_num1..err_num8 indicate the numbers of the errors to be trapped on. Only those
errors in the EC_TRAP group (from 39937 to 40109) can be used.
The maximum number is 8; negative numbers are allowed to invert the ON/OFF.
While error trapping is turned on, the program is expected to handle the specified errors.
$ERROR or other status predefined variables ($SYS_CALL_STS, etc.) will indicate the
error that occurred even if the error is currently being trapped.
Note that to avoid that an error occurs for a program, in case of multiple ERR_TRAP_ON
for the same error, it is useful to execute ERR_TRAP(39997).
Examples: PROGRAM flib NOHOLD
VAR s : STRING[30]
ROUTINE filefound(as_name : STRING) : BOOLEAN EXPORTED FROM flib
ROUTINE filefound(as_name : STRING) : BOOLEAN
BEGIN
ERR_TRAP_ON(39960) -- trap SYS_CALL errors
SYS_CALL(fv, as_name)
ERR_TRAP_OFF(39960)
IF $SYS_CALL_STS > 0 THEN -- check status of SYS_CALL
RETURN(FALSE)
ELSE
RETURN(TRUE)
ENDIF
END filefound
BEGIN
CYCLE
WRITE (‘Enter file name: ‘)
READ (s)
IF filefound(s) = TRUE THEN
WRITE (‘*** file found ***‘, NL)
ELSE
WRITE (‘*** file not found ***‘, NL)
ENDIF
END flib
See also: ERR_TRAP_OFF Built-In Procedure
296
Comau Robotics Product Instruction
Comments: – lun_id can be any user-defined variable that represents an open logical unit number
(LUN).
lun_id must have been opened for random access and read or an error occurs.
– ret_val specifies the returned value: total amount of bytes available at lun_id LUN.
End of line markers are counted as well.
Examples: OPEN FILE file_lun (‘data.txt‘, ‘RWA‘),
WITH $FL_RANDOM = TRUE,
ENDOPEN
FL_SET_POS(file_lun, 0) -- beginning of the file
...
IF FL_BYTES_LEFT(file_lun) > 0 THEN
get_next_value
ELSE
write_error
ENDIF
Comments: – lun_id can be any user-defined var representing an open logical unit number (LUN).
lun_id must have been opened for random access and read or an error occurs.
End of line markers are counted in the returned value.
– ret_val specifies the returned value: current file position for the next read/write
operation on lun_id LUN.
Examples: PROGRAM test NOHOLD
VAR i,lun : INTEGER
arr : ARRAY[20] OF REAL
ROUTINE write_values (values : ARRAY[*] OF REAL; lun : INTEGER)
297
Comau Robotics Product Instruction
VAR i : INTEGER
back_patch : INTEGER
total : INTEGER(0) -- initialize to 0
BEGIN
back_patch : = FL_GET_POS(lun)
WRITE lun (0, NL)
FOR i : = 1 TO ARRAY_DIM1(values) DO
IF values[i] <> 0 THEN
total := total+1
WRITE lun (values[i], NL)
ELSE
ENDIF
ENDFOR
-- backup and output no. of values written to the file
FL_SET_POS (lun,back_patch)
WRITE lun (total)
FL_SET_POS (lun, 1) -- return to end of file
END write_values
BEGIN
-- fill the array
FOR i := 1 TO 20 DO
arr[i] := i
ENDFOR
OPEN FILE lun(‘temp.txt’,‘rw’),
WITH $FL_RANDOM = TRUE,
ENDOPEN
write_values (arr, lun)
CLOSE FILE lun
END test
298
Comau Robotics Product Instruction
back_patch : = FL_GET_POS(lun)
WRITE lun (0, NL)
FOR i : = 1 TO ARRAY_DIM1(values) DO
IF values[i] <> 0 THEN
total := total+1
WRITE lun (values[i], NL)
ELSE
ENDIF
ENDFOR
-- backup and output no. of values written to the file
FL_SET_POS (lun,back_patch)
WRITE lun (total)
FL_SET_POS (lun, 1) -- return to end of file
END write_values
BEGIN
-- fill the array
FOR i := 1 TO 20 DO
arr[i] := i
ENDFOR
OPEN FILE lun(‘temp.txt’,‘rw’),
WITH $FL_RANDOM = TRUE,
ENDOPEN
write_values (arr, lun)
CLOSE FILE lun
END test
Calling Sequence: ret_val := FL_STATE (file_name_str, < size_int < , time_int < ,
attr_int < , checksum <, properties >>>>>)
Return Type: BOOLEAN
299
Comau Robotics Product Instruction
– flow_tbl_idx: is the index of the $FLOW_TBL that contains all the settings to be used
during the algorithm application.
Allowed values: 1 or 2.
FLOW_MOD_OFF Built-In Procedure must be called for disabling the algorithm.
300
Comau Robotics Product Instruction
Please note that, if the program which called FLOW_MOD_ON is deactivated, the
algorithm is automatically disabled.
Refer to Motion Programming manual for further details about this algorithm (chap. Flow
Modulate Algorithm).
See also: FLOW_MOD_OFF Built-In Procedure
301
Comau Robotics Product Instruction
Comments: When a high speed digital input is set, the Arm can be stopped and its current position
recorded.
– arm indicates the Arm on which enabling capture.
– enbl is a flag indicating whether the HDIN interrupt is enabled or disabled.
– cont is a flag indicating whether the HDIN is continuously enabled or disabled after the
first transition.
– record_flag is a flag indicating whether the position is recorded upon HDIN. If it is
recorded, HDIN_READ can be used to obtain the recorded value.
– channel_input indicates channel 1 or 2 on which the high speed input is physically
connected; the default channel is 1.
– arm_num (is an Arm number or a squence of numbers) indicates on which Arm(s), if
any, the automatic LOCK function and an event are to be performed when a capture
operation is triggered. Up to four arm numbers can be specified as separate
parameters. If no Arms are specified, neither automatic LOCK functions nor events
are enabled.
Note that even if this parameter is optional, the programmer is strongly recommanded
to specify it always, otherwise the transition events are not issued!
Please NOTE THAT if no Arm number(s) is specified as parameter, any $HDIN
transition generates a 121 event and no arms are put to LOCK state.
The HDIN interrupt is triggered by a transition (either positive to negative or negative to
positive). For detecting the transition of the HDIN, events from 209 to 216 can be used in
a CONDITION statement. Refer to Condition Handlers chapter for further details.
The HDIN interrupt is not triggered, also if enabled, if the predefined variable
$HDIN_SUSP: $HDIN suspend has the value of 1. It is important to underline however that
when HDIN_SET enables HDIN interrupt, this predefined variable is zeroed, independently
from its current value. Refer also to par. 12.161 $HDIN: High speed digital input on
page 485.
Examples: HDIN_SET(1, TRUE, FALSE, TRUE, 2, 1)
302
Comau Robotics Product Instruction
POS_SHIFT(lp_shift, lv_diff)
MOVE LINEAR TO lp_shift
ENDFOR
END isr_siding
BEGIN
CONDITION[1] NODISABLE:
WHEN HOLD DO -- temporarely disable HDIN triggering
-- when the system goes in HOLD state
$CRNT_DATA[1].HDIN_SUSP[1]:=1
WHEN START DO -- enable HDIN again triggering when moving
-- restarts (START button)
$CRNT _DATA[1].HDIN_SUSP[1]:= 0
ENDCONDITION
CONDITION[2]:
WHEN EVENT 209 DO --triggering of HDIN (neg. transition)
CANCEL ALL
UNLOCK
RESUME
DISABLE CONDITION[1]
isr_siding
ENDCONDITION
CONDITION[3]: -- enable HDIN when the motion starts
WHEN AT START DO
$CRNT_DATA[1].HDIN_SUSP[1] :=0
ENABLE CONDITION[1], CONDITION[2]
ENDCONDITION
MOVE TO pnt0001j
CYCLE
RESUME -- in case the arm is locked
MOVE TO pnt0002j
-- setup HDIN to lock the arm and record the position
HDIN_SET(1, TRUE, FALSE, TRUE, 1, 1)
$CRNT_DATA[1].HDIN_SUSP[1] := 1
-- pnt0004j is the first point of research of the workpiece
MOVE LINEAR TO pnt0004j WITH CONDITION[3]
....
END hdin_ex
303
Comau Robotics Product Instruction
304
Comau Robotics Product Instruction
305
Comau Robotics Product Instruction
IR_SET_DIG($DOUT[2], 1, IR_RESERVATION)
-- Associate IR no.1 to $DIN[1] for the consent
IR_SET_DIG($DIN[1], 1, IR_CONSENT)
-- Activation of Interference Region no.1
IR_SWITCH(ON, 1)
306
Comau Robotics Product Instruction
BEGIN
MOVEFLY TO p1 ADVANCE
f1(10)
END prg_1
307
Comau Robotics Product Instruction
During the built-in execution, it is needed that all axes linked to the machine (Servo CPU
board) are steady, that there are no pending or active movements and that there are not
positioning transient. It is suggested to use a well defined positioning range of tolerance
($TERM_TYPE := FINE or $TERM_TYPE := JNT_FINE) for the motion that precedes
the JNT_SET_TAR call.It is a good rule, after having executed the built-in, to wait about
one second before executing new movements in order to complete the process of
position update.
Examples: -- A table has three working positions: 0°, 120°, 240°.
-- Reached 240°, instead of going back to 0° (table should turn by
-- -240°), it goes to 360° (it only turns by +120°) and JNT_SET_TAR
-- sets the position to 0° (physically equal to 360°)
PROGRAM rotate
CONST
axis = 7
arm_num = 1
BEGIN
-- Initialization…
MOVE JOINT TO {,,,,,,0} -- Rotate table to 0° (Table Home)
CYCLE
-- Robot operation…
MOVE JOINT TO {,,,,,,120} -- Rotate table to 120°
-- Robot operation…
MOVE JOINT TO {,,,,,,240} -- Rotate table to 240°
-- Robot operation…
MOVE JOINT TO {,,,,,,360} -- Rotate table to 360°
-- Table at 360°, set the position to 0°:
JNT_SET_TAR(axis, 0, arm_num)
END rotate
308
Comau Robotics Product Instruction
309
Comau Robotics Product Instruction
310
Comau Robotics Product Instruction
vi_count : INTEGER
ROUTINE dump(as : ARRAY[*] OF STRING)
VAR
li : INTEGER
BEGIN
WRITE LUN_CRT ($PROG_EXEC[2], NL)
FOR li := 1 TO ARRAY_DIM1(as) DO
IF STR_LEN(as[li]) = 0 THEN
RETURN
ENDIF
WRITE LUN_CRT (li::2, '="', as[li], '"', NL)
ENDFOR
END dump
BEGIN
MEM_GET_PROGS(ws_array2); dump(ws_array2) --First 2 PROGRAMs
-- First two PROGRAMs starting with x
MEM_GET_PROGS(ws_array2, 'x*'); dump(ws_array2)
MEM_GET_PROGS(ws_array2, 'p*'); dump(ws_array2) -- Not found
END get_progs
311
Comau Robotics Product Instruction
t4 = RECORD
fi : INTEGER
ENDRECORD
xt1 = RECORD
fi : INTEGER
ENDRECORD
xt2 = RECORD
fi : INTEGER
ENDRECORD
xt3 = RECORD
fi : INTEGER
ENDRECORD
VAR
ws_array2 : ARRAY[2] OF STRING[20]
ws_array20 : ARRAY[20] OF STRING[20]
xs_array : ARRAY[3, 2] OF STRING[20]
vi_count : INTEGER
ROUTINE dump(as : ARRAY[*] OF STRING)
VAR
li : INTEGER
BEGIN
WRITE LUN_CRT ($PROG_EXEC[2], NL)
FOR li := 1 TO ARRAY_DIM1(as) DO
IF STR_LEN(as[li]) = 0 THEN
RETURN
ENDIF
WRITE LUN_CRT (li::2, '="', as[li], '"', NL)
ENDFOR
END dump
BEGIN
MEM_GET_TYPES(ws_array2); dump(ws_array2) -- First two TYPEs
END get_types
312
Comau Robotics Product Instruction
313
Comau Robotics Product Instruction
ENDIF
ENDFOR
WRITE LUN_CRT (NL)
ENDFOR
END dump
BEGIN
vi_count := 0
as_array2[1, 1] := 'a'
as_array2[1, 2] := 'b'
as_array2[1, 3] := 'c'
-- All record variables of type t1
MEM_GET_VARS(as_array2, '*'); dump(0, as_array2)
-- All record variables of type t1
MEM_GET_VARS(as_array2, 'ttp*'); dump(0, as_array2)
314
Comau Robotics Product Instruction
REPEAT
-- Getting all but in chunks
MEM_GET_VARS(as_array20, '', '', 0, '', vi_idx, 0, vi_got)
dump(vi_count, as_array20)
vi_idx += vi_got
UNTIL vi_got = 0
vi_idx := 1
-- Just records and paths
MEM_GET_VARS(as_array2, '', '', DT_PATH, '', 0, vi_idx, vi_got)
dump(vi_count, as_array2)
vi_idx += vi_got
-- Just records and paths
MEM_GET_VARS(as_array2, '', '', DT_RECORD, '', 0, vi_idx, vi_got)
dump(vi_count, as_array2)
vi_idx += vi_got
-- Just records and paths
MEM_GET_VARS(as_array2, '', '', DT_PATH, '', 0, vi_idx, vi_got)
dump(vi_count, as_array2)
vi_idx += vi_got
-- Just records and paths
MEM_GET_VARS(as_array2, '', '', DT_RECORD, '', 0, vi_idx, vi_got)
dump(vi_count, as_array2)
vi_idx += vi_got
-- Just records and paths
MEM_GET_VARS(as_array2, '', '', DT_ARECORD, '', 0, vi_idx, vi_got)
dump(vi_count, as_array2)
vi_idx += vi_got
vi_idx += vi_got
DEACTIVATE
ACTIVATE t1, t2, t3
ACTIVATE xt1, xt2, xt3
END get_vars
315
Comau Robotics Product Instruction
316
Comau Robotics Product Instruction
317
Comau Robotics Product Instruction
path node.
318
Comau Robotics Product Instruction
– jnt_mask is the mask of the joints that are checked during the robot motion for
determining if the $ON_POS_TBL[on_pos_idx].OP_JNT has been reached. If some
joints or auxiliary axes have to be excluded from this checking, it is sufficient to pass
the corresponding bit of this mask with the 0 value. jnt_mask is an optional parameter
and, if not specified, it assumes the default value of
$ARM_DATA[arm_num].JNT_MASK.
Examples: PROGRAM op45 n-- program for NH4 robot and integrated rail
VAR p1, p2, p3 : POSITION
VAR j1, j2 : JOINTPOS
VAR i : INTEGER
BEGIN
-- disable On Pos feature for the first 5 $ON_POS_TBL elements
FOR i := 1 TO 5 DO
ON_POS(FALSE, i)
ENDFOR
CONDITION[1] NODISABLE :
WHEN EVENT 134 DO
$FDOUT[21] := TRUE
WHEN EVENT 135 DO
$FDOUT[22] := TRUE
WHEN EVENT 136 DO
$FDOUT[23] := TRUE
ENDCONDITION
CONDITION[2] NODISABLE :
WHEN EVENT 142 DO
$FDOUT[21] := FALSE
WHEN EVENT 143 DO
$FDOUT[22] := FALSE
WHEN EVENT 144 DO
$FDOUT[23] := FALSE
ENDCONDITION
ENABLE CONDITION[1], CONDITION[2]
$TOOL_RMT := TRUE
$BASE := POS(0, 0, 0, 0, 0, 0, '')
$TOOL := POS(1000, 3000, -1000, 180, 0, 0, '')
$UFRAME := POS(0, 0, 50, 0, 90, 0, '')
-- On Pos definition on POSITIONs for the first 3 elements of $ON_POS_TBL
ON_POS_SET($WORD[20], 1, 1) -- element 1 uses bit 1 of $WORD[20]
ON_POS_SET($WORD[20], 2, 2) -- element 2 uses bit 3 of $WORD[20]
ON_POS_SET($WORD[20], 3, 3) --element 3 uses bit 3 of $WORD[20]
-- On Pos definition on JOINTPOS
ON_JNT_SET($WORD[20], 4, 4, j1, $JNT_MASK) -- element 4 uses bit 4
-- of $WORD[20]
ON_JNT_SET($WORD[20], 5, 5, j2, 0x40) -- element 5 uses bit 5
-- of $WORD[20]
FOR i := 1 TO 5 DO
$ON_POS_TBL[i].OP_TOOL := $TOOL
$ON_POS_TBL[i].OP_UFRAME := $UFRAME
$ON_POS_TBL[i].OP_TOOL_DSBL := FALSE
$ON_POS_TBL[i].OP_TOOL_RMT := TRUE
ENDFOR
$ON_POS_TBL[1].OP_POS := p1
$ON_POS_TBL[2].OP_POS := p2
$ON_POS_TBL[3].OP_POS := p3
-- Enable On Pos feature for the first 5 $ON_POS_TBL elements
FOR i := 1 TO 5 DO
ON_POS(TRUE, i, 1)
ENDFOR
319
Comau Robotics Product Instruction
MOVE LINEAR TO j2
DELAY 1000
END op45
See also: ON_POS Built-In Procedure, ON_POS_SET Built-In Procedure, On Position Feature in
Motion Programming manual and $ON_POS_TBL: ON POS table data.
320
Comau Robotics Product Instruction
– jnt_mask is the mask of the joints that are checked during the robot motion for
determining if the $ON_POS_TBL[on_pos_idx].OP_JNT has been reached. To
exclude some axis from being checked, it is sufficient to pass the corresponding bit
of this mask with the 0 value. jnt_mask is an optional parameter and, if not specified,
it assumes the default value of $ARM_DATA[arm_num].JNT_MASK.
Examples: See the example of ON_JNT_SET Built-In Procedure.
See also: ON_POS Built-In Procedure, ON_JNT_SET Built-In Procedure and $ON_POS_TBL:
ON POS table data.
Please note that ON_POS built-in procedure cannot be used in case of:
– CONVEYOR TRACKING
– SENSOR TRACKING
– AUX COOP
– ARM COOP
321
Comau Robotics Product Instruction
BEGIN
-- definition of condition that monitor the entering and
-- the exiting from the sphere defined in the $ON_POS_TBL.
CONDITION[1] NODISABLE:
WHEN EVENT 134 DO
$FDOUT[21] := TRUE
WHEN EVENT 135 DO
$FDOUT[22] := TRUE
WHEN EVENT 136 DO
$FDOUT[23] := TRUE
ENDCONDITION
CONDITION[2] NODISABLE :
WHEN EVENT 142 DO
$FDOUT[21] := FALSE
WHEN EVENT 143 DO
$FDOUT[22] := FALSE
WHEN EVENT 144 DO
$FDOUT[23] := FALSE
ENDCONDITION
ENABLE CONDITION[1], CONDITION[2]
-- definition of bits 1, 2, 3 of $WORD[5]
-- associated to element 1,2,3 of the $ON_POS_TBL
ON_POS_SET($WORD[5], 1, 1); ON_POS_SET($WORD[5], 2, 2)
ON_POS_SET($WORD[5], 3, 3)
FOR i := 1 TO 3 DO
$ON_POS_TBL[i].OP_TOOL := $TOOL
$ON_POS_TBL[i].OP_UFRAME := $UFRAME
$ON_POS_TBL[i].OP_TOOL_DSBL:= FALSE
$ON_POS_TBL[i].OP_TOOL_RMT := FALSE
ENDFOR
-- Home Position
$ON_POS_TBL[1].OP_POS := p1
-- Enabling of ON POS feature on element 1 of the
-- $ON_POS_TBL
ON_POS(TRUE, 1, 1)
-- Tip dress position
$ON_POS_TBL[2].OP_POS := p2
ON_POS(TRUE, 2, 1)
-- Service position
$ON_POS_TBL[3].OP_POS := p3
ON_POS(TRUE, 3, 1)
CYCLE
MOVE ARM[1] TO p1;
MOVE ARM[1] TO p2;
MOVE ARM[1] TO p3
END op44
See also: ON_POS_SET Built-In Procedure,
$ON_POS_TBL: ON POS table data and
On Position Feature in Motion Programming manual.
322
Comau Robotics Product Instruction
$ON_POS_TBL element.
The $OP_TOOL and $OP_UFRAME fields of $ON_POS_TBL must be initialized in
addition to $OP_POS.
323
Comau Robotics Product Instruction
See also: Class of predefined variables having $OT_ prefix in Predefined Variables List chapter,
$CRNT_DATA: Current Arm data fields and
On Trajectory Feature in Motion Programming manual
See also: Class of predefined variables having $OT_ prefix in Predefined Variables List chapter,
ON_TRAJ_SET Built-In Procedure and On Trajectory Feature in Motion Programming
manual
324
Comau Robotics Product Instruction
PROGRAM e NOHOLD
VAR s : STRING[20] NOSAVE
VAR vi_value, vi_j, vi_len : INTEGER NOSAVE
BEGIN
s := '\199A\127\129\000N'
vi_len := STR_LEN(s)
FOR vi_j := 1 TO vi_len DO
vi_value := ORD(s, vi_j)
BIT_SET($PROG_CNFG, 17)
WRITE LUN_CRT ('Index ', vi_j, ' Value: ', vi_value::3::-5, NL)
ENDFOR
END e
325
Comau Robotics Product Instruction
326
Comau Robotics Product Instruction
327
Comau Robotics Product Instruction
328
Comau Robotics Product Instruction
329
Comau Robotics Product Instruction
330
Comau Robotics Product Instruction
331
Comau Robotics Product Instruction
332
Comau Robotics Product Instruction
333
Comau Robotics Product Instruction
334
Comau Robotics Product Instruction
335
Comau Robotics Product Instruction
NOTE that POS_SHIFT Built-in Procedure shifts a Cartesian position using the
CURRENT tool and frame references; the tool and frame references written in the WITH
clause are NOT used at all.
Examples: JNTP_TO_POS(jp1, p1) -- converts from jointpos to position
v1 := VEC(0, 100, 0) -- creates vector
336
Comau Robotics Product Instruction
Note that using XTNDPOS is suggested mainly in case of integrated auxiliary axes. A
POS_TO_JNTP built-in call is an asynchronous statement which means it continues while
the program is paused and interrupt service routines can begin before the built-in
completes.
Examples: JNTP_TO_POS(jp1, p1) -- converts from jointpos to position/xtndpos
v1 := VEC(0, 100, 0) -- creates vector
POS_SHIFT(p1, v1) -- shifts position by vector
POS_TO_JNTP(p1, jp1) -- converts shifted position/xtndpos to jointpos
See also: JNTP_TO_POS Built-In Procedure
337
Comau Robotics Product Instruction
ROUTINE r1
BEGIN
vi_state := PROG_STATE($PROG_NAME, vi_line, vs_rout, vs_owner)
WRITE LUN_CRT ('State = ', vi_state, ' Line =', vi_line, ' Rout =',
vs_owner, '->', vs_rout, NL)
END r1
338
Comau Robotics Product Instruction
BEGIN
vi_state := PROG_STATE($PROG_NAME, vi_line, vs_rout, vs_owner)
WRITE LUN_CRT ('State = ', vi_state, ' Line =', vi_line, ' Rout =',
vs_owner, '->', vs_rout, NL)
r1
END psex
Comments: – max_num is an optional parameter that indicates the maximum limit for the generated
number. If not specified, the range is between 0 and 99.
339
Comau Robotics Product Instruction
340
Comau Robotics Product Instruction
CONST ki_field_float = 1
CONST ki_field_integer = 2
CONST ki_moni_valid = 3
CONST ki_sw_vers_maj_1 = 4
CONST ki_sw_vers_maj_2 = 5
CONST ki_sw_vers_min = 6
CONST ki_moni_vers = 7
CONST ki_num_samples_pos = 8
CONST ki_date_yy = 9
CONST ki_date_mm = 10
CONST ki_date_dd = 11
CONST ki_time_start_hh = 12
CONST ki_time_start_mm = 13
CONST ki_time_start_ss = 14
CONST ki_time_stop_hh = 15
CONST ki_time_stop_mm = 16
CONST ki_time_stop_ss = 17
CONST ki_idx_speed_init = 1
CONST ki_idx_speed_max = 2
CONST ki_idx_speed_end = 3
VAR
VAR ar_Real : ARRAY[KI_NUM_REAL_ITEMS] OF REAL NOSAVE
VAR ai_Int : ARRAY[KI_NUM_INT_ITEMS] OF INTEGER NOSAVE
VAR vi_i : INTEGER NOSAVE
BEGIN
$RPL_DIR_PATH := 'UD:\\usr\\MoniReplay'
341
Comau Robotics Product Instruction
END p_rpl_get_data
342
Comau Robotics Product Instruction
343
Comau Robotics Product Instruction
– code is an INTEGER expression indicating what to clear from the user screen.
The following predefined constants can be used:
SCRN_CLR_CHR -- clear all characters on the specified screen
SCRN_CLR_REM -- remove all windows from the specified screen
SCRN_CLR_DEL -- remove and delete all user created windows
-- from the specified screen
If code is not specified, SCRN_CLR_REM is used as the default.
– scrn_num indicates the user-created screen to be cleared. If not specified, the system
created user screen (SCRN_USER) is cleared. SCRN_CREATE Built-In Function
can be used to create new user screens.
Examples: SCRN_CLEAR(PDV_CRT) -- Clear predefined user screen on PC
-- clear a user-created screen
SCRN_CLEAR(PDV_CRT, SCRN_CLR_CHR, appl_screen)
SCRN_CLEAR(PDV_CRT, SCRN_CLR_DEL) -- windows are deleted
344
Comau Robotics Product Instruction
345
Comau Robotics Product Instruction
346
Comau Robotics Product Instruction
347
Comau Robotics Product Instruction
348
Comau Robotics Product Instruction
349
Comau Robotics Product Instruction
x := SIN(angle1) * COS(angle2)
x := SIN(60) -- x = 0.866025
x := SQRT(276.971) -- x = 16.6424
350
Comau Robotics Product Instruction
351
Comau Robotics Product Instruction
352
Comau Robotics Product Instruction
353
Comau Robotics Product Instruction
354
Comau Robotics Product Instruction
355
Comau Robotics Product Instruction
If <0, find_me is calculated in the following way: start from the string character whose
position is indicated by start_from (without sign), from original_string beginning. Look
for find_me substring, passed as parameter (reading it from left to right anyway),
going leftwards.
– found_at specifies the returned value: the position in which find_me is found inside
the original_string.
Examples: PROGRAM tstr_loc NOHOLD
VAR vs_SNr : STRING[64] NOSAVE
BEGIN
vs_SNr := $SYS_ID
ru_GetSerial(vs_SNr)
WRITE LUN_CRT ('The serial number of the Control Unit ''', $SYS_ID, '''
is ', vs_SNr, NL)
END tstr_loc
356
Comau Robotics Product Instruction
357
Comau Robotics Product Instruction
number of bytes) to a REAL value. This is not the same as ENCODE Statement which
puts the ASCII representation in the string.
358
Comau Robotics Product Instruction
BEGIN
source := 'abc def ghi'
delimiter := ' '
count := STR_TOKENS(source, delimiter, a_substr)
-- count := 3 and a_substr[1] := 'abc', [2] := 'def' etc
source := 'abc;def,ghi jkl'
delimiter := ';,' -- Both ; and , to be delimiters
-- Starting at index [4]
count := STR_TOKENS(source, delimiter, a_substr, 4)
-- count := 3 and a_substr[1] := 'def' [2] := 'ghi jkl'
359
Comau Robotics Product Instruction
360
Comau Robotics Product Instruction
The predefined variable $SYS_CALL_STS indicates the status of the last SYS_CALL
built-in. There is a $SYS_CALL_STS for each running program.
The following commands cannot be used with the SYS_CALL built-in:
• PE -- PROGRAM EDIT
• FE -- FILER EDIT
• MT -- MEMORY TEACH
• MD -- MEMORY DEBUG
• UA -- UTILITY APPLICATN
• DCS -- DISPLAY CLOSE SELECT
• FUDC -- FILER UTILITY DIRECTORY CHANGE
• SCK -- SET CNTRLER KEY-LOCK
• SL -- SET LOGIN
• UCP -- UTILITY COMMUNICN PORT_CHAR
– param is a STRING expression whose value is a parameter that can be specified with
the command.
If param contains a directory path specification, a double backslash should be used
instead of a single one. For example, file UD:\usr1\Prog1.cod, when inside a
SYS_CALL, should be written as follows:
SYS_CALL (‘FD’, ‘UD:\\usr1\\Prog1.cod‘)
Multiple param parameters, separated by commas, are allowed, as necessary for the
command. It is also possible to specify more parameter than those required by the
command, but only the significative ones will be considered.
The program does not continue execution until the SYS_CALL built-in completes.
However, a SYS_CALL built-in is an asynchronous statement which means it continues
while the program is paused and interrupt service routines can begin before the built-in
completes.
If an error occurs during SYS_CALL execution, the program is paused. For avoiding the
program execution suspension due to SYS_CALL errors, ERR_TRAP_ON (39960)
built-in procedure can be used or bit 6 of $PROG_CNFG can be set to 1.
NOTE that it is allowed to use the ‘!’ character as the first character in cmnd_str parameter,
in order to implicitly enable and disable error trapping. Example:
SYS_CALL('!FC', vs_filename, 'LD:\\EPL\\EPLcfg.xml')
means
ERR_TRAP_ON (39960)
SYS_CALL('FC', vs_filename, 'LD:\\EPL\\EPLcfg.xml')
ERR_TRAP_OFF(39960)
361
Comau Robotics Product Instruction
The table must be created by defining a RECORD which fields are the columns of the
table.
When TABLE_ADD is called, the new table can be accessed from TP.
Comments: – table_name is the name of the TYPEDEF which defines the table elements.
362
Comau Robotics Product Instruction
Examples: TABLE_DEL('userTable')
363
Comau Robotics Product Instruction
364
Comau Robotics Product Instruction
– tree_attrib :
• 0x0 : whether program specific - in which case when the program is deactivated
the tree is automatically deleted
• 0x1 : global - in which case it has to be explicitly deleted
• 0x2 : local tree and can only be accessed by this program's context
• 0x4 : priviledge access in order to access the tree
– root is the root of the tree. The roots are optional; if none is specified then
TREE_LOAD Built-In Procedure must be used for creating the root(s). This root
cannot be removed. If this root is deleted the tree is deleted. There can be multiple
roots to a tree. Note that root nodes cannot be added later - they must be added when
the tree is created.
See also: TREE_ADD Built-In Procedure
TREE_CLONE Built-In Procedure
TREE_DEL Built-In Procedure
TREE_LOAD Built-In Procedure
TREE_NODE_INFO Built-In Procedure
TREE_NODE_CHILD Built-In Procedure
TREE_REMOVE Built-In Procedure
TREE_SAVE Built-In Procedure
365
Comau Robotics Product Instruction
vi_i := 1
vi_count := 0
366
Comau Robotics Product Instruction
vi_i := 1
vi_count := 0
367
Comau Robotics Product Instruction
368
Comau Robotics Product Instruction
369
Comau Robotics Product Instruction
370
Comau Robotics Product Instruction
– type_name is the type name, if the variable type is either Record or Path or Node; it
is optional.
Examples: -- creates the following variable: VAR anInt : INTEGER
VAR_CREATE(’Prog1’,’anInt’, 1, 0, -1,-1)
371
Comau Robotics Product Instruction
BEGIN
-- Error in VAR_LINK
VAR_LINK(ve1a, ve2) -- Different types
VAR_LINK(wi1, xi1) -- Different dimensions
-- Ok
VAR_LINK(ve1a, ve1b) -- Types
ve1a.fi := 12
WRITE LUN_CRT ('ve1b=', ve1b.fi, NL)
VAR_LINK(wi1, wi2) -- Array
wi1[1] := 99
WRITE LUN_CRT ('wi2[1]=', wi2[1], NL)
VAR_LINK(vs1, vs2) -- Strings
vs1 := 'hello'
WRITE LUN_CRT ('vs1=', vs2, NL)
VAR_LINK(ne1, ne2) -- Node
ne1.$MOVE_TYPE := LINEAR
WRITE LUN_CRT ('ne2=', ne1.$MOVE_TYPE, NL)
rr(vp2)
vp1 := POS(1, 2, 3, 4, 5, 60, '')
WRITE LUN_CRT ('VP2:=', vp2, NL)
VAR_UNLINK(ne1)
372
Comau Robotics Product Instruction
VAR_UNLINK_ALL
END varlink
See also: VAR_LINK_INFO Built-In Procedure, VAR_LINKS Built-In Procedure, VAR_LINKSS
Built-In Procedure, VAR_UNLINK Built-In Procedure, VAR_UNLINK_ALL Built-In
Procedure.
373
Comau Robotics Product Instruction
374
Comau Robotics Product Instruction
Comments: – var_ref is the variable to be tested. It can be a single variable reference (my_var), an
array element reference (ary_var[43]), or a field reference (fld_var.fld_name).
– If var_ref has not been given a value, TRUE is returned. Otherwise, FALSE is
returned.
If an ARRAY variable is used, it must be subscripted.
If a RECORD or NODE variable is used, it must have a field specification.
If a PATH variable is specified, the whole path is tested. A PATH is considered
uninitialized if it has zero nodes.
If a PATH node is tested, a specific field must be specified.
Examples: PROGRAM testinit_OK
TYPE nd=NODEDEF
$MAIN_POS
i: INTEGER
b: BOOLEAN
ENDNODEDEF
VAR
ok : BOOLEAN
count : INTEGER (0)
pallet : ARRAY[4,2] OF BOOLEAN
spray_pth : PATH OF nd
BEGIN
NODE_APP(spray_pth, 3)
-- ok will be set to FALSE since count is initialized
ok := VAR_UNINIT(count)
-- test an array element
ok := VAR_UNINIT(pallet[1, 2])
Comments: Breakes up a link between variables. This variable cannot be local or argument variable.
Parameters: none
Comments: Break up all links created by this program. The same is also performed when the program
is deactivated
375
Comau Robotics Product Instruction
376
Comau Robotics Product Instruction
377
Comau Robotics Product Instruction
378
Comau Robotics Product Instruction
379
Comau Robotics Product Instruction
Comments: – win_name can be any user-defined window name (created using the WIN_CREATE
Built-In Procedure).
A window can be deleted only after it has been removed from the screen. Deleting a
window means the window name can no longer be used in window-related built-in
routines.
An error occurs if a window is deleted before all LUNs opened on the window are closed.
In addition, it must also be detached.
System defined windows cannot be deleted.
Examples: WIN_DEL (‘menu:‘)
-- popup window over window USR1
WIN_POPUP(‘POP1:‘, ‘USR1:‘)
-- open a lun on window POP1
OPEN FILE lun (‘POP1:‘, ‘rw‘)
FOR i := 1 TO 10 DO
WRITE lun (i, ‘: This is an example of a popup window‘, NL)
ENDFOR
CLOSE FILE lun
-- let user read the message
DELAY 5000
-- Remove and delete window POP1 from user screen
WIN_REMOVE(‘POP1:‘)
WIN_DEL(‘POP1:‘)
380
Comau Robotics Product Instruction
381
Comau Robotics Product Instruction
Calling Sequence: WIN_LINE <(row <, column <, num_chars <, win_name)>>>>
382
Comau Robotics Product Instruction
...
-- get row 4
as_line := WIN_LINE(4, 0, -1, ‘CRT:‘)
...
END winline
383
Comau Robotics Product Instruction
384
Comau Robotics Product Instruction
WIN_REMOVE(‘POP1:‘)
WIN_DEL(‘POP1:‘)
385
Comau Robotics Product Instruction
386
Comau Robotics Product Instruction
FOR vi_i := 1 TO 5 DO
WIN_COLOR(WIN_RED, WIN_BLACK, FALSE, ks_dev)
WIN_SET_CRSR(vi_i, 0, ks_dev)
WRITE vi_lun (‘\186‘)
WIN_COLOR(1, WIN_GREEN, FALSE, ks_dev)
WRITE vi_lun (‘ ‘::10)
WIN_COLOR(WIN_RED, WIN_BLACK, FALSE, ks_dev)
WRITE vi_lun (‘\186‘)
ENDFOR
-- Bottom line of box
WIN_SET_CRSR(5, 0, ks_dev)
WRITE vi_lun (‘\200‘)
FOR vi_i := 1 TO 10 DO
WRITE vi_lun (‘\205‘)
ENDFOR
WRITE vi_lun (‘\188‘)
-- Save the pattern into two files
WIN_SAVE(‘winex.win‘, ks_dev, 0, 0, 6, 12)
CYCLE
WIN_LOAD(‘winex.win‘, ks_dev, $CYCLE MOD 15, $CYCLE MOD 69)
DELAY 150
IF $CYCLE MOD 69 = 0 THEN
WIN_COLOR($CYCLE MOD 8, $CYCLE MOD 8 + 1, TRUE, ks_dev)
ENDIF
END wins1
387
Comau Robotics Product Instruction
388
Comau Robotics Product Instruction
Calling Sequence: WIN_STATE (win_name <, scrn_num <, parent <, num_rows>>>)
389
Comau Robotics Product Instruction
BEGIN
write_state('CRT:', SCRN_SYS)
END win_state_example
390
Comau Robotics Product Instruction
391
Comau Robotics Product Instruction
For further information see also Control Unit Use Manual - Chap. SYSTEM
COMMANDS.
392
Comau Robotics Product Instruction
12.4 Attributes
The attributes section lists access information.
– Read-only. Usually, PDL2 programs can assign (write ) a value to a predefined
variable and can examine (read) the current value of a variable. The “read-only”
attribute indicates that a predefined variable can only be read .
– WITH MOVE, WITH MOVE ALONG, WITH OPEN FILE: some predefined
variables can assume a specific value that is assigned during a statement
execution using the WITH clause.
– Limited Access. Some predefined variables can only be accessed using the WITH
clause.
– Field node. The predefined variable can be used as a predefined field of a path
node (NODEDEF data type definition).
– Pulse usable. The predefined variable can be used in a PULSE statement.
– Priviledged read-write. Only COMAU technicians or COMAU programs can set this
variables by means of a special mechanism.
– Property. The predefined variable can be used as a property in the header of a PDL
file; in such a case the value is updated when the file is created/saved and
displayed when properties are viewed.
– Nodal. This system variable can be used on the nodal MOVE statement; e.g.
MV .... $RCVR_TYPE := 1
12.5 Limits
This indication is present if the value of a predefined variable should be included in a
specific range of values.
12.7 Unparsed
If this information is present, it specifies the format (e.g. hexadecimal) in which the value
of the predefined variable is shown when the configuration file (.C5G) is converted in an
393
Comau Robotics Product Instruction
394
Comau Robotics Product Instruction
395
Comau Robotics Product Instruction
396
Comau Robotics Product Instruction
397
Comau Robotics Product Instruction
398
Comau Robotics Product Instruction
399
Comau Robotics Product Instruction
400
Comau Robotics Product Instruction
401
Comau Robotics Product Instruction
402
Comau Robotics Product Instruction
403
Comau Robotics Product Instruction
404
Comau Robotics Product Instruction
405
Comau Robotics Product Instruction
406
Comau Robotics Product Instruction
407
Comau Robotics Product Instruction
408
Comau Robotics Product Instruction
409
Comau Robotics Product Instruction
410
Comau Robotics Product Instruction
411
Comau Robotics Product Instruction
412
Comau Robotics Product Instruction
413
Comau Robotics Product Instruction
414
Comau Robotics Product Instruction
415
Comau Robotics Product Instruction
416
Comau Robotics Product Instruction
417
Comau Robotics Product Instruction
418
Comau Robotics Product Instruction
419
Comau Robotics Product Instruction
420
Comau Robotics Product Instruction
421
Comau Robotics Product Instruction
422
Comau Robotics Product Instruction
423
Comau Robotics Product Instruction
424
Comau Robotics Product Instruction
425
Comau Robotics Product Instruction
426
Comau Robotics Product Instruction
Attributes: read-only
Limits none
Default:
S/W Version: 1.0
Description: This variable contains the definitions of the application features currently enabled on
the Control Unit.
427
Comau Robotics Product Instruction
428
Comau Robotics Product Instruction
429
Comau Robotics Product Instruction
Attributes: property
Limits 0.1..100.0
Default: 100.0
S/W Version: 4.0
Description: $ARM_REAL_OVR is similar to $GEN_OVR but is accessible from a PDL2 program,
whereas $GEN_OVR is accessible from the teach pendant. The variable scales speed,
acceleration and deceleration, so that the trajectory remains constant
with changes in its value.
A change to $ARM_REAL_OVR immediately effects the shape of the velocity profile;
allows to set the override using real numbers (eg 92.123).
It is not used with built-in ARM_MOVE, ARM_MOVE_ATVEL, MOVE REPLAY and in
case of Weaving feature.
430
Comau Robotics Product Instruction
431
Comau Robotics Product Instruction
Default:
S/W Version: 1.0
Description: Each element of this array of booleans indicates whether at least one program is active on
that arm. The array index corresponds to the arm number. If $ARM_USED[1] is TRUE, it
means that on arm 1 there is one holdable program running.
432
Comau Robotics Product Instruction
433
Comau Robotics Product Instruction
434
Comau Robotics Product Instruction
435
Comau Robotics Product Instruction
Limits none
Default:
S/W Version: 1.0
Description: It represents the offset between two consecutive axes. For example, some SMART
machines have an offset between the base and the pivot of the second axis.
436
Comau Robotics Product Instruction
For example:
$AX_PURSUIT_ARM_MASTER := 1
$ARM_DATA[2].AX_PURSUIT_LINKED[3] := 7
means that axis 3 of Arm 2 (SLAVE arm) pursuits axis 7 of Arm 1 (MASTER Arm).
For example:
$AX_PURSUIT_ARM_MASTER := 1
$ARM_DATA[2].AX_PURSUIT_LINKED[3] := -7
means that axis 3 of Arm 2 (SLAVE arm) pursuits axis 7 of Arm 1 in the negative direction
(MASTER Arm).
See also $AX_PURSUIT_ARM_MASTER: Master Arm in the Axes Pursuit feature,
$AX_PURSUIT_ENBL: Axes Pursuit enabling flag.
437
Comau Robotics Product Instruction
438
Comau Robotics Product Instruction
439
Comau Robotics Product Instruction
440
Comau Robotics Product Instruction
441
Comau Robotics Product Instruction
Description: There are certain fields of $CRNT_DATA which do not have corresponding predefined
variables, but instead can be referenced using these general arrays. The format and
meaning of the data within these fields is reserved
442
Comau Robotics Product Instruction
Description: There are certain fields of $CRNT_DATA which do not have corresponding predefined
variables, but instead can be referenced using these general arrays. The format and
meaning of the data within these fields is reserved
443
Comau Robotics Product Instruction
444
Comau Robotics Product Instruction
445
Comau Robotics Product Instruction
Description: Different bits of this predefined variable are used for setting the configuration and startup of
the Control Unit:
– Bit 1: If set, the pop-up window containing information on the system configuration is
not displayed at system restart.
– Bit 2: Disables the checks performed at I/O setting, on: TP position (on/off cabinet), TP
connection status.
This means that , if this bit is set to 1, bit 3 is not considered.
– Bit 3: If set, all the programs activated in the system will have bit 3 in $PROG_CNFG
set, which disables the setting of an output in these circumstances:
• a: if in PROGR state from an active program.
• b: if in PROGR state executing the statement from the WinCRC program running
on the PC when the Teach Pendant is recognized to be out of cabinet.
• c: if in PROGR state under MEMORY DEBUG or PROGRAM EDIT from the
WinCRC program running on the PC when the Teach Pendant is recognized to
be out of cabinet.
• d: if the state selector was turned out of the T1 position when the Teach Pendant
is recognized to be out of cabinet.
– Bit 4: reserved
– Bit 5: If set, the WAIT FOR does not trigger if the program is in the held state (due to
HOLD or to an error)
– Bit 6: reserved
– Bit 7: If set, the communication protocol for WinCRC program is automatically
mounted on COMP: port after a restart.
– Bit 8..16: reserved
– Bit 17: do not log download messages
– Bit 18: do not log upload messages
– Bit 19-22: reserved
– Bit 23: set to 1 to enable Autosave in IDE and DATA when switching to AUTO state.
– Bit 24: set to 1 if the system is configured to handle the Customized Nodal Move
– Bit 25: Manage UNICODE in the string $PROG_CNFG set to this
– Bit 26: set to 1 to view the name in the shortest format (e.g. 8 characters in
ProgramView for the ProgramName) in some of the views. Otherwise view in the
extended format.
– Bit 27: Disables the commands for adding (CCLA) and deleting (CCLD) a login from
SYS_CALL and Teach Pendant Pages.
– Bit 28: set to 1 to disable the property output to the LSV file. The default is that the
information is added at the head of the LSV file. Setting this bit to 1 will disable saving
of Property information. This can be useful for maintaining upwards compatibility in the
LSV file.
– Bit 29: set to 1 to use greater precision when printing REAL number in LSV
– Bit 30-32: reserved.
446
Comau Robotics Product Instruction
Limits none
Default: 0
S/W Version: 2.3
Description: Different bits of this predefined variable are used for setting the Control Unit configuration
and startup :
• Bit 1: If set to 1, the Alarm page is automatically shown on the Teach Pendant,
whenever a fault occurs in Remote state
• Bit 2..23: reserved.
• Bit 24: enabling BACK button for MODAL motion backward execution - set to 1 means
enabled
• Bit 25..31: reserved
447
Comau Robotics Product Instruction
– Bit 11: This bit configures the remote output as a copy of the state selector in REMOTE
position.
– Bit 12: reserved
– Bit 13: This bit configures the enabling device switch as the DRIVE OFF button, when
released in PROGR instead of HOLD.
– Bit 14: This bit enables warnings generated when a command is received from a
REMOTE device (Remote CAN I/O, FieldBus)
– Bit 15..16: reserved
– Bit 17: Enables software timer (1.4 sec) that activate motors brake after remote DRIVE
OFF command (used as CONTROLLED EMERGENCY).
– Bit 18: If set, it disables multiarm command forcing.
– Bit 19, 20: reserved
– Bit 21: If set, it means the loading system software is running.
– Bit 22: If set, ConfigureArmCalibrate and ConfigureArmTurnset commands are
disabled.
– Bit 23: If set, the precision (via the ‘:’ operator), in small orientation variations, around X
and Y axes, is of 0.2 degrees (instead of the default of 0.02 degrees). The precision
obtained is lower in this case.
448
Comau Robotics Product Instruction
– Bit 21 reserved
– Bit 22 for VP2.Frames
– Bit 23 for Vp2.Builder
– Bit 24 reserved
– Bit 25 for Multipass
– Bit 26 for C5GOpen
– Bit 27..28 reserved
– Bit 29 for Manual Guidance
– Bit 30 for Palletizing Motion
– Bit 31 Interference regions (Monitored and Forbidden).
449
Comau Robotics Product Instruction
450
Comau Robotics Product Instruction
PROGRAM pth
TYPE nd = NODEDEF
$MAIN_POS
$MOVE_TYPE
$COND_MASK
i : INTEGER
b : BOOLEAN
ENDNODEDEF
451
Comau Robotics Product Instruction
Description: Each PATH contains a condition handler table (COND_TBL) of 32 INTEGERs. This table
is used for specifying which condition handlers will be used during the PATH motion.
The standard node field $COND_MASK_BACK is a bit oriented INTEGER for determining
which of the condition handlers in the COND_TBL should be locally enabled for the
segment if the PATH is being interpreted backwards. For example, if the COND_TBL
elements 1, 2, and 3 contain the condition handler numbers 10, 20, and 30 respectively,
setting $COND_MASK_BACK to 6 for a node will cause condition handlers 20 and 30 to
be locally enabled for the segment (this is because a value of 6 has bits 2 and 3 set to 1,
so COND_TBL[2] and COND_TBL[3] will be enabled).
452
Comau Robotics Product Instruction
453
Comau Robotics Product Instruction
454
Comau Robotics Product Instruction
Title | <rule>;<rule2>...
$CRC_RULES[5]:="rule1|ARM_DATA,1,AREA,-1,-1,1,1,1,4,1,2,A_AREA*"
$ARM_DATA[1].A_AREAL_2D[1,1]
$ARM_DATA[1].A_AREAL_2D[1,2]
$ARM_DATA[1].A_AREAL_2D[2,1]
$ARM_DATA[1].A_AREAL_2D[2,2]
$ARM_DATA[1].A_AREAL_2D[3,1]
$ARM_DATA[1].A_AREAL_2D[3,2]
$ARM_DATA[1].A_AREAL_1D[1]
455
Comau Robotics Product Instruction
456
Comau Robotics Product Instruction
457
Comau Robotics Product Instruction
PROGRAM tcycle
ROUTINE do_clean_gun EXPORTED FROM gun
BEGIN
-- $CYCLE value is 0
CYCLE
-- $CYCLE is incremented every CYCLE
IF $CYCLE MOD 10 = 0 THEN
WRITE (‘CYCLE=‘,$CYCLE,NL)
do_clean_gun
ENDIF
END tcycle
458
Comau Robotics Product Instruction
459
Comau Robotics Product Instruction
460
Comau Robotics Product Instruction
Description: It represents the default setting for $ADVANCE: Motion advance predefined variable for
each HOLDable program. It is the lookahead level used by the Interpreter, only referred to
the motion statements. It is defined at system level.
The allowed values are:
• 1 - Lookahead of 1 motion statement
• 2 - Lookahead of 2 motion statements (with Lookahead option, available since
4.20.xxx system software version)
• 7 - Lookahead of 7 motion statements (with Lookahead option, available since
4.20.xxx system software version)
461
Comau Robotics Product Instruction
462
Comau Robotics Product Instruction
463
Comau Robotics Product Instruction
464
Comau Robotics Product Instruction
465
Comau Robotics Product Instruction
466
Comau Robotics Product Instruction
467
Comau Robotics Product Instruction
468
Comau Robotics Product Instruction
469
Comau Robotics Product Instruction
Description: Additional data associated to the current $ERROR. This could include the “secondary”
error code reported in an alarm.
470
Comau Robotics Product Instruction
Description: It represents the functional digital output points. For further information see also $FDIN
and $FDOUT.
471
Comau Robotics Product Instruction
Description: It is used to handle the name of the Auxiliary Axes data file, used as information to be
displayed and to search for the new file to be used for updating.
472
Comau Robotics Product Instruction
Description: It represents the compensation file name used by the compensation algorithm. There is
one of this variable for each arm.
The user can assign to this variable the name of the compensation file to be used for that
arm. The name should NOT include the file extension and the device specification. If this
variable is not initialized or is set to the null string (''), the algorithm looks in UD: for a file
with extension .ROB and with the arm number as last character of the file name.
Note that, if more than one file are present in UD: with this characteristic, the first one (non
necessarily in alphabetical order) is taken.
For disabling the algorithm, it is needed to set this variable to the null string and to remove
the .ROB file from the UD:.
The system returns an error only in case $FL_COMP is set to a certain value (different
from NULL string) and the corresponding file is not present in UD:
473
Comau Robotics Product Instruction
474
Comau Robotics Product Instruction
475
Comau Robotics Product Instruction
476
Comau Robotics Product Instruction
477
Comau Robotics Product Instruction
Note that in case of eMotion Control this variable is not meaningful because it is based
on FLY_CART (no longer existing with eMotion Control).
478
Comau Robotics Product Instruction
479
Comau Robotics Product Instruction
Limits none
Default:
S/W Version: 1.0
Description: It represents the current following error between the actual robot position and the desired
robot position. The value is expressed in motor turns.
480
Comau Robotics Product Instruction
Description: It is the axis which the algorithm should apply to. It must be specified only when
$FLOW_TBL[index].FW_VAR is set to 2.
481
Comau Robotics Product Instruction
482
Comau Robotics Product Instruction
483
Comau Robotics Product Instruction
484
Comau Robotics Product Instruction
485
Comau Robotics Product Instruction
Description: This variable is used for temporarily disabling, when set to 1, what defined for $HDIN by
means of a previous call to the HDIN_SET Built-In Procedure.
For re-enabling the $HDIN monitoring (if it was previously enabled), $HDIN_SUSP should
be set to 0. Note that, when the HDIN_SET Built-In Procedure is called, the $HDIN_SUSP
is automatically set to 0. It is therefore suggested to use the $HDIN_SUSP only after
calling HDIN_SET Built-In Procedure.
Example: $CRNT_DATA[1].HDIN_SUSP[2] := 0
486
Comau Robotics Product Instruction
Limits none
Default: 0
S/W Version: 1.0
Description: Physical address of the I/O Device on the Fieldbus network.
487
Comau Robotics Product Instruction
Limits none
Default: 0
S/W Version: 1.0
Description: Last error detected on the current I/O Device.
488
Comau Robotics Product Instruction
489
Comau Robotics Product Instruction
– 5 - DeviceNet Interface 2
– 6 - Reserved
– 7 - Reserved
– 8 - Powerlink
– 9 - Profinet I/O Interface 1
– 10 - Profinet I/O Interface 2
– 11 - EtherNetIP Interface 1
– 12 - EtherNetIP Interface 2
– 13 - CANOpen Interface 1
– 14 - CANOpen Interface 2
– 15 - Reserved
– 16 - Reserved
– 17 - EtherCAT Interface 1
– 18 - EtherCAT Interface 2.
490
Comau Robotics Product Instruction
491
Comau Robotics Product Instruction
Description: It represents the set of digital input points reserved for PDL2 applications.
PDL2 programs written by the end-user should not refer this port in order to avoid conflicts
in I/O mapping definitions.
For further information see also par. 5.2.2 $IN and $OUT on page 119.
492
Comau Robotics Product Instruction
Attributes: none
Limits none
Default:
S/W Version: 1.0
Description: This predefined variable has a dynamic number of elements: it changes every I/O
compiling time and can be obtained by means of the $NUM_IO_STS: Number of I/O points
predefined variable.
Each I/O Point has its own element in this table. $IO_STS is an array of predefined records
with one element for each I/O Point.
The fields of each record are as follows:
$IS_DEV: Related Device
$IS_FACTOR: Scale Factor
$IS_HELP_INT: User Help code
$IS_HELP_STR: I/O point User Help string
$IS_NAME: I/O point unique name
$IS_PORT_CODE: I/O point Comau code
$IS_PORT_INDEX: Index of the I/O point
$IS_PRIV: priviledged Port flag
$IS_RTN: retentive output flag
$IS_SIZE: Size of the I/O point
$IS_STS: I/O point status
See also: DV_CNTRL Built-In Procedure, bit 14, to get the index to access the status of a specific I/O
Point, passing the I/O Point Name.
493
Comau Robotics Product Instruction
Limits none
Default:
S/W Version: 1.0
Description: $IR_TBL is an array of 32 elements, with each element containing the $IR_xxx fields. The
fields of each record are as follows:
$IR_ARM: Interference Region Arm
$IR_CNFG: Interference Region Configuration
$IR_CON_LOGIC: Interference Region Consent Logic
$IR_ENBL: Interference Region enabled flag
$IR_IN_OUT: Interference Region location flag
$IR_JNT_N: Interference Region negative joint
$IR_JNT_P: Interference Region positive joint
$IR_NAME: Interference Region name
$IR_PBIT: Interference Region port bit
$IR_PBIT_RC: Interference Region port bit for reservation and consent
$IR_PERMANENT: Interference Region permanent
$IR_PIDX: Interference Region port index
$IR_PIDX_RC: Interference Region port index for reservation and consent
$IR_POS1: Interference Region position
$IR_POS2: Interference Region position
$IR_POS3: Interference Region position
$IR_POS4: Interference Region position
$IR_PTYPE: Interference Region port type
$IR_PTYPE_RC: Interference Region port type for reservation and consent
$IR_REACHED: Interference Region position reached flag
$IR_REFERENCE: Interference Region frame reference
$IR_RES_LOGIC: Interference Region reservation logic
$IR_SHAPE: Interference Region Shape
$IR_TYPE: Interference Region type
$IR_UFRAME: Interference Region Uframe
See also: IR_SET Built-In Procedure, IR_SET_DIG Built-In Procedure, IR_SWITCH Built-In
Procedure.
494
Comau Robotics Product Instruction
Description: It indicates the arm referred by the $IR_TBL: Interference Region table data element.
495
Comau Robotics Product Instruction
496
Comau Robotics Product Instruction
497
Comau Robotics Product Instruction
498
Comau Robotics Product Instruction
499
Comau Robotics Product Instruction
500
Comau Robotics Product Instruction
501
Comau Robotics Product Instruction
502
Comau Robotics Product Instruction
503
Comau Robotics Product Instruction
504
Comau Robotics Product Instruction
505
Comau Robotics Product Instruction
20 - IN
21 - OUT
26 - BDO
27 - FMI
28 - FMO
506
Comau Robotics Product Instruction
Description: The Output point is retentive against the power failure recovery.
Possible values are:
– 0 - output value will be zeroed at power failure recovery
– 1 - output value will be restored at power failure recovery.
507
Comau Robotics Product Instruction
Limits 0..100
Default: 0
S/W Version: 1.0
Description: It represents the percentage of acceleration time and deceleration time used in the
constant jerk phase. This is a variation of acceleration
– $JERK[1]: percentage of acceleration time in the jerk phase
– $JERK[2]: reserved
– $JERK[3]: reserved
– $JERK[4]: percentage of deceleration time in the jerk phase
508
Comau Robotics Product Instruction
509
Comau Robotics Product Instruction
Description: It represents the override value for each joint of a robot arm.
This variable scales speed, acceleration, and deceleration, so that the trajectory remains
constant with changes in the override value.
It is taken into account during the planning phase of a motion, therefore it will not affect
the current active motion but the next one. The default value is 100%.
510
Comau Robotics Product Instruction
511
Comau Robotics Product Instruction
512
Comau Robotics Product Instruction
513
Comau Robotics Product Instruction
514
Comau Robotics Product Instruction
515
Comau Robotics Product Instruction
516
Comau Robotics Product Instruction
517
Comau Robotics Product Instruction
518
Comau Robotics Product Instruction
519
Comau Robotics Product Instruction
520
Comau Robotics Product Instruction
Description: This is a set of data for the algorithm which controls variable acceleration and deceleration
based upon the arm position.
521
Comau Robotics Product Instruction
522
Comau Robotics Product Instruction
Default:
S/W Version: 1.0
Description: It represents the minimum motor deceleration time expressed in milliseconds.
523
Comau Robotics Product Instruction
Default:
S/W Version: 1.0
Description: It is the name of the directory in which the boot file (e.g. /export/home/crc) can be found.
524
Comau Robotics Product Instruction
525
Comau Robotics Product Instruction
526
Comau Robotics Product Instruction
Default:
S/W Version: 1.0
Description: It is an array of 2 elements having the following meaning:
[1]: List of hosts connected
[2]: List of user connected
527
Comau Robotics Product Instruction
528
Comau Robotics Product Instruction
1 = Ethernet Annex
2 = reserved
3 = reserved
4 = reserved
5 = USB Cable
6 = USB Ethernet adaptor
529
Comau Robotics Product Instruction
530
Comau Robotics Product Instruction
531
Comau Robotics Product Instruction
532
Comau Robotics Product Instruction
Default: reserved
S/W Version: 1.0
Description: It represents the number of existing I/O points in the Control Unit.
533
Comau Robotics Product Instruction
534
Comau Robotics Product Instruction
535
Comau Robotics Product Instruction
Description: It represents the number of tree structures that can be supported by the System.
536
Comau Robotics Product Instruction
Limits none
Default:
S/W Version: 1.0
Description: It represents the total arm space. It is only in used in cartesian motions for indicating the
average TCP space expressed in millimeters.
This variable is updated every tick (default 2 milliseconds) in case of linear or circular
motions.
It is zeroed in the following situations: restart, reset from pdl2, when the variable overflows
its numerical value
537
Comau Robotics Product Instruction
538
Comau Robotics Product Instruction
Limits none
Default:
S/W Version: 1.0
Description: This variable contains a tolerance in millimeters. The value is related to: X,Y,Z coordinates
of the actual Cartesian robot POSITION in respect with the
$ON_POS_TBL[on_pos_idx].OP_POS; linear joints of the actual JOINTPOS in respect
with the $ON_POS_TBL[on_pos_idx].OP_JNT. The ON POS feature must be enabled
(ON_POS(ON,..)) after having been defined on the position (ON_POS_SET) or on the
jointpos (ON_JNT_SET)
539
Comau Robotics Product Instruction
540
Comau Robotics Product Instruction
541
Comau Robotics Product Instruction
Description: This is the current position of robot joints (JOINTPOS) on the trajectory. Its value is
updated any time the robot stops.
542
Comau Robotics Product Instruction
Description: This variable contains the tolerance (in degrees related to the Euler angles) of the current
robot position in respect with $CRNT_DATA[arm].OT_POS. It is also used for expressing
the tolerance related to rotating auxiliary axes.
543
Comau Robotics Product Instruction
544
Comau Robotics Product Instruction
545
Comau Robotics Product Instruction
Description: Non-saved Position registers that can be used by users instead of having to define
variables. Also for Integer, Real, String, Boolean, Jointpos and Xtndpos datatypes there
are saved and non-saved registers.
546
Comau Robotics Product Instruction
547
Comau Robotics Product Instruction
548
Comau Robotics Product Instruction
549
Comau Robotics Product Instruction
550
Comau Robotics Product Instruction
551
Comau Robotics Product Instruction
552
Comau Robotics Product Instruction
553
Comau Robotics Product Instruction
554
Comau Robotics Product Instruction
555
Comau Robotics Product Instruction
556
Comau Robotics Product Instruction
557
Comau Robotics Product Instruction
558
Comau Robotics Product Instruction
559
Comau Robotics Product Instruction
560
Comau Robotics Product Instruction
561
Comau Robotics Product Instruction
562
Comau Robotics Product Instruction
563
Comau Robotics Product Instruction
Description: It represents the family of the robot arm. The different families are:
– 1: SMART
– 2: reserved
– 3: REBEL
– 4: Special ARM without inverse and direct kinematics
– 5: GANTRY
– 6..18: reserved.
564
Comau Robotics Product Instruction
Default:
S/W Version: 1.0
Description: It represents the current state of the robot arm. Some states have been defined.
– Bit 1: The arm is not RESUMED
– Bit 2: The arm is not CALIBRATED
– Bit 3: The arm is in HELD state
– Bit 4: The arm is in DRIVE OFF state
– Bit 5: The arm is in SIMULATE state.
565
Comau Robotics Product Instruction
• 10: Russian
– Bit 13..16: reserved
– Bit 17: System variables initialized
– Bit 18: XD: device connected
– Bit 19: TX: device connected
– Bit 20..21: reserved
– Bit 22: USB NET (ethernet) device inserted
– Bit 23..27: reserved
Bit 28: used for language localization; if the set language is Portuguese this bit
indicates whether the language is for Portugal (value 0) or for Brazil (value 1); if the
set language is English, this bit indicates whether the language is for United Kingdom
(value 0) or for USA (value 1)
– Bit 29..30: reserved
– Bit 31: system in minimal configuration
– Bit 32: reserved.
566
Comau Robotics Product Instruction
567
Comau Robotics Product Instruction
568
Comau Robotics Product Instruction
569
Comau Robotics Product Instruction
570
Comau Robotics Product Instruction
571
Comau Robotics Product Instruction
572
Comau Robotics Product Instruction
573
Comau Robotics Product Instruction
574
Comau Robotics Product Instruction
575
Comau Robotics Product Instruction
576
Comau Robotics Product Instruction
577
Comau Robotics Product Instruction
frmpth.NODE[6].$MOVE_TYPE := LINEAR
frmpth.NODE[6].$MAIN_POS := POS(-1000, -1000, 1000, 0, 180, 0, '')
frmpth.NODE[6].$SEG_TOOL_IDX := 4
578
Comau Robotics Product Instruction
Description: It has the same purpose as $STRESS_PER but is used with PATH segments.
$SEG_STRESS_PER doesn’t apply to last node of path, $STRESS_PER is used instead.
579
Comau Robotics Product Instruction
Limits 0..7
Default: 0
S/W Version: 1.0
Description: Each PATH contains a frame table (FRM_TBL) of 7 positional elements that can be used
either as a tool or a reference frame in a node which contains the MAIN_POS standard
field.
$SEG_TOOL_IDX represents the FRM_TBL index to be used as the tool frame of a
particular node; if $SEG_TOOL_IDX is not included in the node definition or has value of
zero (default value), the value of $TOOL is used. As there is just one FRM_TBL in each
path, for clearness it is suggested to use elements 1 to 3 inclusive for reference frames
and elements 4 to 7 for tools. See example of $SEG_REF_IDX: PATH segment reference
index.
PROGRAM segwait
VAR pnt0001j, pnt0002j, pnt0003j : JOINTPOS FOR ARM[1]
TYPE path_type = NODEDEF
$MAIN_JNTP
$SEG_WAIT
ENDNODEDEF
BEGIN
-- This condition will signal the path nodes interpretation
CONDITION[1] NODISABLE :
WHEN SEGMENT WAIT pth DO
.....
SIGNAL SEGMENT pth
ENDCONDITION
ENABLE CONDITION[1]
...
580
Comau Robotics Product Instruction
pth.NODE[1].$MAIN_JNTP := pnt0001j
pth.NODE[1].$SEG_WAIT := FALSE
...
pth.NODE[2].$MAIN_JNTP := pnt0002j
581
Comau Robotics Product Instruction
582
Comau Robotics Product Instruction
583
Comau Robotics Product Instruction
584
Comau Robotics Product Instruction
Limits none
Default:
S/W Version: 2.32
Description: Safe Logic EMOI Data DINT (32 bits) Array image.
585
Comau Robotics Product Instruction
586
Comau Robotics Product Instruction
587
Comau Robotics Product Instruction
588
Comau Robotics Product Instruction
589
Comau Robotics Product Instruction
Description: This username is used upon Control Unit startup in case an implicit login has been defined
(via the ConfigureControllerLoginStartup (CCLS) command). This saves the user from
having to login from the user interface any time the system starts up.
590
Comau Robotics Product Instruction
Limits none
Default:
S/W Version: 1.0
Description: It represents the maximum positive stroke for each axis of the arm. This value can be
changed by the user, but has effect only if it is saved in the configuration file and the
Control Unit is restarted.
591
Comau Robotics Product Instruction
592
Comau Robotics Product Instruction
593
Comau Robotics Product Instruction
594
Comau Robotics Product Instruction
595
Comau Robotics Product Instruction
Description: It defines when the motion is to be terminated based on how close the arm is to its
destination. Valid values are represented by the predefined constants NOSETTLE,
COARSE, FINE, JNT_COARSE, and JNT_FINE. The default value is NOSETTLE.
– NOSETTLE: The move is considered complete when the trajectory generator has
produced the last intermediate position for the arm. The actual position of the arm is
not considered.
– COARSE: The move is considered complete when the tool center point (TCP) has
entered the tolerance sphere defined by the value of the predefined variable
$TOL_COARSE: Tolerance coarse.
– FINE: The move is complete when the tool center point (TCP) has entered the
tolerance sphere defined by the value of the predefined variable $TOL_FINE.
– JNT_COARSE: The move is considered complete when every joint has entered the
joint tolerance sphere defined by the value of the predefined variable
$TOL_JNT_COARSE: Tolerance for joints [axis_num].
– JNT_FINE: The move is considered complete when every joint has entered the joint
tolerance sphere defined by the value of the predefined variable $TOL_JNT_FINE:
Tolerance for joints [axis_num].
For example:
WAIT FOR HOLD OR EVENT 94 OR ($FDIN[5]=TRUE) AND
($FDOUT[5]=FALSE)
IF $THRD_CEXP = 3 THEN
WRITE ('FDIN[5] IS TRUE AND $FDOUT[5] IS FALSE', NL)
ELSE
IF $THRD_CEXP = 2 THEN
WRITE ('EVENT 94 event triggered', NL)
ELSE -- $THRD_CEXP is 1
WRITE ('The HOLD event triggered', NL)
ENDIF
ENDIF
596
Comau Robotics Product Instruction
597
Comau Robotics Product Instruction
598
Comau Robotics Product Instruction
Description: It represents 1 second timers for use in PDL2 programs. The number of elements is
dependant on the predefined variable $NUM_TIMERS: Number of timers.
Timer elements can be attached by different programs.
See ATTACH Statement and DETACH Statement.
See also the other timers: $TIMER: Clock timer (in ms), $PROG_TIMER_O: Program
timer - owning context specific (in ms), $PROG_TIMER_OS: Program timer - owning
context specific (in seconds), $PROG_TIMER_X: Program timer - execution context
specific (in ms), $PROG_TIMER_XS: Program timer - execution context specific (in
seconds).
599
Comau Robotics Product Instruction
600
Comau Robotics Product Instruction
601
Comau Robotics Product Instruction
602
Comau Robotics Product Instruction
Limits none
Default:
S/W Version: 1.0
Description: it represents the more far away point reached by the tool: if not implicitly declared, it is the
same by default of $TOOL.
603
Comau Robotics Product Instruction
604
Comau Robotics Product Instruction
NOTE
To better understand the below listed variables, please read chap.Conveyor Tracking
(optional feature) in Motion Programming manual.
605
Comau Robotics Product Instruction
606
Comau Robotics Product Instruction
607
Comau Robotics Product Instruction
608
Comau Robotics Product Instruction
[17]: Maximum number of available lines to the DISPLAY group of commands when
issued on the teach pendant. The default value is 10 lines
[18]: reserved
[19]: Timeout for TP backlight. The default value is 180 seconds (3 minutes).
Allowed values:
-1 - the TP will never switch off (NOT RECOMMENDED because this could cause the
display life to be reduced);
0 - it is automatically set by the system to 180.
[20]: Refresh time, in msecs, for the FOLLOW command of the PROGRAM EDIT and
MEMORY DEBUG environments. The default value is every half second
[21]: Status line refresh time in msecs. The default value is 500
[22]: Automatic logout timeout (in ms). The default value is 0 for indicating No timeout
[23]: reserved
[24]: During PowerFailureRecovery, this is the lag in some error logging. The default is
800 msecs.
[25]: reserved
[26]: Software timer that activates the motors brake when time expires after the controlled
emergency. The default value is 1400 ms
[27]: Energy saving timeout expressed in seconds. The default is 120
[28]: reserved
[29]: size, in bytes, of the stack to be allocated for PDL2 programs. The default is 1000
[30]: Maximum size, in bytes, for read-ahead buffer. The default is 4096
[31]: Maximum execution time, in msecs, for the calibration program. The default is 10000
[32..41]: reserved
[42]: Default stack size, in bytes, for EXECUTE command. The default is 300
[43..50]: reserved
[54]: Number of default characters read. Default 256.
609
Comau Robotics Product Instruction
If its value is TRUE the system sends an error msg if the trajectory tries to move the robot
to a final position having a configuration number of turns different from the number of turns
present in the MOVE statement.
610
Comau Robotics Product Instruction
611
Comau Robotics Product Instruction
612
Comau Robotics Product Instruction
613
Comau Robotics Product Instruction
614
Comau Robotics Product Instruction
615
Comau Robotics Product Instruction
Attributes: none
Limits 0..10
Default: 0
S/W Version: 1.0
Description: This field of $CRNT_DATA selects the kind of weaving between the cartesian mode and the
joint mode. Set this variable to zero to enable the cartesian weaving. Otherwise, in case of
joint weaving, values from 1 to 8 select the axis on which weaving is performed. It should
only be used if the weaving is performed without arm motion. It replaces $WEAVE_TYPE in
absence of arm movement.
616
Comau Robotics Product Instruction
617
Comau Robotics Product Instruction
618
Comau Robotics Product Instruction
619
Comau Robotics Product Instruction
Description: It represents the weaving height (in mm) in the direction perpendicular to the weaving
plane.
620
Comau Robotics Product Instruction
621
Comau Robotics Product Instruction
622
Comau Robotics Product Instruction
623
Comau Robotics Product Instruction
624
Comau Robotics Product Instruction
Limits none
Default:
S/W Version: 1.0
Description: Xtndpos registers that can be used by users instead of having to define variables. Also for
Integer, Real, String, Boolean, Jointpos and Position datatypes there are saved and
non-saved registers.
625
Comau Robotics Product Instruction
$PWR_RCVR := 0
– while power failure recovery is enabled, the startup program will not be executed
every time the Control Unit main switch is turned on. The name of the startup
program is stored in the $STARTUP: Startup program predefined variable;
– a PDL2 program can detect the power failure recovery event by using the WHEN
POWERUP DO event in a condition handler. This event is triggered only when the
system restarts in power failure recovery mode. It will not be triggered when the
system restarts due to a Restart Cold operation (Restart function in the Start Page
on the Teach Pendant). Refer to par. 8.3.5 SYSTEM Events on page 169 for more
information on the POWERUP event and the use of condition handlers;
– when a power failure occurs, the HOLD system event and the DRIVEs OFF events
are triggered (see also par. 8.3.5 SYSTEM Events on page 169). A PDL2 program
can use such events to perform the same actions that are normally performed
during HOLD and DRIVEs OFF events;
– a READ Statement will return an error if it is pending on the TP or a serial
communication line;
– a WRITE Statement to a serial communication line will return an error. A WRITE
Statement to the TP will not return an error and the window will contain the correct
display data after the system is restarted;
– some of the devices in the system, require several seconds to perform their
diagnostic and startup procedures. While these operations are being performed,
the PDL2 program will begin to execute. Some of the PDL2 language statements
and built-in routines will fail if they are executed before these devices have
completed their startup procedures. Built-in routines, like the ARM_POS Built-In
Function, or pressing the DRIVE ON or START button will fail if the startup
procedures have not been completed. A PDL2 program should wait until the power
failure recovery has completed before continuing execution. To cause a PDL2
program to wait until the power failure recover has completed, create a condition
handler that triggers on the POWERUP event and then waits until bit number 9 of
the $SYS_STATE: State of the system predefined variable is cleared.
It is also suggested to check that the Teach Pendant is connected after the power failure
recovery. Please use the proper event (EVENT 116) inside a CONDITION or a WAIT
FOR statement. For further details about the use of Conditions, see Chap.8. - Condition
Handlers on page 161
626
Comau Robotics Product Instruction
14.1 Introduction
The current chapter identifies the main differences in the use of PDL2 language,
between C5G and C5GPlus platforms, that should be taken into account before
running, on C5GPlus Control Unit, a PDL2 program previously written for C5G Control
Unit.
Please, also refer to the chapters in which the related features are described.
627
Comau Robotics Product Instruction
– $SL_SI, $SL_SO
– $IS_STS[ ].IS_PORT_CODE - only removed the following old values:
• 9 - SDI
• 10 - SDO
– $IO_DEV[ ].ID_NET - only removed the following old values:
• 6 - CANOpen
• 15 - Powerlink Annex
– $VRC_STR, $VRC_INT
– $PAIRING_STATE, $PAIRING_STS
– $FEED_VOLTAGE
– $JNT_SM
– $LASER1D_ENBL_PWR, $LASER1D_PWR, $LASER1D_PWR_START,
$LASER1D_PWR_END, $LASER1D_DIST_START, $LASER1D_DIST_END,
$LASER1D_LENGTH
– $L3D_XECAM, $L3D_YECAM, $L3D_ZECAM, $L3D_MASTER
– $DYN_WRISTQS
– $ARM_SENSITIVITY
– $COLL_SOFT_PER, $COLL_TYPE
– $PROT_3964R_TUNE
– $C4GOPEN_JNT_MASK, $C4GOPEN_MODE, $C4GOPEN_CMD.
628
Comau Robotics Product Instruction
– CDetect open source library has been removed. The exported routines
• CD_START
• CD_END
• CD_READ
have been substituted by CD_SET Built-in Procedure.
629
Comau Robotics Product Instruction
15. APPENDIX A -
CHARACTERS SET
Current chapter lists the ASCII numeric decimal codes and their corresponding
hexadecimal codes, character values, and graphics characters, used by the Teach
Pendant.
Character values enclosed in parentheses ( ) are ASCII control characters, which are
displayed as graphics characters when printed to the screen of the Teach Pendant.
Note that, on a PC (when WINC5G program is active), control characters and graphics
characters are displayed according to the currently configured language and characters
set.
In the next section (called Characters Table) a list of all characters, together with the
corresponding numeric value in both decimal and hexadecimal representation, follows.
The decimal or hexadecimal numeric value for a character can be used in a STRING
value to indicate the corresponding character (for example, ‘\003 is a graphic
character‘).
630
Comau Robotics Product Instruction
631
Comau Robotics Product Instruction
632
Comau Robotics Product Instruction
633
Comau Robotics Product Instruction
634
Comau Robotics Product Instruction
635
Comau Robotics Product Instruction
Cause: The lock arms specified as the parameters to the HDIN_SET built-in are not present.
– HDIN_SET can only lock arms which are defined in the mask of the predefined variable
Remedy:
$REF_ARMS.
39947 <prog_id>(<line_num>): JNTP_TO_POS jntp not initialized
Cause: The JNTP_TO_POS built-in failed because the JOINTPOS data has not been initialized.
Remedy: – Check the value passed to the built-in.
39948 <prog_id>(<line_num>): LN value <= zero
The value passed to the LN built-in is invalid. The value must be greater than 0.0. The returned
Cause:
result when this error is trapped on is an uninitialized REAL.
Remedy: – Check and modify the parameter passed to the built-in.
39949 <prog_id>(<line_num>): ORD bad index
The index passed to the ORD built-in is invalid. The value must be greater than 0 and less than
Cause: or equal to the current length of the STRING variable. The returned result when this error is
trapped on is an uninitialized INTEGER.
Remedy: – Check and modify the parameter passed to the built-in.
39950 <prog_id>(<line_num>): POS_FRAME pos parallel
The positional values passed to the FRAME built-in are co-linear and therefore the frame
Cause: position cannot be calculated. The result returned when this error is trapped on is an
uninitialized POSITION.
Remedy: – Check and modify the parameter passed to the built-in.
39951 <prog_id>(<line_num>): POS_TO_JNTP pos not initialized
The POS_TO_JNTP built-in failed due to the fact that the Cartesian positional data has not
Cause:
been initialized.
Remedy: – Check the value passed to the built-in.
39952 <prog_id>(<line_num>): SCRN_GET unknown screen
Cause: The SCRN_GET built-in failed to find the current screen on the particular device.
Remedy: – Check that the PDV_TP or PDV_CRT physical device has been passed to the built-in.
39953 <prog_id>(<line_num>): SQRT value less than zero
The value passed to the SQRT built-in is invalid. The value must be greater than or equal to
Cause:
0.0. The result returned when this error is trapped on is an uninitialized REAL.
Remedy: – Check and modify the parameter passed to the built-in.
39954 <prog_id>(<line_num>): Continuous statement limit reached
The limit on number of continuous statements without any asynchronous statement has been
Cause: reached. This effects CPU usage and performance so please check what has been written in
the PDL2 program and wherever possible use events and asynchronous statements.
Remedy: – Check the program statements and if necessary add a DELAY.
39955 <prog_id>(<line_num>): STR_DEL bad start or length
Either the STRING has no length or the starting index or the length specified in the STR_DEL
Cause: built-in is invalid. Index and length values must be greater than or equal to one. If the error is
trapped on, the STRING remains unchanged.
Remedy: – Check and modify the parameter passed to the built-in.
39956 <prog_id>(<line_num>): STR_INS bad index
The starting index to the STR_INS built-in is invalid. The value must be greater than zero and
Cause: less than the current string length or, if the STRING is uninitialized, the index must be zero.
The destination STRING must be of a valid length.
Remedy: – Check and modify the parameter passed to the built-in.
636
Comau Robotics Product Instruction
637
Comau Robotics Product Instruction
The length specified or calculated for an ARRAY predefined variable in the built-in is invalid.
Cause:
For ARRAYs, the length must be a multiple of the element size.
Remedy: – Check and modify the offset or length parameter for the ARRAY predefined variable.
39968 <prog_id>(<line_num>): specification offset not on element boundary
The offset specified or calculated for an ARRAY predefined variable in the built-in is invalid. For
Cause:
ARRAYs, the offset must be on an ARRAY element boundary.
Remedy: – Check and modify the offset or length parameter for the ARRAY predefined variable.
39969 <prog_id>(<line_num>): VOL_SPACE label string too short
The length of the STRING passed to the VOL_SPACE built-in is too short. The string length
Cause:
must be at least 12.
Remedy: – Pass a STRING whose length is greater than 11.
39970 <prog_id>(<line_num>): WIN_CLEAR bad option
Cause: The clear specification parameter passed to the WIN_CLEAR built-in is invalid.
Remedy: – Check that the parameter is one of the WIN_CLR_xxx predefined constants.
39971 <prog_id>(<line_num>): WIN_CREATE/WIN_SIZE bad number of rows
The number of rows specified in the WIN_CREATE or WIN_SIZE built-in is invalid. The value
Cause:
must be greater than zero and less than the number of rows on the particular device.
Remedy: – Check and modify the number of rows parameter.
39972 <prog_id>(<line_num>): bad physical device
The physical device specified in one of the WIN_CREATE, SCRN_SET, SCRN_FONT, or
Cause:
SCRN_CLEAR built-ins is invalid.
Remedy: – Check and modify the parameter such that it is one of the PDV_xxx predefined constants
39973 <prog_id>(<line_num>): WIN_DEL window not deleted
The WIN_DEL built-in failed because either files are currently open on the device or the device
Cause:
is currently being displayed
– Check the window state using WIN_STATE and either close the files or remove the
Remedy:
window or both
39974 <prog_id>(<line_num>): WIN_REMOVE window not displayed
Cause: The WIN_REMOVE built-in failed because the window is currently not being displayed
Remedy: – Check the state of the window by using WIN_STATE and take the corrective action
39975 <prog_id>(<line_num>): WIN_REMOVE POP-UPs on window
The WIN_REMOVE built-in failed because either the fixed window contains pop-up windows or
Cause:
the TP0: window is not being displayed
– Check the state of the window by using WIN_STATE and remove the offending pop-up
Remedy:
windows before trying to remove the fixed window
39976 <prog_id>(<line_num>): EXIT CYCLE program not in a cycle
The EXIT CYCLE statement failed because the program has not yet entered the CYCLE ..
Cause:
END loop
– Check that the current program counter position is within the CYCLE and END of the
Remedy:
program and that the CYCLE statement or attribute is included in the program
39977 <prog_id>(<line_num>): no matching CASE
Cause: No matching CASE could be found in the SELECT statement
– Check the select value and the list of CASEs. If necessary add the ELSE: clause for
Remedy:
handling the unexpected select value
39978 <prog_id>(<line_num>): PULSE time < 0
638
Comau Robotics Product Instruction
Cause: The time specified with the PULSE statement is less than zero
Remedy: – Check and modify the pulse time
39979 <prog_id>(<line_num>): DELAY time less than 0 or greater than a week
The time specified in the DELAY statement is less than zero or greater than the maximum
Cause:
allowed value
Remedy: – Change the time value specified in the DELAY statement
39980 <prog_id>(<line_num>): no memory for activatio
Cause: An attempt was made to ACTIVATE a program but there are insufficient memory resources
– Check that the size of the program stack is not too large. Erase unneeded code and/or
Remedy:
data from memory
39981 <prog_id>(<line_num>): program not loaded
Cause: An attempt was made to ACTIVATE a program which is currently not loaded in memory
Remedy: – Load the program into memory before trying to activate it
39982 <prog_id>(<line_num>): program already active
Cause: An attempt was made to ACTIVATE a program which is already active
Remedy: – Either DEACTIVATE the program and then reissue the ACTIVATE or leave as is
39983 <prog_id>(<line_num>): program being edited
An attempt was made to ACTIVATE the program currently being edited in PROGRAM
Cause:
EDIT/DATA or viewed in MEMORY DEBUG. Only the editor can activate this program
Remedy: – ACTIVATE the program from within the editor by issuing the RUN command
39984 <prog_id>(<line_num>): program not loaded
An attempt was made to DEACTIVATE a program which is not only not active, it is not even
Cause:
loaded in memory
Remedy: – Check that the program name specified in the DEACTIVATE statement is correct
39985 <prog_id>(<line_num>): program not active
An attempt was made to either DEACTIVATE or EXIT CYCLE a program which is currently not
Cause:
active
Remedy: – Check the state of the program and determine what action to take
39986 <prog_id>(<line_num>): program not active
An attempt was made to change the state and unsuspend a program which is currently not
Cause: active. This typically occurs when trying to UNPAUSE or PAUSE a program which is not yet
active
Remedy: – Check what the program state should be
39987 <prog_id>(<line_num>): program already unsuspended
An attempt was made to change the state and suspend a program which is currently not active.
Cause:
This typically occurs when trying to UNPAUSE or PAUSE a program which is not yet active
Remedy: – Check what the program state should be
39988 <prog_id>(<line_num>): program already suspended
An attempt was made to change the state and suspend a program which is already suspended
Cause: for the same reason. This typically occurs when trying to PAUSE a program which is already
paused
Remedy: – Check what the program state should be
39989 <prog_id>(<line_num>): division by zero
Cause: A division by zero was attempted
Remedy: – Check and modify the right hand side of the division operator
639
Comau Robotics Product Instruction
640
Comau Robotics Product Instruction
641
Comau Robotics Product Instruction
The arm, typically a SMART robot, has the center of the wrist align with the z-axis of the world
Cause:
frame. This is an arm singularity.
Remedy: – Avoid entering the center of the wrist in a cylindrical volume coaxial to z-axis
40014 <prog_id>(<line_num>): wrist axis at undefined pos
The wrist, typically a SMART wrist, has axis 5 at zero position. For this position it is impossible
Cause:
to independently compute the values of axes 5, 4 and 6
– Avoid working in Cartesian with axis 5 at zero position or, if implemented, change the
Remedy: setting of $ORNT_TYPE to WRIST_JNT in order to execute the trajectory in Cartesian,
but interpolating the axes in joint
40015 <prog_id>(<line_num>): limits <lower_lim>..<upper_lim> for system variables
Cause: The value assigned to a predefined variable is outside the specified range
Remedy: – Check and modify the assignment such that the value is within the range.
40016 <prog_id>(<line_num>): NODISABLE on a STATE condition
The NODISABLE condition handler attribute cannot be used if the condition handler contains
Cause: state condition expressions (for example WHEN $DOUT[3] = TRUE). This is because the
condition handler would remain enabled and the state would be continuously triggering
– Change the type of condition expression to an event (for example WHEN $DOUT[3]+) or
Remedy:
remove the NODISABLE attribute
40017 <prog_id>(<line_num>): WITH bad FOR ARM number
The arm number specified in the FOR ARM condition handler attribute does not match the arm
being referenced in the MOVE statement. For example:
arm 1 is being moved, but the condition handler is defined for arm 2
– Redefine the condition handler or change the MOVE statement so that the arm numbers
Remedy:
are the same
40018 <prog_id>(<line_num>): WITH bad arm number for cond action
The FOR ARM was not specified in a condition handler definition and the condition handler
contains actions which are arm related. This condition handler is being used in a MOVE
statement and the arm at the time of the condition handler definition is different from the arm
being moved. For example:
642
Comau Robotics Product Instruction
643
Comau Robotics Product Instruction
For definition, the second Euler angle cannot be less than 0 degrees or greater than 180
Cause:
degrees
Remedy: – Set the angle accordingly
40030 <prog_id>(<line_num>): SCRN_SET edit not active
The setting of the screen to SCRN_EDIT using the SCRN_SET built-in failed as the editor is
Cause:
not active on the particular device
Remedy: – Check that the editor is active on the physical device.
40031 <prog_id>(<line_num>): XTND_IN_RANGE XTNDPOS not initialized
The XTND_IN_RANGE built-in failed because the XTNDPOS positional data has not been
Cause:
initialized
Remedy: – Check the value passed to the built-in
40032 <prog_id>(<line_num>): SYS_CALL timeout
The SYS_CALL has timed out and has therefore been canceled. The variable
Cause:
$SYS_CALL_TOUT can be used for setting this timeout value
Remedy: – Either change the timeout period or accept this error
40033 <prog_id>(<line_num>): WRITE error <error_num>
The specified error occurred during an asynchronous WRITE operation. Due to the fact that
Cause: many errors can be reported for the WRITE operation, this message is used so that the errors
can be trapped. The predefined variable $FL_STS contains the specified error
Remedy: – Review the specified error to determine what action to take
40034 <prog_id>(<line_num>): WRITE timeout
The asynchronous WRITE operation has timed out. The program predefined variable
Cause: $WRITE_TOUT can be used for specifying for how long the program should wait for the
WRITE to complete
– Check why the WRITE may not have completed in time and if necessary increase the
Remedy:
timeout value
40035 <prog_id>(<line_num>): WRITE not completed
The asynchronous WRITE operation did not complete for some reason, with only a partial
Cause:
amount of the data written
– Check the value of $WRITE_TOUT and that the LUN was not closed or the program
Remedy:
deactivated during the WRITE operation
40036 <prog_id>(<line_num>): file closed on WRITE
Cause: The WRITE operation has been aborted because the LUN has been closed
Remedy: – Cancel the WRITE operation before attempting to close the file if this is a problem.
40037 <prog_id>(<line_num>): bad CANCEL semaphore
An attempt was made to CANCEL a SEMAPHORE while programs are waiting on it. The
Cause:
CANCEL statement or action only has an effect if the SEMAPHORE has been signaled
Remedy: – Check which programs are waiting on the SEMAPHORE
40038 <prog_id>(<line_num>): not ALL conds DISABLEd
Cause: The DISABLE CONDITION ALL statement failed with not all the conditions disabled
Remedy: – Check if any of the conditions are currently being used locally in a motion statement.
40039 <prog_id>(<line_num>): not ALL conditions PURGEd. Error <error_num>
The PURGE CONDITION ALL statement or action failed due to the specified reason with not
Cause:
all the conditions purged
– Review the specified error to determine what action to take. Check if any of the conditions
Remedy:
are currently being used locally in a motion statement
644
Comau Robotics Product Instruction
645
Comau Robotics Product Instruction
The KEY_LOCK built-in failed because either the state selector is not LOCAL or REMOTE or
Cause:
the editor, teach, or EXECUTE is active on the device
Remedy: – Reissue the built-in when in the correct state
40052 <prog_id>(<line_num>): no condition action specified
A CONDITION has been defined which contains a condition expression but no corresponding
Cause:
action
Remedy: – Either trap on the error so that there is no action or insert some form of action
40053 <prog_id>(<line_num>): string has no length
An attempt was made to assign or set a STRING variable which has no length. This occurs
Cause: when the STRING is defined as STRING[*] and the length has not been defined in another
program or when a variable file was loaded
Remedy: – Set the string length or load a variable file that contains the variable value and a length
40054 <prog_id>(<line_num>): Invalid CNTRL_GET argument: <enumeration>
Cause: The enumeration for CNTRL_GET information was invalid
Remedy: – Check the value passed in as the argument.
40055 <prog_id>(<line_num>): $UFRAME not initialized
Cause: The value of $UFRAME is not initialized
Remedy: – Check and modify the value of $UFRAME
This is used to allow trapping on mtn canc. error - Issue ERR_TRAP_ON (40056) to trap on
40056
errors due to CANCEL statements (like motion already cancelled)
40059 <prog_id>(<line_num>): AUX_SET error <error_num>
The AUX_SET built-in failed due to an error. In order to avoid the program to be suspended it is
needed to issue ERR_TRAP_ON on this error. For example:
Cause:
"40059 - 4 pippo(5): AUX_SET error 37194"; issue ERR_TRAP_ON(40059) for not suspending
program pippo
– For understanding what caused the alarm, please check the meaning of the associated
Remedy: error. In the example, the description of the cause and the remedy of 37194 has to be
looked for
40060 <prog_id>(<line_num>): Cartesian Position not compensable
In case of compensation algorithm active, it means that the programmed Joint or Cartesian
Cause:
position cannot be compensated
– In case of compensation algorithm active, program the Joint or Cartesian position out of
Remedy:
the area where the compensation algorithm cannot work
40061 <prog_id>(<line_num>): flow modulate already enabled
Cause: This error occurs when the FLOW_MOD_ON is called twice from the same program
Remedy: – Remove the second call to FLOW_MOD_ON
40062 <prog_id>(<line_num>): flow modulate already disabled
Cause: This error occurs when the FLOW_MOD_OFF is called twice from the same program
Remedy: – Remove the second call to FLOW_MOD_OFF
40063 <prog_id>(<line_num>): ON_POS already enabled
This error occurs when the ON_POS(ON) is called twice on the same element of the
Cause:
$ON_POS_TBL
Remedy: – Remove the second call to the ON_POS(ON)
40064 <prog_id>(<line_num>): ON_POS already disabled
646
Comau Robotics Product Instruction
This error occurs when the ON_POS(OFF) is called on an element of the $ON_POS_TBL that
Cause:
is not currently reserved to anybody
– Review the program in order to determine what causes this error, for example two
Remedy:
consecutive calls to the ON_POS(OFF).
40065 <prog_id>(<line_num>): bad JNT axis specified
Cause: An axis value has been specified in the builtin JNT but the axis does not exist
Remedy: – Correct the function call to JNT
40066 <prog_id>(<line_num>): payload identification file not found
Cause: The file containing data for the payload identification is not present in the specified location
Remedy: – Check if the file exists in the specified place
40067 <prog_id>(<line_num>): STR_SET_INT/REAL bad string
Cause: Attempting to set an integer or real value into a string and found an error in one the parameters
Remedy: – Check the parameters passed
40068 <prog_id>(<line_num>): STR_GET_INT/REAL bad string
Cause: Attempting to get an integer or real value from a string and error found in one parameter
Remedy: – Check the parameters passed
40070 <prog_id>(<line_num>): cannot create data storage file
Cause: It is not possible to create the data storage file
– Please check if the required space for the file is available or if another phase of data
Remedy:
calculation is currently active
40071 <prog_id>(<line_num>): Invalid mode for DIR_GET
DIR_GET foresees the following 3 modalities: 0 for knowing the directory that was selected at
Cause: the time in which the program was activated, 1 for knowing the directory from which the .COD
was loaded, 2 for knowing the directory from which the .VAR was loaded
Remedy: – Check the mode parameter passed to DIR_GET
40073 <prog_id>(<line_num>): error in data storage files
Cause: Data storage files for the payload identification may contain wrong data
Remedy: – Retry the payload identification procedure
40074 <prog_id>(<line_num>): TABLE_ADD/DEL failed: <cause>
Cause: The TABLE_ADD or TABLE_DEL function call failed due to the specified reason
Remedy: – Check the cause of failure.
40075 <prog_id>(<line_num>): VAR_CREATE/CLONE failed: <cause>
Cause: The VAR_CREATE or VAR_CLONE builtin call failed due to the specified reason
Remedy: – Check the cause of failure
40076 <prog_id>(<line_num>): ACT_POST error in code
Cause: Only errors between 43009 and 44031 can be action posted
Remedy: – Check the number supplied
40077 <prog_id>(<line_num>): $TIMER overflow
Cause: An element of $TIMER overflowed its value
Remedy: – Reset the $TIMER and assign to it a value that avoids the overflow event
40078 <prog_id>(<line_num>): WAIT FOR timed out
Cause: The WAIT FOR statement completed due to a timed out
Remedy: – Expected if $WFR_TOUT for the program has been set
647
Comau Robotics Product Instruction
648
Comau Robotics Product Instruction
649
Comau Robotics Product Instruction
650
Comau Robotics Product Instruction
651
Comau Robotics Product Instruction
Cause: The identifier supplied to the database built-in routiner is not correct
Remedy: – Check the value supplied
40131 <prog_id>(<line_num>): the database is protected
Cause: Operation cannot be performed as database is protected
Remedy: – Check the access rights to the database
40132 <prog_id>(<line_num>): user type DB not currently supported
Cause: The ability to create user database of a user defined type is currently not supported
Remedy: – Check the state of implementation in future system software versions.
40133 <prog_id>(<line_num>): bad variable datatype
Cause: The datatype of the variable supplied to DB_GET_VAR is incorrect
Remedy: – Check the field and the specific datatype
40134 <prog_id>(<line_num>): I/O point does not exist
Cause: The being indexed I/O point does not exist
– Check the correctness of the name and of the configuration of the I/O point and the
Remedy:
associated device
40135 <prog_id>(<line_num>): I/O points not configured
Cause: No I/O point is currently configured
Remedy: – I/Os need to be configured.
40136 <prog_id>(<line_num>): system variable <variable> is deprecated
Cause: Program being translated contains deprecated predefined variables
Remedy: – Remove or change the access to the specified variable
40137 <prog_id>(<line_num>): statement disallowed in DRIVE OFF/STANDBY
Cause: This statement can be executed only when the DRIVES are ON
Remedy: – Check that the DRIVES are ON before executing this statement
40138 <prog_id>(<line_num>): statement disallowed in HOLD
Cause: This statement can be executed only when the robot is NOT HELD
Remedy: – Check that the robot is NOT held before executing this statement
40139 <prog_id>(<line_num>): Device not found
Cause: The indicated device is not present in the configuration
Remedy: – Check the name of the device.
40140 <prog_id>(<line_num>): I/O not configured
Cause: The handling of I/Os in inactive
Remedy: – Check the I/O configuration
40141 <prog_id>(<line_num>): region already enabled
Cause: This error occurs when the IR_SWHITCH(ON) is called twice on the same $IR_TBL element
Remedy: – Remove the second call to the IR_SWITCH(ON).
40142 <prog_id>(<line_num>): region already disabled
This error occurs when the IR_SWITCH(OFF) is called on a $IR_TBL element which is already
Cause:
available
– Review the program in order to determine the cause of the error (for example two
Remedy:
consecutive calls to the IR_SWITCH(OFF))
40143 <prog_id>(<line_num>): active motion on axis
652
Comau Robotics Product Instruction
The axis on which the motion is required via the predefined routine ARM_MOVE is already
Cause:
executing a movement issued via a MOVE statement
– Check the flow of the program calling the routine.
Remedy: Eventually add a test on the speed threshold of the axis
$CRNT_DATA[num_arm].C_AREAL_2D[4,num_asse]
40144 <prog_id>(<line_num>): predefined routine already active
Cause: The ARM_MOVE predefined routine is being executed on the requested arm
– Verify the flow of the program which calls the routine, checking that the value of the
Remedy:
$CRNT_DATA[arm_num].C_ALONG_1D[2] is 0
40145 <prog_id>(<line_num>): No CATCH for RAISE value
Cause: A RAISE was issued but the specified value is not being caught
Remedy: – Check that the value being raised is caught.
40146 <prog_id>(<line_num>): RETRY/SKIP only valid in CATCH
Cause: RETRY/SKIP are only valid when the error has been caught
Remedy: – Check that the statement is within a TRY clause
40147 <prog_id>(<line_num>): RETRY limit exceeded
Cause: RETRY can only be used a limited number of times within the same CATCH
Remedy: – Check the number of times that RETRY has been attempted.
653
Comau Robotics Product Instruction
654
Original instructions
Made in Comau