Professional Documents
Culture Documents
See also
Declaration Parts
Procedures
Functions
Predefined Functions
Data Lists
System Specification
Definition Conventions
Predefined Identifiers
Movement Statements
I/O Statements
©·2000·IRF·EFR·Dortmund
Lexical Elements
General Remarks
- Word symbols
- Identifiers
- Predefined Identifiers
- Characterstrings
- Numbers
Character Set
Letters
Letter =
"a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" |
"l" | "m" |
"n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" |
"y" | "z" |
"A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" |
"L" | "M" |
"N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X"
| "Y" | "Z" |
"_".
Example:
Digits
Digit =
"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9".
See also
Definition Conventions
meta symboldescription
=defined as
|alternative
.end of definition
(x|y)select x or y
Identifiernonterminal symbol
Example:
RealConstant =
DecimalConstant Exponent |
DecimalConstant "." { Digit } [ Exponent ] |
"." DecimalConstant [ Exponent ].
ProgramHead =
"PROGRAM" ProgramIdentifier ";" CompilerDirective.
RoutineList =
{
ProcedureDeclaration [ ";" ] |
ExternalProcedureDeclaration ";" |
FunctionDeclaration [ ";" ] |
ExternalFunctionDeclaration ";" |
ProcessDeclaration [";"]
}.
Example:
PROGRAM test;
BEGIN
{ procedure statements }
BEGIN
{ procedure statements }
BEGIN
WRITELN('end of test');
ENDPROGRAM;
ImportDeclaration =
"FROM" ProgramIdentifier "IMPORT"
( "ALL" | ImportIdList ) ";".
ImportIdList =
Identifier { "," Identifier }.
ExportDeclaration =
"EXPORT"
( "ALL" | ExportIdList )
[ "TO" ProgramIdList ] ";".
ExportIdList =
Identifier { "," Identifier }.
ProgramIdList =
ProgramIdentifier { "," ProgramIdentifier }.
Example:
PROGRAM discharge;
EXPORT f1;
{ "f1" exported }
POSE: f1;
INT: i,discharge_x;
PROCEDURE schedule();
BEGIN
ENDPROC;
BEGIN
discharge_x := 99;
x := 0;
schedule();
WRITE(x);
ENDPROGRAM.
Example:
PROGRAM dummy;
BEGIN
{ ... }
operation();
{ ... }
ENDPROGRAM;
©·2000·IRF·EFR·Dortmund
Declaration Parts
ProgramDeclarationPart =
{
DeclarationPart |
ImportDeclaration |
ExportDeclaration |
DataListSpecification |
RobotSpecification |
"INTERRUPT" { InterruptDeclaration } |
DeclarationPart =
(
"CONST" { ConstantDefinition } |
"TYPE" { TypeDeclaration } |
"VAR" { VariableDeclaration }
)
{
"CONST" { ConstantDefinition } |
"TYPE" { TypeDeclaration } |
"VAR" { VariableDeclaration }
}.
Constant Definition
Constant Definition
ConstantDefiniton =
TeachConstantDefinition | UsualConstantDefinition.
UsualConstantDefinition =
ConstantIdList =
ConstantIdentifier { "," ConstantIdentifier }.
Example:
REAL : pi := 3.1415926;
TeachConstantDefinition =
TeachType ":" TeachConstantIdList ";".
TeachConstantIdList =
TeachConstantIdentifier
{ "," TeachConstantIdentifier }.
Formal Parameters
FormalParameter =
[ "IN" | "OUT" | "INOUT" ] ParameterSpecification
{ ";"
[ "IN" | "OUT" | "INOUT" ] ParameterSpecification
}.
ParameterSpecification =
ParameterType ":" ParameterIdList |
ConformantScheme ":" Identifier.
ParameterType =
Type |
TeachType |
SignalType |
SemaphoreType .
ParameterIdList =
Identifier { "," Identifier }.
ConformantScheme =
"ARRAY" "[" IndexTypeSpecList "]" "OF" Type.
IndexTypeSpecList =
IndexTypeSpecification { "," IndexTypeSpecification }.
IndexTypeSpecification =
TypeIdentifier ":"
ConformantParameter ".." ConformantParameter.
ConformantParameter = Identifier.
Note:
compatible.
Note:
parameter compatibility:
-if both types are ARRAY types and if they are either of
the same type or in the case of a formal conformant
scheme if the numbers of dimensions are identical and
the types of the elements are assignment compatible
for input parameters (call by value) and parameter
compatible for in/output and output parameters (call by
reference). And if the indices are assignment
compatible in any case.
-if both types are LIST types and if there elements are
paramater compatible.
-if both types are TEACH types and if the proper types
of these teach types are parameter compatible.
-if both types are INPUT types and if the types of these
signal types are parameter compatible.
Example:
PROGRAM test;
TYPE
VAR
array_type1: f1;
array_type2: f2;
VAR INT: i;
BEGIN
ENDFOR;
ENDPROC;
BEGIN
init (f1);
init (f2);
ENDPROGRAM {test};
©·2000·IRF·EFR·Dortmund
Constants
RSXYZYXZ
ZYZ2ZYXVANG
QUAT
Integer Constants
IntegerConstant =
DecimalConstant |
BinaryConstant |
OctalConstant |
HexadecimalConstant.
DecimalConstant:
DecimalConstant =
Digit { Digit }.
Note:
BinaryConstant:
BinaryConstant =
"2#" ( "0" | "1" | "_" )
{ "0" | "1" | "_" }.
OctalConstant:
OctalConstant =
"8#" ( "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "_" )
{ "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "_" }.
HexadecimalConstant:
HexadecimalConstant =
"16#" ( Digit | "A" | "B" | "C" | "D" | "E" | "F" | "_" )
{ Digit | "A" | "B" | "C" | "D" | "E" | "F" | "_" }.
Note:
Real Constants
RealConstant =
DecimalConstant Exponent |
DecimalConstant "." { Digit } [ Exponent ] |
"." DecimalConstant [ Exponent ].
Exponent =
( "E" | "e" ) ["+" | "-"] DecimalConstant.
Example:
5.
100.07
.3
23.4E5
10.2E-3
CharacterString =
"'" { Any-Character-Except-"'" | "''" } "'".
Note:
Example:
'alarm'
'abc''def'
Record Constants
CallOrRecord =
Object "(" [ ValueList ] ")".
ValueList =
Expression { "," Expression }.
Example:
Example :
ADD_JOINT( -90.0 ) )
Boolean Constants
Range of Value
and 'TrueZero'
Note:
Procedures
IRL Procedures
ProcedureDeclaration =
"PROCEDURE" ProcedureIdentifier
"(" [ FormalParameter ] ")" ";"
[ DeclarationPart ] "BEGIN" StatementBlock "ENDPROC".
External Procedures
ExternalProcedureDeclaration =
"EXTERNALPROCEDURE" ProcedureIdentifier
"(" [ FormalParameter ] ")".
Functions
IRL Functions
FunctionDeclaration =
"FUNCTION" FunctionIdentifier
"(" [ FormalParameter ] ")" ":" PredefinedType ";"
[ DeclarationPart ] "BEGIN" StatementBlock "ENDFCT".
{declaration part}
BEGIN
{statements}
IF x>0.0 THEN
RETURN 1;
ENDIF;
IF x<0.0 THEN
RETURN -1;
ENDIF;
RETURN 0;
ENDFCT;
External Functions
ExternalFunctionDeclaration =
"EXTERNALFUNCTION" FunctionIdentifier
"(" [ FormalParameter ] ")" ":" PredefinedType.
Predefined Functions
ABS ACOSANGLEX
ANGLEYANGLEZANGLEZ2
APPENDCASINATAN2
CHRCOMPARECONCATS
COSCROSSDELETEC
DOTEOFEOL
EXTRACTSFLOATGETCHR
INVLENGTHLOCATE
ORDORIQUATORIRS
ORIVANGORIXYZORIYXZ
ORIZYXORIZYZ2QUATA
QUATBQUATCQUATD
ROTANGLEROTAXISROUND
SETCHRSINSIZE
SQRTTANTRAFO
TRAFOINVTRUNC
©·2000·IRF·EFR·Dortmund
Parallel Processes
ProcessDeclaration =
"PROCESS" ProcessIdentifier
"(" [ FormalParameter ] ")" [ IntegerConstant ] ";"
DeclarationPart "BEGIN" StatementBlock "ENDPROCESS".
Data Lists
World Coordinates+ConfigurationROBTARGET
World CoordinatesPOSE
Joint CoordinatesMAIN_JOINT
Add. AxisADD_JOINT
BooleanBOOL
IntegerINT
RealREAL
TextSTRING
DataListSpecification =
"IMPORT" "DATALIST" Expression ";".
Note:
System Specification
SystemSpecification=
[ "SYSTEM_SPECIFICATION" Expression ";" ].
CONST
INT: R_NTURNS := 2;
{ maximum number of joints in a cell which can rotate
more than 360 degrees }
INT: R_NADDJ := 1;
{ maximum number of additional joints in a cell; see
type ADD_JOINT }
INT: R_NJ := 7;
{number of joints; must correspond with type JOINT}
STRING : RS := 'RS';
INT :R_DEVICE_NUMBER := 4;
INT :R_PROCESS_READY := 0;
INT :R_PROCESS_RUNNING := 1;
INT :R_PROCESS_STOPPED := 2;
INT :R_PROCESS_BLOCKED := 3;
TYPE
RECORD
ENDRECORD = MAIN_JOINT;
RECORD
REAL: AA1;
ENDRECORD = ADD_JOINT;
RECORD
MAIN_JOINT: M_JOINT;
ENDRECORD = JOINT;
RECORD
POSE: PSE;
INT: STATUS;
ADD_JOINT: A_JOINT;
RECORD
ENDRECORD = D_SPEC_TYPE;
RECORD
REAL:R_ACC;
ARRAY[1..R_NJ] OF REAL:R_ACC_PTP;
REAL:R_C_PTP;
REAL:R_C_CP;
REAL:R_C_SPEED;
JOINT:R_JOINT_ACT;
ROBTARGET:R_ROBTARGET_ACT;
ROBTARGET:R_ROBTARGET_START;
ROBTARGET:R_ROBTARGET_END;
ROBTARGET:R_ROBTARGET_INTER;
REAL:R_SPEED_ACT;
REAL:R_SPEED;
ARRAY[1..R_NJ] OF REAL:R_SPEED_PTP;
REAL:R_SPEED_ORI;
POSE:R_BASE;
POSE:R_TOOL;
ENDRECORD = R_SPEC_TYPE;
ROBOT ROBOT_AND_POSITIONER :=
ROBTARGET(
POSE(POSITION(100.0,1000.0,0.0),ORIRS
(90.0,0.0,90.0)),
0,[0,0],0.0),
ROBTARGET(
POSE(POSITION(100.0,1000.0,0.0),ORIRS
(90.0,0.0,90.0)),
0,[0,0],0.0),
ROBTARGET(
POSE(POSITION(100.0,1000.0,0.0),ORIRS
(90.0,0.0,90.0)),
0,[0,0],0.0),
ROBTARGET(
POSE(POSITION(100.0,1000.0,0.0),ORIRS
(90.0,0.0,90.0)),
0,[0,0],0.0),
POSE(POSITION(0.0,0.0,0.0),ORIRS(0.0,0.0,0.0))
POSE(POSITION(0.0,0.0,-100.0),ORIRS(90.0,0.0,0.0)));
R_SPEC_TYPE( 50.0,
[100.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0],
50.0, 250.0, 50.0,
(((200.0,200.0,10.0),ORIXYZ(90.0,0.0,90.0)),
0,[0,1],180.0),
(((200.0,200.0,10.0),ORIXYZ(90.0,0.0,90.0)),
0,[0,1],180.0),
(((200.0,200.0,10.0),ORIXYZ(90.0,0.0,90.0)),
0,[0,1],180.0),
(((200.0,200.0,10.0),ORIXYZ(90.0,0.0,90.0)),
0,[0,1],180.0),
((0.0,0.0,0.0),ORIRS(0.0,0.0,0.0) )
((0.0,0.0,-200.0),ORIRS(0.0,0.0,90.0) ) );
VAR
ARRAY[1..R_DEVICE_NUMBER] OF D_SPEC_TYPE :
D_DEVICES :=
]; { all devices }
©·2000·IRF·EFR·Dortmund
See also
Predefined Variables
Comments
Comment =
"{" { CommentCharStream | Comment } "}"
CommentCharStream =
{ Any-Character-Exept-"{"-or-"}" }.
Word Symbols
ACCACC_PTPACT_ROB
ADAX_CONTROLALLAND
ARRAYATBRAKE
BEGINCANCELCASE
C_PASSCIRCLECLOSE
CONSTCONTINUEC_CP
C_PTPC_SPEEDDATALIST
DECLDECLOFFDECLON
DECLSYSDEFAULTDELAY
DEVICEDISABLEDIV
DODURATIONELSE
ENABLEENDCASEENDERROR
ENDFCTENDFORENDIF
ENDPROCENDPROCESSENDPROGRAM
ENDRECORDENDWHILEERROR
EXOREXPORTEXTERNALFUNCTION
EXTERNALPROCEDUREFALSEFAST
FILEFORFROM
FUNCTIONGETSTATUSGOTO
HALTHIGHIF
IMPORTININOUT
INPUTINTERRUPTINTO
LINLISTLISTADD
LISTDELLISTINDEXLISTINS
LISTLENGTHLOCKLOW
MODMOVEMOVE_INC
NOTOFOFF
ONOPENOR
OUTOUTPUTPATH
PAUSEPERMANENTPROCEDURE
PROCESSPROGRAMPTP
PULSEREADREADLN
READRACRECORDREPEAT
RESUMERETURNROBOT
SECSEMAPHORESEMA_SIGNAL
SEMA_WAITSHAREDSPEED
SPEED_ORISPEED_PTPSTANDARD_IN
STANDARD_OUTSTARTSTEP
STOPSYNACTSYSTEM_SPECIFICATION
TEACHTHENTIME
TIMEOUTTOTRUE
TYPEUNLOCKUNTIL
VARWAITWHEN
WHILEWOBBLEWRITE
WRITELNWRITERAC
©·2000·IRF·EFR·Dortmund
Identifier =
ProgramIdentifier =Identifier.
TeachConstantIdentifier =Identifier.
ConstantIdentifier =Identifier.
StructuredTypeIdentifier =Identifier.
SimpleTypeIdentifier =Identifier.
StandardTypeIdentifier =Identifier.
SystemTypeIdentifier =Identifier.
TeachTypeIdentifier =Identifier.
SignalTypeIdentifier =Identifier.
VariableIdentifier =Identifier.
SignalIdentifier =Identifier.
ProcedureIdentifier =Identifier.
FunctionIdentifier =Identifier.
TypeIdentifier =Identifier.
LabelIdentifier =Identifier.
ComponentIdentifier =Identifier.
©·2000·IRF·EFR·Dortmund
Predefined Identifiers
System Constants and System Variables
Functions
Channels
Constants
Types
©·2000·IRF·EFR·Dortmund
resultparameters
APPENDCSTRINGSTRING, CHAR
Appends the character c to the end of the string s.
COMPAREINTSTRING, STRING
Compares string s1 with string s2. Returns the index of
the first character that differs. If the two strings are
identical 0 is returned.
CONCATSSTRINGSTRING, STRING
Appends the characters of the string s2 to the end of
the string s1.
LOCATEINTSTRING, STRING
Checks if string s2 is a substring of string s1. If it is the
first index of s1 where s2 starts is returned. If not 0 is
returned.
Predefined Variables
Variablewrite protection
nametype|meaning
R_ACT_ROBR_SPEC_TYPEnactual robot
Predefined Constants
constantpredefined
nametypefixed valuemeaning
R_NJINTnumber of joints
XYZSTRING'XYZ'descriptions of orientations
ZYXSTRING'ZYX'orientations, write
VANGSTRING'VANG'statements
QUATSTRING'QUAT'
R_PROCESS_RUNNINGINT1process running
R_PROCESS_STOPPEDINT2process stopped
R_PROCESS_BLOCKEDINT3process blocked
componentCSRwrite protection
namenametype|meaning
R_ACCREALnacceleration (path)
OF REAL
R_C_PTPREALnpath smoothing:
axis distance (factor, %)
R_C_CPREALnpath smoothing:
distance to the intermediate point
R_C_SPEEDREALnpath smoothing:
(% of programmed speed)
R_ROBTARGET_ACT.PSE
R_ROBTARGET_ENDROBTARGETyrobot position to be
reached at the end of theactual movement statement
R_SPEEDR_PSTUREALnspeed (path)
OF REAL
R_SPEED_ORIREALnorientation speed
resultparameters
ABSREALREALAbsolut value
INTINT -"-
CROSSPOSITIONPOSITION, POSITION
Cross or Vector product
DOTREALPOSITION, POSITION
Inner or Scalar product
FLOATREALINTConvert
INVPOSEPOSEInverse of POSE
integer value
SQRTREALREALSquare root
resultparameters
EOFBOOLFileTypeEnd of file
Types
INTREAL
CHARSTRINGTEXT
BOOL
ORIENTATIONPOSITION
POSEROBTARGET
ADD_JOINTMAIN_JOINT
JOINT
©·2000·IRF·EFR·Dortmund
StandardType = StandardTypeIdentifier.
String Type
Text Type
See also
©·2000·IRF·EFR·Dortmund
Simple Type
SimpleType = SimpleTypeIdentifier.
Boolean Type
Character Type
Integer Type
Real Type
Array Types
ArrayTypeDescription =
"ARRAY" "[" IndexBoundList "]" "OF" Type.
IndexBoundList =
IndexBound { "," IndexBound }.
IndexBound =
Expression ".." Expression.
Example:
TYPE
List Types
ListTypeDescription =
"LIST" "OF" Type.
Example:
TYPE
SystemType = SystemTypeIdentifier.
File Types
FileTypeDescription =
"FILE" "OF" Type.
- Channels
©·2000·IRF·EFR·Dortmund
Signal Types
SignalTypeDeclaration =
SignalTypeDescription ":" SignalTypeIdentifier.
SignalTypeDescription =
( "INPUT" | "OUTPUT" ) SimpleType.
SignalType =
SignalTypeIdentifier |
SignalTypeDescription.
©·2000·IRF·EFR·Dortmund
Example:
TYPE
RECORD
REAL:R_ACC;
ARRAY[1..R_NJ] OF REAL:R_ACC_PTP;
REAL:R_C_PTP;
REAL:R_C_CP;
REAL:R_C_SPEED;
JOINT:R_JOINT_ACT;
ROBTARGET:R_ROBTARGET_ACT;
ROBTARGET:R_ROBTARGET_START;
ROBTARGET:R_ROBTARGET_END;
ROBTARGET:R_ROBTARGET_INTER;
REAL:R_SPEED_ACT;
REAL:R_SPEED;
ARRAY[1..R_NJ] OF REAL:R_SPEED_PTP;
REAL:R_SPEED_ORI;
POSE:R_BASE;
POSE:R_TOOL;
ENDRECORD = R_SPEC_TYPE;
©·2000·IRF·EFR·Dortmund
StructuredTypeDeclaration =
StructuredTypeDescription ":" StructuredTypeIdentifier
StructuredTypeDescription =
RecordTypeDescription |
ArrayTypeDescription |
ListTypeDescription |
FileTypeDescription.
See also
Record Types
Array Types
List Types
File Types
Teach Types
Signal Types
Semaphore Types
©·2000·IRF·EFR·Dortmund
Type Declaration
TypeDeclaration =
StructuredTypeDeclaration |
TeachTypeDeclaration |
SignalTypeDeclaration |
SemaphoreTypeDeclaration.
Type =
PredefinedType |
StructuredTypeIdentifier |
StructuredTypeDescription.
PredefinedType =
SimpleType |
StandardType |
SystemType.
See also
Simple Type
Standard Types
System Types
©·2000·IRF·EFR·Dortmund
Record Types
RecordTypeDescription =
"RECORD" ComponentList "ENDRECORD".
ComponentList =
Type ":" ComponentIdList
{ ";" Type ":" ComponentIdList }.
ComponentIdList =
ComponentIdentifier { "," ComponentIdentifier }.
Example:
TYPE
RECORD
REAL: current;
ENDRECORD = test_type;
©·2000·IRF·EFR·Dortmund
See also
©·2000·IRF·EFR·Dortmund
TYPE
RECORD
POSITION: POS;
ORIENTATION: ORI
ENDRECORD = POSE;
VAR
ORIENTATION: ori;
POSE: f,g;
BEGIN
f.POS := first_pos;
f.ORI := ori;
g := POSE (next_pos,f.ORI);
next_pos := f.POS;
ori := g.ORI;
©·2000·IRF·EFR·Dortmund
VAR
ORIENTATION: ori;
POSITION: n1,o1,a1,v;
REAL: a,b,c,d;
BEGIN
ori := ORIRS(a,b,c);
ori := ORIXYZ(a,b,c);
ori := ORIYXZ(a,b,c);
ori := ORIZYX(a,b,c);
ori := ORIZYZ2(a,b,c);
ori := ORIVANG(v,a);
ori := ORIQUAT(a,b,c,d);
ori := ORIMAT(n1,o1,a1);
VAR
ORIENTATION: ori;
POSITION: n1,o1,a1,v;
REAL: r;
BEGIN
r := ANGLEX(RS,ori);
r := ANGLEX(XYZ,ori);
r := ANGLEX(YXZ,ori);
r := ANGLEX(ZYX,ori);
r := ANGLEY(RS,ori);
r := ANGLEY(XYZ,ori);
r := ANGLEY(YXZ,ori);
r := ANGLEY(ZYZ2,ori);
r := ANGLEY(ZYX,ori);
r := ANGLEZ(RS,ori);
r := ANGLEZ(XYZ,ori);
r := ANGLEZ(YXZ,ori);
r := ANGLEZ(ZYZ2,ori);
r := ANGLEZ(ZYX,ori);
r := ANGLEZ2(ZYZ2,ori);
v := ROTAXIS(ori);
r := ROTANGLE(ori);
r := QUATA(ori);
r := QUATB(ori);
r := QUATC(ori);
r := QUATD(ori);
a1 := VECTORA(ori);
n1 := VECTORN(ori);
o1 := VECTORO(ori);
ENDPROGRAM;
-180 <= c <= 180 - third rotation about the new z-axis
Example:
VAR
REAL: r;
BEGIN
ori1 := ORIRS(90,90,0);
ori2 := ORIXYZ(90,90,0);
r := ANGLEZ(RS,ORIZYZ2(90,90,90));
ENDPROGRAM;
Note:
Robot Target
TYPE
RECORD
POSE: PSE;
INT: STATUS;
ADD_JOINT: A_JOINT;
ENDRECORD = ROBTARGET;
©·2000·IRF·EFR·Dortmund
Teach Types
TeachTypeDeclaration =
TeachTypeDescription ":" TeachTypeIdentifier.
TeachTypeDescription =
( "TEACH" | "PERMANENT" ) PredefinedType.
TeachType =
TeachTypeIdentifier |
TeachTypeDescription.
©·2000·IRF·EFR·Dortmund
Joints
Example:
TYPE
RECORD
MAIN_JOINT: M_JOINT;
ADD_JOINT : A_JOINT
ENDRECORD = JOINT;
©·2000·IRF·EFR·Dortmund
Program Flow
ProgramflowStatement =
GotoStatement |
ConditionalBranchStatement |
CaseStatement |
LoopStatement |
WaitStatement |
PauseStatement |
ReturnStatement |
ProgramHaltStatement |
InterruptStatement |
ResumeStatement |
SynactStatement.
See also
Goto Statement
Case Statement
Wait Statement
Pause Statement
Return Statement
Interrupt Statement
Resume Statement
Synact Statement
©·2000·IRF·EFR·Dortmund
Goto Statement
GotoStatement =
"GOTO" LabelIdentifier.
For Loop
ForStatement =
"FOR" Object ":=" Expression "TO" Expression
[ "STEP" Expression ]
StatementBlock "ENDFOR".
Example:
FOR i := 1 TO 10
ENDFOR;
©·2000·IRF·EFR·Dortmund
Case Statement
CaseStatement =
"CASE" Expression "OF"
CaseList [ "DEFAULT" [ ":" ] StatementBlock ]
"ENDCASE".
CaseList =
Case { ( "|" | "WHEN" ) Case }.
Case =
[ CaseConstantList ":" StatementBlock ].
CaseConstantList =
CaseConstant { "," CaseConstant }.
CaseConstant =
Expression.
Example:
CASE workpiece OF
WHEN 0:length := 1;
WHEN 1,6:length := 5;
DEFAULT: length := 0;
ENDCASE;
©·2000·IRF·EFR·Dortmund
ConditionalBranchStatement =
"IF" Expression
"THEN" StatementBlock
[ "ELSE" StatementBlock ]
"ENDIF".
Example:
IF x > 1
THEN
y := 50;
z := 20;
ELSE
y := 30;
ENDIF;
©·2000·IRF·EFR·Dortmund
Procedure Call
ProcedureCall =
ProcedureIdentifier "(" [ ValueList ] ")".
While Loop
WhileStatement =
"WHILE" Expression StatementBlock "ENDWHILE".
Example:
i := 1;
WHILE i<=10
i := i+1;
ENDWHILE;
©·2000·IRF·EFR·Dortmund
Repeat Loop
RepeatStatement =
"REPEAT" StatementBlock "UNTIL" Expression.
Example:
i := 1;
REPEAT
i := i+1;
UNTIL i>10;
©·2000·IRF·EFR·Dortmund
Resume Statement
ResumeStatement =
"RESUME".
Example:
PROGRAM ResumeDemo;
VAR
INT:ErrorNumber;
PROCEDURE Int_Gripper();
BEGIN
...
ErrorNumber:=1;
RESUME;
ENDPROC;
BEGIN
INTERRUPT ON 41;
INTERRUPT OFF;
CASE ErrorNumber OF
WHEN 0: ...
WHEN 1: ...
...
ENDCASE;
ENDPROGRAM
©·2000·IRF·EFR·Dortmund
Return Statement
ReturnStatement =
"RETURN" [ Expression ].
©·2000·IRF·EFR·Dortmund
I/O Statements
Signals
Example:
CONST
VAR
BEGIN
Write Statement
WriteStatement =
( "WRITE" | "WRITELN" ) "(" FormatList ")" |
"WRITERAC" "(" Expression "," ElementNumber ","
ValueList ")".
FormatList =
[ OutputValue
[ ":" Expression
[ ":" Expression
[ ":" Expression
]]]
{ "," OutputValue
[ ":" Expression
[ ":" Expression
[ ":" Expression
]]]
}
].
OutputValue = Expression.
ElementNumber = Expression.
WRITE(orivar:4:2:XYZ);
WRITE(orivar:ZYX);
WRITE(orivar);
WRITE(orivar:2:1:VANG);
WRITE(orivar:3:1:QUAT);
- Channels
Read Statement
ReadStatement =
( "READ" | "READLN" ) "(" ObjectList ")" |
"READRAC" "(" Expression "," ElementNumber ","
ObjectList ")".
ObjectList =
Object { "," Object }.
Channels
KEYBOARD
PANEL
PRINTER
SCREEN
TTY
Open Statement
OpenStatement =
"OPEN" "(" Object "," Expression ","
Expression "," Object ")".
Close Statement
supported.
CloseStatement =
"CLOSE" [ "(" Expression ")" ].
File_I_O_Statement =
OpenStatement |
CloseStatement |
WriteStatement |
ReadStatement.
Pulse Statement
PulseStatement =
"PULSE" Object ( "HIGH" | "LOW" ) "DURATION" ":="
Expression.
Example:
...
...
...
©·2000·IRF·EFR·Dortmund
Expressions
Expression =
"+" Expression |
"-" Expression |
"NOT" Expression |
Expression Operator Expression |
Object |
IntegerConstant |
RealConstant |
BooleanConstant |
CharacterString |
CallOrRecord |
Precedence |
ArrayInit.
Precedence =
"(" [ ValueList ] ")".
Arithmetical Expressions
Logical Expressions
Geometric Expressions
Interpretation of Expressions
*, / , MOD, DIV, @
+, -
=, <>
AND
Arithmetical Expressions
INTREALREAL
REALINTREAL
REALREALREAL
REALCHARREAL
CHARREALREAL
Logical Expressions
BOOLINTnot allowed.
INTBOOLnot allowed
Geometric Expressions
nroperand1operand2resultshort description
operator
2POSITION-POSITIONPOSITIONsubtraction of positions
4POSITION*REALPOSITIONmultiplication of all
add3= add1.
Examples:
RS @ Spose1' = Rpose2
RS = Rpose2 @ INV(Spose1')
RS = Rpose2 @ INV(Rpose1)
VAR
INT: i;
BEGIN
usercircle[1] := R_ROBTARGET_ACT;
FOR i := 2 to 12
record constant }
ENDFOR;
ENDPROGRAM;
VAR
INT: i;
BEGIN
usercircle[1] := R_ROBTARGET_ACT;
FOR i := 2 to 12
usercircle[i] := usercircle[i-1];
usercircle[i].PSE.POS :=
usercircle[i-1].PSE.POS + pos1;
ENDFOR;
ENDPROGRAM;
K1 := K2
p1 @ POSITION(p2)
p1 @ p2
operandoperandcomponent of
robtarget
ORIENTATIONORIENTATIONORIENTATIONcombining two
rotations to a new rotation (see example g))
ORIENTATIONPOSITIONPOSITIONrotation of a vector
POSITIONORIENTATIONPOSEPOSE-Generator
POSITIONPOSITIONPOSITIONaddition of vectors
POSITIONINV(POSITION)POSITIONdifference of vectors
©·2000·IRF·EFR·Dortmund
Operators
Operator =
"*" | "/" | "DIV" | "MOD" | "@" |
"+" | "-" |
"<" | ">" | "<=" | ">=" |
"=" | "<>" |
"AND" |
"OR" | "EXOR".
arithmetical operators:
+addition
/division
*multiplication
DIVinteger division
MODmodulo function
boolean operators:
ANDlogical and
ORlogical or
EXORexclusive or
logical operators:
=equal
>greater
<less
<>not equal
>=greater equal
<=less equal
geometric operators:
+addition
-subtraction
/division
*multiplication
Function Calls
CallOrRecord =
Object "(" [ ValueList ] ")".
ValueList =
Expression { "," Expression }.
Example:
a:=SIN(X);
b:=DISTANCE(point_1,point_2);
c:=init();
©·2000·IRF·EFR·Dortmund
Statements
Construction of Statements
Statement =
[
Assignment |
ProcedureCall |
ProgramflowStatement |
MovementStatement |
I_O_Statement |
ListControlStatement |
ParallelProcessStatement
].
StatementBlock =
{ LabelIdentifier ":" | Statement ";" }.
Assignment
Assignment =
Object ":=" Expression.
= = no typeconversion
x = typeconversion
- = not allowed
REALBOOLINTCHAR
of expressionREAL=---
BOOL-=x-
INTxx=x
CHARx-x=
POSITIONORIENTAT.POSEROBTARGET
of expressionPOSITION=-x2x2
ORIENTAT.-=x2x2
POSEx1x1=x2
ROBTARGETx1x1x1=
-if both types are LIST types and if the types of the
elements are assignment compatible. After the
assignment the object list has as many elements as the
list in the right hand side expression had before.
-if one or both types are TEACH types and if the proper
types of these teach types are assignment compatible.
Object:=Expression
type2INPUT type1
OUTPUT type2type1
Movement Statements
MovementStatement =
LinearMovement |
PointToPointMovement |
CircleMovement |
BrakeStatement.
LinearMovement =
( "MOVE" | "MOVE_INC" ) "LIN" ToPoint
ContinuePathParameter.
PointToPointMovement =
( "MOVE" | "MOVE_INC" ) "PTP" ToPoint
PointToPointParameter.
CircleMovement =
( "MOVE" | "MOVE_INC" ) "CIRCLE" Circle
ContinuePathParameter.
ToPoint =
Expression | Path.
Circle =
Expression "," Expression | Path.
Path =
"PATH" [ Expression ":" ]
( Object "[" [ IndexBound ] "]" |
"(" ValueList ")" ).
Note:
movement.
Path smoothing:
Additional parameters:
PointToPointParameter =
[ "ACT_ROB" ":=" Expression ]
{
"C_PTP" [ ":=" Expression] |
"C_PASS" |
"SPEED_PTP" [ ":=" Expression ] |
"ACC_PTP" [ ":=" Expression ] |
"TIME" ":=" Expression |
"UNTIL" Expression
[ "ERROR" StatementBlock "ENDERROR" ] |
"ALTER_BY" ProcedureCall
}.
parameterdescription
CP additional parameters:
ContinuePathParameter =
[ "ACT_ROB" ":=" Expression ]
[ "ADAX_CONTROL" ":=" Expression ]
[ "DEVICE" ":=" Expression ]
{
"C_CP" [ ":=" Expression ] |
parameterdescription
Default: NO_ADAX_CONTROL
WOBBLEsuperimposed movement
Examples:
- movement statements:
VAR
BEGIN
ENDPROGRAM;
DECLOFF;
VAR
POSE:p3, p4;
BEGIN
LISTADD p4 TO listpath;
R_SPEED := 100.0;
0.8 (80%). }
Brake Statement
BrakeStatement =
"BRAKE" ["FAST"].
Pause Statement
PauseStatement =
"PAUSE" [ Expression ].
Example:
ProgramHaltStatement =
"HALT".
©·2000·IRF·EFR·Dortmund
Wait Statement
WaitStatement =
"WAIT"
( Expression "SEC" |
"FOR" Expression
[ "TIMEOUT" Expression "SEC"
[ "ERROR" StatementBlock "ENDERROR" ]
]
).
Example:
ParallelProcessStatement =
ProcessControlStatement |
VariableControlStatement |
GetStatusStatement |
SemaphoreControlStatement.
ProcessControlStatement =
StartStatement |
StopStatement |
ContinueStatement |
CancelStatement.
Starting a process
StartStatement =
"START" ProcessIdentifier "(" ValueList ")".
Stopping a process
StopStatement =
"STOP" [ ProcessIdentifier ].
Continuing a process
ContinueStatement =
"CONTINUE" ProcessIdentifier.
Terminating a process
CancelStatement =
"CANCEL" [ ProcessIdentifier ].
©·2000·IRF·EFR·Dortmund
ListControlStatement =
ListElementInsertionStatement |
ListElementAddingStatement |
ListElementDeletionStatement |
ListLengthStatement |
ListElementIndexStatement.
ListElementInsertionStatement =
"LISTINS" Expression "INTO" Object "AT" Expression.
ListElementAddingStatement =
"LISTADD" Expression "TO" Object.
ListElementDeletionStatement =
"LISTDEL" Expression "OF" Object.
ListLengthStatement =
"LISTLENGTH" "(" Object "," Object ")".
ListElementIndexStatement =
"LISTINDEX" "(" Object "," Expression "," Object ")".
SynactStatement =
"SYNACT" "WHEN" Expression "DO"
( Assignment | PulseStatement ) [ "DELAY" Expression ].
Example:
VAR
ROBTARGET: point_1;
...
BEGIN
...
...
ENDPROGRAM
©·2000·IRF·EFR·Dortmund
Semaphore Types
In COSIMIR/PCROB a SemaphoreTypeDescription
differs in the following way:
SemaphoreTypeDescription =
"SEMA" Identifier.
SemaphoreTypeDeclaration =
SemaphoreTypeDescription ":"
SemaphoreTypeIdentifier.
SemaphoreTypeDescription =
"SEMAPHORE" SimpleType.
SemaphoreType =
SemaphoreTypeIdentifier |
SemaphoreTypeDescription.
©·2000·IRF·EFR·Dortmund
SemaphoreControlStatement =
SemaphoreWaitStatement |
SemaphoreSignalStatement.
SemaphoreWaitStatement =
"SEMA_WAIT" "(" Object ["," Expression] ")".
SemaphoreSignalStatement =
"SEMA_SIGNAL" "(" Object ["," Expression] ")".
Binary Semaphores
Example:
...
VAR
POSE: p;
SENSORDATA: sendata;
...
read_sensor_data(sendata); .
p := pos_from_data(sendata); SEMA_WAIT a;
...
Integer Semaphores
Interrupt Statement
InterruptStatement = "INTERRUPT"
("ON" | "OFF" | "ENABLE" | "DISABLE" ) [ Expression ].
GetStatusStatement =
"GETSTATUS" "(" ProcessIdentifier "," Object ")".
IRL supports additional axes. These additional axes are controlled by the robot
controller and may be for example external devices like positioners or internal
devices like a linear axis (rail) the robot is mounted on. The joint values of these
devices are determined by the A_JOINT component (of type ADD_JOINT) of JOINT
or ROBTARGET variables.
IRL allows only PTP movements of additional axes but it enables the user to
synchronize the movements of the robot and the additional axes in time as well as
kinematically.
CONST
INT :R_DEVICE_NUMBER := 4;
INT :ADAX_IS := 1; { Additional axes starting the kinematical chain; e.g. a rail }
TYPE
RECORD
ENDRECORD = D_SPEC_TYPE;
VAR
ARRAY[1..R_DEVICE_NUMBER] OF D_SPEC_TYPE :
D_DEVICES :=
rail }
]; { all devices }
ROBOT GROUP_1 :=
R_SPEC_TYPE(
...
...
);
ROBOT GROUP_2 :=
R_SPEC_TYPE(
...
...
);
ROBOT POSITIONER_1 :=
R_SPEC_TYPE(
...
[ 3 {2 axis positioner},
...
);
ROBOT POSITIONER_2 :=
R_SPEC_TYPE(
...
[ 4 {3 axis positioner},
...
);
Using these definitions we can build the following example, that uses multitasking
to load and unload the two positioners and to do some welding. Task A does the
welding, Task B loads and unloads positioner 1 and Task C (not listed) loads and
unloads positioner 2:
SEMA_WAIT positioner_2_loaded;
weld(2); { do welding }
SEMA_SIGNAL positioner_2_done;
...
Switching between the groups is done by the R_ACT_ROB variable or the ACT_ROB
clause.
As the ADD_JOINT system data type comprises all additional axes in a cell, the
manufacturer of the robot controller has to document the assignment of the
components of the ADD_JOINT structure and the devices in the cell. This
assignment will be fixed. In a movement statement only those additional axes will
be moved, that belong to the actual group of devices.
Furthermore the manufacturer has to document the position and orientation of all
device "TCP" coordinate systems, that might be used for relative movements.
TCP_KEEP: The current position and orientation of the TCP in world coordinates is
kept. The addional axes are moved according to the ADD_JOINT component of
ToPoint or Circle. If the movement of the additional axes would move the TCP, the
robot's joints are moved to compensate for that.
TCP_KEEP_REL: The current position and orientation of the TCP relative to the
"TCP" coordinate system of the device given by DEVICE:=Expression is kept. Only
the ADD_JOINT component of ToPoint or Circle is considered for the movement.
This type of movement is useful to re-orient a workpiece on a positioner while
keeping the relative position of the tool towards the workpiece.
Example:
CONST
INT : R_DEVICE_NUMBER := 2;
TYPE
RECORD
...
...
ENDRECORD = R_SPEC_TYPE;
ROBOT
ROB_AND_POS := R_SPEC_TYPE(
...
...
);
VAR
ARRAY[1..R_DEVICE_NUMBER] OF D_SPEC_TYPE:
VAR
BEGIN
R_ACT_ROB := ROB_AND_POS;
{ Move the robot and the positioner to the starting position. No kinematical
synchronization }
{ Start welding, while moving the tool relative to the workpiece moved by the
positioner. The robot movement is kinematically synchronized with the movement
of the workpiece. }
start_weld(3.0);
ADAX_CONTROL:=DEVICE_REL
DEVICE:=2;
ROBTARGET(p3,0,[0,0],pos_p3)
ADAX_CONTROL:=DEVICE_REL
DEVICE:=2;
stop_weld();
©·2000·IRF·EFR·Dortmund
TYPE
VAR
POSITION: p;
REAL: x := -10.5;
BEGIN
p.X := x;
p.Z := 2.01;
p := (x,p.y*0.5,2.01);
p := POSITION(100.0,150.0,200.0);
x := p.X;
©·2000·IRF·EFR·Dortmund
Example:
TYPE
RECORD
ENDRECORD = D_SPEC_TYPE;
©·2000·IRF·EFR·Dortmund
RobotSpecification =
"ROBOT" Identifier ":=" CallOrRecord ";".
Objects
Object =
Identifier |
ArrayOrListElement |
RecordComponent.
RecordComponent =
Object "." ComponentIdentifier.
ArrayOrListElement =
Object "[" ArrayExpressionList "]".
ArrayExpressionList =
Expression { "," Expression }.
Example:
TYPE
RECORD
ROBTARGET: p;
REAL: current;
VAR
p1.PSE.POS.X{ x component of p1 }
door.p.PSE.POS
door.p.PSE.POS.X
door.current
©·2000·IRF·EFR·Dortmund
VariableControlStatement =
LockStatement |
UnlockStatement.
Locking variables
LockStatement =
"LOCK" Identifier { "," Identifier }.
Unlocking variables
UnlockStatement =
"UNLOCK" [ Identifier { "," Identifier } ].
Units
acceleration (path)[mm/(s*s)]
distance [mm]
angle [degree]
time [sec]