Document Name
stringclasses 11
values | URL
stringclasses 11
values | page_number
int64 1
1.26k
| full_text
stringlengths 65
18.2k
|
|---|---|---|---|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 907
|
2 Functions
2.77. NumToStr - Converts numeric value to string
RobotWare - OS
3HAC 16581-1 Revision: J
904
© Copyright 2004-2010 ABB. All rights reserved.
2.77. NumToStr - Converts numeric value to string
Usage
NumToStr ( Numeric To String ) is used to convert a numeric value to a string.
Basic examples
Basic examples of the function NumToStr are illustrated below.
Example 1
VAR string str;
str := NumToStr(0.38521,3);
The variable str is given the value "0.385" .
Example 2
reg1 := 0.38521;
str := NumToStr(reg1, 2\Exp);
The variable str is given the value "3.85E-01" .
Example 3
VAR dnum ex3 := 1234567890.123456;
str := NumToStr(ex3, 15\Exp);
The variable str is given the value "1.234567890123456E+09" .
Return value
Data type: string
The numeric value converted to a string with the specified number of decimals, with exponent
if so requested. The numeric value is rounded if necessary. The decimal point is suppressed
if no decimals are included.
Arguments
NumToStr (Val | Dval Dec [\Exp])
Val
Value
Data type: num
The numeric value to be converted.
Dval
Value
Data type: dnum
The numeric value to be converted.
Dec
Decimals
Data type: num
Number of decimals. The number of decimals must not be negative or greater than the
available precision for numeric values.
Continues on next page
2 Functions
2.77. NumToStr - Converts numeric value to string
RobotWare - OS
905
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
[\Exp]
Exponent
Data type: switch
To use exponent in return value.
Syntax
NumToStr’(’
[ Val ’:=’ ] <expression ( IN ) of num>
| [ Dval ’:=’ ] <expression ( IN ) of dnum> ’,’
[ Dec ’:=’ ] <expression ( IN ) of num>
[ \Exp ]
’)’
A function with a return value of the data type string .
Related information
For information about
See
String functions
Technical reference manual - RAPID overview , section
RAPID summary - String functions
Definition of string
string - Strings on page 1195
String values
Technical reference manual - RAPID overview , section
Basic characteristics - Basic elements
Continued
2 Functions
2.78. Offs - Displaces a robot position
RobotWare - OS
3HAC 16581-1 Revision: J
906
© Copyright 2004-2010 ABB. All rights reserved.
2.78. Offs - Displaces a robot position
Usage
Offs is used to add an offset in the object coordinate system to a robot position.
Basic examples
Basic examples of the function Offs are illustrated below.
See also More examples on page 907 .
MoveL Offs(p2, 0, 0, 10), v1000, z50, tool1;
The robot is moved to a point 10 mm from the position p2 (in the z-direction).
p1 := Offs (p1, 5, 10, 15);
The robot position p1 is displaced 5 mm in the x-direction, 10 mm in the y-direction and 15
mm in the z-direction.
Return value
Data type: robtarget
The displaced position data.
Arguments
Offs (Point XOffset YOffset ZOffset)
Point
Data type: robtarget
The position data to be displaced.
XOffset
Data type: num
The displacement in the x-direction, in the object coordinate system.
YOffset
Data type: num
The displacement in the y-direction, in the object coordinate system.
ZOffset
Data type: num
The displacement in the z-direction, in the object coordinate system.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 908
|
2 Functions
2.77. NumToStr - Converts numeric value to string
RobotWare - OS
905
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
[\Exp]
Exponent
Data type: switch
To use exponent in return value.
Syntax
NumToStr’(’
[ Val ’:=’ ] <expression ( IN ) of num>
| [ Dval ’:=’ ] <expression ( IN ) of dnum> ’,’
[ Dec ’:=’ ] <expression ( IN ) of num>
[ \Exp ]
’)’
A function with a return value of the data type string .
Related information
For information about
See
String functions
Technical reference manual - RAPID overview , section
RAPID summary - String functions
Definition of string
string - Strings on page 1195
String values
Technical reference manual - RAPID overview , section
Basic characteristics - Basic elements
Continued
2 Functions
2.78. Offs - Displaces a robot position
RobotWare - OS
3HAC 16581-1 Revision: J
906
© Copyright 2004-2010 ABB. All rights reserved.
2.78. Offs - Displaces a robot position
Usage
Offs is used to add an offset in the object coordinate system to a robot position.
Basic examples
Basic examples of the function Offs are illustrated below.
See also More examples on page 907 .
MoveL Offs(p2, 0, 0, 10), v1000, z50, tool1;
The robot is moved to a point 10 mm from the position p2 (in the z-direction).
p1 := Offs (p1, 5, 10, 15);
The robot position p1 is displaced 5 mm in the x-direction, 10 mm in the y-direction and 15
mm in the z-direction.
Return value
Data type: robtarget
The displaced position data.
Arguments
Offs (Point XOffset YOffset ZOffset)
Point
Data type: robtarget
The position data to be displaced.
XOffset
Data type: num
The displacement in the x-direction, in the object coordinate system.
YOffset
Data type: num
The displacement in the y-direction, in the object coordinate system.
ZOffset
Data type: num
The displacement in the z-direction, in the object coordinate system.
Continues on next page
2 Functions
2.78. Offs - Displaces a robot position
RobotWare - OS
907
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of the function Offs are illustrated below.
Example 1
PROC pallet (num row, num column, num distance, PERS tooldata tool,
PERS wobjdata wobj)
VAR robtarget palletpos:=[[0, 0, 0], [1, 0, 0, 0], [0, 0, 0, 0],
[9E9, 9E9, 9E9, 9E9, 9E9, 9E9]];
palettpos := Offs (palettpos, (row-1)*distance, (column-
1)*distance, 0);
MoveL palettpos, v100, fine, tool\WObj:=wobj;
ENDPROC
A routine for picking parts from a pallet is made. Each pallet is defined as a work object (see
figure below). The part to be picked (row and column) and the distance between the parts are
given as input parameters. Incrementing the row and column index is performed outside the
routine.
The figure shows the position and orientation of the pallet is specified by defining a work
object.
xx0500002300
Syntax
Offs ’(’
[Point ’:=’] <expression ( IN ) of robtarget>’ ,’
[XOffset ’:=’] <expression (IN ) of num> ’,’
[YOffset ’:=’] <expression ( IN ) of num> ’,’
[ZOffset ’:=’] <expression ( IN ) of num> ’)’
A function with a return value of the data type robtarget .
Related information
For information about
See
Position data
robtarget - Position data on page 1176
Mathematical instructions and functions
Technical reference manual - RAPID overview ,
section RAPID Summary - Mathematics
Positioning instructions
Technical reference manual - RAPID overview ,
section RAPID summary - Motion
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 909
|
2 Functions
2.78. Offs - Displaces a robot position
RobotWare - OS
3HAC 16581-1 Revision: J
906
© Copyright 2004-2010 ABB. All rights reserved.
2.78. Offs - Displaces a robot position
Usage
Offs is used to add an offset in the object coordinate system to a robot position.
Basic examples
Basic examples of the function Offs are illustrated below.
See also More examples on page 907 .
MoveL Offs(p2, 0, 0, 10), v1000, z50, tool1;
The robot is moved to a point 10 mm from the position p2 (in the z-direction).
p1 := Offs (p1, 5, 10, 15);
The robot position p1 is displaced 5 mm in the x-direction, 10 mm in the y-direction and 15
mm in the z-direction.
Return value
Data type: robtarget
The displaced position data.
Arguments
Offs (Point XOffset YOffset ZOffset)
Point
Data type: robtarget
The position data to be displaced.
XOffset
Data type: num
The displacement in the x-direction, in the object coordinate system.
YOffset
Data type: num
The displacement in the y-direction, in the object coordinate system.
ZOffset
Data type: num
The displacement in the z-direction, in the object coordinate system.
Continues on next page
2 Functions
2.78. Offs - Displaces a robot position
RobotWare - OS
907
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of the function Offs are illustrated below.
Example 1
PROC pallet (num row, num column, num distance, PERS tooldata tool,
PERS wobjdata wobj)
VAR robtarget palletpos:=[[0, 0, 0], [1, 0, 0, 0], [0, 0, 0, 0],
[9E9, 9E9, 9E9, 9E9, 9E9, 9E9]];
palettpos := Offs (palettpos, (row-1)*distance, (column-
1)*distance, 0);
MoveL palettpos, v100, fine, tool\WObj:=wobj;
ENDPROC
A routine for picking parts from a pallet is made. Each pallet is defined as a work object (see
figure below). The part to be picked (row and column) and the distance between the parts are
given as input parameters. Incrementing the row and column index is performed outside the
routine.
The figure shows the position and orientation of the pallet is specified by defining a work
object.
xx0500002300
Syntax
Offs ’(’
[Point ’:=’] <expression ( IN ) of robtarget>’ ,’
[XOffset ’:=’] <expression (IN ) of num> ’,’
[YOffset ’:=’] <expression ( IN ) of num> ’,’
[ZOffset ’:=’] <expression ( IN ) of num> ’)’
A function with a return value of the data type robtarget .
Related information
For information about
See
Position data
robtarget - Position data on page 1176
Mathematical instructions and functions
Technical reference manual - RAPID overview ,
section RAPID Summary - Mathematics
Positioning instructions
Technical reference manual - RAPID overview ,
section RAPID summary - Motion
Continued
2 Functions
2.79. OpMode - Read the operating mode
RobotWare - OS
3HAC 16581-1 Revision: J
908
© Copyright 2004-2010 ABB. All rights reserved.
2.79. OpMode - Read the operating mode
Usage
OpMode ( Operating Mode ) is used to read the current operating mode of the system.
Basic examples
Basic examples of the function OpMode are illustrated below.
Example 1
TEST OpMode()
CASE OP_AUTO:
...
CASE OP_MAN_PROG:
...
CASE OP_MAN_TEST:
...
DEFAULT:
...
ENDTEST
Different program sections are executed depending on the current operating mode.
Return value
Data type: symnum
The current operating mode as defined in the table below.
Syntax
OpMode’(’ ’)’
A function with a return value of the data type symnum .
Related information
Return value Symbolic constant
Comment
0
OP_UNDEF
Undefined operating mode
1
OP_AUTO
Automatic operating mode
2
OP_MAN_PROG
Manual operating mode max. 250 mm/s
3
OP_MAN_TEST
Manual operating mode full speed, 100 %
For information about
See
Different operating modes
Operating manual - IRC5 with FlexPendant
Reading running mode
RunMode - Read the running mode on page 971
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 910
|
2 Functions
2.78. Offs - Displaces a robot position
RobotWare - OS
907
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of the function Offs are illustrated below.
Example 1
PROC pallet (num row, num column, num distance, PERS tooldata tool,
PERS wobjdata wobj)
VAR robtarget palletpos:=[[0, 0, 0], [1, 0, 0, 0], [0, 0, 0, 0],
[9E9, 9E9, 9E9, 9E9, 9E9, 9E9]];
palettpos := Offs (palettpos, (row-1)*distance, (column-
1)*distance, 0);
MoveL palettpos, v100, fine, tool\WObj:=wobj;
ENDPROC
A routine for picking parts from a pallet is made. Each pallet is defined as a work object (see
figure below). The part to be picked (row and column) and the distance between the parts are
given as input parameters. Incrementing the row and column index is performed outside the
routine.
The figure shows the position and orientation of the pallet is specified by defining a work
object.
xx0500002300
Syntax
Offs ’(’
[Point ’:=’] <expression ( IN ) of robtarget>’ ,’
[XOffset ’:=’] <expression (IN ) of num> ’,’
[YOffset ’:=’] <expression ( IN ) of num> ’,’
[ZOffset ’:=’] <expression ( IN ) of num> ’)’
A function with a return value of the data type robtarget .
Related information
For information about
See
Position data
robtarget - Position data on page 1176
Mathematical instructions and functions
Technical reference manual - RAPID overview ,
section RAPID Summary - Mathematics
Positioning instructions
Technical reference manual - RAPID overview ,
section RAPID summary - Motion
Continued
2 Functions
2.79. OpMode - Read the operating mode
RobotWare - OS
3HAC 16581-1 Revision: J
908
© Copyright 2004-2010 ABB. All rights reserved.
2.79. OpMode - Read the operating mode
Usage
OpMode ( Operating Mode ) is used to read the current operating mode of the system.
Basic examples
Basic examples of the function OpMode are illustrated below.
Example 1
TEST OpMode()
CASE OP_AUTO:
...
CASE OP_MAN_PROG:
...
CASE OP_MAN_TEST:
...
DEFAULT:
...
ENDTEST
Different program sections are executed depending on the current operating mode.
Return value
Data type: symnum
The current operating mode as defined in the table below.
Syntax
OpMode’(’ ’)’
A function with a return value of the data type symnum .
Related information
Return value Symbolic constant
Comment
0
OP_UNDEF
Undefined operating mode
1
OP_AUTO
Automatic operating mode
2
OP_MAN_PROG
Manual operating mode max. 250 mm/s
3
OP_MAN_TEST
Manual operating mode full speed, 100 %
For information about
See
Different operating modes
Operating manual - IRC5 with FlexPendant
Reading running mode
RunMode - Read the running mode on page 971
2 Functions
2.80. OrientZYX - Builds an orient from euler angles
RobotWare - OS
909
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.80. OrientZYX - Builds an orient from euler angles
Usage
OrientZYX ( Orient from Euler ZYX angles ) is used to build an orient type variable out of
Euler angles.
Basic examples
Basic examples of the function OrientZYX are illustrated below.
Example 1
VAR num anglex;
VAR num angley;
VAR num anglez;
VAR pose object;
...
object.rot := OrientZYX(anglez, angley, anglex)
Return value
Data type: orient
The orientation made from the Euler angles.
The rotations will be performed in the following order:
•
rotation around the z axis,
•
rotation around the new y axis,
•
rotation around the new x axis.
Arguments
OrientZYX (ZAngle YAngle XAngle)
ZAngle
Data type: num
The rotation, in degrees, around the Z axis.
YAngle
Data type: num
The rotation, in degrees, around the Y axis.
XAngle
Data type: num
The rotation, in degrees, around the X axis.
The rotations will be performed in the following order:
•
rotation around the z axis,
•
rotation around the new y axis,
•
rotation around the new x axis.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 911
|
2 Functions
2.79. OpMode - Read the operating mode
RobotWare - OS
3HAC 16581-1 Revision: J
908
© Copyright 2004-2010 ABB. All rights reserved.
2.79. OpMode - Read the operating mode
Usage
OpMode ( Operating Mode ) is used to read the current operating mode of the system.
Basic examples
Basic examples of the function OpMode are illustrated below.
Example 1
TEST OpMode()
CASE OP_AUTO:
...
CASE OP_MAN_PROG:
...
CASE OP_MAN_TEST:
...
DEFAULT:
...
ENDTEST
Different program sections are executed depending on the current operating mode.
Return value
Data type: symnum
The current operating mode as defined in the table below.
Syntax
OpMode’(’ ’)’
A function with a return value of the data type symnum .
Related information
Return value Symbolic constant
Comment
0
OP_UNDEF
Undefined operating mode
1
OP_AUTO
Automatic operating mode
2
OP_MAN_PROG
Manual operating mode max. 250 mm/s
3
OP_MAN_TEST
Manual operating mode full speed, 100 %
For information about
See
Different operating modes
Operating manual - IRC5 with FlexPendant
Reading running mode
RunMode - Read the running mode on page 971
2 Functions
2.80. OrientZYX - Builds an orient from euler angles
RobotWare - OS
909
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.80. OrientZYX - Builds an orient from euler angles
Usage
OrientZYX ( Orient from Euler ZYX angles ) is used to build an orient type variable out of
Euler angles.
Basic examples
Basic examples of the function OrientZYX are illustrated below.
Example 1
VAR num anglex;
VAR num angley;
VAR num anglez;
VAR pose object;
...
object.rot := OrientZYX(anglez, angley, anglex)
Return value
Data type: orient
The orientation made from the Euler angles.
The rotations will be performed in the following order:
•
rotation around the z axis,
•
rotation around the new y axis,
•
rotation around the new x axis.
Arguments
OrientZYX (ZAngle YAngle XAngle)
ZAngle
Data type: num
The rotation, in degrees, around the Z axis.
YAngle
Data type: num
The rotation, in degrees, around the Y axis.
XAngle
Data type: num
The rotation, in degrees, around the X axis.
The rotations will be performed in the following order:
•
rotation around the z axis,
•
rotation around the new y axis,
•
rotation around the new x axis.
Continues on next page
2 Functions
2.80. OrientZYX - Builds an orient from euler angles
RobotWare - OS
3HAC 16581-1 Revision: J
910
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
OrientZYX’(’
[ZAngle’:=’] <expression ( IN ) of num>’ ,’
[YAngle ’:=’] <expression ( IN ) of num> ’,’
[XAngle’:=’] <expression ( IN ) of num>
’)’
A function with a return value of the data type orient .
Related information
For information about
See
Mathematical instructions and functions
Operating manual - IRC5 with FlexPendant ,
section RAPID summary - Mathematics
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 912
|
2 Functions
2.80. OrientZYX - Builds an orient from euler angles
RobotWare - OS
909
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.80. OrientZYX - Builds an orient from euler angles
Usage
OrientZYX ( Orient from Euler ZYX angles ) is used to build an orient type variable out of
Euler angles.
Basic examples
Basic examples of the function OrientZYX are illustrated below.
Example 1
VAR num anglex;
VAR num angley;
VAR num anglez;
VAR pose object;
...
object.rot := OrientZYX(anglez, angley, anglex)
Return value
Data type: orient
The orientation made from the Euler angles.
The rotations will be performed in the following order:
•
rotation around the z axis,
•
rotation around the new y axis,
•
rotation around the new x axis.
Arguments
OrientZYX (ZAngle YAngle XAngle)
ZAngle
Data type: num
The rotation, in degrees, around the Z axis.
YAngle
Data type: num
The rotation, in degrees, around the Y axis.
XAngle
Data type: num
The rotation, in degrees, around the X axis.
The rotations will be performed in the following order:
•
rotation around the z axis,
•
rotation around the new y axis,
•
rotation around the new x axis.
Continues on next page
2 Functions
2.80. OrientZYX - Builds an orient from euler angles
RobotWare - OS
3HAC 16581-1 Revision: J
910
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
OrientZYX’(’
[ZAngle’:=’] <expression ( IN ) of num>’ ,’
[YAngle ’:=’] <expression ( IN ) of num> ’,’
[XAngle’:=’] <expression ( IN ) of num>
’)’
A function with a return value of the data type orient .
Related information
For information about
See
Mathematical instructions and functions
Operating manual - IRC5 with FlexPendant ,
section RAPID summary - Mathematics
Continued
2 Functions
2.81. ORobT - Removes the program displacement from a position
RobotWare - OS
911
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.81. ORobT - Removes the program displacement from a position
Usage
ORobT ( Object Robot Target ) is used to transform a robot position from the program
displacement coordinate system to the object coordinate system and/or to remove an offset
for the external axes.
Basic examples
Basic examples of the function ORobT are illustrated below.
See also More examples on page 912 .
Example 1
VAR robtarget p10;
VAR robtarget p11;
VAR num wobj_diameter;
p10 := CRobT(\Tool:=tool1 \WObj:=wobj_diameter);
p11 := ORobT(p10);
The current positions of the robot and the external axes are stored in p10 and p11 . The values
stored in p10 are related to the ProgDisp/ExtOffs coordinate system. The values stored in
p11 are related to the object coordinate system without any program displacement and any
offset on the external axes.
Return value
Data type: robtarget
The transformed position data.
Arguments
ORobT (OrgPoint [\InPDisp] | [\InEOffs])
OrgPoint
Original Point
Data type: robtarget
The original point to be transformed.
[\InPDisp]
In Program Displacement
Data type: switch
Returns the TCP position in the ProgDisp coordinate system, i.e. removes external axes
offset only.
[\InEOffs]
In External Offset
Data type: switch
Returns the external axes in the offset coordinate system, i.e. removes program displacement
for the robot only.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 913
|
2 Functions
2.80. OrientZYX - Builds an orient from euler angles
RobotWare - OS
3HAC 16581-1 Revision: J
910
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
OrientZYX’(’
[ZAngle’:=’] <expression ( IN ) of num>’ ,’
[YAngle ’:=’] <expression ( IN ) of num> ’,’
[XAngle’:=’] <expression ( IN ) of num>
’)’
A function with a return value of the data type orient .
Related information
For information about
See
Mathematical instructions and functions
Operating manual - IRC5 with FlexPendant ,
section RAPID summary - Mathematics
Continued
2 Functions
2.81. ORobT - Removes the program displacement from a position
RobotWare - OS
911
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.81. ORobT - Removes the program displacement from a position
Usage
ORobT ( Object Robot Target ) is used to transform a robot position from the program
displacement coordinate system to the object coordinate system and/or to remove an offset
for the external axes.
Basic examples
Basic examples of the function ORobT are illustrated below.
See also More examples on page 912 .
Example 1
VAR robtarget p10;
VAR robtarget p11;
VAR num wobj_diameter;
p10 := CRobT(\Tool:=tool1 \WObj:=wobj_diameter);
p11 := ORobT(p10);
The current positions of the robot and the external axes are stored in p10 and p11 . The values
stored in p10 are related to the ProgDisp/ExtOffs coordinate system. The values stored in
p11 are related to the object coordinate system without any program displacement and any
offset on the external axes.
Return value
Data type: robtarget
The transformed position data.
Arguments
ORobT (OrgPoint [\InPDisp] | [\InEOffs])
OrgPoint
Original Point
Data type: robtarget
The original point to be transformed.
[\InPDisp]
In Program Displacement
Data type: switch
Returns the TCP position in the ProgDisp coordinate system, i.e. removes external axes
offset only.
[\InEOffs]
In External Offset
Data type: switch
Returns the external axes in the offset coordinate system, i.e. removes program displacement
for the robot only.
Continues on next page
2 Functions
2.81. ORobT - Removes the program displacement from a position
RobotWare - OS
3HAC 16581-1 Revision: J
912
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of how to use the function ORobT are illustrated below.
Example 1
p10 := ORobT(p10 \InEOffs );
The ORobT function will remove any program displacement that is active, leaving the TCP
position relative to the object coordinate system. The external axes will remain in the offset
coordinate system.
Example 2
p10 := ORobT(p10 \InPDisp );
The ORobT function will remove any offset of the external axes. The TCP position will
remain in the ProgDisp coordinate system.
Syntax
ORobT ’(’
[ OrgPoint ’:=’ ] < expression ( IN ) of robtarget>
[’\’InPDisp] | [’\’InEOffs]’)’
A function with a return value of the data type robtarget .
Related information
For information about
See
Definition of program displacement
for the robot
PDispOn - Activates program displacement on page
317
PDispSet - Activates program displacement using
known frame on page 321
Definition of offset for external axes
EOffsOn - Activates an offset for external axes on page
88
EOffsSet - Activates an offset for external axes using
known values on page 90
Coordinate systems
Operating manual - IRC5 with FlexPendant , section
Motion and I/O principles - Coordinate systems
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 914
|
2 Functions
2.81. ORobT - Removes the program displacement from a position
RobotWare - OS
911
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.81. ORobT - Removes the program displacement from a position
Usage
ORobT ( Object Robot Target ) is used to transform a robot position from the program
displacement coordinate system to the object coordinate system and/or to remove an offset
for the external axes.
Basic examples
Basic examples of the function ORobT are illustrated below.
See also More examples on page 912 .
Example 1
VAR robtarget p10;
VAR robtarget p11;
VAR num wobj_diameter;
p10 := CRobT(\Tool:=tool1 \WObj:=wobj_diameter);
p11 := ORobT(p10);
The current positions of the robot and the external axes are stored in p10 and p11 . The values
stored in p10 are related to the ProgDisp/ExtOffs coordinate system. The values stored in
p11 are related to the object coordinate system without any program displacement and any
offset on the external axes.
Return value
Data type: robtarget
The transformed position data.
Arguments
ORobT (OrgPoint [\InPDisp] | [\InEOffs])
OrgPoint
Original Point
Data type: robtarget
The original point to be transformed.
[\InPDisp]
In Program Displacement
Data type: switch
Returns the TCP position in the ProgDisp coordinate system, i.e. removes external axes
offset only.
[\InEOffs]
In External Offset
Data type: switch
Returns the external axes in the offset coordinate system, i.e. removes program displacement
for the robot only.
Continues on next page
2 Functions
2.81. ORobT - Removes the program displacement from a position
RobotWare - OS
3HAC 16581-1 Revision: J
912
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of how to use the function ORobT are illustrated below.
Example 1
p10 := ORobT(p10 \InEOffs );
The ORobT function will remove any program displacement that is active, leaving the TCP
position relative to the object coordinate system. The external axes will remain in the offset
coordinate system.
Example 2
p10 := ORobT(p10 \InPDisp );
The ORobT function will remove any offset of the external axes. The TCP position will
remain in the ProgDisp coordinate system.
Syntax
ORobT ’(’
[ OrgPoint ’:=’ ] < expression ( IN ) of robtarget>
[’\’InPDisp] | [’\’InEOffs]’)’
A function with a return value of the data type robtarget .
Related information
For information about
See
Definition of program displacement
for the robot
PDispOn - Activates program displacement on page
317
PDispSet - Activates program displacement using
known frame on page 321
Definition of offset for external axes
EOffsOn - Activates an offset for external axes on page
88
EOffsSet - Activates an offset for external axes using
known values on page 90
Coordinate systems
Operating manual - IRC5 with FlexPendant , section
Motion and I/O principles - Coordinate systems
Continued
2 Functions
2.82. ParIdPosValid - Valid robot position for parameter identification
RobotWare - OS
913
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.82. ParIdPosValid - Valid robot position for parameter identification
Usage
ParIdPosValid ( Parameter Identification Position Valid ) checks whether the robot
position is valid for the current parameter identification, such as load identification of tool or
payload.
This instruction can only be used in the main task or, if in a MultiMove system, in motion
tasks.
Basic examples
Basic examples of the function ParIdPosValid are illustrated below.
Example 1
VAR jointtarget joints;
VAR bool valid_joints{12};
! Read the current joint angles
joints := CJointT();
! Check if valid robot position
IF ParIdPosValid (TOOL_LOAD_ID, joints, valid_joints) = TRUE THEN
! Valid position for load identification
! Continue with LoadId
...
ELSE
! Not valid position for one or several axes for load
! identification
! Move the robot to the output data given in variable joints
! and do ParIdPosValid once again
...
ENDIF
Check whether robot position is valid before doing load identification of tool.
Return value
Data type: bool
TRUE if robot position is valid for current parameter identification.
FALSE if robot position is not valid for current parameter identification.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 915
|
2 Functions
2.81. ORobT - Removes the program displacement from a position
RobotWare - OS
3HAC 16581-1 Revision: J
912
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of how to use the function ORobT are illustrated below.
Example 1
p10 := ORobT(p10 \InEOffs );
The ORobT function will remove any program displacement that is active, leaving the TCP
position relative to the object coordinate system. The external axes will remain in the offset
coordinate system.
Example 2
p10 := ORobT(p10 \InPDisp );
The ORobT function will remove any offset of the external axes. The TCP position will
remain in the ProgDisp coordinate system.
Syntax
ORobT ’(’
[ OrgPoint ’:=’ ] < expression ( IN ) of robtarget>
[’\’InPDisp] | [’\’InEOffs]’)’
A function with a return value of the data type robtarget .
Related information
For information about
See
Definition of program displacement
for the robot
PDispOn - Activates program displacement on page
317
PDispSet - Activates program displacement using
known frame on page 321
Definition of offset for external axes
EOffsOn - Activates an offset for external axes on page
88
EOffsSet - Activates an offset for external axes using
known values on page 90
Coordinate systems
Operating manual - IRC5 with FlexPendant , section
Motion and I/O principles - Coordinate systems
Continued
2 Functions
2.82. ParIdPosValid - Valid robot position for parameter identification
RobotWare - OS
913
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.82. ParIdPosValid - Valid robot position for parameter identification
Usage
ParIdPosValid ( Parameter Identification Position Valid ) checks whether the robot
position is valid for the current parameter identification, such as load identification of tool or
payload.
This instruction can only be used in the main task or, if in a MultiMove system, in motion
tasks.
Basic examples
Basic examples of the function ParIdPosValid are illustrated below.
Example 1
VAR jointtarget joints;
VAR bool valid_joints{12};
! Read the current joint angles
joints := CJointT();
! Check if valid robot position
IF ParIdPosValid (TOOL_LOAD_ID, joints, valid_joints) = TRUE THEN
! Valid position for load identification
! Continue with LoadId
...
ELSE
! Not valid position for one or several axes for load
! identification
! Move the robot to the output data given in variable joints
! and do ParIdPosValid once again
...
ENDIF
Check whether robot position is valid before doing load identification of tool.
Return value
Data type: bool
TRUE if robot position is valid for current parameter identification.
FALSE if robot position is not valid for current parameter identification.
Continues on next page
2 Functions
2.82. ParIdPosValid - Valid robot position for parameter identification
RobotWare - OS
3HAC 16581-1 Revision: J
914
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
ParIdPosValid (ParIdType Pos AxValid [\ConfAngle])
ParIdType
Data type: paridnum
Type of parameter identification as defined in table below
Pos
Data type: jointtarget
Variable specifies the actual joint angles for all robot and external axes. The variable is
updated by ParIdPosValid according to the table below.
AxValid
Data type: bool
Array variable with 12 elements corresponding to 6 robot and 6 external axes. The variable
is updated by ParIdPosValid according to the table below.
Value
Symbolic constant
Comment
1
TOOL_LOAD_ID
Identify tool load
2
PAY_LOAD_ID
Identify payload (Ref. instruction GripLoad)
3
IRBP_K
Identify External Manipulator IRBP K load
4
IRBP_L
Identify External Manipulator IRBP L load
4
IRBP_C
Identify External Manipulator IRBP C load
4
IRBP_C_INDEX
Identify External Manipulator IRBP C_INDEX load
4
IRBP_T
Identify External Manipulator IRBP T load
5
IRBP_R
Identify External Manipulator IRBP R load
6
IRBP_A
Identify External Manipulator IRBP A load
6
IRBP_B
Identify External Manipulator IRBP B load
6
IRBP_D
Identify External Manipulator IRBP D load
Input axis joint value
Output axis joint value
Valid
Not changed
Not valid
Changed to suitable value
Input axis joint value in Pos
Output status in AxValid
Valid
TRUE
Not valid
FALSE
Continued
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 916
|
2 Functions
2.82. ParIdPosValid - Valid robot position for parameter identification
RobotWare - OS
913
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.82. ParIdPosValid - Valid robot position for parameter identification
Usage
ParIdPosValid ( Parameter Identification Position Valid ) checks whether the robot
position is valid for the current parameter identification, such as load identification of tool or
payload.
This instruction can only be used in the main task or, if in a MultiMove system, in motion
tasks.
Basic examples
Basic examples of the function ParIdPosValid are illustrated below.
Example 1
VAR jointtarget joints;
VAR bool valid_joints{12};
! Read the current joint angles
joints := CJointT();
! Check if valid robot position
IF ParIdPosValid (TOOL_LOAD_ID, joints, valid_joints) = TRUE THEN
! Valid position for load identification
! Continue with LoadId
...
ELSE
! Not valid position for one or several axes for load
! identification
! Move the robot to the output data given in variable joints
! and do ParIdPosValid once again
...
ENDIF
Check whether robot position is valid before doing load identification of tool.
Return value
Data type: bool
TRUE if robot position is valid for current parameter identification.
FALSE if robot position is not valid for current parameter identification.
Continues on next page
2 Functions
2.82. ParIdPosValid - Valid robot position for parameter identification
RobotWare - OS
3HAC 16581-1 Revision: J
914
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
ParIdPosValid (ParIdType Pos AxValid [\ConfAngle])
ParIdType
Data type: paridnum
Type of parameter identification as defined in table below
Pos
Data type: jointtarget
Variable specifies the actual joint angles for all robot and external axes. The variable is
updated by ParIdPosValid according to the table below.
AxValid
Data type: bool
Array variable with 12 elements corresponding to 6 robot and 6 external axes. The variable
is updated by ParIdPosValid according to the table below.
Value
Symbolic constant
Comment
1
TOOL_LOAD_ID
Identify tool load
2
PAY_LOAD_ID
Identify payload (Ref. instruction GripLoad)
3
IRBP_K
Identify External Manipulator IRBP K load
4
IRBP_L
Identify External Manipulator IRBP L load
4
IRBP_C
Identify External Manipulator IRBP C load
4
IRBP_C_INDEX
Identify External Manipulator IRBP C_INDEX load
4
IRBP_T
Identify External Manipulator IRBP T load
5
IRBP_R
Identify External Manipulator IRBP R load
6
IRBP_A
Identify External Manipulator IRBP A load
6
IRBP_B
Identify External Manipulator IRBP B load
6
IRBP_D
Identify External Manipulator IRBP D load
Input axis joint value
Output axis joint value
Valid
Not changed
Not valid
Changed to suitable value
Input axis joint value in Pos
Output status in AxValid
Valid
TRUE
Not valid
FALSE
Continued
Continues on next page
2 Functions
2.82. ParIdPosValid - Valid robot position for parameter identification
RobotWare - OS
915
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
[ \ConfAngle ]
Data type: num
Option argument for specification of specific configuration angle +/- degrees to be used for
parameter identification.
xx0500002493
Default + 90 degrees if this argument is not specified.
Min. + or - 30 degrees. Optimum + or - 90 degrees.
Error handling
If an error occurs, the system variable ERRNO is set to ERR_PID_RAISE_PP . This error can
then be handled in the error handler.
Syntax
ParIdPosValid’(’
[ ParIdType ´:=´ ] <expression ( IN ) of paridnum> ´,´
[ Pos ´:=´ ] <variable ( VAR ) of jointtarget> ´,´
[ AxValid ´:=´ ] <array variable {*} ( VAR ) of bool>
[ ´\´ ConfAngle ´:=´ <expression ( IN ) of num> ] ´)´
A function with a return value of the data type bool.
Related information
For information about
See
Type of parameter identification
paridnum - Type of parameter identification on
page 1154
Valid robot type
ParIdRobValid - Valid robot type for
parameter identification on page 916
Load identification of tool or payload
LoadId - Load identification of tool or payload
on page 212
Load identification of positioners (IRBP)
ManLoadIdProc - Load identification of IRBP
manipulators on page 219
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 917
|
2 Functions
2.82. ParIdPosValid - Valid robot position for parameter identification
RobotWare - OS
3HAC 16581-1 Revision: J
914
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
ParIdPosValid (ParIdType Pos AxValid [\ConfAngle])
ParIdType
Data type: paridnum
Type of parameter identification as defined in table below
Pos
Data type: jointtarget
Variable specifies the actual joint angles for all robot and external axes. The variable is
updated by ParIdPosValid according to the table below.
AxValid
Data type: bool
Array variable with 12 elements corresponding to 6 robot and 6 external axes. The variable
is updated by ParIdPosValid according to the table below.
Value
Symbolic constant
Comment
1
TOOL_LOAD_ID
Identify tool load
2
PAY_LOAD_ID
Identify payload (Ref. instruction GripLoad)
3
IRBP_K
Identify External Manipulator IRBP K load
4
IRBP_L
Identify External Manipulator IRBP L load
4
IRBP_C
Identify External Manipulator IRBP C load
4
IRBP_C_INDEX
Identify External Manipulator IRBP C_INDEX load
4
IRBP_T
Identify External Manipulator IRBP T load
5
IRBP_R
Identify External Manipulator IRBP R load
6
IRBP_A
Identify External Manipulator IRBP A load
6
IRBP_B
Identify External Manipulator IRBP B load
6
IRBP_D
Identify External Manipulator IRBP D load
Input axis joint value
Output axis joint value
Valid
Not changed
Not valid
Changed to suitable value
Input axis joint value in Pos
Output status in AxValid
Valid
TRUE
Not valid
FALSE
Continued
Continues on next page
2 Functions
2.82. ParIdPosValid - Valid robot position for parameter identification
RobotWare - OS
915
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
[ \ConfAngle ]
Data type: num
Option argument for specification of specific configuration angle +/- degrees to be used for
parameter identification.
xx0500002493
Default + 90 degrees if this argument is not specified.
Min. + or - 30 degrees. Optimum + or - 90 degrees.
Error handling
If an error occurs, the system variable ERRNO is set to ERR_PID_RAISE_PP . This error can
then be handled in the error handler.
Syntax
ParIdPosValid’(’
[ ParIdType ´:=´ ] <expression ( IN ) of paridnum> ´,´
[ Pos ´:=´ ] <variable ( VAR ) of jointtarget> ´,´
[ AxValid ´:=´ ] <array variable {*} ( VAR ) of bool>
[ ´\´ ConfAngle ´:=´ <expression ( IN ) of num> ] ´)´
A function with a return value of the data type bool.
Related information
For information about
See
Type of parameter identification
paridnum - Type of parameter identification on
page 1154
Valid robot type
ParIdRobValid - Valid robot type for
parameter identification on page 916
Load identification of tool or payload
LoadId - Load identification of tool or payload
on page 212
Load identification of positioners (IRBP)
ManLoadIdProc - Load identification of IRBP
manipulators on page 219
Continued
2 Functions
2.83. ParIdRobValid - Valid robot type for parameter identification
RobotWare - OS
3HAC 16581-1 Revision: J
916
© Copyright 2004-2010 ABB. All rights reserved.
2.83. ParIdRobValid - Valid robot type for parameter identification
Usage
ParIdRobValid ( Parameter Identification Robot Valid ) checks whether the robot or
manipulator type is valid for the current parameter identification, such as load identification
of tool or payload.
This instruction can only be used in the main task T_ROB1 or, if in a MultiMove system, in
Motion tasks.
Basic examples
Basic examples of the function ParIdRobValue are illustrated below.
Example 1
TEST ParIdRobValid (TOOL_LOAD_ID)
CASE ROB_LOAD_VAL:
! Possible to do load identification of tool in actual robot
type
...
CASE ROB_LM1_LOAD_VAL:
! Only possible to do load identification of tool with
! IRB 6400FHD if actual load < 200 kg
...
CASE ROB_NOT_LOAD_VAL:
! Not possible to do load identification of tool in actual
robot type
...
ENDTEST
Return value
Data type: paridvalidnum
Whether the specified parameter identification can be performed with the current robot or
manipulator type, as defined in the table below.
Value
Symbolic constant
Comment
10
ROB_LOAD_VAL
Valid robot or manipulator type for the actual parameter
identification
11
ROB_NOT_LOAD_VAL
Not valid type for the actual parameter identification
12
ROB_LM1_LOAD_VAL
Valid robot type IRB 6400FHD for the actual parameter
identification if actual load < 200kg
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 918
|
2 Functions
2.82. ParIdPosValid - Valid robot position for parameter identification
RobotWare - OS
915
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
[ \ConfAngle ]
Data type: num
Option argument for specification of specific configuration angle +/- degrees to be used for
parameter identification.
xx0500002493
Default + 90 degrees if this argument is not specified.
Min. + or - 30 degrees. Optimum + or - 90 degrees.
Error handling
If an error occurs, the system variable ERRNO is set to ERR_PID_RAISE_PP . This error can
then be handled in the error handler.
Syntax
ParIdPosValid’(’
[ ParIdType ´:=´ ] <expression ( IN ) of paridnum> ´,´
[ Pos ´:=´ ] <variable ( VAR ) of jointtarget> ´,´
[ AxValid ´:=´ ] <array variable {*} ( VAR ) of bool>
[ ´\´ ConfAngle ´:=´ <expression ( IN ) of num> ] ´)´
A function with a return value of the data type bool.
Related information
For information about
See
Type of parameter identification
paridnum - Type of parameter identification on
page 1154
Valid robot type
ParIdRobValid - Valid robot type for
parameter identification on page 916
Load identification of tool or payload
LoadId - Load identification of tool or payload
on page 212
Load identification of positioners (IRBP)
ManLoadIdProc - Load identification of IRBP
manipulators on page 219
Continued
2 Functions
2.83. ParIdRobValid - Valid robot type for parameter identification
RobotWare - OS
3HAC 16581-1 Revision: J
916
© Copyright 2004-2010 ABB. All rights reserved.
2.83. ParIdRobValid - Valid robot type for parameter identification
Usage
ParIdRobValid ( Parameter Identification Robot Valid ) checks whether the robot or
manipulator type is valid for the current parameter identification, such as load identification
of tool or payload.
This instruction can only be used in the main task T_ROB1 or, if in a MultiMove system, in
Motion tasks.
Basic examples
Basic examples of the function ParIdRobValue are illustrated below.
Example 1
TEST ParIdRobValid (TOOL_LOAD_ID)
CASE ROB_LOAD_VAL:
! Possible to do load identification of tool in actual robot
type
...
CASE ROB_LM1_LOAD_VAL:
! Only possible to do load identification of tool with
! IRB 6400FHD if actual load < 200 kg
...
CASE ROB_NOT_LOAD_VAL:
! Not possible to do load identification of tool in actual
robot type
...
ENDTEST
Return value
Data type: paridvalidnum
Whether the specified parameter identification can be performed with the current robot or
manipulator type, as defined in the table below.
Value
Symbolic constant
Comment
10
ROB_LOAD_VAL
Valid robot or manipulator type for the actual parameter
identification
11
ROB_NOT_LOAD_VAL
Not valid type for the actual parameter identification
12
ROB_LM1_LOAD_VAL
Valid robot type IRB 6400FHD for the actual parameter
identification if actual load < 200kg
Continues on next page
2 Functions
2.83. ParIdRobValid - Valid robot type for parameter identification
RobotWare - OS
917
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
ParIdRobValid(ParIdType [\MechUnit] [\AxisNo])
ParIdType
Data type: paridnum
Type of parameter identification as defined in table below.
[ \MechUnit ]
Mechanical Unit
Data type: mecunit
Mechanical Unit used for the load identification. Only to be specified for external
manipulator. If this argument is omitted the TCP-robot in the task is used.
[ \AxisNo ]
Axis number
Data type: num
Axis number within the mechanical unit which holds the load to be identified. Only to be
specified for external manipulator.
When the argument \MechUnit is used, then \AxisNo must be used. The argument
\AxisNo can not be used without \MechUnit .
Error handling
If an error occurs, the system variable ERRNO is set to ERR_PID_RAISE_PP . This error can
then be handled in the error handler.
Syntax
ParIdRobValid’(’
[ParIdType ’:=’] <expression ( IN ) of paridnum>
[´\’ MechUnit‘ :=’ <variable ( VAR ) of mecunit>]
[´\’ AxisNo ´:=’ <expression ( IN ) of num>] ´)’
A function with a return value of the data type paridvalidnum .
Value
Symbolic constant
Comment
1
TOOL_LOAD_ID
Identify robot tool load
2
PAY_LOAD_ID
Identify robot payload (Ref. instruction GripLoad)
3
IRBP_K
Identify External Manipulator IRBP K load
4
IRBP_L
Identify External Manipulator IRBP L load
4
IRBP_C
Identify External Manipulator IRBP C load
4
IRBP_C_INDEX
Identify External Manipulator IRBP C_INDEX load
4
IRBP_T
Identify External Manipulator IRBP T load
5
IRBP_R
Identify External Manipulator IRBP R load
6
IRBP_A
Identify External Manipulator IRBP A load
6
IRBP_B
Identify External Manipulator IRBP B load
6
IRBP_D
Identify External Manipulator IRBP D load
Continued
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 919
|
2 Functions
2.83. ParIdRobValid - Valid robot type for parameter identification
RobotWare - OS
3HAC 16581-1 Revision: J
916
© Copyright 2004-2010 ABB. All rights reserved.
2.83. ParIdRobValid - Valid robot type for parameter identification
Usage
ParIdRobValid ( Parameter Identification Robot Valid ) checks whether the robot or
manipulator type is valid for the current parameter identification, such as load identification
of tool or payload.
This instruction can only be used in the main task T_ROB1 or, if in a MultiMove system, in
Motion tasks.
Basic examples
Basic examples of the function ParIdRobValue are illustrated below.
Example 1
TEST ParIdRobValid (TOOL_LOAD_ID)
CASE ROB_LOAD_VAL:
! Possible to do load identification of tool in actual robot
type
...
CASE ROB_LM1_LOAD_VAL:
! Only possible to do load identification of tool with
! IRB 6400FHD if actual load < 200 kg
...
CASE ROB_NOT_LOAD_VAL:
! Not possible to do load identification of tool in actual
robot type
...
ENDTEST
Return value
Data type: paridvalidnum
Whether the specified parameter identification can be performed with the current robot or
manipulator type, as defined in the table below.
Value
Symbolic constant
Comment
10
ROB_LOAD_VAL
Valid robot or manipulator type for the actual parameter
identification
11
ROB_NOT_LOAD_VAL
Not valid type for the actual parameter identification
12
ROB_LM1_LOAD_VAL
Valid robot type IRB 6400FHD for the actual parameter
identification if actual load < 200kg
Continues on next page
2 Functions
2.83. ParIdRobValid - Valid robot type for parameter identification
RobotWare - OS
917
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
ParIdRobValid(ParIdType [\MechUnit] [\AxisNo])
ParIdType
Data type: paridnum
Type of parameter identification as defined in table below.
[ \MechUnit ]
Mechanical Unit
Data type: mecunit
Mechanical Unit used for the load identification. Only to be specified for external
manipulator. If this argument is omitted the TCP-robot in the task is used.
[ \AxisNo ]
Axis number
Data type: num
Axis number within the mechanical unit which holds the load to be identified. Only to be
specified for external manipulator.
When the argument \MechUnit is used, then \AxisNo must be used. The argument
\AxisNo can not be used without \MechUnit .
Error handling
If an error occurs, the system variable ERRNO is set to ERR_PID_RAISE_PP . This error can
then be handled in the error handler.
Syntax
ParIdRobValid’(’
[ParIdType ’:=’] <expression ( IN ) of paridnum>
[´\’ MechUnit‘ :=’ <variable ( VAR ) of mecunit>]
[´\’ AxisNo ´:=’ <expression ( IN ) of num>] ´)’
A function with a return value of the data type paridvalidnum .
Value
Symbolic constant
Comment
1
TOOL_LOAD_ID
Identify robot tool load
2
PAY_LOAD_ID
Identify robot payload (Ref. instruction GripLoad)
3
IRBP_K
Identify External Manipulator IRBP K load
4
IRBP_L
Identify External Manipulator IRBP L load
4
IRBP_C
Identify External Manipulator IRBP C load
4
IRBP_C_INDEX
Identify External Manipulator IRBP C_INDEX load
4
IRBP_T
Identify External Manipulator IRBP T load
5
IRBP_R
Identify External Manipulator IRBP R load
6
IRBP_A
Identify External Manipulator IRBP A load
6
IRBP_B
Identify External Manipulator IRBP B load
6
IRBP_D
Identify External Manipulator IRBP D load
Continued
Continues on next page
2 Functions
2.83. ParIdRobValid - Valid robot type for parameter identification
RobotWare - OS
3HAC 16581-1 Revision: J
918
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Type of parameter identification
paridnum - Type of parameter identification on
page 1154
Mechanical unit to be identified
mecunit - Mechanical unit on page 1139
Result of this function
paridvalidnum - Result of ParIdRobValid on
page 1156
Valid robot position
ParIdPosValid - Valid robot position for
parameter identification on page 913
Load identification of robot tool load or
payload
LoadId - Load identification of tool or payload
on page 212
Load identification of positioner loads
ManLoadIdProc - Load identification of IRBP
manipulators on page 219
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 920
|
2 Functions
2.83. ParIdRobValid - Valid robot type for parameter identification
RobotWare - OS
917
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
ParIdRobValid(ParIdType [\MechUnit] [\AxisNo])
ParIdType
Data type: paridnum
Type of parameter identification as defined in table below.
[ \MechUnit ]
Mechanical Unit
Data type: mecunit
Mechanical Unit used for the load identification. Only to be specified for external
manipulator. If this argument is omitted the TCP-robot in the task is used.
[ \AxisNo ]
Axis number
Data type: num
Axis number within the mechanical unit which holds the load to be identified. Only to be
specified for external manipulator.
When the argument \MechUnit is used, then \AxisNo must be used. The argument
\AxisNo can not be used without \MechUnit .
Error handling
If an error occurs, the system variable ERRNO is set to ERR_PID_RAISE_PP . This error can
then be handled in the error handler.
Syntax
ParIdRobValid’(’
[ParIdType ’:=’] <expression ( IN ) of paridnum>
[´\’ MechUnit‘ :=’ <variable ( VAR ) of mecunit>]
[´\’ AxisNo ´:=’ <expression ( IN ) of num>] ´)’
A function with a return value of the data type paridvalidnum .
Value
Symbolic constant
Comment
1
TOOL_LOAD_ID
Identify robot tool load
2
PAY_LOAD_ID
Identify robot payload (Ref. instruction GripLoad)
3
IRBP_K
Identify External Manipulator IRBP K load
4
IRBP_L
Identify External Manipulator IRBP L load
4
IRBP_C
Identify External Manipulator IRBP C load
4
IRBP_C_INDEX
Identify External Manipulator IRBP C_INDEX load
4
IRBP_T
Identify External Manipulator IRBP T load
5
IRBP_R
Identify External Manipulator IRBP R load
6
IRBP_A
Identify External Manipulator IRBP A load
6
IRBP_B
Identify External Manipulator IRBP B load
6
IRBP_D
Identify External Manipulator IRBP D load
Continued
Continues on next page
2 Functions
2.83. ParIdRobValid - Valid robot type for parameter identification
RobotWare - OS
3HAC 16581-1 Revision: J
918
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Type of parameter identification
paridnum - Type of parameter identification on
page 1154
Mechanical unit to be identified
mecunit - Mechanical unit on page 1139
Result of this function
paridvalidnum - Result of ParIdRobValid on
page 1156
Valid robot position
ParIdPosValid - Valid robot position for
parameter identification on page 913
Load identification of robot tool load or
payload
LoadId - Load identification of tool or payload
on page 212
Load identification of positioner loads
ManLoadIdProc - Load identification of IRBP
manipulators on page 219
Continued
2 Functions
2.84. PathLevel - Get current path level
RobotWare - OS
919
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.84. PathLevel - Get current path level
Usage
PathLevel is used to get the current path level. This function will show whether the task is
executing on the original level or if the original movement path has been stored and a new
temporary movement is executing. Read more about Path Recovery in Application manual -
Motion functions and event .
Basic examples
Basic example of the function PathLevel is illustrated below.
See also More examples on page 919 .
Example 1
VAR num level;
level:= PathLevel();
Variable level will be 1 if executed in an original movement path or 2 if executed in a
temporary new movement path.
Return value
Data type: num
There are two possible return values.
More examples
One more example of how to use the function PathLevel is illustrated below.
Example 1
...
MoveL p100, v100, z10, tool1;
StopMove;
StorePath;
p:= CRobT(\Tool:=tool1);
!New temporary movement
MoveL p1, v100, fine, tool1;
...
level:= PathLevel();
...
MoveL p, v100, fine, tool1;
RestoPath;
StartMove;
...
Variable level will be 2.
Return value Description
1
Executing in original movement path.
2
Executing in StorePath level, a temporary new movement path.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 921
|
2 Functions
2.83. ParIdRobValid - Valid robot type for parameter identification
RobotWare - OS
3HAC 16581-1 Revision: J
918
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Type of parameter identification
paridnum - Type of parameter identification on
page 1154
Mechanical unit to be identified
mecunit - Mechanical unit on page 1139
Result of this function
paridvalidnum - Result of ParIdRobValid on
page 1156
Valid robot position
ParIdPosValid - Valid robot position for
parameter identification on page 913
Load identification of robot tool load or
payload
LoadId - Load identification of tool or payload
on page 212
Load identification of positioner loads
ManLoadIdProc - Load identification of IRBP
manipulators on page 219
Continued
2 Functions
2.84. PathLevel - Get current path level
RobotWare - OS
919
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.84. PathLevel - Get current path level
Usage
PathLevel is used to get the current path level. This function will show whether the task is
executing on the original level or if the original movement path has been stored and a new
temporary movement is executing. Read more about Path Recovery in Application manual -
Motion functions and event .
Basic examples
Basic example of the function PathLevel is illustrated below.
See also More examples on page 919 .
Example 1
VAR num level;
level:= PathLevel();
Variable level will be 1 if executed in an original movement path or 2 if executed in a
temporary new movement path.
Return value
Data type: num
There are two possible return values.
More examples
One more example of how to use the function PathLevel is illustrated below.
Example 1
...
MoveL p100, v100, z10, tool1;
StopMove;
StorePath;
p:= CRobT(\Tool:=tool1);
!New temporary movement
MoveL p1, v100, fine, tool1;
...
level:= PathLevel();
...
MoveL p, v100, fine, tool1;
RestoPath;
StartMove;
...
Variable level will be 2.
Return value Description
1
Executing in original movement path.
2
Executing in StorePath level, a temporary new movement path.
Continues on next page
2 Functions
2.84. PathLevel - Get current path level
RobotWare - OS
3HAC 16581-1 Revision: J
920
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
RobotWare option Path Recovery must be installed to be able to use function PathLevel at
path level 2
Syntax
PathLevel’(’’)’
A function with a return value of the data type num .
Related information
For information about
See
Path recovery.
Application manual - Motion functions and events
Store and restore path.
StorePath - Stores the path when an interrupt occurs on page
521
RestoPath - Restores the path after an interrupt on page 362
Stop and start move.
StartMove - Restarts robot movement on page 486
StopMove - Stops robot movement on page 515
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 922
|
2 Functions
2.84. PathLevel - Get current path level
RobotWare - OS
919
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.84. PathLevel - Get current path level
Usage
PathLevel is used to get the current path level. This function will show whether the task is
executing on the original level or if the original movement path has been stored and a new
temporary movement is executing. Read more about Path Recovery in Application manual -
Motion functions and event .
Basic examples
Basic example of the function PathLevel is illustrated below.
See also More examples on page 919 .
Example 1
VAR num level;
level:= PathLevel();
Variable level will be 1 if executed in an original movement path or 2 if executed in a
temporary new movement path.
Return value
Data type: num
There are two possible return values.
More examples
One more example of how to use the function PathLevel is illustrated below.
Example 1
...
MoveL p100, v100, z10, tool1;
StopMove;
StorePath;
p:= CRobT(\Tool:=tool1);
!New temporary movement
MoveL p1, v100, fine, tool1;
...
level:= PathLevel();
...
MoveL p, v100, fine, tool1;
RestoPath;
StartMove;
...
Variable level will be 2.
Return value Description
1
Executing in original movement path.
2
Executing in StorePath level, a temporary new movement path.
Continues on next page
2 Functions
2.84. PathLevel - Get current path level
RobotWare - OS
3HAC 16581-1 Revision: J
920
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
RobotWare option Path Recovery must be installed to be able to use function PathLevel at
path level 2
Syntax
PathLevel’(’’)’
A function with a return value of the data type num .
Related information
For information about
See
Path recovery.
Application manual - Motion functions and events
Store and restore path.
StorePath - Stores the path when an interrupt occurs on page
521
RestoPath - Restores the path after an interrupt on page 362
Stop and start move.
StartMove - Restarts robot movement on page 486
StopMove - Stops robot movement on page 515
Continued
2 Functions
2.85. PathRecValidBwd - Is there a valid backward path recorded
Path Recovery
921
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.85. PathRecValidBwd - Is there a valid backward path recorded
Usage
PathRecValidBwd is used to check if the path recorder is active and if a recorded backward
path is available.
Basic examples
Basic examples of the function PathRecValidBwd are illustrated below.
See also More examples on page 922 .
Example 1
VAR bool bwd_path;
VAR pathrecid fixture_id;
bwd_path := PathRecValidBwd (\ID:=fixture_id);
The variable bwd_path is set to TRUE if it is possible to back-up to the position with
identifier fixture_id . If not, bwd_path is set to FALSE
Return value
Data type: bool
The return value of the function can be determined from following flow chart:
xx0500002132
![Image]
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 923
|
2 Functions
2.84. PathLevel - Get current path level
RobotWare - OS
3HAC 16581-1 Revision: J
920
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
RobotWare option Path Recovery must be installed to be able to use function PathLevel at
path level 2
Syntax
PathLevel’(’’)’
A function with a return value of the data type num .
Related information
For information about
See
Path recovery.
Application manual - Motion functions and events
Store and restore path.
StorePath - Stores the path when an interrupt occurs on page
521
RestoPath - Restores the path after an interrupt on page 362
Stop and start move.
StartMove - Restarts robot movement on page 486
StopMove - Stops robot movement on page 515
Continued
2 Functions
2.85. PathRecValidBwd - Is there a valid backward path recorded
Path Recovery
921
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.85. PathRecValidBwd - Is there a valid backward path recorded
Usage
PathRecValidBwd is used to check if the path recorder is active and if a recorded backward
path is available.
Basic examples
Basic examples of the function PathRecValidBwd are illustrated below.
See also More examples on page 922 .
Example 1
VAR bool bwd_path;
VAR pathrecid fixture_id;
bwd_path := PathRecValidBwd (\ID:=fixture_id);
The variable bwd_path is set to TRUE if it is possible to back-up to the position with
identifier fixture_id . If not, bwd_path is set to FALSE
Return value
Data type: bool
The return value of the function can be determined from following flow chart:
xx0500002132
![Image]
Continues on next page
2 Functions
2.85. PathRecValidBwd - Is there a valid backward path recorded
Path Recovery
3HAC 16581-1 Revision: J
922
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
PathRecValidBwd ([\ID])
[\ID]
Identifier
Data type: pathrecid
Variable that specifies the name of the recording start position. Data type pathrecid is a
non-value type, only used as an identifier for naming the recording position.
Program execution
Before the path recorder is ordered to move backwards with PathRecMoveBwd it is possible
to check whether a valid recorded path is present with PathRecValidBwd .
More examples
More examples of how to use the function PathRecValidBwd are illustrated below.
Example 1
PathRecStart id1;
MoveL p1, vmax, z50, tool1;
MoveL p2, vmax, z50, tool1;
bwd_path := PathRecValidBwd (\ID := id1);
The path recorder is started and two move instructions are executed. PathRecValidBwd will
return TRUE and the available backup path will be:
p2 -> p1 -> Start postion .
Example 2
PathRecStart id1;
MoveL p1, vmax, z50, tool1;
MoveL p2, vmax, z50, tool1;
PathRecStop \Clear;
bwd_path:= PathRecValidBwd (\ID := id1);
The path recorder is started and two move instructions are executed. Then the path recorder
is stopped and cleared. PathRecValidBwd will return FALSE.
Example 3
PathRecStart id1;
MoveL p1, vmax, z50, tool1;
PathRecStart id2;
MoveL p2, vmax, z50, tool1;
bwd_path := PathRecValidBwd ();
The path recorder is started and one move instruction is executed. Then, an additional path
identifier is started followed by a move instruction. PathRecValidBwd will return TRUE
and the backup path will be:
p2 -> p1 .
Continued
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 924
|
2 Functions
2.85. PathRecValidBwd - Is there a valid backward path recorded
Path Recovery
921
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.85. PathRecValidBwd - Is there a valid backward path recorded
Usage
PathRecValidBwd is used to check if the path recorder is active and if a recorded backward
path is available.
Basic examples
Basic examples of the function PathRecValidBwd are illustrated below.
See also More examples on page 922 .
Example 1
VAR bool bwd_path;
VAR pathrecid fixture_id;
bwd_path := PathRecValidBwd (\ID:=fixture_id);
The variable bwd_path is set to TRUE if it is possible to back-up to the position with
identifier fixture_id . If not, bwd_path is set to FALSE
Return value
Data type: bool
The return value of the function can be determined from following flow chart:
xx0500002132
![Image]
Continues on next page
2 Functions
2.85. PathRecValidBwd - Is there a valid backward path recorded
Path Recovery
3HAC 16581-1 Revision: J
922
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
PathRecValidBwd ([\ID])
[\ID]
Identifier
Data type: pathrecid
Variable that specifies the name of the recording start position. Data type pathrecid is a
non-value type, only used as an identifier for naming the recording position.
Program execution
Before the path recorder is ordered to move backwards with PathRecMoveBwd it is possible
to check whether a valid recorded path is present with PathRecValidBwd .
More examples
More examples of how to use the function PathRecValidBwd are illustrated below.
Example 1
PathRecStart id1;
MoveL p1, vmax, z50, tool1;
MoveL p2, vmax, z50, tool1;
bwd_path := PathRecValidBwd (\ID := id1);
The path recorder is started and two move instructions are executed. PathRecValidBwd will
return TRUE and the available backup path will be:
p2 -> p1 -> Start postion .
Example 2
PathRecStart id1;
MoveL p1, vmax, z50, tool1;
MoveL p2, vmax, z50, tool1;
PathRecStop \Clear;
bwd_path:= PathRecValidBwd (\ID := id1);
The path recorder is started and two move instructions are executed. Then the path recorder
is stopped and cleared. PathRecValidBwd will return FALSE.
Example 3
PathRecStart id1;
MoveL p1, vmax, z50, tool1;
PathRecStart id2;
MoveL p2, vmax, z50, tool1;
bwd_path := PathRecValidBwd ();
The path recorder is started and one move instruction is executed. Then, an additional path
identifier is started followed by a move instruction. PathRecValidBwd will return TRUE
and the backup path will be:
p2 -> p1 .
Continued
Continues on next page
2 Functions
2.85. PathRecValidBwd - Is there a valid backward path recorded
Path Recovery
923
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Example 4
PathRecStart id1;
MoveL p1, vmax, z50, tool1;
WaitSyncTask sync101, tasklist_r1o1;
MoveL p2, vmax, z50, tool1;
bwd_path1 := PathRecValidBwd ();
bwd_path2 := PathRecValidBwd (\ID := id1);
Executing above program will result in that the boolean variable bwd_path1 will be assigned
TRUE since a valid backwards path to the WaitSyncTask statement exists. The boolean
variable bwd_path2 will be assigned FALSE since it isn’t possible to back up above a
WaitSyncTask statement.
Syntax
PathRecValidBwd ´(´
[´\´ ID‘ :=’ < variable ( VAR ) of pathrecid >] ’)’
A function with a return value of the data type bool .
Related information
For information about
See
Path Recorder Identifiers
pathrecid - Path recorder identifier on page
1158
Start - stop the path recorder
PathRecStart - Start the path recorder on page
308
PathRecStop - Stop the path recorder on page
311
Play the path recorder backward
PathRecMoveBwd - Move path recorder
backwards on page 298
Check if a valid forward path exists
PathRecValidFwd - Is there a valid forward
path recorded on page 924
Play the path recorder forward
PathRecMoveFwd - Move path recorder
forward on page 305
Motion in general
Technical reference manual - RAPID overview ,
section Motion and I/O principles
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 925
|
2 Functions
2.85. PathRecValidBwd - Is there a valid backward path recorded
Path Recovery
3HAC 16581-1 Revision: J
922
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
PathRecValidBwd ([\ID])
[\ID]
Identifier
Data type: pathrecid
Variable that specifies the name of the recording start position. Data type pathrecid is a
non-value type, only used as an identifier for naming the recording position.
Program execution
Before the path recorder is ordered to move backwards with PathRecMoveBwd it is possible
to check whether a valid recorded path is present with PathRecValidBwd .
More examples
More examples of how to use the function PathRecValidBwd are illustrated below.
Example 1
PathRecStart id1;
MoveL p1, vmax, z50, tool1;
MoveL p2, vmax, z50, tool1;
bwd_path := PathRecValidBwd (\ID := id1);
The path recorder is started and two move instructions are executed. PathRecValidBwd will
return TRUE and the available backup path will be:
p2 -> p1 -> Start postion .
Example 2
PathRecStart id1;
MoveL p1, vmax, z50, tool1;
MoveL p2, vmax, z50, tool1;
PathRecStop \Clear;
bwd_path:= PathRecValidBwd (\ID := id1);
The path recorder is started and two move instructions are executed. Then the path recorder
is stopped and cleared. PathRecValidBwd will return FALSE.
Example 3
PathRecStart id1;
MoveL p1, vmax, z50, tool1;
PathRecStart id2;
MoveL p2, vmax, z50, tool1;
bwd_path := PathRecValidBwd ();
The path recorder is started and one move instruction is executed. Then, an additional path
identifier is started followed by a move instruction. PathRecValidBwd will return TRUE
and the backup path will be:
p2 -> p1 .
Continued
Continues on next page
2 Functions
2.85. PathRecValidBwd - Is there a valid backward path recorded
Path Recovery
923
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Example 4
PathRecStart id1;
MoveL p1, vmax, z50, tool1;
WaitSyncTask sync101, tasklist_r1o1;
MoveL p2, vmax, z50, tool1;
bwd_path1 := PathRecValidBwd ();
bwd_path2 := PathRecValidBwd (\ID := id1);
Executing above program will result in that the boolean variable bwd_path1 will be assigned
TRUE since a valid backwards path to the WaitSyncTask statement exists. The boolean
variable bwd_path2 will be assigned FALSE since it isn’t possible to back up above a
WaitSyncTask statement.
Syntax
PathRecValidBwd ´(´
[´\´ ID‘ :=’ < variable ( VAR ) of pathrecid >] ’)’
A function with a return value of the data type bool .
Related information
For information about
See
Path Recorder Identifiers
pathrecid - Path recorder identifier on page
1158
Start - stop the path recorder
PathRecStart - Start the path recorder on page
308
PathRecStop - Stop the path recorder on page
311
Play the path recorder backward
PathRecMoveBwd - Move path recorder
backwards on page 298
Check if a valid forward path exists
PathRecValidFwd - Is there a valid forward
path recorded on page 924
Play the path recorder forward
PathRecMoveFwd - Move path recorder
forward on page 305
Motion in general
Technical reference manual - RAPID overview ,
section Motion and I/O principles
Continued
2 Functions
2.86. PathRecValidFwd - Is there a valid forward path recorded
Path Recovery
3HAC 16581-1 Revision: J
924
© Copyright 2004-2010 ABB. All rights reserved.
2.86. PathRecValidFwd - Is there a valid forward path recorded
Usage
PathRecValidFwd is used to check if the path recorder can be used to move forward. The
ability to move forward with the path recorder implies that the path recorder must have been
ordered to move backwards earlier.
Basic examples
Basic examples of the function PathRecValidFwd are illustrated below.
See also More examples on page 925 .
Example 1
VAR bool fwd_path;
VAR pathrecid fixture_id;
fwd_path:= PathRecValidFwd (\ID:=fixture_id);
The variable fwd_path is set to TRUE if it is possible to move forward to the position with
the with identifier fixture_id. If not, fwd_path is set to FALSE .
Return Value
Data type: bool
The return value of PathRecValidFwd without specified \ID is:
TRUE if:
•
The path recorder has moved the robot backwards, using PathRecMoveBwd .
•
The robot has not moved away from the path executed by PathRecMoveBwd .
FALSE if:
•
The above stated conditions are not met.
The return value of PathRecValidFwd with specified \ID is:
TRUE if:
•
The path recorder has moved the robot backwards, using PathRecMoveBwd .
•
The robot has not moved away from the path executed by PathRecMoveBwd .
•
The specified \ID was passed during the backward motion.
FALSE if:
•
The above stated conditions are not met.
Arguments
PathRecValidFwd ([\ID])
[\ID]
Identifier
Data type: pathrecid
Variable that specifies the name of the recording start position. Data type pathrecid is a
non-value type, only used as an identifier for naming the recording position.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 926
|
2 Functions
2.85. PathRecValidBwd - Is there a valid backward path recorded
Path Recovery
923
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Example 4
PathRecStart id1;
MoveL p1, vmax, z50, tool1;
WaitSyncTask sync101, tasklist_r1o1;
MoveL p2, vmax, z50, tool1;
bwd_path1 := PathRecValidBwd ();
bwd_path2 := PathRecValidBwd (\ID := id1);
Executing above program will result in that the boolean variable bwd_path1 will be assigned
TRUE since a valid backwards path to the WaitSyncTask statement exists. The boolean
variable bwd_path2 will be assigned FALSE since it isn’t possible to back up above a
WaitSyncTask statement.
Syntax
PathRecValidBwd ´(´
[´\´ ID‘ :=’ < variable ( VAR ) of pathrecid >] ’)’
A function with a return value of the data type bool .
Related information
For information about
See
Path Recorder Identifiers
pathrecid - Path recorder identifier on page
1158
Start - stop the path recorder
PathRecStart - Start the path recorder on page
308
PathRecStop - Stop the path recorder on page
311
Play the path recorder backward
PathRecMoveBwd - Move path recorder
backwards on page 298
Check if a valid forward path exists
PathRecValidFwd - Is there a valid forward
path recorded on page 924
Play the path recorder forward
PathRecMoveFwd - Move path recorder
forward on page 305
Motion in general
Technical reference manual - RAPID overview ,
section Motion and I/O principles
Continued
2 Functions
2.86. PathRecValidFwd - Is there a valid forward path recorded
Path Recovery
3HAC 16581-1 Revision: J
924
© Copyright 2004-2010 ABB. All rights reserved.
2.86. PathRecValidFwd - Is there a valid forward path recorded
Usage
PathRecValidFwd is used to check if the path recorder can be used to move forward. The
ability to move forward with the path recorder implies that the path recorder must have been
ordered to move backwards earlier.
Basic examples
Basic examples of the function PathRecValidFwd are illustrated below.
See also More examples on page 925 .
Example 1
VAR bool fwd_path;
VAR pathrecid fixture_id;
fwd_path:= PathRecValidFwd (\ID:=fixture_id);
The variable fwd_path is set to TRUE if it is possible to move forward to the position with
the with identifier fixture_id. If not, fwd_path is set to FALSE .
Return Value
Data type: bool
The return value of PathRecValidFwd without specified \ID is:
TRUE if:
•
The path recorder has moved the robot backwards, using PathRecMoveBwd .
•
The robot has not moved away from the path executed by PathRecMoveBwd .
FALSE if:
•
The above stated conditions are not met.
The return value of PathRecValidFwd with specified \ID is:
TRUE if:
•
The path recorder has moved the robot backwards, using PathRecMoveBwd .
•
The robot has not moved away from the path executed by PathRecMoveBwd .
•
The specified \ID was passed during the backward motion.
FALSE if:
•
The above stated conditions are not met.
Arguments
PathRecValidFwd ([\ID])
[\ID]
Identifier
Data type: pathrecid
Variable that specifies the name of the recording start position. Data type pathrecid is a
non-value type, only used as an identifier for naming the recording position.
Continues on next page
2 Functions
2.86. PathRecValidFwd - Is there a valid forward path recorded
Path Recovery
925
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Program execution
After the path recorder has been ordered to move backwards using PathRecMoveBwd it is
possible to check if a valid recorded path to move the robot forward exists. If the identifier
\ID is omitted PathRevValidFwd returns if it is possible to move forward to the position
where the backwards movement was initiated.
More examples
More examples of how to use the function PathRecValidFwd are illustrated below.
Example 1
VAR pathrecid id1;
VAR pathrecid id2;
VAR pathrecid id3;
PathRecStart id1;
MoveL p1, vmax, z50, tool1;
PathRecStart id2;
MoveL p2, vmax, z50, tool1;
PathRecStart id3;
!See figures 1 and 8 in tbe following table.
MoveL p3, vmax, z50, tool1;
ERROR
StorePath;
IF PathRecValidBwd(\ID:=id3) THEN
!See figure 2 in the following table.
PathRecMoveBwd \ID:=id3;
! Do some other operation
ENDIF
IF PathRecValidBwd(\ID:=id2) THEN
!See figure 3 in the following table.
PathRecMoveBwd \ID:=id2;
! Do some other operation
ENDIF
!See figure 4 in the following table.
PathRecMoveBwd;
! Do final service action
IF PathRecValidFwd(\ID:=id2) THEN
!See figure 5 in the following table.
PathRecMoveFwd \ID:=id2;
! Do some other operation
ENDIF
IF PathRecValidFwd(\ID:=id3) THEN
!See figure 6 in the following table.
PathRecMoveFwd \ID:=id3;
! Do some other operation
ENDIF
Continued
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 927
|
2 Functions
2.86. PathRecValidFwd - Is there a valid forward path recorded
Path Recovery
3HAC 16581-1 Revision: J
924
© Copyright 2004-2010 ABB. All rights reserved.
2.86. PathRecValidFwd - Is there a valid forward path recorded
Usage
PathRecValidFwd is used to check if the path recorder can be used to move forward. The
ability to move forward with the path recorder implies that the path recorder must have been
ordered to move backwards earlier.
Basic examples
Basic examples of the function PathRecValidFwd are illustrated below.
See also More examples on page 925 .
Example 1
VAR bool fwd_path;
VAR pathrecid fixture_id;
fwd_path:= PathRecValidFwd (\ID:=fixture_id);
The variable fwd_path is set to TRUE if it is possible to move forward to the position with
the with identifier fixture_id. If not, fwd_path is set to FALSE .
Return Value
Data type: bool
The return value of PathRecValidFwd without specified \ID is:
TRUE if:
•
The path recorder has moved the robot backwards, using PathRecMoveBwd .
•
The robot has not moved away from the path executed by PathRecMoveBwd .
FALSE if:
•
The above stated conditions are not met.
The return value of PathRecValidFwd with specified \ID is:
TRUE if:
•
The path recorder has moved the robot backwards, using PathRecMoveBwd .
•
The robot has not moved away from the path executed by PathRecMoveBwd .
•
The specified \ID was passed during the backward motion.
FALSE if:
•
The above stated conditions are not met.
Arguments
PathRecValidFwd ([\ID])
[\ID]
Identifier
Data type: pathrecid
Variable that specifies the name of the recording start position. Data type pathrecid is a
non-value type, only used as an identifier for naming the recording position.
Continues on next page
2 Functions
2.86. PathRecValidFwd - Is there a valid forward path recorded
Path Recovery
925
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Program execution
After the path recorder has been ordered to move backwards using PathRecMoveBwd it is
possible to check if a valid recorded path to move the robot forward exists. If the identifier
\ID is omitted PathRevValidFwd returns if it is possible to move forward to the position
where the backwards movement was initiated.
More examples
More examples of how to use the function PathRecValidFwd are illustrated below.
Example 1
VAR pathrecid id1;
VAR pathrecid id2;
VAR pathrecid id3;
PathRecStart id1;
MoveL p1, vmax, z50, tool1;
PathRecStart id2;
MoveL p2, vmax, z50, tool1;
PathRecStart id3;
!See figures 1 and 8 in tbe following table.
MoveL p3, vmax, z50, tool1;
ERROR
StorePath;
IF PathRecValidBwd(\ID:=id3) THEN
!See figure 2 in the following table.
PathRecMoveBwd \ID:=id3;
! Do some other operation
ENDIF
IF PathRecValidBwd(\ID:=id2) THEN
!See figure 3 in the following table.
PathRecMoveBwd \ID:=id2;
! Do some other operation
ENDIF
!See figure 4 in the following table.
PathRecMoveBwd;
! Do final service action
IF PathRecValidFwd(\ID:=id2) THEN
!See figure 5 in the following table.
PathRecMoveFwd \ID:=id2;
! Do some other operation
ENDIF
IF PathRecValidFwd(\ID:=id3) THEN
!See figure 6 in the following table.
PathRecMoveFwd \ID:=id3;
! Do some other operation
ENDIF
Continued
Continues on next page
2 Functions
2.86. PathRecValidFwd - Is there a valid forward path recorded
Path Recovery
3HAC 16581-1 Revision: J
926
© Copyright 2004-2010 ABB. All rights reserved.
!See figure 7 in the following table.
PathRecMoveFwd;
RestoPath;
StartMove;
RETRY;
1
xx0500002121
2
xx0500002124
3
xx0500002126
4
xx0500002127
5
xx0500002128
6
xx0500002129
7
xx0500002138
Continued
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 928
|
2 Functions
2.86. PathRecValidFwd - Is there a valid forward path recorded
Path Recovery
925
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Program execution
After the path recorder has been ordered to move backwards using PathRecMoveBwd it is
possible to check if a valid recorded path to move the robot forward exists. If the identifier
\ID is omitted PathRevValidFwd returns if it is possible to move forward to the position
where the backwards movement was initiated.
More examples
More examples of how to use the function PathRecValidFwd are illustrated below.
Example 1
VAR pathrecid id1;
VAR pathrecid id2;
VAR pathrecid id3;
PathRecStart id1;
MoveL p1, vmax, z50, tool1;
PathRecStart id2;
MoveL p2, vmax, z50, tool1;
PathRecStart id3;
!See figures 1 and 8 in tbe following table.
MoveL p3, vmax, z50, tool1;
ERROR
StorePath;
IF PathRecValidBwd(\ID:=id3) THEN
!See figure 2 in the following table.
PathRecMoveBwd \ID:=id3;
! Do some other operation
ENDIF
IF PathRecValidBwd(\ID:=id2) THEN
!See figure 3 in the following table.
PathRecMoveBwd \ID:=id2;
! Do some other operation
ENDIF
!See figure 4 in the following table.
PathRecMoveBwd;
! Do final service action
IF PathRecValidFwd(\ID:=id2) THEN
!See figure 5 in the following table.
PathRecMoveFwd \ID:=id2;
! Do some other operation
ENDIF
IF PathRecValidFwd(\ID:=id3) THEN
!See figure 6 in the following table.
PathRecMoveFwd \ID:=id3;
! Do some other operation
ENDIF
Continued
Continues on next page
2 Functions
2.86. PathRecValidFwd - Is there a valid forward path recorded
Path Recovery
3HAC 16581-1 Revision: J
926
© Copyright 2004-2010 ABB. All rights reserved.
!See figure 7 in the following table.
PathRecMoveFwd;
RestoPath;
StartMove;
RETRY;
1
xx0500002121
2
xx0500002124
3
xx0500002126
4
xx0500002127
5
xx0500002128
6
xx0500002129
7
xx0500002138
Continued
Continues on next page
2 Functions
2.86. PathRecValidFwd - Is there a valid forward path recorded
Path Recovery
927
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
The example above will start the path recorder and add identifiers at three different locations
along the executed path. The picture above references the example code and describes how
the robot will move in the case of an error while executing towards point p3 . The
PathRecValidBwd and PathRecValidFwd are used respectively as it is not possible in
advance to determine where in the program a possible error occurs.
Syntax
PathRecValidFwd ´(´
[´\’ ID‘:=’ < variable ( VAR ) of pathrecid >] ’)’
A function with a return value of the data type bool .
Related information
8
xx0500002131
For information about
See
Path Recorder Identifiers
pathrecid - Path recorder identifier on page 1158
Start - stop the path recorder
PathRecStart - Start the path recorder on page
308
PathRecStop - Stop the path recorder on page 311
Check if valid backward path exists
PathRecValidBwd - Is there a valid backward path
recorded on page 921
Play the path recorder backward
PathRecMoveBwd - Move path recorder
backwards on page 298
Play the path recorder forward
PathRecMoveFwd - Move path recorder forward
on page 305
Motion in general
Technical reference manual - RAPID overview ,
section Motion and I/O principles
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 929
|
2 Functions
2.86. PathRecValidFwd - Is there a valid forward path recorded
Path Recovery
3HAC 16581-1 Revision: J
926
© Copyright 2004-2010 ABB. All rights reserved.
!See figure 7 in the following table.
PathRecMoveFwd;
RestoPath;
StartMove;
RETRY;
1
xx0500002121
2
xx0500002124
3
xx0500002126
4
xx0500002127
5
xx0500002128
6
xx0500002129
7
xx0500002138
Continued
Continues on next page
2 Functions
2.86. PathRecValidFwd - Is there a valid forward path recorded
Path Recovery
927
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
The example above will start the path recorder and add identifiers at three different locations
along the executed path. The picture above references the example code and describes how
the robot will move in the case of an error while executing towards point p3 . The
PathRecValidBwd and PathRecValidFwd are used respectively as it is not possible in
advance to determine where in the program a possible error occurs.
Syntax
PathRecValidFwd ´(´
[´\’ ID‘:=’ < variable ( VAR ) of pathrecid >] ’)’
A function with a return value of the data type bool .
Related information
8
xx0500002131
For information about
See
Path Recorder Identifiers
pathrecid - Path recorder identifier on page 1158
Start - stop the path recorder
PathRecStart - Start the path recorder on page
308
PathRecStop - Stop the path recorder on page 311
Check if valid backward path exists
PathRecValidBwd - Is there a valid backward path
recorded on page 921
Play the path recorder backward
PathRecMoveBwd - Move path recorder
backwards on page 298
Play the path recorder forward
PathRecMoveFwd - Move path recorder forward
on page 305
Motion in general
Technical reference manual - RAPID overview ,
section Motion and I/O principles
Continued
2 Functions
2.87. PFRestart - Check interrupted path after power failure
RobotWare - OS
3HAC 16581-1 Revision: J
928
© Copyright 2004-2010 ABB. All rights reserved.
2.87. PFRestart - Check interrupted path after power failure
Usage
PFRestart (Power Failure Restart) is used to check if the path has been interrupted at power
failure. If so it might be necessary to make some specific actions. The function checks the
path on current level, base level or on interrupt level.
Basic examples
Basic examples of the function PFRestart are illustrated below.
Example 1
IF PFRestart() = TRUE THEN
It is checked, if an interrupted path exists on the current level. If so the function will return
TRUE .
Return value
Data type: bool
TRUE if an interrupted path exists on the specified path level, otherwise FALSE .
Arguments
PFRestart([\Base] | [\Irpt])
[ \Base ]
Base Level
Data type: switch
Returns TRUE if an interrupted path exists on base level.
[ \Irpt ]
Interrupt Level
Data type: switch
Returns TRUE if an interrupted path exists on StorePath level.
If no argument is given, the function will return TRUE if an interrupted path exists on current
level.
Syntax
PFRestart’(’
[’\’Base] | [’\’Irpt]’)’
A function with a return value of the data type bool .
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 930
|
2 Functions
2.86. PathRecValidFwd - Is there a valid forward path recorded
Path Recovery
927
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
The example above will start the path recorder and add identifiers at three different locations
along the executed path. The picture above references the example code and describes how
the robot will move in the case of an error while executing towards point p3 . The
PathRecValidBwd and PathRecValidFwd are used respectively as it is not possible in
advance to determine where in the program a possible error occurs.
Syntax
PathRecValidFwd ´(´
[´\’ ID‘:=’ < variable ( VAR ) of pathrecid >] ’)’
A function with a return value of the data type bool .
Related information
8
xx0500002131
For information about
See
Path Recorder Identifiers
pathrecid - Path recorder identifier on page 1158
Start - stop the path recorder
PathRecStart - Start the path recorder on page
308
PathRecStop - Stop the path recorder on page 311
Check if valid backward path exists
PathRecValidBwd - Is there a valid backward path
recorded on page 921
Play the path recorder backward
PathRecMoveBwd - Move path recorder
backwards on page 298
Play the path recorder forward
PathRecMoveFwd - Move path recorder forward
on page 305
Motion in general
Technical reference manual - RAPID overview ,
section Motion and I/O principles
Continued
2 Functions
2.87. PFRestart - Check interrupted path after power failure
RobotWare - OS
3HAC 16581-1 Revision: J
928
© Copyright 2004-2010 ABB. All rights reserved.
2.87. PFRestart - Check interrupted path after power failure
Usage
PFRestart (Power Failure Restart) is used to check if the path has been interrupted at power
failure. If so it might be necessary to make some specific actions. The function checks the
path on current level, base level or on interrupt level.
Basic examples
Basic examples of the function PFRestart are illustrated below.
Example 1
IF PFRestart() = TRUE THEN
It is checked, if an interrupted path exists on the current level. If so the function will return
TRUE .
Return value
Data type: bool
TRUE if an interrupted path exists on the specified path level, otherwise FALSE .
Arguments
PFRestart([\Base] | [\Irpt])
[ \Base ]
Base Level
Data type: switch
Returns TRUE if an interrupted path exists on base level.
[ \Irpt ]
Interrupt Level
Data type: switch
Returns TRUE if an interrupted path exists on StorePath level.
If no argument is given, the function will return TRUE if an interrupted path exists on current
level.
Syntax
PFRestart’(’
[’\’Base] | [’\’Irpt]’)’
A function with a return value of the data type bool .
2 Functions
2.88. PoseInv - Inverts pose data
RobotWare - OS
929
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.88. PoseInv - Inverts pose data
Usage
PoseInv ( Pose Invert ) calculates the reverse transformation of a pose .
Basic examples
Basic examples of the function PoseInv are illustrated below.
Example 1
xx0500002443
Pose1 represents the coordinates system 1 related to the coordinate system 0. The
transformation giving the coordinate system 0 related to the coordinate system 1 is obtained
by the reverse transformation, stored in pose2.
VAR pose pose1;
VAR pose pose2;
...
pose2 := PoseInv(pose1);
Return value
Data type: pose
The value of the reverse pose.
Arguments
PoseInv (Pose)
Pose
Data type: pose
The pose to invert.
Syntax
PoseInv’(’
[Pose ’:=’] <expression ( IN ) of pose>
’)’
A function with a return value of the data type pose .
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 931
|
2 Functions
2.87. PFRestart - Check interrupted path after power failure
RobotWare - OS
3HAC 16581-1 Revision: J
928
© Copyright 2004-2010 ABB. All rights reserved.
2.87. PFRestart - Check interrupted path after power failure
Usage
PFRestart (Power Failure Restart) is used to check if the path has been interrupted at power
failure. If so it might be necessary to make some specific actions. The function checks the
path on current level, base level or on interrupt level.
Basic examples
Basic examples of the function PFRestart are illustrated below.
Example 1
IF PFRestart() = TRUE THEN
It is checked, if an interrupted path exists on the current level. If so the function will return
TRUE .
Return value
Data type: bool
TRUE if an interrupted path exists on the specified path level, otherwise FALSE .
Arguments
PFRestart([\Base] | [\Irpt])
[ \Base ]
Base Level
Data type: switch
Returns TRUE if an interrupted path exists on base level.
[ \Irpt ]
Interrupt Level
Data type: switch
Returns TRUE if an interrupted path exists on StorePath level.
If no argument is given, the function will return TRUE if an interrupted path exists on current
level.
Syntax
PFRestart’(’
[’\’Base] | [’\’Irpt]’)’
A function with a return value of the data type bool .
2 Functions
2.88. PoseInv - Inverts pose data
RobotWare - OS
929
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.88. PoseInv - Inverts pose data
Usage
PoseInv ( Pose Invert ) calculates the reverse transformation of a pose .
Basic examples
Basic examples of the function PoseInv are illustrated below.
Example 1
xx0500002443
Pose1 represents the coordinates system 1 related to the coordinate system 0. The
transformation giving the coordinate system 0 related to the coordinate system 1 is obtained
by the reverse transformation, stored in pose2.
VAR pose pose1;
VAR pose pose2;
...
pose2 := PoseInv(pose1);
Return value
Data type: pose
The value of the reverse pose.
Arguments
PoseInv (Pose)
Pose
Data type: pose
The pose to invert.
Syntax
PoseInv’(’
[Pose ’:=’] <expression ( IN ) of pose>
’)’
A function with a return value of the data type pose .
Continues on next page
2 Functions
2.88. PoseInv - Inverts pose data
RobotWare - OS
3HAC 16581-1 Revision: J
930
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID
overview , section RAPID summary -
Mathematics
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 932
|
2 Functions
2.88. PoseInv - Inverts pose data
RobotWare - OS
929
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.88. PoseInv - Inverts pose data
Usage
PoseInv ( Pose Invert ) calculates the reverse transformation of a pose .
Basic examples
Basic examples of the function PoseInv are illustrated below.
Example 1
xx0500002443
Pose1 represents the coordinates system 1 related to the coordinate system 0. The
transformation giving the coordinate system 0 related to the coordinate system 1 is obtained
by the reverse transformation, stored in pose2.
VAR pose pose1;
VAR pose pose2;
...
pose2 := PoseInv(pose1);
Return value
Data type: pose
The value of the reverse pose.
Arguments
PoseInv (Pose)
Pose
Data type: pose
The pose to invert.
Syntax
PoseInv’(’
[Pose ’:=’] <expression ( IN ) of pose>
’)’
A function with a return value of the data type pose .
Continues on next page
2 Functions
2.88. PoseInv - Inverts pose data
RobotWare - OS
3HAC 16581-1 Revision: J
930
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID
overview , section RAPID summary -
Mathematics
Continued
2 Functions
2.89. PoseMult - Multiplies pose data
RobotWare - OS
931
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.89. PoseMult - Multiplies pose data
Usage
PoseMult ( Pose Multiply ) is used to calculate the product of two pose transformations. A
typical use is to calculate a new pose as the result of a displacement acting on an original pose.
Basic examples
Basic examples of the function PoseMult are illustrated below.
Example 1
xx0500002444
pose1 represents the coordinate system 1 related to the coordinate system 0. pose2
represents the coordinate system 2 related to the coordinate system 1. The transformation
giving pose3 , the coordinate system 2 related to the coordinate system 0, is obtained by the
product of the two transformations:
VAR pose pose1;
VAR pose pose2;
VAR pose pose3;
...
pose3 := PoseMult(pose1, pose2);
Return value
Data type: pose
The value of the product of the two poses.
Arguments
PoseMult (Pose1 Pose2)
Pose1
Data type: pose
The first pose.
Pose2
Data type: pose
The second pose.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 933
|
2 Functions
2.88. PoseInv - Inverts pose data
RobotWare - OS
3HAC 16581-1 Revision: J
930
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID
overview , section RAPID summary -
Mathematics
Continued
2 Functions
2.89. PoseMult - Multiplies pose data
RobotWare - OS
931
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.89. PoseMult - Multiplies pose data
Usage
PoseMult ( Pose Multiply ) is used to calculate the product of two pose transformations. A
typical use is to calculate a new pose as the result of a displacement acting on an original pose.
Basic examples
Basic examples of the function PoseMult are illustrated below.
Example 1
xx0500002444
pose1 represents the coordinate system 1 related to the coordinate system 0. pose2
represents the coordinate system 2 related to the coordinate system 1. The transformation
giving pose3 , the coordinate system 2 related to the coordinate system 0, is obtained by the
product of the two transformations:
VAR pose pose1;
VAR pose pose2;
VAR pose pose3;
...
pose3 := PoseMult(pose1, pose2);
Return value
Data type: pose
The value of the product of the two poses.
Arguments
PoseMult (Pose1 Pose2)
Pose1
Data type: pose
The first pose.
Pose2
Data type: pose
The second pose.
Continues on next page
2 Functions
2.89. PoseMult - Multiplies pose data
RobotWare - OS
3HAC 16581-1 Revision: J
932
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
PoseMult’(’
[Pose1 ’:=’] <expression ( IN ) of pose>’,’
[Pose2 ’:=’] <expression ( IN ) of pose>
’)’
A function with a return value of the data type pose .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID
overview , section RAPID summary -
Mathematics
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 934
|
2 Functions
2.89. PoseMult - Multiplies pose data
RobotWare - OS
931
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.89. PoseMult - Multiplies pose data
Usage
PoseMult ( Pose Multiply ) is used to calculate the product of two pose transformations. A
typical use is to calculate a new pose as the result of a displacement acting on an original pose.
Basic examples
Basic examples of the function PoseMult are illustrated below.
Example 1
xx0500002444
pose1 represents the coordinate system 1 related to the coordinate system 0. pose2
represents the coordinate system 2 related to the coordinate system 1. The transformation
giving pose3 , the coordinate system 2 related to the coordinate system 0, is obtained by the
product of the two transformations:
VAR pose pose1;
VAR pose pose2;
VAR pose pose3;
...
pose3 := PoseMult(pose1, pose2);
Return value
Data type: pose
The value of the product of the two poses.
Arguments
PoseMult (Pose1 Pose2)
Pose1
Data type: pose
The first pose.
Pose2
Data type: pose
The second pose.
Continues on next page
2 Functions
2.89. PoseMult - Multiplies pose data
RobotWare - OS
3HAC 16581-1 Revision: J
932
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
PoseMult’(’
[Pose1 ’:=’] <expression ( IN ) of pose>’,’
[Pose2 ’:=’] <expression ( IN ) of pose>
’)’
A function with a return value of the data type pose .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID
overview , section RAPID summary -
Mathematics
Continued
2 Functions
2.90. PoseVect - Applies a transformation to a vector
RobotWare - OS
933
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.90. PoseVect - Applies a transformation to a vector
Usage
PoseVect ( Pose Vector ) is used to calculate the product of a pose and a vector. It is typically
used to calculate a vector as the result of the effect of a displacement on an original vector.
Basic examples
Basic examples of the function PoseVect are illustrated below.
Example 1
xx0500002445
pose1 represents the coordinates system 1 related to the coordinate system 0.
pos1 is a vector related to coordinate system 1. The corresponding vector related to
coordinate system 0 is obtained by the product;
VAR pose pose1;
VAR pos pos1;
VAR pos pos2;
...
...
pos2:= PoseVect(pose1, pos1);
Return value
Data type: pos
The value of the product of the pose and the original pos.
Arguments
PoseVect (Pose Pos)
Pose
Data type: pose
The transformation to be applied.
Pos
Data type: pos
The pos to be transformed.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 935
|
2 Functions
2.89. PoseMult - Multiplies pose data
RobotWare - OS
3HAC 16581-1 Revision: J
932
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
PoseMult’(’
[Pose1 ’:=’] <expression ( IN ) of pose>’,’
[Pose2 ’:=’] <expression ( IN ) of pose>
’)’
A function with a return value of the data type pose .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID
overview , section RAPID summary -
Mathematics
Continued
2 Functions
2.90. PoseVect - Applies a transformation to a vector
RobotWare - OS
933
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.90. PoseVect - Applies a transformation to a vector
Usage
PoseVect ( Pose Vector ) is used to calculate the product of a pose and a vector. It is typically
used to calculate a vector as the result of the effect of a displacement on an original vector.
Basic examples
Basic examples of the function PoseVect are illustrated below.
Example 1
xx0500002445
pose1 represents the coordinates system 1 related to the coordinate system 0.
pos1 is a vector related to coordinate system 1. The corresponding vector related to
coordinate system 0 is obtained by the product;
VAR pose pose1;
VAR pos pos1;
VAR pos pos2;
...
...
pos2:= PoseVect(pose1, pos1);
Return value
Data type: pos
The value of the product of the pose and the original pos.
Arguments
PoseVect (Pose Pos)
Pose
Data type: pose
The transformation to be applied.
Pos
Data type: pos
The pos to be transformed.
Continues on next page
2 Functions
2.90. PoseVect - Applies a transformation to a vector
RobotWare - OS
3HAC 16581-1 Revision: J
934
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
PoseVect’(’
[Pose ’:=’] <expression ( IN ) of pose>’,’
[Pos ’:=’] <expression ( IN ) of pos>
’)’
A function with a return value of the data type pos .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID
overview , section RAPID summary -
Mathematics
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 936
|
2 Functions
2.90. PoseVect - Applies a transformation to a vector
RobotWare - OS
933
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.90. PoseVect - Applies a transformation to a vector
Usage
PoseVect ( Pose Vector ) is used to calculate the product of a pose and a vector. It is typically
used to calculate a vector as the result of the effect of a displacement on an original vector.
Basic examples
Basic examples of the function PoseVect are illustrated below.
Example 1
xx0500002445
pose1 represents the coordinates system 1 related to the coordinate system 0.
pos1 is a vector related to coordinate system 1. The corresponding vector related to
coordinate system 0 is obtained by the product;
VAR pose pose1;
VAR pos pos1;
VAR pos pos2;
...
...
pos2:= PoseVect(pose1, pos1);
Return value
Data type: pos
The value of the product of the pose and the original pos.
Arguments
PoseVect (Pose Pos)
Pose
Data type: pose
The transformation to be applied.
Pos
Data type: pos
The pos to be transformed.
Continues on next page
2 Functions
2.90. PoseVect - Applies a transformation to a vector
RobotWare - OS
3HAC 16581-1 Revision: J
934
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
PoseVect’(’
[Pose ’:=’] <expression ( IN ) of pose>’,’
[Pos ’:=’] <expression ( IN ) of pos>
’)’
A function with a return value of the data type pos .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID
overview , section RAPID summary -
Mathematics
Continued
2 Functions
2.91. Pow - Calculates the power of a value
RobotWare - OS
935
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.91. Pow - Calculates the power of a value
Usage
Pow ( Power ) is used to calculate the exponential value in any base.
Basic examples
Basic examples of the function Pow are illustrated below.
Example 1
VAR num x;
VAR num y
VAR num reg1;
...
reg1:= Pow(x, y);
reg1 is assigned the value x y .
Return value
Data type: num
The value of the Base raised to the power of the Exponent, i.e. Base Exponent .
Arguments
Pow (Base Exponent)
Base
Data type: num
The base argument value.
Exponent
Data type: num
The exponent argument value.
Limitations
The execution of the function x y will give an error if:
•
x < 0 and y is not an integer;
•
x = 0 and y ≤ 0.
Syntax
Pow’(’
[Base ’:=’] <expression ( IN ) of num>’,’
[Exponent ’:=’] <expression ( IN ) of num>
’)’
A function with a return value of the data type num .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID overview ,
section RAPID summary - Mathematics
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 937
|
2 Functions
2.90. PoseVect - Applies a transformation to a vector
RobotWare - OS
3HAC 16581-1 Revision: J
934
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
PoseVect’(’
[Pose ’:=’] <expression ( IN ) of pose>’,’
[Pos ’:=’] <expression ( IN ) of pos>
’)’
A function with a return value of the data type pos .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID
overview , section RAPID summary -
Mathematics
Continued
2 Functions
2.91. Pow - Calculates the power of a value
RobotWare - OS
935
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.91. Pow - Calculates the power of a value
Usage
Pow ( Power ) is used to calculate the exponential value in any base.
Basic examples
Basic examples of the function Pow are illustrated below.
Example 1
VAR num x;
VAR num y
VAR num reg1;
...
reg1:= Pow(x, y);
reg1 is assigned the value x y .
Return value
Data type: num
The value of the Base raised to the power of the Exponent, i.e. Base Exponent .
Arguments
Pow (Base Exponent)
Base
Data type: num
The base argument value.
Exponent
Data type: num
The exponent argument value.
Limitations
The execution of the function x y will give an error if:
•
x < 0 and y is not an integer;
•
x = 0 and y ≤ 0.
Syntax
Pow’(’
[Base ’:=’] <expression ( IN ) of num>’,’
[Exponent ’:=’] <expression ( IN ) of num>
’)’
A function with a return value of the data type num .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID overview ,
section RAPID summary - Mathematics
2 Functions
2.92. PPMovedInManMode - Test whether the program pointer is moved in manual mode
RobotWare - OS
3HAC 16581-1 Revision: J
936
© Copyright 2004-2010 ABB. All rights reserved.
2.92. PPMovedInManMode - Test whether the program pointer is moved in manual
mode
Usage
PPMovedInManMode returns TRUE if the user has moved the program pointer while the
controller is in manual mode - that is, operator key is at Man Reduced Speed or Man Full
Speed. The program pointer moved state is reset when the key is switched from Auto to Man,
or when using the instruction ResetPPMoved .
Basic examples
Basic example of the function PPMovedInManMode is illustrated below.
Example 1
IF PPMovedInManMode() THEN
WarnUserOfPPMovement;
DoJob;
ELSE
DoJob;
ENDIF
Return value
Data type: bool
TRUE if the program pointer has been moved by the user while in manual mode.
Program execution
Test if the program pointer for the current program task has been moved in manual mode.
Syntax
PPMovedInManMode’(’’)’
A function with a return value of the data type bool .
Related information
For information about
See
Test whether program pointer has moved
IsStopStateEvent - Test whether moved
program pointer on page 886
Reset state of moved program pointer in
manual mode
ResetPPMoved - Reset state for the program
pointer moved in manual mode on page 360
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 938
|
2 Functions
2.91. Pow - Calculates the power of a value
RobotWare - OS
935
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.91. Pow - Calculates the power of a value
Usage
Pow ( Power ) is used to calculate the exponential value in any base.
Basic examples
Basic examples of the function Pow are illustrated below.
Example 1
VAR num x;
VAR num y
VAR num reg1;
...
reg1:= Pow(x, y);
reg1 is assigned the value x y .
Return value
Data type: num
The value of the Base raised to the power of the Exponent, i.e. Base Exponent .
Arguments
Pow (Base Exponent)
Base
Data type: num
The base argument value.
Exponent
Data type: num
The exponent argument value.
Limitations
The execution of the function x y will give an error if:
•
x < 0 and y is not an integer;
•
x = 0 and y ≤ 0.
Syntax
Pow’(’
[Base ’:=’] <expression ( IN ) of num>’,’
[Exponent ’:=’] <expression ( IN ) of num>
’)’
A function with a return value of the data type num .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID overview ,
section RAPID summary - Mathematics
2 Functions
2.92. PPMovedInManMode - Test whether the program pointer is moved in manual mode
RobotWare - OS
3HAC 16581-1 Revision: J
936
© Copyright 2004-2010 ABB. All rights reserved.
2.92. PPMovedInManMode - Test whether the program pointer is moved in manual
mode
Usage
PPMovedInManMode returns TRUE if the user has moved the program pointer while the
controller is in manual mode - that is, operator key is at Man Reduced Speed or Man Full
Speed. The program pointer moved state is reset when the key is switched from Auto to Man,
or when using the instruction ResetPPMoved .
Basic examples
Basic example of the function PPMovedInManMode is illustrated below.
Example 1
IF PPMovedInManMode() THEN
WarnUserOfPPMovement;
DoJob;
ELSE
DoJob;
ENDIF
Return value
Data type: bool
TRUE if the program pointer has been moved by the user while in manual mode.
Program execution
Test if the program pointer for the current program task has been moved in manual mode.
Syntax
PPMovedInManMode’(’’)’
A function with a return value of the data type bool .
Related information
For information about
See
Test whether program pointer has moved
IsStopStateEvent - Test whether moved
program pointer on page 886
Reset state of moved program pointer in
manual mode
ResetPPMoved - Reset state for the program
pointer moved in manual mode on page 360
2 Functions
2.93. Present - Tests if an optional parameter is used
RobotWare - OS
937
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.93. Present - Tests if an optional parameter is used
Usage
Present is used to test if an optional argument has been used when calling a routine.
An optional parameter may not be used if it was not specified when calling the routine. This
function can be used to test if a parameter has been specified, in order to prevent errors from
occurring.
Basic examples
Basic examples of the function Present are illustrated below.
See also More examples on page 938 .
Example 1
PROC feeder (\switch on | \switch off)
IF Present (on) Set do1;
IF Present (off) Reset do1;
ENDPROC
The output do1 , which controls a feeder, is set or reset depending on the argument used when
calling the routine.
Return value
Data type: bool
TRUE = The parameter value or a switch has been defined when calling the routine.
FALSE = The parameter value or a switch has not been defined.
Arguments
Present (OptPar)
OptPar
Optional Parameter
Data type: Any type
The name of the optional parameter to be tested.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 939
|
2 Functions
2.92. PPMovedInManMode - Test whether the program pointer is moved in manual mode
RobotWare - OS
3HAC 16581-1 Revision: J
936
© Copyright 2004-2010 ABB. All rights reserved.
2.92. PPMovedInManMode - Test whether the program pointer is moved in manual
mode
Usage
PPMovedInManMode returns TRUE if the user has moved the program pointer while the
controller is in manual mode - that is, operator key is at Man Reduced Speed or Man Full
Speed. The program pointer moved state is reset when the key is switched from Auto to Man,
or when using the instruction ResetPPMoved .
Basic examples
Basic example of the function PPMovedInManMode is illustrated below.
Example 1
IF PPMovedInManMode() THEN
WarnUserOfPPMovement;
DoJob;
ELSE
DoJob;
ENDIF
Return value
Data type: bool
TRUE if the program pointer has been moved by the user while in manual mode.
Program execution
Test if the program pointer for the current program task has been moved in manual mode.
Syntax
PPMovedInManMode’(’’)’
A function with a return value of the data type bool .
Related information
For information about
See
Test whether program pointer has moved
IsStopStateEvent - Test whether moved
program pointer on page 886
Reset state of moved program pointer in
manual mode
ResetPPMoved - Reset state for the program
pointer moved in manual mode on page 360
2 Functions
2.93. Present - Tests if an optional parameter is used
RobotWare - OS
937
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.93. Present - Tests if an optional parameter is used
Usage
Present is used to test if an optional argument has been used when calling a routine.
An optional parameter may not be used if it was not specified when calling the routine. This
function can be used to test if a parameter has been specified, in order to prevent errors from
occurring.
Basic examples
Basic examples of the function Present are illustrated below.
See also More examples on page 938 .
Example 1
PROC feeder (\switch on | \switch off)
IF Present (on) Set do1;
IF Present (off) Reset do1;
ENDPROC
The output do1 , which controls a feeder, is set or reset depending on the argument used when
calling the routine.
Return value
Data type: bool
TRUE = The parameter value or a switch has been defined when calling the routine.
FALSE = The parameter value or a switch has not been defined.
Arguments
Present (OptPar)
OptPar
Optional Parameter
Data type: Any type
The name of the optional parameter to be tested.
Continues on next page
2 Functions
2.93. Present - Tests if an optional parameter is used
RobotWare - OS
3HAC 16581-1 Revision: J
938
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of how to use the function Present are illustrated below.
Example 1
PROC glue (\switch on, num glueflow, robtarget topoint, speeddata
speed, zonedata zone, PERS tooldata tool, \PERS wobjdata
wobj)
IF Present (on) PulseDO glue_on;
SetAO gluesignal, glueflow;
IF Present (wobj) THEN
MoveL topoint, speed, zone, tool \WObj=wobj;
ELSE
MoveL topoint, speed, zone, tool;
ENDIF
ENDPROC
A glue routine is made. If the argument \on is specified when calling the routine, a pulse is
generated on the signal glue_on . The robot then sets an analog output gluesignal , which
controls the glue gun, and moves to the end position. As the wobj parameter is optional,
different MoveL instructions are used depending on whether this argument is used or not.
Syntax
Present ’(’
[OptPar’:=’] <reference ( REF ) of any type> ’)’
A REF parameter requires, in this case, the optional parameter name.
A function with a return value of the data type bool .
Related information
For information about
See
Routine parameters
Technical reference manual - RAPID overview ,
section Basic characteristics - Routines
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 940
|
2 Functions
2.93. Present - Tests if an optional parameter is used
RobotWare - OS
937
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.93. Present - Tests if an optional parameter is used
Usage
Present is used to test if an optional argument has been used when calling a routine.
An optional parameter may not be used if it was not specified when calling the routine. This
function can be used to test if a parameter has been specified, in order to prevent errors from
occurring.
Basic examples
Basic examples of the function Present are illustrated below.
See also More examples on page 938 .
Example 1
PROC feeder (\switch on | \switch off)
IF Present (on) Set do1;
IF Present (off) Reset do1;
ENDPROC
The output do1 , which controls a feeder, is set or reset depending on the argument used when
calling the routine.
Return value
Data type: bool
TRUE = The parameter value or a switch has been defined when calling the routine.
FALSE = The parameter value or a switch has not been defined.
Arguments
Present (OptPar)
OptPar
Optional Parameter
Data type: Any type
The name of the optional parameter to be tested.
Continues on next page
2 Functions
2.93. Present - Tests if an optional parameter is used
RobotWare - OS
3HAC 16581-1 Revision: J
938
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of how to use the function Present are illustrated below.
Example 1
PROC glue (\switch on, num glueflow, robtarget topoint, speeddata
speed, zonedata zone, PERS tooldata tool, \PERS wobjdata
wobj)
IF Present (on) PulseDO glue_on;
SetAO gluesignal, glueflow;
IF Present (wobj) THEN
MoveL topoint, speed, zone, tool \WObj=wobj;
ELSE
MoveL topoint, speed, zone, tool;
ENDIF
ENDPROC
A glue routine is made. If the argument \on is specified when calling the routine, a pulse is
generated on the signal glue_on . The robot then sets an analog output gluesignal , which
controls the glue gun, and moves to the end position. As the wobj parameter is optional,
different MoveL instructions are used depending on whether this argument is used or not.
Syntax
Present ’(’
[OptPar’:=’] <reference ( REF ) of any type> ’)’
A REF parameter requires, in this case, the optional parameter name.
A function with a return value of the data type bool .
Related information
For information about
See
Routine parameters
Technical reference manual - RAPID overview ,
section Basic characteristics - Routines
Continued
2 Functions
2.94. ProgMemFree - Get the size of free program memory
RobotWare - OS
939
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.94. ProgMemFree - Get the size of free program memory
Usage
ProgMemFree ( Program Memory Free ) is used to get the size of free program memory.
Basic examples
Basic examples of the function ProgMemFree are illustrated below.
Example 1
FUNC num module_size(string file_path)
VAR num pgmfree_before;
VAR num pgmfree_after;
pgmfree_before:=ProgMemFree();
Load \Dynamic, file_path;
pgmfree_after:=ProgMemFree();
Unload file_path;
RETURN (pgmfree_before-pgmfree_after);
ENDFUNC
ProgMemFree is used in a function that returns the value for how much memory a module
allocates in the program memory.
Return value
Data type: num
The size of free program memory in bytes.
Syntax
ProgMemFree’(’ ’)’
A function with a return value of the data type num .
Related information
For information about
See
Load a program module
Load - Load a program module during execution on
page 208
Unload a program module
UnLoad - UnLoad a program module during execution
on page 655
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 941
|
2 Functions
2.93. Present - Tests if an optional parameter is used
RobotWare - OS
3HAC 16581-1 Revision: J
938
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of how to use the function Present are illustrated below.
Example 1
PROC glue (\switch on, num glueflow, robtarget topoint, speeddata
speed, zonedata zone, PERS tooldata tool, \PERS wobjdata
wobj)
IF Present (on) PulseDO glue_on;
SetAO gluesignal, glueflow;
IF Present (wobj) THEN
MoveL topoint, speed, zone, tool \WObj=wobj;
ELSE
MoveL topoint, speed, zone, tool;
ENDIF
ENDPROC
A glue routine is made. If the argument \on is specified when calling the routine, a pulse is
generated on the signal glue_on . The robot then sets an analog output gluesignal , which
controls the glue gun, and moves to the end position. As the wobj parameter is optional,
different MoveL instructions are used depending on whether this argument is used or not.
Syntax
Present ’(’
[OptPar’:=’] <reference ( REF ) of any type> ’)’
A REF parameter requires, in this case, the optional parameter name.
A function with a return value of the data type bool .
Related information
For information about
See
Routine parameters
Technical reference manual - RAPID overview ,
section Basic characteristics - Routines
Continued
2 Functions
2.94. ProgMemFree - Get the size of free program memory
RobotWare - OS
939
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.94. ProgMemFree - Get the size of free program memory
Usage
ProgMemFree ( Program Memory Free ) is used to get the size of free program memory.
Basic examples
Basic examples of the function ProgMemFree are illustrated below.
Example 1
FUNC num module_size(string file_path)
VAR num pgmfree_before;
VAR num pgmfree_after;
pgmfree_before:=ProgMemFree();
Load \Dynamic, file_path;
pgmfree_after:=ProgMemFree();
Unload file_path;
RETURN (pgmfree_before-pgmfree_after);
ENDFUNC
ProgMemFree is used in a function that returns the value for how much memory a module
allocates in the program memory.
Return value
Data type: num
The size of free program memory in bytes.
Syntax
ProgMemFree’(’ ’)’
A function with a return value of the data type num .
Related information
For information about
See
Load a program module
Load - Load a program module during execution on
page 208
Unload a program module
UnLoad - UnLoad a program module during execution
on page 655
2 Functions
2.95. RawBytesLen - Get the length of rawbytes data
RobotWare - OS
3HAC 16581-1 Revision: J
940
© Copyright 2004-2010 ABB. All rights reserved.
2.95. RawBytesLen - Get the length of rawbytes data
Usage
RawBytesLen is used to get the current length of valid bytes in a rawbytes variable.
Basic examples
Basic examples of the instruction RawBytesLen are illustrated below.
Example 1
VAR rawbytes from_raw_data;
VAR rawbytes to_raw_data;
VAR num integer := 8
VAR num float := 13.4;
ClearRawBytes from_raw_data;
PackRawBytes integer, from_raw_data, 1 \IntX := INT;
PackRawBytes float, from_raw_data, (RawBytesLen(from_raw_data)+1)
\Float4;
CopyRawBytes from_raw_data, 1, to_raw_data, 3;
In this example the variable from_raw_data of type rawbytes is first cleared, i.e. all bytes
set to 0 (same as default at declaration). Then the value of integer is placed in the first 2 bytes
and with help of the function RawBytesLen the value of float is placed in the next 4 bytes
(starting at index 3).
After having filled from_raw_data with data, the contents (6 bytes) is copied to
to_raw_data, starting at position 3.
Return value
Data type: num
The current length of valid bytes in a variable of type rawbytes ; range 0 ... 1024.
In general, the current length of valid bytes in a rawbytes variable is updated by the system
to be the last written byte in the rawbytes structure.
For details, see data type rawbytes , instruction ClearRawBytes , CopyRawBytes ,
PackDNHeader , PackRawBytes and ReadRawBytes.
Arguments
RawBytesLen (RawData)
RawData
Data type: rawbytes
RawData is the data container whose current length of valid bytes shall be returned.
Program execution
During program execution the current length of valid bytes is returned.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 942
|
2 Functions
2.94. ProgMemFree - Get the size of free program memory
RobotWare - OS
939
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.94. ProgMemFree - Get the size of free program memory
Usage
ProgMemFree ( Program Memory Free ) is used to get the size of free program memory.
Basic examples
Basic examples of the function ProgMemFree are illustrated below.
Example 1
FUNC num module_size(string file_path)
VAR num pgmfree_before;
VAR num pgmfree_after;
pgmfree_before:=ProgMemFree();
Load \Dynamic, file_path;
pgmfree_after:=ProgMemFree();
Unload file_path;
RETURN (pgmfree_before-pgmfree_after);
ENDFUNC
ProgMemFree is used in a function that returns the value for how much memory a module
allocates in the program memory.
Return value
Data type: num
The size of free program memory in bytes.
Syntax
ProgMemFree’(’ ’)’
A function with a return value of the data type num .
Related information
For information about
See
Load a program module
Load - Load a program module during execution on
page 208
Unload a program module
UnLoad - UnLoad a program module during execution
on page 655
2 Functions
2.95. RawBytesLen - Get the length of rawbytes data
RobotWare - OS
3HAC 16581-1 Revision: J
940
© Copyright 2004-2010 ABB. All rights reserved.
2.95. RawBytesLen - Get the length of rawbytes data
Usage
RawBytesLen is used to get the current length of valid bytes in a rawbytes variable.
Basic examples
Basic examples of the instruction RawBytesLen are illustrated below.
Example 1
VAR rawbytes from_raw_data;
VAR rawbytes to_raw_data;
VAR num integer := 8
VAR num float := 13.4;
ClearRawBytes from_raw_data;
PackRawBytes integer, from_raw_data, 1 \IntX := INT;
PackRawBytes float, from_raw_data, (RawBytesLen(from_raw_data)+1)
\Float4;
CopyRawBytes from_raw_data, 1, to_raw_data, 3;
In this example the variable from_raw_data of type rawbytes is first cleared, i.e. all bytes
set to 0 (same as default at declaration). Then the value of integer is placed in the first 2 bytes
and with help of the function RawBytesLen the value of float is placed in the next 4 bytes
(starting at index 3).
After having filled from_raw_data with data, the contents (6 bytes) is copied to
to_raw_data, starting at position 3.
Return value
Data type: num
The current length of valid bytes in a variable of type rawbytes ; range 0 ... 1024.
In general, the current length of valid bytes in a rawbytes variable is updated by the system
to be the last written byte in the rawbytes structure.
For details, see data type rawbytes , instruction ClearRawBytes , CopyRawBytes ,
PackDNHeader , PackRawBytes and ReadRawBytes.
Arguments
RawBytesLen (RawData)
RawData
Data type: rawbytes
RawData is the data container whose current length of valid bytes shall be returned.
Program execution
During program execution the current length of valid bytes is returned.
Continues on next page
2 Functions
2.95. RawBytesLen - Get the length of rawbytes data
RobotWare - OS
941
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
RawBytesLen ´(´
[RawData ´:=´ ] < variable ( VAR ) of rawbytes> ´)´
A function with a return value of the data type num .
Related information
For information about
See
rawbytes data
rawbytes - Raw data on page 1165
Clear the contents of rawbytes data
ClearRawBytes - Clear the contents of
rawbytes data on page 49
Copy the contents of rawbytes data
CopyRawBytes - Copy the contents of
rawbytes data on page 67
Pack DeviceNet header into rawbytes data
PackDNHeader - Pack DeviceNet Header
into rawbytes data on page 287
Pack data into rawbytes data
PackRawBytes - Pack data into rawbytes
data on page 290
Read rawbytes data
ReadRawBytes - Read rawbytes data on
page 352
Unpack data from rawbytes data
UnpackRawBytes - Unpack data from
rawbytes data on page 658
Write rawbytes data
WriteRawBytes - Write rawbytes data on
page 725
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 943
|
2 Functions
2.95. RawBytesLen - Get the length of rawbytes data
RobotWare - OS
3HAC 16581-1 Revision: J
940
© Copyright 2004-2010 ABB. All rights reserved.
2.95. RawBytesLen - Get the length of rawbytes data
Usage
RawBytesLen is used to get the current length of valid bytes in a rawbytes variable.
Basic examples
Basic examples of the instruction RawBytesLen are illustrated below.
Example 1
VAR rawbytes from_raw_data;
VAR rawbytes to_raw_data;
VAR num integer := 8
VAR num float := 13.4;
ClearRawBytes from_raw_data;
PackRawBytes integer, from_raw_data, 1 \IntX := INT;
PackRawBytes float, from_raw_data, (RawBytesLen(from_raw_data)+1)
\Float4;
CopyRawBytes from_raw_data, 1, to_raw_data, 3;
In this example the variable from_raw_data of type rawbytes is first cleared, i.e. all bytes
set to 0 (same as default at declaration). Then the value of integer is placed in the first 2 bytes
and with help of the function RawBytesLen the value of float is placed in the next 4 bytes
(starting at index 3).
After having filled from_raw_data with data, the contents (6 bytes) is copied to
to_raw_data, starting at position 3.
Return value
Data type: num
The current length of valid bytes in a variable of type rawbytes ; range 0 ... 1024.
In general, the current length of valid bytes in a rawbytes variable is updated by the system
to be the last written byte in the rawbytes structure.
For details, see data type rawbytes , instruction ClearRawBytes , CopyRawBytes ,
PackDNHeader , PackRawBytes and ReadRawBytes.
Arguments
RawBytesLen (RawData)
RawData
Data type: rawbytes
RawData is the data container whose current length of valid bytes shall be returned.
Program execution
During program execution the current length of valid bytes is returned.
Continues on next page
2 Functions
2.95. RawBytesLen - Get the length of rawbytes data
RobotWare - OS
941
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
RawBytesLen ´(´
[RawData ´:=´ ] < variable ( VAR ) of rawbytes> ´)´
A function with a return value of the data type num .
Related information
For information about
See
rawbytes data
rawbytes - Raw data on page 1165
Clear the contents of rawbytes data
ClearRawBytes - Clear the contents of
rawbytes data on page 49
Copy the contents of rawbytes data
CopyRawBytes - Copy the contents of
rawbytes data on page 67
Pack DeviceNet header into rawbytes data
PackDNHeader - Pack DeviceNet Header
into rawbytes data on page 287
Pack data into rawbytes data
PackRawBytes - Pack data into rawbytes
data on page 290
Read rawbytes data
ReadRawBytes - Read rawbytes data on
page 352
Unpack data from rawbytes data
UnpackRawBytes - Unpack data from
rawbytes data on page 658
Write rawbytes data
WriteRawBytes - Write rawbytes data on
page 725
Continued
2 Functions
2.96. ReadBin - Reads a byte from a file or serial channel
RobotWare - OS
3HAC 16581-1 Revision: J
942
© Copyright 2004-2010 ABB. All rights reserved.
2.96. ReadBin - Reads a byte from a file or serial channel
Usage
ReadBin ( Read Binary ) is used to read a byte (8 bits) from a file or serial channel.
This function works on both binary and character-based files or serial channels.
Basic examples
Basic examples of the function ReadBin are illustrated below.
See also More examples on page 943 .
Example 1
VAR num character;
VAR iodev inchannel;
...
Open "com2:", inchannel\Bin;
character := ReadBin(inchannel);
A byte is read from the binary serial channel inchannel .
Return value
Data type: num
A byte (8 bits) is read from a specified file or serial channel. This byte is converted to the
corresponding positive numeric value and returned as a num data type. If a file is empty (end
of file), EOF_BIN (the number -1) is returned.
Arguments
ReadBin (IODevice [\Time])
IODevice
Data type: iodev
The name (reference) of the file or serial channel to be read.
[\Time]
Data type: num
The max. time for the reading operation (timeout) in seconds. If this argument is not
specified, the max. time is set to 60 seconds. To wait forever, use the predefined constant
WAIT_MAX .
If this time runs out before the reading operation is finished, the error handler will be called
with the error code ERR_DEV_MAXTIME . If there is no error handler, the execution will be
stopped.
The timeout function is in use also during program stop and will be noticed by the RAPID
program at program start.
Program execution
Program execution waits until a byte (8 bits) can be read from the file or serial channel.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 944
|
2 Functions
2.95. RawBytesLen - Get the length of rawbytes data
RobotWare - OS
941
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
RawBytesLen ´(´
[RawData ´:=´ ] < variable ( VAR ) of rawbytes> ´)´
A function with a return value of the data type num .
Related information
For information about
See
rawbytes data
rawbytes - Raw data on page 1165
Clear the contents of rawbytes data
ClearRawBytes - Clear the contents of
rawbytes data on page 49
Copy the contents of rawbytes data
CopyRawBytes - Copy the contents of
rawbytes data on page 67
Pack DeviceNet header into rawbytes data
PackDNHeader - Pack DeviceNet Header
into rawbytes data on page 287
Pack data into rawbytes data
PackRawBytes - Pack data into rawbytes
data on page 290
Read rawbytes data
ReadRawBytes - Read rawbytes data on
page 352
Unpack data from rawbytes data
UnpackRawBytes - Unpack data from
rawbytes data on page 658
Write rawbytes data
WriteRawBytes - Write rawbytes data on
page 725
Continued
2 Functions
2.96. ReadBin - Reads a byte from a file or serial channel
RobotWare - OS
3HAC 16581-1 Revision: J
942
© Copyright 2004-2010 ABB. All rights reserved.
2.96. ReadBin - Reads a byte from a file or serial channel
Usage
ReadBin ( Read Binary ) is used to read a byte (8 bits) from a file or serial channel.
This function works on both binary and character-based files or serial channels.
Basic examples
Basic examples of the function ReadBin are illustrated below.
See also More examples on page 943 .
Example 1
VAR num character;
VAR iodev inchannel;
...
Open "com2:", inchannel\Bin;
character := ReadBin(inchannel);
A byte is read from the binary serial channel inchannel .
Return value
Data type: num
A byte (8 bits) is read from a specified file or serial channel. This byte is converted to the
corresponding positive numeric value and returned as a num data type. If a file is empty (end
of file), EOF_BIN (the number -1) is returned.
Arguments
ReadBin (IODevice [\Time])
IODevice
Data type: iodev
The name (reference) of the file or serial channel to be read.
[\Time]
Data type: num
The max. time for the reading operation (timeout) in seconds. If this argument is not
specified, the max. time is set to 60 seconds. To wait forever, use the predefined constant
WAIT_MAX .
If this time runs out before the reading operation is finished, the error handler will be called
with the error code ERR_DEV_MAXTIME . If there is no error handler, the execution will be
stopped.
The timeout function is in use also during program stop and will be noticed by the RAPID
program at program start.
Program execution
Program execution waits until a byte (8 bits) can be read from the file or serial channel.
Continues on next page
2 Functions
2.96. ReadBin - Reads a byte from a file or serial channel
RobotWare - OS
943
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of the function ReadBin are illustrated below.
Example 1
VAR num bindata;
VAR iodev file;
Open "HOME:/myfile.bin", file \Read \Bin;
bindata := ReadBin(file);
WHILE bindata <> EOF_BIN DO
TPWrite ByteToStr(bindata\Char);
bindata := ReadBin(file);
ENDWHILE
Read the contents of a binary file myfile.bin from the beginning to the end and displays the
received binary data converted to chars on the FlexPendant (one char on each line).
Limitations
The function can only be used for files and serial channels that have been opened with read
access ( \Read for character based files, \Bin or \Append \Bin for binary files).
Error handling
If an error occurs during reading, the system variable ERRNO is set to ERR_FILEACC .
If time out before the read operation is finished, the system variable ERRNO is set to
ERR_DEV_MAXTIME .
These errors can then be dealt with by the error handler.
Predefined data
The constant EOF_BIN can be used to stop reading at the end of the file.
CONST num EOF_BIN := -1;
Syntax
ReadBin’(’
[IODevice ’:=’] <variable ( VAR ) of iodev>
[’\’Time’:=’ <expression ( IN ) of num>]’)’
A function with a return value of the type num .
Related information
For information about
See
Opening, etc. files or serial channels
Technical reference manual - RAPID overview ,
section RAPID summary - Communication
Convert a byte to a string data
ByteToStr - Converts a byte to a string data on page
784
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 945
|
2 Functions
2.96. ReadBin - Reads a byte from a file or serial channel
RobotWare - OS
3HAC 16581-1 Revision: J
942
© Copyright 2004-2010 ABB. All rights reserved.
2.96. ReadBin - Reads a byte from a file or serial channel
Usage
ReadBin ( Read Binary ) is used to read a byte (8 bits) from a file or serial channel.
This function works on both binary and character-based files or serial channels.
Basic examples
Basic examples of the function ReadBin are illustrated below.
See also More examples on page 943 .
Example 1
VAR num character;
VAR iodev inchannel;
...
Open "com2:", inchannel\Bin;
character := ReadBin(inchannel);
A byte is read from the binary serial channel inchannel .
Return value
Data type: num
A byte (8 bits) is read from a specified file or serial channel. This byte is converted to the
corresponding positive numeric value and returned as a num data type. If a file is empty (end
of file), EOF_BIN (the number -1) is returned.
Arguments
ReadBin (IODevice [\Time])
IODevice
Data type: iodev
The name (reference) of the file or serial channel to be read.
[\Time]
Data type: num
The max. time for the reading operation (timeout) in seconds. If this argument is not
specified, the max. time is set to 60 seconds. To wait forever, use the predefined constant
WAIT_MAX .
If this time runs out before the reading operation is finished, the error handler will be called
with the error code ERR_DEV_MAXTIME . If there is no error handler, the execution will be
stopped.
The timeout function is in use also during program stop and will be noticed by the RAPID
program at program start.
Program execution
Program execution waits until a byte (8 bits) can be read from the file or serial channel.
Continues on next page
2 Functions
2.96. ReadBin - Reads a byte from a file or serial channel
RobotWare - OS
943
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of the function ReadBin are illustrated below.
Example 1
VAR num bindata;
VAR iodev file;
Open "HOME:/myfile.bin", file \Read \Bin;
bindata := ReadBin(file);
WHILE bindata <> EOF_BIN DO
TPWrite ByteToStr(bindata\Char);
bindata := ReadBin(file);
ENDWHILE
Read the contents of a binary file myfile.bin from the beginning to the end and displays the
received binary data converted to chars on the FlexPendant (one char on each line).
Limitations
The function can only be used for files and serial channels that have been opened with read
access ( \Read for character based files, \Bin or \Append \Bin for binary files).
Error handling
If an error occurs during reading, the system variable ERRNO is set to ERR_FILEACC .
If time out before the read operation is finished, the system variable ERRNO is set to
ERR_DEV_MAXTIME .
These errors can then be dealt with by the error handler.
Predefined data
The constant EOF_BIN can be used to stop reading at the end of the file.
CONST num EOF_BIN := -1;
Syntax
ReadBin’(’
[IODevice ’:=’] <variable ( VAR ) of iodev>
[’\’Time’:=’ <expression ( IN ) of num>]’)’
A function with a return value of the type num .
Related information
For information about
See
Opening, etc. files or serial channels
Technical reference manual - RAPID overview ,
section RAPID summary - Communication
Convert a byte to a string data
ByteToStr - Converts a byte to a string data on page
784
Continued
2 Functions
2.97. ReadDir - Read next entry in a directory
RobotWare - OS
3HAC 16581-1 Revision: J
944
© Copyright 2004-2010 ABB. All rights reserved.
2.97. ReadDir - Read next entry in a directory
Usage
ReadDir is used to retrieve the name of the next file or subdirectory under a directory that
has been opened with the instruction OpenDir .
As long as the function returns TRUE , there can be more files or subdirectories to retrieve.
Basic examples
Basic examples of the function ReadDir are illustrated below.
See also More examples on page 945 .
Example 1
PROC lsdir(string dirname)
VAR dir directory;
VAR string filename;
OpenDir directory, dirname;
WHILE ReadDir(directory, filename) DO
TPWrite filename;
ENDWHILE
CloseDir directory;
ENDPROC
This example prints out the names of all files or subdirectories under the specified directory.
Return value
Data type: bool
The function will return TRUE if it has retrieved a name, otherwise FALSE .
Arguments
ReadDir (Dev FileName)
Dev
Data type: dir
A variable with reference to the directory, fetched by instruction OpenDir .
FileName
Data type: string
The retrieved file or subdirectory name.
Program execution
This function returns a bool that specifies if the retrieving of a name was successful or not.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 946
|
2 Functions
2.96. ReadBin - Reads a byte from a file or serial channel
RobotWare - OS
943
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of the function ReadBin are illustrated below.
Example 1
VAR num bindata;
VAR iodev file;
Open "HOME:/myfile.bin", file \Read \Bin;
bindata := ReadBin(file);
WHILE bindata <> EOF_BIN DO
TPWrite ByteToStr(bindata\Char);
bindata := ReadBin(file);
ENDWHILE
Read the contents of a binary file myfile.bin from the beginning to the end and displays the
received binary data converted to chars on the FlexPendant (one char on each line).
Limitations
The function can only be used for files and serial channels that have been opened with read
access ( \Read for character based files, \Bin or \Append \Bin for binary files).
Error handling
If an error occurs during reading, the system variable ERRNO is set to ERR_FILEACC .
If time out before the read operation is finished, the system variable ERRNO is set to
ERR_DEV_MAXTIME .
These errors can then be dealt with by the error handler.
Predefined data
The constant EOF_BIN can be used to stop reading at the end of the file.
CONST num EOF_BIN := -1;
Syntax
ReadBin’(’
[IODevice ’:=’] <variable ( VAR ) of iodev>
[’\’Time’:=’ <expression ( IN ) of num>]’)’
A function with a return value of the type num .
Related information
For information about
See
Opening, etc. files or serial channels
Technical reference manual - RAPID overview ,
section RAPID summary - Communication
Convert a byte to a string data
ByteToStr - Converts a byte to a string data on page
784
Continued
2 Functions
2.97. ReadDir - Read next entry in a directory
RobotWare - OS
3HAC 16581-1 Revision: J
944
© Copyright 2004-2010 ABB. All rights reserved.
2.97. ReadDir - Read next entry in a directory
Usage
ReadDir is used to retrieve the name of the next file or subdirectory under a directory that
has been opened with the instruction OpenDir .
As long as the function returns TRUE , there can be more files or subdirectories to retrieve.
Basic examples
Basic examples of the function ReadDir are illustrated below.
See also More examples on page 945 .
Example 1
PROC lsdir(string dirname)
VAR dir directory;
VAR string filename;
OpenDir directory, dirname;
WHILE ReadDir(directory, filename) DO
TPWrite filename;
ENDWHILE
CloseDir directory;
ENDPROC
This example prints out the names of all files or subdirectories under the specified directory.
Return value
Data type: bool
The function will return TRUE if it has retrieved a name, otherwise FALSE .
Arguments
ReadDir (Dev FileName)
Dev
Data type: dir
A variable with reference to the directory, fetched by instruction OpenDir .
FileName
Data type: string
The retrieved file or subdirectory name.
Program execution
This function returns a bool that specifies if the retrieving of a name was successful or not.
Continues on next page
2 Functions
2.97. ReadDir - Read next entry in a directory
RobotWare - OS
945
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of the function ReadDir are illustrated below
Example 1
This example implements a generic traverse of a directory structure function.
PROC searchdir(string dirname, string actionproc)
VAR dir directory;
VAR string filename;
IF IsFile(dirname \Directory) THEN
OpenDir directory, dirname;
WHILE ReadDir(directory, filename) DO
! .. and . is the parent and resp. this directory
IF filename <> ".." AND filename <> "." THEN
searchdir dirname+"/"+filename, actionproc;
ENDIF
ENDWHILE
CloseDir directory;
ELSE
%actionproc% dirname;
ENDIF
ERROR
RAISE;
ENDPROC
PROC listfile(string filename)
TPWrite filename;
ENDPROC
PROC main()
! Execute the listfile routine for all files found under the
! tree in HOME:
searchdir "HOME:","listfile";
ENDPROC
This program traverses the directory structure under " HOME :", and for each file found it calls
the listfile procedure. The searchdir is the generic part that knows nothing about the
start of the search or which routine should be called for each file. It uses IsFile to check
whether it has found a subdirectory or a file and it uses the late binding mechanism to call the
procedure specified in actionproc for all files found. The actionproc routine should be
a procedure with one parameter of the type string .
Error handling
If the directory is not opened (see OpenDir ), the system variable ERRNO is set to
ERR_FILEACC . This error can then be handled in the error handler.
Continued
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 947
|
2 Functions
2.97. ReadDir - Read next entry in a directory
RobotWare - OS
3HAC 16581-1 Revision: J
944
© Copyright 2004-2010 ABB. All rights reserved.
2.97. ReadDir - Read next entry in a directory
Usage
ReadDir is used to retrieve the name of the next file or subdirectory under a directory that
has been opened with the instruction OpenDir .
As long as the function returns TRUE , there can be more files or subdirectories to retrieve.
Basic examples
Basic examples of the function ReadDir are illustrated below.
See also More examples on page 945 .
Example 1
PROC lsdir(string dirname)
VAR dir directory;
VAR string filename;
OpenDir directory, dirname;
WHILE ReadDir(directory, filename) DO
TPWrite filename;
ENDWHILE
CloseDir directory;
ENDPROC
This example prints out the names of all files or subdirectories under the specified directory.
Return value
Data type: bool
The function will return TRUE if it has retrieved a name, otherwise FALSE .
Arguments
ReadDir (Dev FileName)
Dev
Data type: dir
A variable with reference to the directory, fetched by instruction OpenDir .
FileName
Data type: string
The retrieved file or subdirectory name.
Program execution
This function returns a bool that specifies if the retrieving of a name was successful or not.
Continues on next page
2 Functions
2.97. ReadDir - Read next entry in a directory
RobotWare - OS
945
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of the function ReadDir are illustrated below
Example 1
This example implements a generic traverse of a directory structure function.
PROC searchdir(string dirname, string actionproc)
VAR dir directory;
VAR string filename;
IF IsFile(dirname \Directory) THEN
OpenDir directory, dirname;
WHILE ReadDir(directory, filename) DO
! .. and . is the parent and resp. this directory
IF filename <> ".." AND filename <> "." THEN
searchdir dirname+"/"+filename, actionproc;
ENDIF
ENDWHILE
CloseDir directory;
ELSE
%actionproc% dirname;
ENDIF
ERROR
RAISE;
ENDPROC
PROC listfile(string filename)
TPWrite filename;
ENDPROC
PROC main()
! Execute the listfile routine for all files found under the
! tree in HOME:
searchdir "HOME:","listfile";
ENDPROC
This program traverses the directory structure under " HOME :", and for each file found it calls
the listfile procedure. The searchdir is the generic part that knows nothing about the
start of the search or which routine should be called for each file. It uses IsFile to check
whether it has found a subdirectory or a file and it uses the late binding mechanism to call the
procedure specified in actionproc for all files found. The actionproc routine should be
a procedure with one parameter of the type string .
Error handling
If the directory is not opened (see OpenDir ), the system variable ERRNO is set to
ERR_FILEACC . This error can then be handled in the error handler.
Continued
Continues on next page
2 Functions
2.97. ReadDir - Read next entry in a directory
RobotWare - OS
3HAC 16581-1 Revision: J
946
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
ReadDir ’(’
[ Dev’:=’ ] < variable ( VAR ) of dir>’,’
[ FileName’:=’ ] < var or pers ( INOUT ) of string>´)´
A function with a return value of the data type bool .
Related information
For information about
See
Directory
dir - File directory structure on page 1103
Make a directory
MakeDir - Create a new directory on page 218
Open a directory
OpenDir - Open a directory on page 285
Close a directory
CloseDir - Close a directory on page 56
Remove a directory
RemoveDir - Delete a directory on page 355
Remove a file
RemoveFile - Delete a file on page 356
Rename a file
RenameFile - Rename a file on page 357
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 948
|
2 Functions
2.97. ReadDir - Read next entry in a directory
RobotWare - OS
945
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of the function ReadDir are illustrated below
Example 1
This example implements a generic traverse of a directory structure function.
PROC searchdir(string dirname, string actionproc)
VAR dir directory;
VAR string filename;
IF IsFile(dirname \Directory) THEN
OpenDir directory, dirname;
WHILE ReadDir(directory, filename) DO
! .. and . is the parent and resp. this directory
IF filename <> ".." AND filename <> "." THEN
searchdir dirname+"/"+filename, actionproc;
ENDIF
ENDWHILE
CloseDir directory;
ELSE
%actionproc% dirname;
ENDIF
ERROR
RAISE;
ENDPROC
PROC listfile(string filename)
TPWrite filename;
ENDPROC
PROC main()
! Execute the listfile routine for all files found under the
! tree in HOME:
searchdir "HOME:","listfile";
ENDPROC
This program traverses the directory structure under " HOME :", and for each file found it calls
the listfile procedure. The searchdir is the generic part that knows nothing about the
start of the search or which routine should be called for each file. It uses IsFile to check
whether it has found a subdirectory or a file and it uses the late binding mechanism to call the
procedure specified in actionproc for all files found. The actionproc routine should be
a procedure with one parameter of the type string .
Error handling
If the directory is not opened (see OpenDir ), the system variable ERRNO is set to
ERR_FILEACC . This error can then be handled in the error handler.
Continued
Continues on next page
2 Functions
2.97. ReadDir - Read next entry in a directory
RobotWare - OS
3HAC 16581-1 Revision: J
946
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
ReadDir ’(’
[ Dev’:=’ ] < variable ( VAR ) of dir>’,’
[ FileName’:=’ ] < var or pers ( INOUT ) of string>´)´
A function with a return value of the data type bool .
Related information
For information about
See
Directory
dir - File directory structure on page 1103
Make a directory
MakeDir - Create a new directory on page 218
Open a directory
OpenDir - Open a directory on page 285
Close a directory
CloseDir - Close a directory on page 56
Remove a directory
RemoveDir - Delete a directory on page 355
Remove a file
RemoveFile - Delete a file on page 356
Rename a file
RenameFile - Rename a file on page 357
Continued
2 Functions
2.98. ReadMotor - Reads the current motor angles
RobotWare - OS
947
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.98. ReadMotor - Reads the current motor angles
Usage
ReadMotor is used to read the current angles of the different motors of the robot and external
axes. The primary use of this function is in the calibration procedure of the robot.
Basic examples
Basic example of the function ReadMotor is illustrated below.
See also More examples on page 947 .
VAR num motor_angle2;
motor_angle2 := ReadMotor(2);
The current motor angle of the second axis of the robot is stored in motor_angle2 .
Return value
Data type: num
The current motor angle in radians of the stated axis of the robot or external axes.
Arguments
ReadMotor [\MecUnit ] Axis
MecUnit
Mechanical Unit
Data type: mecunit
The name of the mechanical unit for which an axis is to be read. If this argument is omitted,
the axis for the connected robot is read.
Axis
Data type: num
The number of the axis to be read (1 - 6).
Program execution
The motor angle returned represents the current position in radians for the motor without any
calibration offset. The value is not related to a fix position of the robot, only to the resolver
internal zero position, i.e. normally the resolver zero position closest to the calibration
position (the difference between the resolver zero position and the calibration position is the
calibration offset value). The value represents the full movement of each axis, although this
may be several turns.
More examples
More examples of the function ReadMotor are illustrated below.
Example 1
VAR num motor_angle3;
motor_angle3 := ReadMotor(\MecUnit:=ROB_1, 3);
The current motor angle of the third axis of the robot ROB_1 is stored in motor_angle3 .
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 949
|
2 Functions
2.97. ReadDir - Read next entry in a directory
RobotWare - OS
3HAC 16581-1 Revision: J
946
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
ReadDir ’(’
[ Dev’:=’ ] < variable ( VAR ) of dir>’,’
[ FileName’:=’ ] < var or pers ( INOUT ) of string>´)´
A function with a return value of the data type bool .
Related information
For information about
See
Directory
dir - File directory structure on page 1103
Make a directory
MakeDir - Create a new directory on page 218
Open a directory
OpenDir - Open a directory on page 285
Close a directory
CloseDir - Close a directory on page 56
Remove a directory
RemoveDir - Delete a directory on page 355
Remove a file
RemoveFile - Delete a file on page 356
Rename a file
RenameFile - Rename a file on page 357
Continued
2 Functions
2.98. ReadMotor - Reads the current motor angles
RobotWare - OS
947
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.98. ReadMotor - Reads the current motor angles
Usage
ReadMotor is used to read the current angles of the different motors of the robot and external
axes. The primary use of this function is in the calibration procedure of the robot.
Basic examples
Basic example of the function ReadMotor is illustrated below.
See also More examples on page 947 .
VAR num motor_angle2;
motor_angle2 := ReadMotor(2);
The current motor angle of the second axis of the robot is stored in motor_angle2 .
Return value
Data type: num
The current motor angle in radians of the stated axis of the robot or external axes.
Arguments
ReadMotor [\MecUnit ] Axis
MecUnit
Mechanical Unit
Data type: mecunit
The name of the mechanical unit for which an axis is to be read. If this argument is omitted,
the axis for the connected robot is read.
Axis
Data type: num
The number of the axis to be read (1 - 6).
Program execution
The motor angle returned represents the current position in radians for the motor without any
calibration offset. The value is not related to a fix position of the robot, only to the resolver
internal zero position, i.e. normally the resolver zero position closest to the calibration
position (the difference between the resolver zero position and the calibration position is the
calibration offset value). The value represents the full movement of each axis, although this
may be several turns.
More examples
More examples of the function ReadMotor are illustrated below.
Example 1
VAR num motor_angle3;
motor_angle3 := ReadMotor(\MecUnit:=ROB_1, 3);
The current motor angle of the third axis of the robot ROB_1 is stored in motor_angle3 .
Continues on next page
2 Functions
2.98. ReadMotor - Reads the current motor angles
RobotWare - OS
3HAC 16581-1 Revision: J
948
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
ReadMotor’(’
[’\’MecUnit ’:=’ < variable ( VAR ) of mecunit>’,’]
[Axis’ :=’ ] < expression ( IN ) of num> ’)’
A function with a return value of the data type num .
Related information
For information about
See
Reading the current joint angle
CJointT - Reads the current joint angles on
page 800
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 950
|
2 Functions
2.98. ReadMotor - Reads the current motor angles
RobotWare - OS
947
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.98. ReadMotor - Reads the current motor angles
Usage
ReadMotor is used to read the current angles of the different motors of the robot and external
axes. The primary use of this function is in the calibration procedure of the robot.
Basic examples
Basic example of the function ReadMotor is illustrated below.
See also More examples on page 947 .
VAR num motor_angle2;
motor_angle2 := ReadMotor(2);
The current motor angle of the second axis of the robot is stored in motor_angle2 .
Return value
Data type: num
The current motor angle in radians of the stated axis of the robot or external axes.
Arguments
ReadMotor [\MecUnit ] Axis
MecUnit
Mechanical Unit
Data type: mecunit
The name of the mechanical unit for which an axis is to be read. If this argument is omitted,
the axis for the connected robot is read.
Axis
Data type: num
The number of the axis to be read (1 - 6).
Program execution
The motor angle returned represents the current position in radians for the motor without any
calibration offset. The value is not related to a fix position of the robot, only to the resolver
internal zero position, i.e. normally the resolver zero position closest to the calibration
position (the difference between the resolver zero position and the calibration position is the
calibration offset value). The value represents the full movement of each axis, although this
may be several turns.
More examples
More examples of the function ReadMotor are illustrated below.
Example 1
VAR num motor_angle3;
motor_angle3 := ReadMotor(\MecUnit:=ROB_1, 3);
The current motor angle of the third axis of the robot ROB_1 is stored in motor_angle3 .
Continues on next page
2 Functions
2.98. ReadMotor - Reads the current motor angles
RobotWare - OS
3HAC 16581-1 Revision: J
948
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
ReadMotor’(’
[’\’MecUnit ’:=’ < variable ( VAR ) of mecunit>’,’]
[Axis’ :=’ ] < expression ( IN ) of num> ’)’
A function with a return value of the data type num .
Related information
For information about
See
Reading the current joint angle
CJointT - Reads the current joint angles on
page 800
Continued
2 Functions
2.99. ReadNum - Reads a number from a file or serial channel
RobotWare - OS
949
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.99. ReadNum - Reads a number from a file or serial channel
Usage
ReadNum ( Read Numeric ) is used to read a number from a character-based file or serial
channel.
Basic examples
Basic examples of the function ReadNum are illustrated below.
See also More examples on page 950 .
Example 1
VAR iodev infile;
...
Open "HOME:/file.doc", infile\Read;
reg1 := ReadNum(infile);
reg1 is assigned a number read from the file file.doc .
Return value
Data type: num
The numeric value read from a specified file or serial channel. If the file is empty (end of file),
the number EOF_NUM (9.998E36) is returned.
Arguments
ReadNum (IODevice [\Delim] [\Time])
IODevice
Data type: iodev
The name (reference) of the file or serial channel to be read.
[\Delim]
Delimiters
Data type: string
A string containing the delimiters to use when parsing a line in the file or serial channel. By
default (without \Delim ), the file is read line by line and the line-feed character (\0A) is the
only delimiter considered by the parsing. When the \Delim argument is used, any character
in the specified string argument will be considered to determine the significant part of the
line.
When using the argument \Delim , the control system always adds the characters carriage
return ( \0D ) and line-feed ( \0A ) to the delimiters specified by the user.
To specify non-alphanumeric characters, use \xx , where xx is the hexadecimal
representation of the ASCII code of the character (example: TAB is specified by \09 ).
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 951
|
2 Functions
2.98. ReadMotor - Reads the current motor angles
RobotWare - OS
3HAC 16581-1 Revision: J
948
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
ReadMotor’(’
[’\’MecUnit ’:=’ < variable ( VAR ) of mecunit>’,’]
[Axis’ :=’ ] < expression ( IN ) of num> ’)’
A function with a return value of the data type num .
Related information
For information about
See
Reading the current joint angle
CJointT - Reads the current joint angles on
page 800
Continued
2 Functions
2.99. ReadNum - Reads a number from a file or serial channel
RobotWare - OS
949
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.99. ReadNum - Reads a number from a file or serial channel
Usage
ReadNum ( Read Numeric ) is used to read a number from a character-based file or serial
channel.
Basic examples
Basic examples of the function ReadNum are illustrated below.
See also More examples on page 950 .
Example 1
VAR iodev infile;
...
Open "HOME:/file.doc", infile\Read;
reg1 := ReadNum(infile);
reg1 is assigned a number read from the file file.doc .
Return value
Data type: num
The numeric value read from a specified file or serial channel. If the file is empty (end of file),
the number EOF_NUM (9.998E36) is returned.
Arguments
ReadNum (IODevice [\Delim] [\Time])
IODevice
Data type: iodev
The name (reference) of the file or serial channel to be read.
[\Delim]
Delimiters
Data type: string
A string containing the delimiters to use when parsing a line in the file or serial channel. By
default (without \Delim ), the file is read line by line and the line-feed character (\0A) is the
only delimiter considered by the parsing. When the \Delim argument is used, any character
in the specified string argument will be considered to determine the significant part of the
line.
When using the argument \Delim , the control system always adds the characters carriage
return ( \0D ) and line-feed ( \0A ) to the delimiters specified by the user.
To specify non-alphanumeric characters, use \xx , where xx is the hexadecimal
representation of the ASCII code of the character (example: TAB is specified by \09 ).
Continues on next page
2 Functions
2.99. ReadNum - Reads a number from a file or serial channel
RobotWare - OS
3HAC 16581-1 Revision: J
950
© Copyright 2004-2010 ABB. All rights reserved.
[\Time]
Data type: num
The max. time for the reading operation (timeout) in seconds. If this argument is not
specified, the max. time is set to 60 seconds. To wait forever, use the predefined constant
WAIT_MAX .
If this time runs out before the read operation is finished, the error handler will be called with
the error code ERR_DEV_MAXTIME . If there is no error handler, the execution will be stopped.
The timeout function is also in use during program stop and will be noticed by the RAPID
program at program start.
Program execution
Starting at the current file position, the function reads and discards any heading delimiters. A
heading delimiter without the argument \Delim is a line-feed character. Heading delimiters
with the argument \ Delim are any characters specified in the \Delim argument plus carriage
return and line-feed characters. It then reads everything up to and including the next delimiter
character (will be discarded), but not more than 80 characters. If the significant part exceeds
80 characters, the remainder of the characters will be read on the next reading.
The string that is read is then converted to a numeric value; e.g. "234.4" is converted to the
numeric value 234.4.
More examples
More examples of the function ReadNum are illustrated below.
reg1 := ReadNum(infile\Delim:="\09");
IF reg1 > EOF_NUM THEN
TPWrite "The file is empty";
...
Reads a number in a line where numbers are separated by TAB ( "\09" ) or SPACE ( " " )
characters. Before using the number read from the file, a check is performed to make sure that
the file is not empty.
Limitations
The function can only be used for character based files that have been opened for reading.
Error handling
If an access error occurs during reading, the system variable ERRNO is set to ERR_FILEACC .
If there is an attempt to read non-numeric data, the system variable ERRNO is set to
ERR_RCVDATA .
If time out before the read operation is finished, the system variable ERRNO is set to
ERR_DEV_MAXTIME .
These errors can then be dealt with by the error handler.
Predefined data
The constant EOF_NUM can be used to stop reading, at the end of the file.
CONST num EOF_NUM := 9.998E36;
Continued
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 952
|
2 Functions
2.99. ReadNum - Reads a number from a file or serial channel
RobotWare - OS
949
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.99. ReadNum - Reads a number from a file or serial channel
Usage
ReadNum ( Read Numeric ) is used to read a number from a character-based file or serial
channel.
Basic examples
Basic examples of the function ReadNum are illustrated below.
See also More examples on page 950 .
Example 1
VAR iodev infile;
...
Open "HOME:/file.doc", infile\Read;
reg1 := ReadNum(infile);
reg1 is assigned a number read from the file file.doc .
Return value
Data type: num
The numeric value read from a specified file or serial channel. If the file is empty (end of file),
the number EOF_NUM (9.998E36) is returned.
Arguments
ReadNum (IODevice [\Delim] [\Time])
IODevice
Data type: iodev
The name (reference) of the file or serial channel to be read.
[\Delim]
Delimiters
Data type: string
A string containing the delimiters to use when parsing a line in the file or serial channel. By
default (without \Delim ), the file is read line by line and the line-feed character (\0A) is the
only delimiter considered by the parsing. When the \Delim argument is used, any character
in the specified string argument will be considered to determine the significant part of the
line.
When using the argument \Delim , the control system always adds the characters carriage
return ( \0D ) and line-feed ( \0A ) to the delimiters specified by the user.
To specify non-alphanumeric characters, use \xx , where xx is the hexadecimal
representation of the ASCII code of the character (example: TAB is specified by \09 ).
Continues on next page
2 Functions
2.99. ReadNum - Reads a number from a file or serial channel
RobotWare - OS
3HAC 16581-1 Revision: J
950
© Copyright 2004-2010 ABB. All rights reserved.
[\Time]
Data type: num
The max. time for the reading operation (timeout) in seconds. If this argument is not
specified, the max. time is set to 60 seconds. To wait forever, use the predefined constant
WAIT_MAX .
If this time runs out before the read operation is finished, the error handler will be called with
the error code ERR_DEV_MAXTIME . If there is no error handler, the execution will be stopped.
The timeout function is also in use during program stop and will be noticed by the RAPID
program at program start.
Program execution
Starting at the current file position, the function reads and discards any heading delimiters. A
heading delimiter without the argument \Delim is a line-feed character. Heading delimiters
with the argument \ Delim are any characters specified in the \Delim argument plus carriage
return and line-feed characters. It then reads everything up to and including the next delimiter
character (will be discarded), but not more than 80 characters. If the significant part exceeds
80 characters, the remainder of the characters will be read on the next reading.
The string that is read is then converted to a numeric value; e.g. "234.4" is converted to the
numeric value 234.4.
More examples
More examples of the function ReadNum are illustrated below.
reg1 := ReadNum(infile\Delim:="\09");
IF reg1 > EOF_NUM THEN
TPWrite "The file is empty";
...
Reads a number in a line where numbers are separated by TAB ( "\09" ) or SPACE ( " " )
characters. Before using the number read from the file, a check is performed to make sure that
the file is not empty.
Limitations
The function can only be used for character based files that have been opened for reading.
Error handling
If an access error occurs during reading, the system variable ERRNO is set to ERR_FILEACC .
If there is an attempt to read non-numeric data, the system variable ERRNO is set to
ERR_RCVDATA .
If time out before the read operation is finished, the system variable ERRNO is set to
ERR_DEV_MAXTIME .
These errors can then be dealt with by the error handler.
Predefined data
The constant EOF_NUM can be used to stop reading, at the end of the file.
CONST num EOF_NUM := 9.998E36;
Continued
Continues on next page
2 Functions
2.99. ReadNum - Reads a number from a file or serial channel
RobotWare - OS
951
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
ReadNum ’(’
[IODevice ’:=’]<variable ( VAR ) of iodev>
[’\’Delim’:=’<expression ( IN ) of string>]
[’\’Time’:=’<expression ( IN ) of num>]’)’
A function with a return value of the type num .
Related information
For information about
See
Opening, etc. files or serial channels
Technical reference manual - RAPID overview ,
section RAPID summary - Communication
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 953
|
2 Functions
2.99. ReadNum - Reads a number from a file or serial channel
RobotWare - OS
3HAC 16581-1 Revision: J
950
© Copyright 2004-2010 ABB. All rights reserved.
[\Time]
Data type: num
The max. time for the reading operation (timeout) in seconds. If this argument is not
specified, the max. time is set to 60 seconds. To wait forever, use the predefined constant
WAIT_MAX .
If this time runs out before the read operation is finished, the error handler will be called with
the error code ERR_DEV_MAXTIME . If there is no error handler, the execution will be stopped.
The timeout function is also in use during program stop and will be noticed by the RAPID
program at program start.
Program execution
Starting at the current file position, the function reads and discards any heading delimiters. A
heading delimiter without the argument \Delim is a line-feed character. Heading delimiters
with the argument \ Delim are any characters specified in the \Delim argument plus carriage
return and line-feed characters. It then reads everything up to and including the next delimiter
character (will be discarded), but not more than 80 characters. If the significant part exceeds
80 characters, the remainder of the characters will be read on the next reading.
The string that is read is then converted to a numeric value; e.g. "234.4" is converted to the
numeric value 234.4.
More examples
More examples of the function ReadNum are illustrated below.
reg1 := ReadNum(infile\Delim:="\09");
IF reg1 > EOF_NUM THEN
TPWrite "The file is empty";
...
Reads a number in a line where numbers are separated by TAB ( "\09" ) or SPACE ( " " )
characters. Before using the number read from the file, a check is performed to make sure that
the file is not empty.
Limitations
The function can only be used for character based files that have been opened for reading.
Error handling
If an access error occurs during reading, the system variable ERRNO is set to ERR_FILEACC .
If there is an attempt to read non-numeric data, the system variable ERRNO is set to
ERR_RCVDATA .
If time out before the read operation is finished, the system variable ERRNO is set to
ERR_DEV_MAXTIME .
These errors can then be dealt with by the error handler.
Predefined data
The constant EOF_NUM can be used to stop reading, at the end of the file.
CONST num EOF_NUM := 9.998E36;
Continued
Continues on next page
2 Functions
2.99. ReadNum - Reads a number from a file or serial channel
RobotWare - OS
951
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
ReadNum ’(’
[IODevice ’:=’]<variable ( VAR ) of iodev>
[’\’Delim’:=’<expression ( IN ) of string>]
[’\’Time’:=’<expression ( IN ) of num>]’)’
A function with a return value of the type num .
Related information
For information about
See
Opening, etc. files or serial channels
Technical reference manual - RAPID overview ,
section RAPID summary - Communication
Continued
2 Functions
2.100. ReadStr - Reads a string from a file or serial channel
RobotWare - OS
3HAC 16581-1 Revision: J
952
© Copyright 2004-2010 ABB. All rights reserved.
2.100. ReadStr - Reads a string from a file or serial channel
Usage
ReadStr ( Read String ) is used to read a string from a character-based file or serial channel.
Basic examples
Basic examples of the function ReadStr are illustrated below.
See also More examples on page 953 .
Example 1
VAR string text;
VAR iodev infile;
...
Open "HOME:/file.doc", infile\Read;
text := ReadStr(infile);
text is assigned a string read from the file file.doc .
Return value
Data type: string
The string read from the specified file or serial channel. If the file is empty (end of file), the
string "EOF" is returned.
Arguments
ReadStr (IODevice [\Delim] [\RemoveCR] [\DiscardHeaders]
[\Time])
IODevice
Data type: iodev
The name (reference) of the file or serial channel to be read.
[\Delim]
Delimiters
Data type: string
A string containing the delimiters to use when parsing a line in the file or serial channel. By
default the file is read line by line and the line-feed character (\0A) is the only delimiter
considered by the parsing. When the \Delim argument is used, any character in the specified
string argument plus by default line-feed character will be considered to determine the
significant part of the line.
To specify non-alphanumeric characters, use \ xx , where xx is the hexadecimal representation
of the ASCII code of the character (example: TAB is specified by \ 09 ).
[\RemoveCR]
Data type: switch
A switch used to remove the trailing carriage return character when reading PC files. In PC
files, a new line is specified by carriage return and line feed (CRLF). When reading a line in
such files, the carriage return character is by default read into the return string. When using
this argument, the carriage return character will be read from the file but not included in the
return string.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 954
|
2 Functions
2.99. ReadNum - Reads a number from a file or serial channel
RobotWare - OS
951
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
ReadNum ’(’
[IODevice ’:=’]<variable ( VAR ) of iodev>
[’\’Delim’:=’<expression ( IN ) of string>]
[’\’Time’:=’<expression ( IN ) of num>]’)’
A function with a return value of the type num .
Related information
For information about
See
Opening, etc. files or serial channels
Technical reference manual - RAPID overview ,
section RAPID summary - Communication
Continued
2 Functions
2.100. ReadStr - Reads a string from a file or serial channel
RobotWare - OS
3HAC 16581-1 Revision: J
952
© Copyright 2004-2010 ABB. All rights reserved.
2.100. ReadStr - Reads a string from a file or serial channel
Usage
ReadStr ( Read String ) is used to read a string from a character-based file or serial channel.
Basic examples
Basic examples of the function ReadStr are illustrated below.
See also More examples on page 953 .
Example 1
VAR string text;
VAR iodev infile;
...
Open "HOME:/file.doc", infile\Read;
text := ReadStr(infile);
text is assigned a string read from the file file.doc .
Return value
Data type: string
The string read from the specified file or serial channel. If the file is empty (end of file), the
string "EOF" is returned.
Arguments
ReadStr (IODevice [\Delim] [\RemoveCR] [\DiscardHeaders]
[\Time])
IODevice
Data type: iodev
The name (reference) of the file or serial channel to be read.
[\Delim]
Delimiters
Data type: string
A string containing the delimiters to use when parsing a line in the file or serial channel. By
default the file is read line by line and the line-feed character (\0A) is the only delimiter
considered by the parsing. When the \Delim argument is used, any character in the specified
string argument plus by default line-feed character will be considered to determine the
significant part of the line.
To specify non-alphanumeric characters, use \ xx , where xx is the hexadecimal representation
of the ASCII code of the character (example: TAB is specified by \ 09 ).
[\RemoveCR]
Data type: switch
A switch used to remove the trailing carriage return character when reading PC files. In PC
files, a new line is specified by carriage return and line feed (CRLF). When reading a line in
such files, the carriage return character is by default read into the return string. When using
this argument, the carriage return character will be read from the file but not included in the
return string.
Continues on next page
2 Functions
2.100. ReadStr - Reads a string from a file or serial channel
RobotWare - OS
953
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
[\DiscardHeaders]
Data type: switch
This argument specifies whether the heading delimiters (specified in \Delim plus default
line-feed) are skipped or not before transferring data to the return string. By default, if the first
character at the current file position is a delimiter, it is read but not transferred to the return
string, the line parsing is stopped and the return will be an empty string. If this argument is
used, all delimiters included in the line will be read from the file but discarded, and no return
will be done until the return string will contain the data starting at the first non-delimiter
character in the line.
[\Time]
Data type: num
The max. time for the reading operation (timeout) in seconds. If this argument is not
specified, the max. time is set to 60 seconds. To wait forever, use the predefined constant
WAIT_MAX .
If this time runs out before the read operation is finished, the error handler will be called with
the error code ERR_DEV_MAXTIME . If there is no error handler, the execution will be stopped.
The timeout function is in use also during program stop and will be noticed in the RAPID
program at program start.
Program execution
Starting at the current file position, if the \DiscardHeaders argument is used, the function
reads and discards any heading delimiters (line-feed characters and any character specified in
the \Delim argument). In all cases, it then reads everything up to the next delimiter character,
but not more than 80 characters. If the significant part exceeds 80 characters, the remainder
of the characters will be read on the next reading. The delimiter that caused the parsing to stop
is read from the file but not transferred to the return string. If the last character in the string is
a carriage return character and the \RemoveCR argument is used, this character will be
removed from the string.
More examples
More examples of the function ReadStr are illustrated below.
Example 1
text := ReadStr(infile);
IF text = EOF THEN
TPWrite "The file is empty";
...
Before using the string read from the file, a check is performed to make sure that the file is
not empty.
Continued
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 955
|
2 Functions
2.100. ReadStr - Reads a string from a file or serial channel
RobotWare - OS
3HAC 16581-1 Revision: J
952
© Copyright 2004-2010 ABB. All rights reserved.
2.100. ReadStr - Reads a string from a file or serial channel
Usage
ReadStr ( Read String ) is used to read a string from a character-based file or serial channel.
Basic examples
Basic examples of the function ReadStr are illustrated below.
See also More examples on page 953 .
Example 1
VAR string text;
VAR iodev infile;
...
Open "HOME:/file.doc", infile\Read;
text := ReadStr(infile);
text is assigned a string read from the file file.doc .
Return value
Data type: string
The string read from the specified file or serial channel. If the file is empty (end of file), the
string "EOF" is returned.
Arguments
ReadStr (IODevice [\Delim] [\RemoveCR] [\DiscardHeaders]
[\Time])
IODevice
Data type: iodev
The name (reference) of the file or serial channel to be read.
[\Delim]
Delimiters
Data type: string
A string containing the delimiters to use when parsing a line in the file or serial channel. By
default the file is read line by line and the line-feed character (\0A) is the only delimiter
considered by the parsing. When the \Delim argument is used, any character in the specified
string argument plus by default line-feed character will be considered to determine the
significant part of the line.
To specify non-alphanumeric characters, use \ xx , where xx is the hexadecimal representation
of the ASCII code of the character (example: TAB is specified by \ 09 ).
[\RemoveCR]
Data type: switch
A switch used to remove the trailing carriage return character when reading PC files. In PC
files, a new line is specified by carriage return and line feed (CRLF). When reading a line in
such files, the carriage return character is by default read into the return string. When using
this argument, the carriage return character will be read from the file but not included in the
return string.
Continues on next page
2 Functions
2.100. ReadStr - Reads a string from a file or serial channel
RobotWare - OS
953
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
[\DiscardHeaders]
Data type: switch
This argument specifies whether the heading delimiters (specified in \Delim plus default
line-feed) are skipped or not before transferring data to the return string. By default, if the first
character at the current file position is a delimiter, it is read but not transferred to the return
string, the line parsing is stopped and the return will be an empty string. If this argument is
used, all delimiters included in the line will be read from the file but discarded, and no return
will be done until the return string will contain the data starting at the first non-delimiter
character in the line.
[\Time]
Data type: num
The max. time for the reading operation (timeout) in seconds. If this argument is not
specified, the max. time is set to 60 seconds. To wait forever, use the predefined constant
WAIT_MAX .
If this time runs out before the read operation is finished, the error handler will be called with
the error code ERR_DEV_MAXTIME . If there is no error handler, the execution will be stopped.
The timeout function is in use also during program stop and will be noticed in the RAPID
program at program start.
Program execution
Starting at the current file position, if the \DiscardHeaders argument is used, the function
reads and discards any heading delimiters (line-feed characters and any character specified in
the \Delim argument). In all cases, it then reads everything up to the next delimiter character,
but not more than 80 characters. If the significant part exceeds 80 characters, the remainder
of the characters will be read on the next reading. The delimiter that caused the parsing to stop
is read from the file but not transferred to the return string. If the last character in the string is
a carriage return character and the \RemoveCR argument is used, this character will be
removed from the string.
More examples
More examples of the function ReadStr are illustrated below.
Example 1
text := ReadStr(infile);
IF text = EOF THEN
TPWrite "The file is empty";
...
Before using the string read from the file, a check is performed to make sure that the file is
not empty.
Continued
Continues on next page
2 Functions
2.100. ReadStr - Reads a string from a file or serial channel
RobotWare - OS
3HAC 16581-1 Revision: J
954
© Copyright 2004-2010 ABB. All rights reserved.
Example 2
Consider a file containing:
<LF><SPACE><TAB>Hello<SPACE><SPACE>World<CR><LF>
text := ReadStr(infile);
text will be an empty string: the first character in the file is the default < LF > delimiter.
text := ReadStr(infile\DiscardHeaders);
text will contain <SPACE><TAB>Hello<SPACE><SPACE>World<CR> : the first character in
the file, the default <LF> delimiter, is discarded.
text := ReadStr(infile\RemoveCR\DiscardHeaders);
text will contain <SPACE><TAB>Hello<SPACE><SPACE>World: the first character in the
file, the default <LF> delimiter, is discarded; the final carriage return character is removed
text := ReadStr(infile\Delim:=" \09"\RemoveCR\DiscardHeaders);
text will contain "Hello" : the first characters in the file that match either the default <LF>
delimiter or the character set defined by \Delim (space and tab) are discarded. Data is then
transferred up to the first delimiter that is read from the file but not transferred into the string.
A new invocation of the same statement will return "World" .
Example 3
Consider a file containing:
<CR><LF>Hello<CR><LF>
text := ReadStr(infile);
text will contain the <CR> ( \0d) character: <CR> and < LF> characters are read from the
file, but only <CR> is transferred to the string. A new invocation of the same statement will
return "Hello\0d" .
text := ReadStr(infile\RemoveCR);
text will contain an empty string: <CR> and <LF> characters are read from the file; <CR> is
transferred but removed from the string. A new invocation of the same statement will return
"Hello" .
text := ReadStr(infile\Delim:="\0d");
text will contain an empty string: <CR> is read from the file but not transferred to the return
string. A new invocation of the same instruction will return an empty string again: <LF> is
read from the file but not transferred to the return string.
text := ReadStr(infile\Delim:="\0d"\DiscardHeaders);
text will contain "Hello" . A new invocation of the same instruction will return "EOF" (end
of file).
Continued
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 956
|
2 Functions
2.100. ReadStr - Reads a string from a file or serial channel
RobotWare - OS
953
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
[\DiscardHeaders]
Data type: switch
This argument specifies whether the heading delimiters (specified in \Delim plus default
line-feed) are skipped or not before transferring data to the return string. By default, if the first
character at the current file position is a delimiter, it is read but not transferred to the return
string, the line parsing is stopped and the return will be an empty string. If this argument is
used, all delimiters included in the line will be read from the file but discarded, and no return
will be done until the return string will contain the data starting at the first non-delimiter
character in the line.
[\Time]
Data type: num
The max. time for the reading operation (timeout) in seconds. If this argument is not
specified, the max. time is set to 60 seconds. To wait forever, use the predefined constant
WAIT_MAX .
If this time runs out before the read operation is finished, the error handler will be called with
the error code ERR_DEV_MAXTIME . If there is no error handler, the execution will be stopped.
The timeout function is in use also during program stop and will be noticed in the RAPID
program at program start.
Program execution
Starting at the current file position, if the \DiscardHeaders argument is used, the function
reads and discards any heading delimiters (line-feed characters and any character specified in
the \Delim argument). In all cases, it then reads everything up to the next delimiter character,
but not more than 80 characters. If the significant part exceeds 80 characters, the remainder
of the characters will be read on the next reading. The delimiter that caused the parsing to stop
is read from the file but not transferred to the return string. If the last character in the string is
a carriage return character and the \RemoveCR argument is used, this character will be
removed from the string.
More examples
More examples of the function ReadStr are illustrated below.
Example 1
text := ReadStr(infile);
IF text = EOF THEN
TPWrite "The file is empty";
...
Before using the string read from the file, a check is performed to make sure that the file is
not empty.
Continued
Continues on next page
2 Functions
2.100. ReadStr - Reads a string from a file or serial channel
RobotWare - OS
3HAC 16581-1 Revision: J
954
© Copyright 2004-2010 ABB. All rights reserved.
Example 2
Consider a file containing:
<LF><SPACE><TAB>Hello<SPACE><SPACE>World<CR><LF>
text := ReadStr(infile);
text will be an empty string: the first character in the file is the default < LF > delimiter.
text := ReadStr(infile\DiscardHeaders);
text will contain <SPACE><TAB>Hello<SPACE><SPACE>World<CR> : the first character in
the file, the default <LF> delimiter, is discarded.
text := ReadStr(infile\RemoveCR\DiscardHeaders);
text will contain <SPACE><TAB>Hello<SPACE><SPACE>World: the first character in the
file, the default <LF> delimiter, is discarded; the final carriage return character is removed
text := ReadStr(infile\Delim:=" \09"\RemoveCR\DiscardHeaders);
text will contain "Hello" : the first characters in the file that match either the default <LF>
delimiter or the character set defined by \Delim (space and tab) are discarded. Data is then
transferred up to the first delimiter that is read from the file but not transferred into the string.
A new invocation of the same statement will return "World" .
Example 3
Consider a file containing:
<CR><LF>Hello<CR><LF>
text := ReadStr(infile);
text will contain the <CR> ( \0d) character: <CR> and < LF> characters are read from the
file, but only <CR> is transferred to the string. A new invocation of the same statement will
return "Hello\0d" .
text := ReadStr(infile\RemoveCR);
text will contain an empty string: <CR> and <LF> characters are read from the file; <CR> is
transferred but removed from the string. A new invocation of the same statement will return
"Hello" .
text := ReadStr(infile\Delim:="\0d");
text will contain an empty string: <CR> is read from the file but not transferred to the return
string. A new invocation of the same instruction will return an empty string again: <LF> is
read from the file but not transferred to the return string.
text := ReadStr(infile\Delim:="\0d"\DiscardHeaders);
text will contain "Hello" . A new invocation of the same instruction will return "EOF" (end
of file).
Continued
Continues on next page
2 Functions
2.100. ReadStr - Reads a string from a file or serial channel
RobotWare - OS
955
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
The function can only be used for files or serial channels that have been opened for reading
in a character-based mode.
Error handling
If an error occurs during reading, the system variable ERRNO is set to ERR_FILEACC .
If timeout before the read operation is finished, the system variable ERRNO is set to
ERR_DEV_MAXTIME .
These errors can then be dealt with by the error handler.
Predefined data
The constant EOF can be used to check if the file was empty when trying to read from the file
or to stop reading at the end of the file.
CONST string EOF := "EOF";
Syntax
ReadStr ’(’
[IODevice’ :=’] <variable ( VAR ) of iodev>
[’\’Delim’ :=’<expression ( IN ) of string>]
[’\’RemoveCR]
[’\’DiscardHeaders]
[’\’Time’:=’ <expression ( IN ) of num>]’)’
A function with a return value of the type string .
Related information
For information about
See
Opening, etc. files or serial channels
Technical reference manual - RAPID overview ,
section RAPID summary - Communication
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 957
|
2 Functions
2.100. ReadStr - Reads a string from a file or serial channel
RobotWare - OS
3HAC 16581-1 Revision: J
954
© Copyright 2004-2010 ABB. All rights reserved.
Example 2
Consider a file containing:
<LF><SPACE><TAB>Hello<SPACE><SPACE>World<CR><LF>
text := ReadStr(infile);
text will be an empty string: the first character in the file is the default < LF > delimiter.
text := ReadStr(infile\DiscardHeaders);
text will contain <SPACE><TAB>Hello<SPACE><SPACE>World<CR> : the first character in
the file, the default <LF> delimiter, is discarded.
text := ReadStr(infile\RemoveCR\DiscardHeaders);
text will contain <SPACE><TAB>Hello<SPACE><SPACE>World: the first character in the
file, the default <LF> delimiter, is discarded; the final carriage return character is removed
text := ReadStr(infile\Delim:=" \09"\RemoveCR\DiscardHeaders);
text will contain "Hello" : the first characters in the file that match either the default <LF>
delimiter or the character set defined by \Delim (space and tab) are discarded. Data is then
transferred up to the first delimiter that is read from the file but not transferred into the string.
A new invocation of the same statement will return "World" .
Example 3
Consider a file containing:
<CR><LF>Hello<CR><LF>
text := ReadStr(infile);
text will contain the <CR> ( \0d) character: <CR> and < LF> characters are read from the
file, but only <CR> is transferred to the string. A new invocation of the same statement will
return "Hello\0d" .
text := ReadStr(infile\RemoveCR);
text will contain an empty string: <CR> and <LF> characters are read from the file; <CR> is
transferred but removed from the string. A new invocation of the same statement will return
"Hello" .
text := ReadStr(infile\Delim:="\0d");
text will contain an empty string: <CR> is read from the file but not transferred to the return
string. A new invocation of the same instruction will return an empty string again: <LF> is
read from the file but not transferred to the return string.
text := ReadStr(infile\Delim:="\0d"\DiscardHeaders);
text will contain "Hello" . A new invocation of the same instruction will return "EOF" (end
of file).
Continued
Continues on next page
2 Functions
2.100. ReadStr - Reads a string from a file or serial channel
RobotWare - OS
955
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
The function can only be used for files or serial channels that have been opened for reading
in a character-based mode.
Error handling
If an error occurs during reading, the system variable ERRNO is set to ERR_FILEACC .
If timeout before the read operation is finished, the system variable ERRNO is set to
ERR_DEV_MAXTIME .
These errors can then be dealt with by the error handler.
Predefined data
The constant EOF can be used to check if the file was empty when trying to read from the file
or to stop reading at the end of the file.
CONST string EOF := "EOF";
Syntax
ReadStr ’(’
[IODevice’ :=’] <variable ( VAR ) of iodev>
[’\’Delim’ :=’<expression ( IN ) of string>]
[’\’RemoveCR]
[’\’DiscardHeaders]
[’\’Time’:=’ <expression ( IN ) of num>]’)’
A function with a return value of the type string .
Related information
For information about
See
Opening, etc. files or serial channels
Technical reference manual - RAPID overview ,
section RAPID summary - Communication
Continued
2 Functions
2.101. ReadStrBin - Reads a string from a binary serial channel or file
RobotWare - OS
3HAC 16581-1 Revision: J
956
© Copyright 2004-2010 ABB. All rights reserved.
2.101. ReadStrBin - Reads a string from a binary serial channel or file
Usage
ReadStrBin ( Read String Binary ) is used to read a string from a binary serial channel or file.
Basic examples
Basic examples of the function ReadStrBin are illustrated below.
Example 1
VAR iodev channel2;
VAR string text;
...
Open "com2:", channel2 \Bin;
text := ReadStrBin (channel2, 10);
text := ReadStrBin(infile,20);
IF text = EOF THEN
text is assigned a 10 characters text string read from the serial channel referred to by
channel2
Before using the string read from the file, a check is performed to make sure that the file is
not empty.
Return value
Data type: string
The text string read from the specified serial channel or file. If the file is empty (end of file),
the string "EOF" is returned.
Arguments
ReadStrBin (IODevice NoOfChars [\Time])
IODevice
Data type: iodev
The name (reference) of the binary serial channel or file to be read.
NoOfChars
Number of Characters
Data type: num
The number of characters to be read from the binary serial channel or file.
[\Time]
Data type: num
The max. time for the reading operation (timeout) in seconds. If this argument is not
specified, the max. time is set to 60 seconds. To wait forever, use the predefined constant
WAIT_MAX .
If this time runs out before the read operation is finished, the error handler will be called with
the error code ERR_DEV_MAXTIME . If there is no error handler, the execution will be stopped.
The timeout function is in use also during program stop and will be noticed by the RAPID
program at program start.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 958
|
2 Functions
2.100. ReadStr - Reads a string from a file or serial channel
RobotWare - OS
955
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
The function can only be used for files or serial channels that have been opened for reading
in a character-based mode.
Error handling
If an error occurs during reading, the system variable ERRNO is set to ERR_FILEACC .
If timeout before the read operation is finished, the system variable ERRNO is set to
ERR_DEV_MAXTIME .
These errors can then be dealt with by the error handler.
Predefined data
The constant EOF can be used to check if the file was empty when trying to read from the file
or to stop reading at the end of the file.
CONST string EOF := "EOF";
Syntax
ReadStr ’(’
[IODevice’ :=’] <variable ( VAR ) of iodev>
[’\’Delim’ :=’<expression ( IN ) of string>]
[’\’RemoveCR]
[’\’DiscardHeaders]
[’\’Time’:=’ <expression ( IN ) of num>]’)’
A function with a return value of the type string .
Related information
For information about
See
Opening, etc. files or serial channels
Technical reference manual - RAPID overview ,
section RAPID summary - Communication
Continued
2 Functions
2.101. ReadStrBin - Reads a string from a binary serial channel or file
RobotWare - OS
3HAC 16581-1 Revision: J
956
© Copyright 2004-2010 ABB. All rights reserved.
2.101. ReadStrBin - Reads a string from a binary serial channel or file
Usage
ReadStrBin ( Read String Binary ) is used to read a string from a binary serial channel or file.
Basic examples
Basic examples of the function ReadStrBin are illustrated below.
Example 1
VAR iodev channel2;
VAR string text;
...
Open "com2:", channel2 \Bin;
text := ReadStrBin (channel2, 10);
text := ReadStrBin(infile,20);
IF text = EOF THEN
text is assigned a 10 characters text string read from the serial channel referred to by
channel2
Before using the string read from the file, a check is performed to make sure that the file is
not empty.
Return value
Data type: string
The text string read from the specified serial channel or file. If the file is empty (end of file),
the string "EOF" is returned.
Arguments
ReadStrBin (IODevice NoOfChars [\Time])
IODevice
Data type: iodev
The name (reference) of the binary serial channel or file to be read.
NoOfChars
Number of Characters
Data type: num
The number of characters to be read from the binary serial channel or file.
[\Time]
Data type: num
The max. time for the reading operation (timeout) in seconds. If this argument is not
specified, the max. time is set to 60 seconds. To wait forever, use the predefined constant
WAIT_MAX .
If this time runs out before the read operation is finished, the error handler will be called with
the error code ERR_DEV_MAXTIME . If there is no error handler, the execution will be stopped.
The timeout function is in use also during program stop and will be noticed by the RAPID
program at program start.
Continues on next page
2 Functions
2.101. ReadStrBin - Reads a string from a binary serial channel or file
RobotWare - OS
957
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Program execution
The function reads the specified number of characters from the binary serial channel or file.
Limitations
The function can only be used for serial channels or files that have been opened for reading
in a binary mode.
Error handling
If an error occurs during reading, the system variable ERRNO is set to ERR_FILEACC .
If timeout before the read operation is finished, the system variable ERRNO is set to
ERR_DEV_MAXTIME .
These errors can then be dealt with by the error handler.
Predefined data
The constant EOF can be used to check if the file was empty, when trying to read from the file
or to stop reading at the end of the file.
CONST string EOF := "EOF";
Syntax
ReadStrBin ’(’
[IODevice ’:=’] <variable ( VAR ) of iodev>’,’
[NoOfChars’ :=’] <expression ( IN ) of num>
[’\’Time ’:=’ <expression ( IN ) of num>]’)’
A function with a return value of the type string .
Related information
For information about
See
Opening, etc. serial channels or files
Technical reference manual - RAPID overview ,
section RAPID summary - Communication
Write binary string
WriteStrBin - Writes a string to a binary serial
channel on page 727
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 959
|
2 Functions
2.101. ReadStrBin - Reads a string from a binary serial channel or file
RobotWare - OS
3HAC 16581-1 Revision: J
956
© Copyright 2004-2010 ABB. All rights reserved.
2.101. ReadStrBin - Reads a string from a binary serial channel or file
Usage
ReadStrBin ( Read String Binary ) is used to read a string from a binary serial channel or file.
Basic examples
Basic examples of the function ReadStrBin are illustrated below.
Example 1
VAR iodev channel2;
VAR string text;
...
Open "com2:", channel2 \Bin;
text := ReadStrBin (channel2, 10);
text := ReadStrBin(infile,20);
IF text = EOF THEN
text is assigned a 10 characters text string read from the serial channel referred to by
channel2
Before using the string read from the file, a check is performed to make sure that the file is
not empty.
Return value
Data type: string
The text string read from the specified serial channel or file. If the file is empty (end of file),
the string "EOF" is returned.
Arguments
ReadStrBin (IODevice NoOfChars [\Time])
IODevice
Data type: iodev
The name (reference) of the binary serial channel or file to be read.
NoOfChars
Number of Characters
Data type: num
The number of characters to be read from the binary serial channel or file.
[\Time]
Data type: num
The max. time for the reading operation (timeout) in seconds. If this argument is not
specified, the max. time is set to 60 seconds. To wait forever, use the predefined constant
WAIT_MAX .
If this time runs out before the read operation is finished, the error handler will be called with
the error code ERR_DEV_MAXTIME . If there is no error handler, the execution will be stopped.
The timeout function is in use also during program stop and will be noticed by the RAPID
program at program start.
Continues on next page
2 Functions
2.101. ReadStrBin - Reads a string from a binary serial channel or file
RobotWare - OS
957
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Program execution
The function reads the specified number of characters from the binary serial channel or file.
Limitations
The function can only be used for serial channels or files that have been opened for reading
in a binary mode.
Error handling
If an error occurs during reading, the system variable ERRNO is set to ERR_FILEACC .
If timeout before the read operation is finished, the system variable ERRNO is set to
ERR_DEV_MAXTIME .
These errors can then be dealt with by the error handler.
Predefined data
The constant EOF can be used to check if the file was empty, when trying to read from the file
or to stop reading at the end of the file.
CONST string EOF := "EOF";
Syntax
ReadStrBin ’(’
[IODevice ’:=’] <variable ( VAR ) of iodev>’,’
[NoOfChars’ :=’] <expression ( IN ) of num>
[’\’Time ’:=’ <expression ( IN ) of num>]’)’
A function with a return value of the type string .
Related information
For information about
See
Opening, etc. serial channels or files
Technical reference manual - RAPID overview ,
section RAPID summary - Communication
Write binary string
WriteStrBin - Writes a string to a binary serial
channel on page 727
Continued
2 Functions
2.102. ReadVar - Read variable from a device
Sensor Interface
3HAC 16581-1 Revision: J
958
© Copyright 2004-2010 ABB. All rights reserved.
2.102. ReadVar - Read variable from a device
Usage
ReadVar is used to read a variable from a device connected to the serial sensor interface.
The sensor interface communicates with sensors over serial channels using the RTP1
transport protocol.
This is an example of a sensor channel configuration.
COM_PHY_CHANNEL:
•
Name “COM1:”
•
Connector “COM1”
•
Baudrate 19200
COM_TRP:
•
Name “sen1:”
•
Type “RTP1”
•
PhyChannel “COM1”
Basic examples
Basic examples of the function ReadVar are illustrated below.
Example 1
CONST num XCoord := 8;
CONST num YCoord := 9;
CONST num ZCoord := 10;
VAR pos SensorPos;
! Connect to the sensor device "sen1:" (defined in sio.cfg).
SenDevice "sen1:";
! Read a cartesian position from the sensor.
SensorPos.x := ReadVar ("sen1:", XCoord);
SensorPos.y := ReadVar ("sen1:", YCoord);
SensorPos.z := ReadVar ("sen1:", ZCoord);
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 960
|
2 Functions
2.101. ReadStrBin - Reads a string from a binary serial channel or file
RobotWare - OS
957
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Program execution
The function reads the specified number of characters from the binary serial channel or file.
Limitations
The function can only be used for serial channels or files that have been opened for reading
in a binary mode.
Error handling
If an error occurs during reading, the system variable ERRNO is set to ERR_FILEACC .
If timeout before the read operation is finished, the system variable ERRNO is set to
ERR_DEV_MAXTIME .
These errors can then be dealt with by the error handler.
Predefined data
The constant EOF can be used to check if the file was empty, when trying to read from the file
or to stop reading at the end of the file.
CONST string EOF := "EOF";
Syntax
ReadStrBin ’(’
[IODevice ’:=’] <variable ( VAR ) of iodev>’,’
[NoOfChars’ :=’] <expression ( IN ) of num>
[’\’Time ’:=’ <expression ( IN ) of num>]’)’
A function with a return value of the type string .
Related information
For information about
See
Opening, etc. serial channels or files
Technical reference manual - RAPID overview ,
section RAPID summary - Communication
Write binary string
WriteStrBin - Writes a string to a binary serial
channel on page 727
Continued
2 Functions
2.102. ReadVar - Read variable from a device
Sensor Interface
3HAC 16581-1 Revision: J
958
© Copyright 2004-2010 ABB. All rights reserved.
2.102. ReadVar - Read variable from a device
Usage
ReadVar is used to read a variable from a device connected to the serial sensor interface.
The sensor interface communicates with sensors over serial channels using the RTP1
transport protocol.
This is an example of a sensor channel configuration.
COM_PHY_CHANNEL:
•
Name “COM1:”
•
Connector “COM1”
•
Baudrate 19200
COM_TRP:
•
Name “sen1:”
•
Type “RTP1”
•
PhyChannel “COM1”
Basic examples
Basic examples of the function ReadVar are illustrated below.
Example 1
CONST num XCoord := 8;
CONST num YCoord := 9;
CONST num ZCoord := 10;
VAR pos SensorPos;
! Connect to the sensor device "sen1:" (defined in sio.cfg).
SenDevice "sen1:";
! Read a cartesian position from the sensor.
SensorPos.x := ReadVar ("sen1:", XCoord);
SensorPos.y := ReadVar ("sen1:", YCoord);
SensorPos.z := ReadVar ("sen1:", ZCoord);
Continues on next page
2 Functions
2.102. ReadVar - Read variable from a device
Sensor Interface
959
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
ReadVar (device, VarNo, [ \TaskName ])
device
Data type: string
The I/O device name configured in sio.cfg for the sensor used.
VarNo
Data type: num
The argument VarNo is used to select variable to be read.
[ \TaskName ]
Data type: string
The argument TaskName makes it possible to access devices in other RAPID tasks.
Fault management
Syntax
ReadVar
[ device ‘:=’ ] < expression( IN ) of string>’,’
[ VarNo ’:=’ ] < expression ( IN ) of num > ‘,’
[ ’\’ TaskName’ :=’ < expression ( IN ) of string > ] ‘;’
A function with a return value of the data type num .
Error constant ( ERRNO value)
Description
SEN_NO_MEAS
Measurement failure
SEN_NOREADY
Sensor unable to handle command
SEN_GENERRO
General sensor error
SEN_BUSY
Sensor busy
SEN_UNKNOWN
Unknown sensor
SEN_EXALARM
External sensor error
SEN_CAALARM
Internal sensor error
SEN_TEMP
Sensor temperature error
SEN_VALUE
Illegal communication value
SEN_CAMCHECK
Sensor check failure
SEN_TIMEOUT
Communication error
Continued
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 961
|
2 Functions
2.102. ReadVar - Read variable from a device
Sensor Interface
3HAC 16581-1 Revision: J
958
© Copyright 2004-2010 ABB. All rights reserved.
2.102. ReadVar - Read variable from a device
Usage
ReadVar is used to read a variable from a device connected to the serial sensor interface.
The sensor interface communicates with sensors over serial channels using the RTP1
transport protocol.
This is an example of a sensor channel configuration.
COM_PHY_CHANNEL:
•
Name “COM1:”
•
Connector “COM1”
•
Baudrate 19200
COM_TRP:
•
Name “sen1:”
•
Type “RTP1”
•
PhyChannel “COM1”
Basic examples
Basic examples of the function ReadVar are illustrated below.
Example 1
CONST num XCoord := 8;
CONST num YCoord := 9;
CONST num ZCoord := 10;
VAR pos SensorPos;
! Connect to the sensor device "sen1:" (defined in sio.cfg).
SenDevice "sen1:";
! Read a cartesian position from the sensor.
SensorPos.x := ReadVar ("sen1:", XCoord);
SensorPos.y := ReadVar ("sen1:", YCoord);
SensorPos.z := ReadVar ("sen1:", ZCoord);
Continues on next page
2 Functions
2.102. ReadVar - Read variable from a device
Sensor Interface
959
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
ReadVar (device, VarNo, [ \TaskName ])
device
Data type: string
The I/O device name configured in sio.cfg for the sensor used.
VarNo
Data type: num
The argument VarNo is used to select variable to be read.
[ \TaskName ]
Data type: string
The argument TaskName makes it possible to access devices in other RAPID tasks.
Fault management
Syntax
ReadVar
[ device ‘:=’ ] < expression( IN ) of string>’,’
[ VarNo ’:=’ ] < expression ( IN ) of num > ‘,’
[ ’\’ TaskName’ :=’ < expression ( IN ) of string > ] ‘;’
A function with a return value of the data type num .
Error constant ( ERRNO value)
Description
SEN_NO_MEAS
Measurement failure
SEN_NOREADY
Sensor unable to handle command
SEN_GENERRO
General sensor error
SEN_BUSY
Sensor busy
SEN_UNKNOWN
Unknown sensor
SEN_EXALARM
External sensor error
SEN_CAALARM
Internal sensor error
SEN_TEMP
Sensor temperature error
SEN_VALUE
Illegal communication value
SEN_CAMCHECK
Sensor check failure
SEN_TIMEOUT
Communication error
Continued
Continues on next page
2 Functions
2.102. ReadVar - Read variable from a device
Sensor Interface
3HAC 16581-1 Revision: J
960
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Connect to a sensor device
SenDevice - connect to a sensor device on page
425
Write a sensor variable
WriteVar - write variable on page 729
Write a sensor data block
WriteBlock - write block of data to device on
page 719
Read a sensor data block
ReadBlock - read a block of data from device on
page 343
Configuration of sensor communication
Technical reference manual - RAPID overview ,
section Communication
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 962
|
2 Functions
2.102. ReadVar - Read variable from a device
Sensor Interface
959
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
ReadVar (device, VarNo, [ \TaskName ])
device
Data type: string
The I/O device name configured in sio.cfg for the sensor used.
VarNo
Data type: num
The argument VarNo is used to select variable to be read.
[ \TaskName ]
Data type: string
The argument TaskName makes it possible to access devices in other RAPID tasks.
Fault management
Syntax
ReadVar
[ device ‘:=’ ] < expression( IN ) of string>’,’
[ VarNo ’:=’ ] < expression ( IN ) of num > ‘,’
[ ’\’ TaskName’ :=’ < expression ( IN ) of string > ] ‘;’
A function with a return value of the data type num .
Error constant ( ERRNO value)
Description
SEN_NO_MEAS
Measurement failure
SEN_NOREADY
Sensor unable to handle command
SEN_GENERRO
General sensor error
SEN_BUSY
Sensor busy
SEN_UNKNOWN
Unknown sensor
SEN_EXALARM
External sensor error
SEN_CAALARM
Internal sensor error
SEN_TEMP
Sensor temperature error
SEN_VALUE
Illegal communication value
SEN_CAMCHECK
Sensor check failure
SEN_TIMEOUT
Communication error
Continued
Continues on next page
2 Functions
2.102. ReadVar - Read variable from a device
Sensor Interface
3HAC 16581-1 Revision: J
960
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Connect to a sensor device
SenDevice - connect to a sensor device on page
425
Write a sensor variable
WriteVar - write variable on page 729
Write a sensor data block
WriteBlock - write block of data to device on
page 719
Read a sensor data block
ReadBlock - read a block of data from device on
page 343
Configuration of sensor communication
Technical reference manual - RAPID overview ,
section Communication
Continued
2 Functions
2.103. RelTool - Make a displacement relative to the tool
RobotWare - OS
961
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.103. RelTool - Make a displacement relative to the tool
Usage
RelTool ( Relative Tool ) is used to add a displacement and/or a rotation, expressed in the
active tool coordinate system, to a robot position.
Basic examples
Basic examples of the function RelTool are illustrated below.
Example 1
MoveL RelTool (p1, 0, 0, 100), v100, fine, tool1;
The robot is moved to a position that is 100 mm from p1 in the z direction of the tool.
Example 2
MoveL RelTool (p1, 0, 0, 0 \Rz:= 25), v100, fine, tool1;
The tool is rotated 25° around its z-axis.
Return value
Data type: robtarget
The new position with the addition of a displacement and/or a rotation, if any, relative to the
active tool.
Arguments
RelTool (Point Dx Dy Dz [\Rx] [\Ry] [\Rz])
Point
Data type: robtarget
The input robot position. The orientation part of this position defines the current orientation
of the tool coordinate system.
Dx
Data type: num
The displacement in mm in the x direction of the tool coordinate system.
Dy
Data type: num
The displacement in mm in the y direction of the tool coordinate system.
Dz
Data type: num
The displacement in mm in the z direction of the tool coordinate system.
[\Rx]
Data type: num
The rotation in degrees around the x axis of the tool coordinate system.
[\Ry]
Data type: num
The rotation in degrees around the y axis of the tool coordinate system.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 963
|
2 Functions
2.102. ReadVar - Read variable from a device
Sensor Interface
3HAC 16581-1 Revision: J
960
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Connect to a sensor device
SenDevice - connect to a sensor device on page
425
Write a sensor variable
WriteVar - write variable on page 729
Write a sensor data block
WriteBlock - write block of data to device on
page 719
Read a sensor data block
ReadBlock - read a block of data from device on
page 343
Configuration of sensor communication
Technical reference manual - RAPID overview ,
section Communication
Continued
2 Functions
2.103. RelTool - Make a displacement relative to the tool
RobotWare - OS
961
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.103. RelTool - Make a displacement relative to the tool
Usage
RelTool ( Relative Tool ) is used to add a displacement and/or a rotation, expressed in the
active tool coordinate system, to a robot position.
Basic examples
Basic examples of the function RelTool are illustrated below.
Example 1
MoveL RelTool (p1, 0, 0, 100), v100, fine, tool1;
The robot is moved to a position that is 100 mm from p1 in the z direction of the tool.
Example 2
MoveL RelTool (p1, 0, 0, 0 \Rz:= 25), v100, fine, tool1;
The tool is rotated 25° around its z-axis.
Return value
Data type: robtarget
The new position with the addition of a displacement and/or a rotation, if any, relative to the
active tool.
Arguments
RelTool (Point Dx Dy Dz [\Rx] [\Ry] [\Rz])
Point
Data type: robtarget
The input robot position. The orientation part of this position defines the current orientation
of the tool coordinate system.
Dx
Data type: num
The displacement in mm in the x direction of the tool coordinate system.
Dy
Data type: num
The displacement in mm in the y direction of the tool coordinate system.
Dz
Data type: num
The displacement in mm in the z direction of the tool coordinate system.
[\Rx]
Data type: num
The rotation in degrees around the x axis of the tool coordinate system.
[\Ry]
Data type: num
The rotation in degrees around the y axis of the tool coordinate system.
Continues on next page
2 Functions
2.103. RelTool - Make a displacement relative to the tool
RobotWare - OS
3HAC 16581-1 Revision: J
962
© Copyright 2004-2010 ABB. All rights reserved.
[\Rz]
Data type: num
The rotation in degrees around the z axis of the tool coordinate system.
If two or three rotations are specified at the same time, these will be performed first around
the x-axis, then around the new y-axis, and then around the new z-axis.
Syntax
RelTool’(’
[ Point ’:=’ ] < expression ( IN ) of robtarget>’,’
[Dx ’:=’] <expression ( IN ) of num>’,’
[Dy ’:=’] <expression ( IN ) of num>’,’
[Dz ’:=’] <expression ( IN ) of num>
[’\’Rx ’:=’ <expression ( IN ) of num> ]
[’\’Ry ’:=’ <expression ( IN ) of num> ]
[’\’Rz ’:=’ <expression ( IN ) of num> ]’)’
A function with a return value of the data type robtarget .
Related information
For information about
See
Position data
robtarget - Position data on page 1176
Mathematical instructions and functions
Technical reference manual - RAPID
overview , section RAPID Summary -
Mathematics
Positioning instructions
Technical reference manual - RAPID
overview , section RAPID Summary - Motion
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 964
|
2 Functions
2.103. RelTool - Make a displacement relative to the tool
RobotWare - OS
961
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.103. RelTool - Make a displacement relative to the tool
Usage
RelTool ( Relative Tool ) is used to add a displacement and/or a rotation, expressed in the
active tool coordinate system, to a robot position.
Basic examples
Basic examples of the function RelTool are illustrated below.
Example 1
MoveL RelTool (p1, 0, 0, 100), v100, fine, tool1;
The robot is moved to a position that is 100 mm from p1 in the z direction of the tool.
Example 2
MoveL RelTool (p1, 0, 0, 0 \Rz:= 25), v100, fine, tool1;
The tool is rotated 25° around its z-axis.
Return value
Data type: robtarget
The new position with the addition of a displacement and/or a rotation, if any, relative to the
active tool.
Arguments
RelTool (Point Dx Dy Dz [\Rx] [\Ry] [\Rz])
Point
Data type: robtarget
The input robot position. The orientation part of this position defines the current orientation
of the tool coordinate system.
Dx
Data type: num
The displacement in mm in the x direction of the tool coordinate system.
Dy
Data type: num
The displacement in mm in the y direction of the tool coordinate system.
Dz
Data type: num
The displacement in mm in the z direction of the tool coordinate system.
[\Rx]
Data type: num
The rotation in degrees around the x axis of the tool coordinate system.
[\Ry]
Data type: num
The rotation in degrees around the y axis of the tool coordinate system.
Continues on next page
2 Functions
2.103. RelTool - Make a displacement relative to the tool
RobotWare - OS
3HAC 16581-1 Revision: J
962
© Copyright 2004-2010 ABB. All rights reserved.
[\Rz]
Data type: num
The rotation in degrees around the z axis of the tool coordinate system.
If two or three rotations are specified at the same time, these will be performed first around
the x-axis, then around the new y-axis, and then around the new z-axis.
Syntax
RelTool’(’
[ Point ’:=’ ] < expression ( IN ) of robtarget>’,’
[Dx ’:=’] <expression ( IN ) of num>’,’
[Dy ’:=’] <expression ( IN ) of num>’,’
[Dz ’:=’] <expression ( IN ) of num>
[’\’Rx ’:=’ <expression ( IN ) of num> ]
[’\’Ry ’:=’ <expression ( IN ) of num> ]
[’\’Rz ’:=’ <expression ( IN ) of num> ]’)’
A function with a return value of the data type robtarget .
Related information
For information about
See
Position data
robtarget - Position data on page 1176
Mathematical instructions and functions
Technical reference manual - RAPID
overview , section RAPID Summary -
Mathematics
Positioning instructions
Technical reference manual - RAPID
overview , section RAPID Summary - Motion
Continued
2 Functions
2.104. RemainingRetries - Remaining retries left to do
RobotWare - OS
963
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.104. RemainingRetries - Remaining retries left to do
Usage
RemainingRetries is used to find out how many RETRY that is left to do from the error
handler in the program. The maximum number of retries is defined in the configuration.
Basic examples
Basic examples of the function RemainingRetries are illustrated below.
Example 1
...
ERROR
IF RemainingRetries() > 0 THEN
RETRY;
ELSE
TRYNEXT;
ENDIF
...
This program will retry the instruction, in spite of the error, until the maximum number of
retries is done and then try the next instruction.
Return value
Data type: num
The return value shows how many of the maximum number of retries that is left to do.
Syntax
RemainingRetries‘(‘‘)‘
A function with a return value of the data type num .
Related information
For information about
See
Error handlers
Technical reference manual - RAPID overview , section
Basic Characteristics - Error Recovery
Resume execution after an error
RETRY - Resume execution after an error on page 364
Configure maximum number of
retries
Technical reference manual - System parameters ,
section System misc
Reset the number of retries
counted
ResetRetryCount - Reset the number of retries on page
361
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 965
|
2 Functions
2.103. RelTool - Make a displacement relative to the tool
RobotWare - OS
3HAC 16581-1 Revision: J
962
© Copyright 2004-2010 ABB. All rights reserved.
[\Rz]
Data type: num
The rotation in degrees around the z axis of the tool coordinate system.
If two or three rotations are specified at the same time, these will be performed first around
the x-axis, then around the new y-axis, and then around the new z-axis.
Syntax
RelTool’(’
[ Point ’:=’ ] < expression ( IN ) of robtarget>’,’
[Dx ’:=’] <expression ( IN ) of num>’,’
[Dy ’:=’] <expression ( IN ) of num>’,’
[Dz ’:=’] <expression ( IN ) of num>
[’\’Rx ’:=’ <expression ( IN ) of num> ]
[’\’Ry ’:=’ <expression ( IN ) of num> ]
[’\’Rz ’:=’ <expression ( IN ) of num> ]’)’
A function with a return value of the data type robtarget .
Related information
For information about
See
Position data
robtarget - Position data on page 1176
Mathematical instructions and functions
Technical reference manual - RAPID
overview , section RAPID Summary -
Mathematics
Positioning instructions
Technical reference manual - RAPID
overview , section RAPID Summary - Motion
Continued
2 Functions
2.104. RemainingRetries - Remaining retries left to do
RobotWare - OS
963
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.104. RemainingRetries - Remaining retries left to do
Usage
RemainingRetries is used to find out how many RETRY that is left to do from the error
handler in the program. The maximum number of retries is defined in the configuration.
Basic examples
Basic examples of the function RemainingRetries are illustrated below.
Example 1
...
ERROR
IF RemainingRetries() > 0 THEN
RETRY;
ELSE
TRYNEXT;
ENDIF
...
This program will retry the instruction, in spite of the error, until the maximum number of
retries is done and then try the next instruction.
Return value
Data type: num
The return value shows how many of the maximum number of retries that is left to do.
Syntax
RemainingRetries‘(‘‘)‘
A function with a return value of the data type num .
Related information
For information about
See
Error handlers
Technical reference manual - RAPID overview , section
Basic Characteristics - Error Recovery
Resume execution after an error
RETRY - Resume execution after an error on page 364
Configure maximum number of
retries
Technical reference manual - System parameters ,
section System misc
Reset the number of retries
counted
ResetRetryCount - Reset the number of retries on page
361
2 Functions
2.105. RMQGetSlotName - Get the name of an RMQ client
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
964
© Copyright 2004-2010 ABB. All rights reserved.
2.105. RMQGetSlotName - Get the name of an RMQ client
Usage
RMQGetSlotName ( RAPID Mesasage Queue Get Slot Name ) is used to get the slot name of
an RMQ or a Robot Application Builder client from a given slot identity - that is, from a given
rmqslot .
Basic examples
Basic example of the function RMQGetSlotName is illustrated below.
Example 1
VAR rmqslot slot;
VAR string client_name;
RMQFindSlot slot, "RMQ_T_ROB1";
...
client_name := RMQGetSlotName(slot);
TPWrite "Name of the client: " + client_name;
The example illustrates how to get the name of a client using the identity of the client.
Return value
Data type: string
The name of the client is returned. This can be an RMQ name, or the name of a Robot
Application Builder client using the RMQ functionality.
Arguments
RMQGetSlotName (Slot)
Slot
Data type: rmqslot
The identity slot number of the client to find the name.
Program execution
The instruction RMQGetSlotName is used to find the name of the client with the specified
identity number specified in argument Slot . The client can be another RMQ, or a Robot
Application Builder client.
Error handling
Following recoverable errors can be generated. The errors can be handled in an ERROR
handler. The system variable ERRNO will be set to:
ERR_RMQ_INVALID
The destination slot has not been connected or the destination
slot is no longer available. If not connected, a call to
RMQFindSlot must be done. If not available, the reason is that
a remote client has been disconnected from the controller.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 966
|
2 Functions
2.104. RemainingRetries - Remaining retries left to do
RobotWare - OS
963
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.104. RemainingRetries - Remaining retries left to do
Usage
RemainingRetries is used to find out how many RETRY that is left to do from the error
handler in the program. The maximum number of retries is defined in the configuration.
Basic examples
Basic examples of the function RemainingRetries are illustrated below.
Example 1
...
ERROR
IF RemainingRetries() > 0 THEN
RETRY;
ELSE
TRYNEXT;
ENDIF
...
This program will retry the instruction, in spite of the error, until the maximum number of
retries is done and then try the next instruction.
Return value
Data type: num
The return value shows how many of the maximum number of retries that is left to do.
Syntax
RemainingRetries‘(‘‘)‘
A function with a return value of the data type num .
Related information
For information about
See
Error handlers
Technical reference manual - RAPID overview , section
Basic Characteristics - Error Recovery
Resume execution after an error
RETRY - Resume execution after an error on page 364
Configure maximum number of
retries
Technical reference manual - System parameters ,
section System misc
Reset the number of retries
counted
ResetRetryCount - Reset the number of retries on page
361
2 Functions
2.105. RMQGetSlotName - Get the name of an RMQ client
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
964
© Copyright 2004-2010 ABB. All rights reserved.
2.105. RMQGetSlotName - Get the name of an RMQ client
Usage
RMQGetSlotName ( RAPID Mesasage Queue Get Slot Name ) is used to get the slot name of
an RMQ or a Robot Application Builder client from a given slot identity - that is, from a given
rmqslot .
Basic examples
Basic example of the function RMQGetSlotName is illustrated below.
Example 1
VAR rmqslot slot;
VAR string client_name;
RMQFindSlot slot, "RMQ_T_ROB1";
...
client_name := RMQGetSlotName(slot);
TPWrite "Name of the client: " + client_name;
The example illustrates how to get the name of a client using the identity of the client.
Return value
Data type: string
The name of the client is returned. This can be an RMQ name, or the name of a Robot
Application Builder client using the RMQ functionality.
Arguments
RMQGetSlotName (Slot)
Slot
Data type: rmqslot
The identity slot number of the client to find the name.
Program execution
The instruction RMQGetSlotName is used to find the name of the client with the specified
identity number specified in argument Slot . The client can be another RMQ, or a Robot
Application Builder client.
Error handling
Following recoverable errors can be generated. The errors can be handled in an ERROR
handler. The system variable ERRNO will be set to:
ERR_RMQ_INVALID
The destination slot has not been connected or the destination
slot is no longer available. If not connected, a call to
RMQFindSlot must be done. If not available, the reason is that
a remote client has been disconnected from the controller.
Continues on next page
2 Functions
2.105. RMQGetSlotName - Get the name of an RMQ client
FlexPendant Interface, PC Interface, or Multitasking
965
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
RMQGetSlotName‘(‘
[ Slot ‘:=’ ] < variable ( VAR ) of rmqslot >‘)‘
A function with a return value of the data type string .
Related information
For information about
See
Description of the RAPID Message Queue
functionality
Application manual - Robot communication
and I/O control , section RAPID Message
Queue .
Find the identity number of a RAPID
Message Queue task or Robot Application
Builder client
RMQFindSlot - Find a slot identity from the
slot name on page 371
Send data to the queue of a RAPID task or
Robot Application Builder client
RMQSendMessage - Send an RMQ data
message on page 386
Get the first message from a RAPID Message
Queue.
RMQGetMessage - Get an RMQ message on
page 373
Send data to the queue of a RAPID task or
Robot Application Builder client, and wait for
an answer from the client
RMQSendWait - Send an RMQ data
message and wait for a response on page
390
Extract the header data from an
rmqmessage
RMQGetMsgHeader - Get header
information from an RMQ message on page
380
Extract the data from an rmqmessage
RMQGetMsgData - Get the data part from an
RMQ message on page 377
Order and enable interrupts for a specific data
type
IRMQMessage - Orders RMQ interrupts for a
data type on page 167
RMQ Slot
rmqslot - Identity number of an RMQ client on
page 1174
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 967
|
2 Functions
2.105. RMQGetSlotName - Get the name of an RMQ client
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
964
© Copyright 2004-2010 ABB. All rights reserved.
2.105. RMQGetSlotName - Get the name of an RMQ client
Usage
RMQGetSlotName ( RAPID Mesasage Queue Get Slot Name ) is used to get the slot name of
an RMQ or a Robot Application Builder client from a given slot identity - that is, from a given
rmqslot .
Basic examples
Basic example of the function RMQGetSlotName is illustrated below.
Example 1
VAR rmqslot slot;
VAR string client_name;
RMQFindSlot slot, "RMQ_T_ROB1";
...
client_name := RMQGetSlotName(slot);
TPWrite "Name of the client: " + client_name;
The example illustrates how to get the name of a client using the identity of the client.
Return value
Data type: string
The name of the client is returned. This can be an RMQ name, or the name of a Robot
Application Builder client using the RMQ functionality.
Arguments
RMQGetSlotName (Slot)
Slot
Data type: rmqslot
The identity slot number of the client to find the name.
Program execution
The instruction RMQGetSlotName is used to find the name of the client with the specified
identity number specified in argument Slot . The client can be another RMQ, or a Robot
Application Builder client.
Error handling
Following recoverable errors can be generated. The errors can be handled in an ERROR
handler. The system variable ERRNO will be set to:
ERR_RMQ_INVALID
The destination slot has not been connected or the destination
slot is no longer available. If not connected, a call to
RMQFindSlot must be done. If not available, the reason is that
a remote client has been disconnected from the controller.
Continues on next page
2 Functions
2.105. RMQGetSlotName - Get the name of an RMQ client
FlexPendant Interface, PC Interface, or Multitasking
965
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
RMQGetSlotName‘(‘
[ Slot ‘:=’ ] < variable ( VAR ) of rmqslot >‘)‘
A function with a return value of the data type string .
Related information
For information about
See
Description of the RAPID Message Queue
functionality
Application manual - Robot communication
and I/O control , section RAPID Message
Queue .
Find the identity number of a RAPID
Message Queue task or Robot Application
Builder client
RMQFindSlot - Find a slot identity from the
slot name on page 371
Send data to the queue of a RAPID task or
Robot Application Builder client
RMQSendMessage - Send an RMQ data
message on page 386
Get the first message from a RAPID Message
Queue.
RMQGetMessage - Get an RMQ message on
page 373
Send data to the queue of a RAPID task or
Robot Application Builder client, and wait for
an answer from the client
RMQSendWait - Send an RMQ data
message and wait for a response on page
390
Extract the header data from an
rmqmessage
RMQGetMsgHeader - Get header
information from an RMQ message on page
380
Extract the data from an rmqmessage
RMQGetMsgData - Get the data part from an
RMQ message on page 377
Order and enable interrupts for a specific data
type
IRMQMessage - Orders RMQ interrupts for a
data type on page 167
RMQ Slot
rmqslot - Identity number of an RMQ client on
page 1174
Continued
2 Functions
2.106. RobName - Get the TCP robot name
RobotWare - OS
3HAC 16581-1 Revision: J
966
© Copyright 2004-2010 ABB. All rights reserved.
2.106. RobName - Get the TCP robot name
Usage
RobName ( Robot Name ) is used to get the name of the TCP robot in some program task. If the
task doesn’t control any TCP robot, this function returns an empty string.
Basic examples
Basic examples of the function RobName are illustrated below.
See also More examples on page 966 .
Example 1
VAR string my_robot;
...
my_robot := RobName();
IF my_robot="" THEN
TPWrite "This task does not control any TCP robot";
ELSE
TPWrite "This task controls TCP robot with name "+ my_robot;
ENDIF
Write to FlexPendant the name of the TCP robot which is controlled from this program task.
If no TCP robot is controlled, write that the task controls no robot.
Return value
Data type: string
The mechanical unit name for the TCP robot that is controlled from this program task. Return
empty string if no TCP robot is controlled.
More examples
More examples of how to use the instruction RobName are illustrated below.
Example 1
VAR string my_robot;
...
IF TaskRunRob() THEN
my_robot := RobName();
TPWrite "This task controls robot with name "+ my_robot;
ENDIF
If this program task controls any TCP robot, write to FlexPendant the name of that TCP robot.
Syntax
RobName ’(’’)’
A function with a return value of the data type string .
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 968
|
2 Functions
2.105. RMQGetSlotName - Get the name of an RMQ client
FlexPendant Interface, PC Interface, or Multitasking
965
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
RMQGetSlotName‘(‘
[ Slot ‘:=’ ] < variable ( VAR ) of rmqslot >‘)‘
A function with a return value of the data type string .
Related information
For information about
See
Description of the RAPID Message Queue
functionality
Application manual - Robot communication
and I/O control , section RAPID Message
Queue .
Find the identity number of a RAPID
Message Queue task or Robot Application
Builder client
RMQFindSlot - Find a slot identity from the
slot name on page 371
Send data to the queue of a RAPID task or
Robot Application Builder client
RMQSendMessage - Send an RMQ data
message on page 386
Get the first message from a RAPID Message
Queue.
RMQGetMessage - Get an RMQ message on
page 373
Send data to the queue of a RAPID task or
Robot Application Builder client, and wait for
an answer from the client
RMQSendWait - Send an RMQ data
message and wait for a response on page
390
Extract the header data from an
rmqmessage
RMQGetMsgHeader - Get header
information from an RMQ message on page
380
Extract the data from an rmqmessage
RMQGetMsgData - Get the data part from an
RMQ message on page 377
Order and enable interrupts for a specific data
type
IRMQMessage - Orders RMQ interrupts for a
data type on page 167
RMQ Slot
rmqslot - Identity number of an RMQ client on
page 1174
Continued
2 Functions
2.106. RobName - Get the TCP robot name
RobotWare - OS
3HAC 16581-1 Revision: J
966
© Copyright 2004-2010 ABB. All rights reserved.
2.106. RobName - Get the TCP robot name
Usage
RobName ( Robot Name ) is used to get the name of the TCP robot in some program task. If the
task doesn’t control any TCP robot, this function returns an empty string.
Basic examples
Basic examples of the function RobName are illustrated below.
See also More examples on page 966 .
Example 1
VAR string my_robot;
...
my_robot := RobName();
IF my_robot="" THEN
TPWrite "This task does not control any TCP robot";
ELSE
TPWrite "This task controls TCP robot with name "+ my_robot;
ENDIF
Write to FlexPendant the name of the TCP robot which is controlled from this program task.
If no TCP robot is controlled, write that the task controls no robot.
Return value
Data type: string
The mechanical unit name for the TCP robot that is controlled from this program task. Return
empty string if no TCP robot is controlled.
More examples
More examples of how to use the instruction RobName are illustrated below.
Example 1
VAR string my_robot;
...
IF TaskRunRob() THEN
my_robot := RobName();
TPWrite "This task controls robot with name "+ my_robot;
ENDIF
If this program task controls any TCP robot, write to FlexPendant the name of that TCP robot.
Syntax
RobName ’(’’)’
A function with a return value of the data type string .
Continues on next page
2 Functions
2.106. RobName - Get the TCP robot name
RobotWare - OS
967
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Check if task run some TCP robot
TaskRunRob - Check if task controls some robot
on page 1014
Check if task run some mechanical unit
TaskRunMec - Check if task controls any
mechanical unit on page 1013
Get the name of mechanical units in the
system
GetNextMechUnit - Get name and data for
mechanical units on page 852
String functions
Technical reference manual - RAPID Instructions,
Functions and Data types , section RAPID
summary - String functions
Definition of string
string - Strings on page 1195
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 969
|
2 Functions
2.106. RobName - Get the TCP robot name
RobotWare - OS
3HAC 16581-1 Revision: J
966
© Copyright 2004-2010 ABB. All rights reserved.
2.106. RobName - Get the TCP robot name
Usage
RobName ( Robot Name ) is used to get the name of the TCP robot in some program task. If the
task doesn’t control any TCP robot, this function returns an empty string.
Basic examples
Basic examples of the function RobName are illustrated below.
See also More examples on page 966 .
Example 1
VAR string my_robot;
...
my_robot := RobName();
IF my_robot="" THEN
TPWrite "This task does not control any TCP robot";
ELSE
TPWrite "This task controls TCP robot with name "+ my_robot;
ENDIF
Write to FlexPendant the name of the TCP robot which is controlled from this program task.
If no TCP robot is controlled, write that the task controls no robot.
Return value
Data type: string
The mechanical unit name for the TCP robot that is controlled from this program task. Return
empty string if no TCP robot is controlled.
More examples
More examples of how to use the instruction RobName are illustrated below.
Example 1
VAR string my_robot;
...
IF TaskRunRob() THEN
my_robot := RobName();
TPWrite "This task controls robot with name "+ my_robot;
ENDIF
If this program task controls any TCP robot, write to FlexPendant the name of that TCP robot.
Syntax
RobName ’(’’)’
A function with a return value of the data type string .
Continues on next page
2 Functions
2.106. RobName - Get the TCP robot name
RobotWare - OS
967
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Check if task run some TCP robot
TaskRunRob - Check if task controls some robot
on page 1014
Check if task run some mechanical unit
TaskRunMec - Check if task controls any
mechanical unit on page 1013
Get the name of mechanical units in the
system
GetNextMechUnit - Get name and data for
mechanical units on page 852
String functions
Technical reference manual - RAPID Instructions,
Functions and Data types , section RAPID
summary - String functions
Definition of string
string - Strings on page 1195
Continued
2 Functions
2.107. RobOS - Check if execution is on RC or VC
RobotWare - OS
3HAC 16581-1 Revision: J
968
© Copyright 2004-2010 ABB. All rights reserved.
2.107. RobOS - Check if execution is on RC or VC
Usage
RobOS ( Robot Operating System ) can be used to check if the execution is performed on Robot
Controller RC or Virtual Controller VC.
Basic examples
Basic examples of the function RobOS are illustrated below.
Example 1
IF RobOS() THEN
! Execution statements in RC
ELSE
! Execution statements in VC
ENDIF
Return value
Data type: bool
TRUE if execution runs on Robot Controller RC, FALSE otherwise.
Syntax
RobOS ’(’’)’
A function with a return value of the data type bool .
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 970
|
2 Functions
2.106. RobName - Get the TCP robot name
RobotWare - OS
967
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Check if task run some TCP robot
TaskRunRob - Check if task controls some robot
on page 1014
Check if task run some mechanical unit
TaskRunMec - Check if task controls any
mechanical unit on page 1013
Get the name of mechanical units in the
system
GetNextMechUnit - Get name and data for
mechanical units on page 852
String functions
Technical reference manual - RAPID Instructions,
Functions and Data types , section RAPID
summary - String functions
Definition of string
string - Strings on page 1195
Continued
2 Functions
2.107. RobOS - Check if execution is on RC or VC
RobotWare - OS
3HAC 16581-1 Revision: J
968
© Copyright 2004-2010 ABB. All rights reserved.
2.107. RobOS - Check if execution is on RC or VC
Usage
RobOS ( Robot Operating System ) can be used to check if the execution is performed on Robot
Controller RC or Virtual Controller VC.
Basic examples
Basic examples of the function RobOS are illustrated below.
Example 1
IF RobOS() THEN
! Execution statements in RC
ELSE
! Execution statements in VC
ENDIF
Return value
Data type: bool
TRUE if execution runs on Robot Controller RC, FALSE otherwise.
Syntax
RobOS ’(’’)’
A function with a return value of the data type bool .
2 Functions
2.108. Round - Round is a numeric value
RobotWare - OS
969
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.108. Round - Round is a numeric value
Usage
Round is used to round a numeric value to a specified number of decimals or to an integer
value.
Basic examples
Basic examples of the function Round are illustrated below.
Example 1
VAR num val;
val := Round(0.38521\Dec:=3);
The variable val is given the value 0.385.
Example 2
val := Round(0.38521\Dec:=1);
The variable val is given the value 0.4.
Example 3
val := Round(0.38521);
The variable val is given the value 0.
Return value
Data type: num
The numeric value rounded to the specified number of decimals.
Arguments
Round ( Val [\Dec])
Val
Value
Data type: num
The numeric value to be rounded.
[\Dec]
Decimals
Data type: num
Number of decimals.
If the specified number of decimals is 0 or if the argument is omitted, the value is rounded to
an integer.
The number of decimals must not be negative or greater than the available precision for
numeric values.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 971
|
2 Functions
2.107. RobOS - Check if execution is on RC or VC
RobotWare - OS
3HAC 16581-1 Revision: J
968
© Copyright 2004-2010 ABB. All rights reserved.
2.107. RobOS - Check if execution is on RC or VC
Usage
RobOS ( Robot Operating System ) can be used to check if the execution is performed on Robot
Controller RC or Virtual Controller VC.
Basic examples
Basic examples of the function RobOS are illustrated below.
Example 1
IF RobOS() THEN
! Execution statements in RC
ELSE
! Execution statements in VC
ENDIF
Return value
Data type: bool
TRUE if execution runs on Robot Controller RC, FALSE otherwise.
Syntax
RobOS ’(’’)’
A function with a return value of the data type bool .
2 Functions
2.108. Round - Round is a numeric value
RobotWare - OS
969
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.108. Round - Round is a numeric value
Usage
Round is used to round a numeric value to a specified number of decimals or to an integer
value.
Basic examples
Basic examples of the function Round are illustrated below.
Example 1
VAR num val;
val := Round(0.38521\Dec:=3);
The variable val is given the value 0.385.
Example 2
val := Round(0.38521\Dec:=1);
The variable val is given the value 0.4.
Example 3
val := Round(0.38521);
The variable val is given the value 0.
Return value
Data type: num
The numeric value rounded to the specified number of decimals.
Arguments
Round ( Val [\Dec])
Val
Value
Data type: num
The numeric value to be rounded.
[\Dec]
Decimals
Data type: num
Number of decimals.
If the specified number of decimals is 0 or if the argument is omitted, the value is rounded to
an integer.
The number of decimals must not be negative or greater than the available precision for
numeric values.
Continues on next page
2 Functions
2.108. Round - Round is a numeric value
RobotWare - OS
3HAC 16581-1 Revision: J
970
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
Round’(’
[ Val ’:=’ ] <expression ( IN ) of num>
[ \Dec ’:=’ <expression ( IN ) of num> ]
’)’
A function with a return value of the data type num .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID overview ,
section RAPID summary - Mathematics
Truncating a value
Trunc - Truncates a numeric value on page 1028
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 972
|
2 Functions
2.108. Round - Round is a numeric value
RobotWare - OS
969
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.108. Round - Round is a numeric value
Usage
Round is used to round a numeric value to a specified number of decimals or to an integer
value.
Basic examples
Basic examples of the function Round are illustrated below.
Example 1
VAR num val;
val := Round(0.38521\Dec:=3);
The variable val is given the value 0.385.
Example 2
val := Round(0.38521\Dec:=1);
The variable val is given the value 0.4.
Example 3
val := Round(0.38521);
The variable val is given the value 0.
Return value
Data type: num
The numeric value rounded to the specified number of decimals.
Arguments
Round ( Val [\Dec])
Val
Value
Data type: num
The numeric value to be rounded.
[\Dec]
Decimals
Data type: num
Number of decimals.
If the specified number of decimals is 0 or if the argument is omitted, the value is rounded to
an integer.
The number of decimals must not be negative or greater than the available precision for
numeric values.
Continues on next page
2 Functions
2.108. Round - Round is a numeric value
RobotWare - OS
3HAC 16581-1 Revision: J
970
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
Round’(’
[ Val ’:=’ ] <expression ( IN ) of num>
[ \Dec ’:=’ <expression ( IN ) of num> ]
’)’
A function with a return value of the data type num .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID overview ,
section RAPID summary - Mathematics
Truncating a value
Trunc - Truncates a numeric value on page 1028
Continued
2 Functions
2.109. RunMode - Read the running mode
RobotWare - OS
971
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.109. RunMode - Read the running mode
Usage
RunMode ( Running Mode ) is used to read the current running mode of the program task.
Basic examples
Basic examples of the function RunMode are illustrated below.
Example 1
IF RunMode() = RUN_CONT_CYCLE THEN
...
ENDIF
The program section is executed only for continuous or cycle running.
Return value
Data type: symnum
The current running mode is defined as described in the table below.
Arguments
RunMode ( [ \Main] )
[ \Main ]
Data type: switch
Return current mode for the task if it is a motion task. If used in a non-motion task, it will
return the current mode of the motion task that the non-motion task is connected to.
If this argument is omitted, the return value always mirrors the current running mode for the
program task which executes the function RunMode .
Syntax
RunMode ’(’ [’\’Main] ’)’
A function with a return value of the data type symnum .
Related information
Return value
Symbolic constant
Comment
0
RUN_UNDEF
Undefined running mode
1
RUN_CONT_CYCLE
Continuous or cycle running mode
2
RUN_INSTR_FWD
Instruction forward running mode
3
RUN_INSTR_BWD
Instruction backward running mode
4
RUN_SIM
Simulated running mode. Not yet released.
5
RUN_STEP_MOVE
Move instructions in forward running mode and
logical instructions in continuous running mode
For information about
See
Reading operating mode
OpMode - Read the operating mode on page 908
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 973
|
2 Functions
2.108. Round - Round is a numeric value
RobotWare - OS
3HAC 16581-1 Revision: J
970
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
Round’(’
[ Val ’:=’ ] <expression ( IN ) of num>
[ \Dec ’:=’ <expression ( IN ) of num> ]
’)’
A function with a return value of the data type num .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID overview ,
section RAPID summary - Mathematics
Truncating a value
Trunc - Truncates a numeric value on page 1028
Continued
2 Functions
2.109. RunMode - Read the running mode
RobotWare - OS
971
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.109. RunMode - Read the running mode
Usage
RunMode ( Running Mode ) is used to read the current running mode of the program task.
Basic examples
Basic examples of the function RunMode are illustrated below.
Example 1
IF RunMode() = RUN_CONT_CYCLE THEN
...
ENDIF
The program section is executed only for continuous or cycle running.
Return value
Data type: symnum
The current running mode is defined as described in the table below.
Arguments
RunMode ( [ \Main] )
[ \Main ]
Data type: switch
Return current mode for the task if it is a motion task. If used in a non-motion task, it will
return the current mode of the motion task that the non-motion task is connected to.
If this argument is omitted, the return value always mirrors the current running mode for the
program task which executes the function RunMode .
Syntax
RunMode ’(’ [’\’Main] ’)’
A function with a return value of the data type symnum .
Related information
Return value
Symbolic constant
Comment
0
RUN_UNDEF
Undefined running mode
1
RUN_CONT_CYCLE
Continuous or cycle running mode
2
RUN_INSTR_FWD
Instruction forward running mode
3
RUN_INSTR_BWD
Instruction backward running mode
4
RUN_SIM
Simulated running mode. Not yet released.
5
RUN_STEP_MOVE
Move instructions in forward running mode and
logical instructions in continuous running mode
For information about
See
Reading operating mode
OpMode - Read the operating mode on page 908
2 Functions
2.110. Sin - Calculates the sine value
RobotWare - OS
3HAC 16581-1 Revision: J
972
© Copyright 2004-2010 ABB. All rights reserved.
2.110. Sin - Calculates the sine value
Usage
Sin ( Sine ) is used to calculate the sine value from an angle value.
Basic examples
Basic examples of the function Sin are illustrated below.
Example 1
VAR num angle;
VAR num value;
...
...
value := Sin(angle);
value will get the sine value of angle .
Return value
Data type: num
The sine value, range [-1, 1] .
Arguments
Sin (Angle)
Angle
Data type: num
The angle value, expressed in degrees.
Syntax
Sin’(’
[Angle’:=’] <expression ( IN ) of num>
’)’
A function with a return value of the data type num .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID
overview , section RAPID Summary -
Mathematics
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 974
|
2 Functions
2.109. RunMode - Read the running mode
RobotWare - OS
971
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.109. RunMode - Read the running mode
Usage
RunMode ( Running Mode ) is used to read the current running mode of the program task.
Basic examples
Basic examples of the function RunMode are illustrated below.
Example 1
IF RunMode() = RUN_CONT_CYCLE THEN
...
ENDIF
The program section is executed only for continuous or cycle running.
Return value
Data type: symnum
The current running mode is defined as described in the table below.
Arguments
RunMode ( [ \Main] )
[ \Main ]
Data type: switch
Return current mode for the task if it is a motion task. If used in a non-motion task, it will
return the current mode of the motion task that the non-motion task is connected to.
If this argument is omitted, the return value always mirrors the current running mode for the
program task which executes the function RunMode .
Syntax
RunMode ’(’ [’\’Main] ’)’
A function with a return value of the data type symnum .
Related information
Return value
Symbolic constant
Comment
0
RUN_UNDEF
Undefined running mode
1
RUN_CONT_CYCLE
Continuous or cycle running mode
2
RUN_INSTR_FWD
Instruction forward running mode
3
RUN_INSTR_BWD
Instruction backward running mode
4
RUN_SIM
Simulated running mode. Not yet released.
5
RUN_STEP_MOVE
Move instructions in forward running mode and
logical instructions in continuous running mode
For information about
See
Reading operating mode
OpMode - Read the operating mode on page 908
2 Functions
2.110. Sin - Calculates the sine value
RobotWare - OS
3HAC 16581-1 Revision: J
972
© Copyright 2004-2010 ABB. All rights reserved.
2.110. Sin - Calculates the sine value
Usage
Sin ( Sine ) is used to calculate the sine value from an angle value.
Basic examples
Basic examples of the function Sin are illustrated below.
Example 1
VAR num angle;
VAR num value;
...
...
value := Sin(angle);
value will get the sine value of angle .
Return value
Data type: num
The sine value, range [-1, 1] .
Arguments
Sin (Angle)
Angle
Data type: num
The angle value, expressed in degrees.
Syntax
Sin’(’
[Angle’:=’] <expression ( IN ) of num>
’)’
A function with a return value of the data type num .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID
overview , section RAPID Summary -
Mathematics
2 Functions
2.111. SocketGetStatus - Get current socket state
Socket Messaging
973
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.111. SocketGetStatus - Get current socket state
Usage
SocketGetStatus returns the current state of a socket.
Basic examples
Basic examples of the function SocketGetStatus are illustrated below.
See also More examples on page 974 .
Example 1
VAR socketdev socket1;
VAR socketstatus state;
...
SocketCreate socket1;
state := SocketGetStatus( socket1 );
The socket status SOCKET_CREATED will be stored in the variable state .
Return value
Data type: socketstatus
The current state of the socket.
Only the predefined symbolic constants of type socketstatus can be used to check the
state.
Arguments
SocketGetStatus( Socket )
Socket
Data type: socketdev
The socket variable which state is of interest.
Program execution
The function returns one of the following predefined states of socketstatus:
SOCKET_CREATED , SOCKET_CONNECTED , SOCKET_BOUND , SOCKET_LISTENING or
SOCKET_CLOSED .
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 975
|
2 Functions
2.110. Sin - Calculates the sine value
RobotWare - OS
3HAC 16581-1 Revision: J
972
© Copyright 2004-2010 ABB. All rights reserved.
2.110. Sin - Calculates the sine value
Usage
Sin ( Sine ) is used to calculate the sine value from an angle value.
Basic examples
Basic examples of the function Sin are illustrated below.
Example 1
VAR num angle;
VAR num value;
...
...
value := Sin(angle);
value will get the sine value of angle .
Return value
Data type: num
The sine value, range [-1, 1] .
Arguments
Sin (Angle)
Angle
Data type: num
The angle value, expressed in degrees.
Syntax
Sin’(’
[Angle’:=’] <expression ( IN ) of num>
’)’
A function with a return value of the data type num .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID
overview , section RAPID Summary -
Mathematics
2 Functions
2.111. SocketGetStatus - Get current socket state
Socket Messaging
973
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.111. SocketGetStatus - Get current socket state
Usage
SocketGetStatus returns the current state of a socket.
Basic examples
Basic examples of the function SocketGetStatus are illustrated below.
See also More examples on page 974 .
Example 1
VAR socketdev socket1;
VAR socketstatus state;
...
SocketCreate socket1;
state := SocketGetStatus( socket1 );
The socket status SOCKET_CREATED will be stored in the variable state .
Return value
Data type: socketstatus
The current state of the socket.
Only the predefined symbolic constants of type socketstatus can be used to check the
state.
Arguments
SocketGetStatus( Socket )
Socket
Data type: socketdev
The socket variable which state is of interest.
Program execution
The function returns one of the following predefined states of socketstatus:
SOCKET_CREATED , SOCKET_CONNECTED , SOCKET_BOUND , SOCKET_LISTENING or
SOCKET_CLOSED .
Continues on next page
2 Functions
2.111. SocketGetStatus - Get current socket state
Socket Messaging
3HAC 16581-1 Revision: J
974
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of the function SocketGetStatus are illustrated below.
VAR socketstatus status;
VAR socketdev my_socket;
...
SocketCreate my_socket;
SocketConnect my_socket, "192.168.0.1", 1025;
! A lot of RAPID code
status := SocketGetStatus( my_socket );
!Check which instruction that was executed last, not the state of
!the socket
IF status = SOCKET_CREATED THEN
TPWrite "Instruction SocketCreate has been executed";
ELSEIF status = SOCKET_CLOSED THEN
TPWrite "Instruction SocketClose has been executed";
ELSEIF status = SOCKET_BOUND THEN
TPWrite "Instruction SocketBind has been executed";
ELSEIF status = SOCKET_LISTENING THEN
TPWrite "Instruction SocketListen or SocketAccept has been
executed";
ELSEIF status = SOCKET_CONNECTED THEN
TPWrite "Instruction SocketConnect, SocketReceive or SocketSend
has been executed";
ELSE
TPWrite "Unknown socket status";
ENDIF
A client socket is created and connected to a remote computer. Before the socket is used in a
SocketSend instruction the state of the socket is checked so that it is still connected.
Limitations
The state of a socket can only be changed by executing RAPID socket instruction. E.g. if the
socket is connected and later the connection is broken, this will not be reported by the
SocketGetStatus function. Instead there will be an error returned when the socket is used
in a SocketSend or SocketReceive instruction.
Syntax
SocketGetStatus ’(’
[ Socket ´:=´ ] < variable ( VAR ) of socketdev > ’)’
A function with a return value of the data type socketstatus .
Continued
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 976
|
2 Functions
2.111. SocketGetStatus - Get current socket state
Socket Messaging
973
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.111. SocketGetStatus - Get current socket state
Usage
SocketGetStatus returns the current state of a socket.
Basic examples
Basic examples of the function SocketGetStatus are illustrated below.
See also More examples on page 974 .
Example 1
VAR socketdev socket1;
VAR socketstatus state;
...
SocketCreate socket1;
state := SocketGetStatus( socket1 );
The socket status SOCKET_CREATED will be stored in the variable state .
Return value
Data type: socketstatus
The current state of the socket.
Only the predefined symbolic constants of type socketstatus can be used to check the
state.
Arguments
SocketGetStatus( Socket )
Socket
Data type: socketdev
The socket variable which state is of interest.
Program execution
The function returns one of the following predefined states of socketstatus:
SOCKET_CREATED , SOCKET_CONNECTED , SOCKET_BOUND , SOCKET_LISTENING or
SOCKET_CLOSED .
Continues on next page
2 Functions
2.111. SocketGetStatus - Get current socket state
Socket Messaging
3HAC 16581-1 Revision: J
974
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of the function SocketGetStatus are illustrated below.
VAR socketstatus status;
VAR socketdev my_socket;
...
SocketCreate my_socket;
SocketConnect my_socket, "192.168.0.1", 1025;
! A lot of RAPID code
status := SocketGetStatus( my_socket );
!Check which instruction that was executed last, not the state of
!the socket
IF status = SOCKET_CREATED THEN
TPWrite "Instruction SocketCreate has been executed";
ELSEIF status = SOCKET_CLOSED THEN
TPWrite "Instruction SocketClose has been executed";
ELSEIF status = SOCKET_BOUND THEN
TPWrite "Instruction SocketBind has been executed";
ELSEIF status = SOCKET_LISTENING THEN
TPWrite "Instruction SocketListen or SocketAccept has been
executed";
ELSEIF status = SOCKET_CONNECTED THEN
TPWrite "Instruction SocketConnect, SocketReceive or SocketSend
has been executed";
ELSE
TPWrite "Unknown socket status";
ENDIF
A client socket is created and connected to a remote computer. Before the socket is used in a
SocketSend instruction the state of the socket is checked so that it is still connected.
Limitations
The state of a socket can only be changed by executing RAPID socket instruction. E.g. if the
socket is connected and later the connection is broken, this will not be reported by the
SocketGetStatus function. Instead there will be an error returned when the socket is used
in a SocketSend or SocketReceive instruction.
Syntax
SocketGetStatus ’(’
[ Socket ´:=´ ] < variable ( VAR ) of socketdev > ’)’
A function with a return value of the data type socketstatus .
Continued
Continues on next page
2 Functions
2.111. SocketGetStatus - Get current socket state
Socket Messaging
975
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Socket communication in general
Application manual - Robot communication and
I/O control
Create a new socket
SocketCreate - Create a new socket on page
460
Connect to remote computer (only client)
SocketConnect - Connect to a remote computer
on page 457
Send data to remote computer
SocketSend - Send data to remote computer on
page 469
Receive data from remote computer
SocketReceive - Receive data from remote
computer on page 464
Close the socket
SocketClose - Close a socket on page 455
Bind a socket (only server)
SocketBind - Bind a socket to my IP-address
and port on page 453
Listening connections (only server)
SocketListen - Listen for incoming connections
on page 462
Accept connections (only server)
SocketAccept - Accept an incoming connection
on page 450
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 977
|
2 Functions
2.111. SocketGetStatus - Get current socket state
Socket Messaging
3HAC 16581-1 Revision: J
974
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of the function SocketGetStatus are illustrated below.
VAR socketstatus status;
VAR socketdev my_socket;
...
SocketCreate my_socket;
SocketConnect my_socket, "192.168.0.1", 1025;
! A lot of RAPID code
status := SocketGetStatus( my_socket );
!Check which instruction that was executed last, not the state of
!the socket
IF status = SOCKET_CREATED THEN
TPWrite "Instruction SocketCreate has been executed";
ELSEIF status = SOCKET_CLOSED THEN
TPWrite "Instruction SocketClose has been executed";
ELSEIF status = SOCKET_BOUND THEN
TPWrite "Instruction SocketBind has been executed";
ELSEIF status = SOCKET_LISTENING THEN
TPWrite "Instruction SocketListen or SocketAccept has been
executed";
ELSEIF status = SOCKET_CONNECTED THEN
TPWrite "Instruction SocketConnect, SocketReceive or SocketSend
has been executed";
ELSE
TPWrite "Unknown socket status";
ENDIF
A client socket is created and connected to a remote computer. Before the socket is used in a
SocketSend instruction the state of the socket is checked so that it is still connected.
Limitations
The state of a socket can only be changed by executing RAPID socket instruction. E.g. if the
socket is connected and later the connection is broken, this will not be reported by the
SocketGetStatus function. Instead there will be an error returned when the socket is used
in a SocketSend or SocketReceive instruction.
Syntax
SocketGetStatus ’(’
[ Socket ´:=´ ] < variable ( VAR ) of socketdev > ’)’
A function with a return value of the data type socketstatus .
Continued
Continues on next page
2 Functions
2.111. SocketGetStatus - Get current socket state
Socket Messaging
975
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Socket communication in general
Application manual - Robot communication and
I/O control
Create a new socket
SocketCreate - Create a new socket on page
460
Connect to remote computer (only client)
SocketConnect - Connect to a remote computer
on page 457
Send data to remote computer
SocketSend - Send data to remote computer on
page 469
Receive data from remote computer
SocketReceive - Receive data from remote
computer on page 464
Close the socket
SocketClose - Close a socket on page 455
Bind a socket (only server)
SocketBind - Bind a socket to my IP-address
and port on page 453
Listening connections (only server)
SocketListen - Listen for incoming connections
on page 462
Accept connections (only server)
SocketAccept - Accept an incoming connection
on page 450
Continued
2 Functions
2.112. Sqrt - Calculates the square root value
RobotWare - OS
3HAC 16581-1 Revision: J
976
© Copyright 2004-2010 ABB. All rights reserved.
2.112. Sqrt - Calculates the square root value
Usage
Sqrt ( Square root ) is used to calculate the square root value.
Basic examples
Basic examples of the function Sqrt are illustrated below.
Example 1
VAR num x_value;
VAR num y_value;
...
...
y_value := Sqrt( x_value);
y-value will get the square root value of x_value , i.e. √ ( x_value ).
Return value
Data type: num
The square root value ( √ ).
Arguments
Sqrt (Value)
Value
Data type: num
The argument value for square root, i.e. √ value .
Value needs to be ≥ 0.
Limitations
The execution of the function Sqrt(x) will give an error if x < 0.
Syntax
Sqrt’(’
[Value’:=’] <expression ( IN ) of num>
’)’
A function with a return value of the data type num .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID overview ,
section RAPID summary - Mathematics
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 978
|
2 Functions
2.111. SocketGetStatus - Get current socket state
Socket Messaging
975
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Socket communication in general
Application manual - Robot communication and
I/O control
Create a new socket
SocketCreate - Create a new socket on page
460
Connect to remote computer (only client)
SocketConnect - Connect to a remote computer
on page 457
Send data to remote computer
SocketSend - Send data to remote computer on
page 469
Receive data from remote computer
SocketReceive - Receive data from remote
computer on page 464
Close the socket
SocketClose - Close a socket on page 455
Bind a socket (only server)
SocketBind - Bind a socket to my IP-address
and port on page 453
Listening connections (only server)
SocketListen - Listen for incoming connections
on page 462
Accept connections (only server)
SocketAccept - Accept an incoming connection
on page 450
Continued
2 Functions
2.112. Sqrt - Calculates the square root value
RobotWare - OS
3HAC 16581-1 Revision: J
976
© Copyright 2004-2010 ABB. All rights reserved.
2.112. Sqrt - Calculates the square root value
Usage
Sqrt ( Square root ) is used to calculate the square root value.
Basic examples
Basic examples of the function Sqrt are illustrated below.
Example 1
VAR num x_value;
VAR num y_value;
...
...
y_value := Sqrt( x_value);
y-value will get the square root value of x_value , i.e. √ ( x_value ).
Return value
Data type: num
The square root value ( √ ).
Arguments
Sqrt (Value)
Value
Data type: num
The argument value for square root, i.e. √ value .
Value needs to be ≥ 0.
Limitations
The execution of the function Sqrt(x) will give an error if x < 0.
Syntax
Sqrt’(’
[Value’:=’] <expression ( IN ) of num>
’)’
A function with a return value of the data type num .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID overview ,
section RAPID summary - Mathematics
2 Functions
2.113. STCalcForce - Calculate the tip force for a Servo Tool
Servo tool control
977
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.113. STCalcForce - Calculate the tip force for a Servo Tool
Usage
STCalcForce is used to calculate the tip force for a Servo Tool. This function is used, for
example, to find the max allowed tip force for a servo tool.
Basic examples
Basic examples of the function STCalcForce are illustrated below.
Example 1
VAR num tip_force;
tip_force := STCalcForce(gun1, 7);
Calculate the tip force when the desired motor torque is 7 Nm.
Return Value
Data type: num
The calculated tip force [N].
Arguments
STCalcForce (ToolName MotorTorque)
ToolName
Data type: string
The name of the mechanical unit.
MotorTorque
Data type: num
The desired motor torque [Nm].
Error handling
If the specified servo tool name is not a configured servo tool, the system variable ERRNO is
set to ERR_NO_SGUN .
The error can be handled in a Rapid error handler.
Syntax
STCalcForce
[ ’ToolName ’:=’ ] < expression ( IN ) of string > ´,´
[ ’MotorTorque’ :=’ ] < expression ( IN ) of num > ´;´
A function with a return value of the data type num.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 979
|
2 Functions
2.112. Sqrt - Calculates the square root value
RobotWare - OS
3HAC 16581-1 Revision: J
976
© Copyright 2004-2010 ABB. All rights reserved.
2.112. Sqrt - Calculates the square root value
Usage
Sqrt ( Square root ) is used to calculate the square root value.
Basic examples
Basic examples of the function Sqrt are illustrated below.
Example 1
VAR num x_value;
VAR num y_value;
...
...
y_value := Sqrt( x_value);
y-value will get the square root value of x_value , i.e. √ ( x_value ).
Return value
Data type: num
The square root value ( √ ).
Arguments
Sqrt (Value)
Value
Data type: num
The argument value for square root, i.e. √ value .
Value needs to be ≥ 0.
Limitations
The execution of the function Sqrt(x) will give an error if x < 0.
Syntax
Sqrt’(’
[Value’:=’] <expression ( IN ) of num>
’)’
A function with a return value of the data type num .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID overview ,
section RAPID summary - Mathematics
2 Functions
2.113. STCalcForce - Calculate the tip force for a Servo Tool
Servo tool control
977
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.113. STCalcForce - Calculate the tip force for a Servo Tool
Usage
STCalcForce is used to calculate the tip force for a Servo Tool. This function is used, for
example, to find the max allowed tip force for a servo tool.
Basic examples
Basic examples of the function STCalcForce are illustrated below.
Example 1
VAR num tip_force;
tip_force := STCalcForce(gun1, 7);
Calculate the tip force when the desired motor torque is 7 Nm.
Return Value
Data type: num
The calculated tip force [N].
Arguments
STCalcForce (ToolName MotorTorque)
ToolName
Data type: string
The name of the mechanical unit.
MotorTorque
Data type: num
The desired motor torque [Nm].
Error handling
If the specified servo tool name is not a configured servo tool, the system variable ERRNO is
set to ERR_NO_SGUN .
The error can be handled in a Rapid error handler.
Syntax
STCalcForce
[ ’ToolName ’:=’ ] < expression ( IN ) of string > ´,´
[ ’MotorTorque’ :=’ ] < expression ( IN ) of num > ´;´
A function with a return value of the data type num.
Continues on next page
2 Functions
2.113. STCalcForce - Calculate the tip force for a Servo Tool
Servo tool control
3HAC 16581-1 Revision: J
978
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Open a servo tool
STOpen - Open a Servo Tool on page 513
Close a servo tool
STClose - Close a Servo Tool on page 496
Calculate the motor torque
STCalcTorque - Calc. the motor torque for a servo tool on
page 979
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 980
|
2 Functions
2.113. STCalcForce - Calculate the tip force for a Servo Tool
Servo tool control
977
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.113. STCalcForce - Calculate the tip force for a Servo Tool
Usage
STCalcForce is used to calculate the tip force for a Servo Tool. This function is used, for
example, to find the max allowed tip force for a servo tool.
Basic examples
Basic examples of the function STCalcForce are illustrated below.
Example 1
VAR num tip_force;
tip_force := STCalcForce(gun1, 7);
Calculate the tip force when the desired motor torque is 7 Nm.
Return Value
Data type: num
The calculated tip force [N].
Arguments
STCalcForce (ToolName MotorTorque)
ToolName
Data type: string
The name of the mechanical unit.
MotorTorque
Data type: num
The desired motor torque [Nm].
Error handling
If the specified servo tool name is not a configured servo tool, the system variable ERRNO is
set to ERR_NO_SGUN .
The error can be handled in a Rapid error handler.
Syntax
STCalcForce
[ ’ToolName ’:=’ ] < expression ( IN ) of string > ´,´
[ ’MotorTorque’ :=’ ] < expression ( IN ) of num > ´;´
A function with a return value of the data type num.
Continues on next page
2 Functions
2.113. STCalcForce - Calculate the tip force for a Servo Tool
Servo tool control
3HAC 16581-1 Revision: J
978
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Open a servo tool
STOpen - Open a Servo Tool on page 513
Close a servo tool
STClose - Close a Servo Tool on page 496
Calculate the motor torque
STCalcTorque - Calc. the motor torque for a servo tool on
page 979
Continued
2 Functions
2.114. STCalcTorque - Calc. the motor torque for a servo tool
Servo tool control
979
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.114. STCalcTorque - Calc. the motor torque for a servo tool
Usage
STCalcTorque is used to calculate the motor torque for a Servo Tool. This function is used,
for example, when a force calibration is performed.
Basic examples
Basic examples of the function STCalcTorque are illustrated below.
Example 1
VAR num curr_motortorque;
curr_motortorque := STCalcTorque( gun1, 1000);
Calculate the motor torque when the desired tip force is 1000 N.
Return value
Data type: num
The calculated motor torque [Nm].
Arguments
STCalcTorque (ToolName TipForce)
ToolName
Data type: string
The name of the mechanical unit.
TipForce
Data type: num
The desired tip force [N].
Error handling
If the specified servo tool name is not a configured servo tool, the system variable ERRNO is
set to ERR_NO_SGUN .
The error can be handled in a Rapid error handler.
Syntax
STCalcTorque
[ ’ToolName ’:=’ ] < expression ( IN ) of string > ´,´
[’ TipForce’ :=’ ] < expression ( IN ) of num > ‘;’
A function with a return value of the data type num .
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 981
|
2 Functions
2.113. STCalcForce - Calculate the tip force for a Servo Tool
Servo tool control
3HAC 16581-1 Revision: J
978
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Open a servo tool
STOpen - Open a Servo Tool on page 513
Close a servo tool
STClose - Close a Servo Tool on page 496
Calculate the motor torque
STCalcTorque - Calc. the motor torque for a servo tool on
page 979
Continued
2 Functions
2.114. STCalcTorque - Calc. the motor torque for a servo tool
Servo tool control
979
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.114. STCalcTorque - Calc. the motor torque for a servo tool
Usage
STCalcTorque is used to calculate the motor torque for a Servo Tool. This function is used,
for example, when a force calibration is performed.
Basic examples
Basic examples of the function STCalcTorque are illustrated below.
Example 1
VAR num curr_motortorque;
curr_motortorque := STCalcTorque( gun1, 1000);
Calculate the motor torque when the desired tip force is 1000 N.
Return value
Data type: num
The calculated motor torque [Nm].
Arguments
STCalcTorque (ToolName TipForce)
ToolName
Data type: string
The name of the mechanical unit.
TipForce
Data type: num
The desired tip force [N].
Error handling
If the specified servo tool name is not a configured servo tool, the system variable ERRNO is
set to ERR_NO_SGUN .
The error can be handled in a Rapid error handler.
Syntax
STCalcTorque
[ ’ToolName ’:=’ ] < expression ( IN ) of string > ´,´
[’ TipForce’ :=’ ] < expression ( IN ) of num > ‘;’
A function with a return value of the data type num .
Continues on next page
2 Functions
2.114. STCalcTorque - Calc. the motor torque for a servo tool
Servo tool control
3HAC 16581-1 Revision: J
980
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Open a servo tool
STOpen - Open a Servo Tool on page 513
Close a servo tool
STClose - Close a Servo Tool on page 496
Calculate the tip force
STCalcForce - Calculate the tip force for a Servo Tool on
page 977
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 982
|
2 Functions
2.114. STCalcTorque - Calc. the motor torque for a servo tool
Servo tool control
979
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.114. STCalcTorque - Calc. the motor torque for a servo tool
Usage
STCalcTorque is used to calculate the motor torque for a Servo Tool. This function is used,
for example, when a force calibration is performed.
Basic examples
Basic examples of the function STCalcTorque are illustrated below.
Example 1
VAR num curr_motortorque;
curr_motortorque := STCalcTorque( gun1, 1000);
Calculate the motor torque when the desired tip force is 1000 N.
Return value
Data type: num
The calculated motor torque [Nm].
Arguments
STCalcTorque (ToolName TipForce)
ToolName
Data type: string
The name of the mechanical unit.
TipForce
Data type: num
The desired tip force [N].
Error handling
If the specified servo tool name is not a configured servo tool, the system variable ERRNO is
set to ERR_NO_SGUN .
The error can be handled in a Rapid error handler.
Syntax
STCalcTorque
[ ’ToolName ’:=’ ] < expression ( IN ) of string > ´,´
[’ TipForce’ :=’ ] < expression ( IN ) of num > ‘;’
A function with a return value of the data type num .
Continues on next page
2 Functions
2.114. STCalcTorque - Calc. the motor torque for a servo tool
Servo tool control
3HAC 16581-1 Revision: J
980
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Open a servo tool
STOpen - Open a Servo Tool on page 513
Close a servo tool
STClose - Close a Servo Tool on page 496
Calculate the tip force
STCalcForce - Calculate the tip force for a Servo Tool on
page 977
Continued
2 Functions
2.115. STIsCalib - Tests if a servo tool is calibrated
Servo Tool Control
981
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.115. STIsCalib - Tests if a servo tool is calibrated
Usage
STIsCalib is used to test if a servo tool is calibrated - that is, check if the gun tips are
calibrated or synchronized.
Basic examples
Basic examples of the function STIsCalib are illustrated below.
Example 1
IF STIsCalib(gun1\sguninit) THEN
...
ELSE
!Start the gun calibration
STCalib gun1\TipChg;
ENDIF
Example 2
IF STIsCalib(gun1\sgunsynch) THEN
...
ELSE
!Start the gun calibration to synchronize the gun position with
the revolution counter
STCalib gun1\ToolChg;
ENDIF
Return value
Data type: bool
TRUE if the tested tool is calibrated - that is, the distance between the tool tips is calibrated,
or if the tested tool is synchronized - that is, the position of the tool tips is synchronized with
the revolution counter of the tool.
FALSE if the tested tool is not calibrated or synchronized.
Arguments
STIsCalib(ToolName [ \sguninit ] | [ \sgunsynch ])
ToolName
Data type: string
The name of the mechanical unit.
[ \sguninit ]
Data type: switch
This argument is used to check if the gun position is initialized and calibrated.
[ \sgunsynch ]
Data type: switch
This argument is used to check if the gun position is synchronized with the revolution counter.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 983
|
2 Functions
2.114. STCalcTorque - Calc. the motor torque for a servo tool
Servo tool control
3HAC 16581-1 Revision: J
980
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Open a servo tool
STOpen - Open a Servo Tool on page 513
Close a servo tool
STClose - Close a Servo Tool on page 496
Calculate the tip force
STCalcForce - Calculate the tip force for a Servo Tool on
page 977
Continued
2 Functions
2.115. STIsCalib - Tests if a servo tool is calibrated
Servo Tool Control
981
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.115. STIsCalib - Tests if a servo tool is calibrated
Usage
STIsCalib is used to test if a servo tool is calibrated - that is, check if the gun tips are
calibrated or synchronized.
Basic examples
Basic examples of the function STIsCalib are illustrated below.
Example 1
IF STIsCalib(gun1\sguninit) THEN
...
ELSE
!Start the gun calibration
STCalib gun1\TipChg;
ENDIF
Example 2
IF STIsCalib(gun1\sgunsynch) THEN
...
ELSE
!Start the gun calibration to synchronize the gun position with
the revolution counter
STCalib gun1\ToolChg;
ENDIF
Return value
Data type: bool
TRUE if the tested tool is calibrated - that is, the distance between the tool tips is calibrated,
or if the tested tool is synchronized - that is, the position of the tool tips is synchronized with
the revolution counter of the tool.
FALSE if the tested tool is not calibrated or synchronized.
Arguments
STIsCalib(ToolName [ \sguninit ] | [ \sgunsynch ])
ToolName
Data type: string
The name of the mechanical unit.
[ \sguninit ]
Data type: switch
This argument is used to check if the gun position is initialized and calibrated.
[ \sgunsynch ]
Data type: switch
This argument is used to check if the gun position is synchronized with the revolution counter.
Continues on next page
2 Functions
2.115. STIsCalib - Tests if a servo tool is calibrated
Servo Tool Control
3HAC 16581-1 Revision: J
982
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
STIsCalib´(´
[ ´ToolName ´:=´ ] < expression ( IN ) of string >
[ ´\´sguninit ] | [ ´\´sgunsynch ] ´)´
A function with a return value of the data type bool .
Related information
For information about
See
Calibrating a servo tool
STCalib - Calibrate a Servo Tool on page 492
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 984
|
2 Functions
2.115. STIsCalib - Tests if a servo tool is calibrated
Servo Tool Control
981
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.115. STIsCalib - Tests if a servo tool is calibrated
Usage
STIsCalib is used to test if a servo tool is calibrated - that is, check if the gun tips are
calibrated or synchronized.
Basic examples
Basic examples of the function STIsCalib are illustrated below.
Example 1
IF STIsCalib(gun1\sguninit) THEN
...
ELSE
!Start the gun calibration
STCalib gun1\TipChg;
ENDIF
Example 2
IF STIsCalib(gun1\sgunsynch) THEN
...
ELSE
!Start the gun calibration to synchronize the gun position with
the revolution counter
STCalib gun1\ToolChg;
ENDIF
Return value
Data type: bool
TRUE if the tested tool is calibrated - that is, the distance between the tool tips is calibrated,
or if the tested tool is synchronized - that is, the position of the tool tips is synchronized with
the revolution counter of the tool.
FALSE if the tested tool is not calibrated or synchronized.
Arguments
STIsCalib(ToolName [ \sguninit ] | [ \sgunsynch ])
ToolName
Data type: string
The name of the mechanical unit.
[ \sguninit ]
Data type: switch
This argument is used to check if the gun position is initialized and calibrated.
[ \sgunsynch ]
Data type: switch
This argument is used to check if the gun position is synchronized with the revolution counter.
Continues on next page
2 Functions
2.115. STIsCalib - Tests if a servo tool is calibrated
Servo Tool Control
3HAC 16581-1 Revision: J
982
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
STIsCalib´(´
[ ´ToolName ´:=´ ] < expression ( IN ) of string >
[ ´\´sguninit ] | [ ´\´sgunsynch ] ´)´
A function with a return value of the data type bool .
Related information
For information about
See
Calibrating a servo tool
STCalib - Calibrate a Servo Tool on page 492
Continued
2 Functions
2.116. STIsClosed - Tests if a servo tool is closed
Servo Tool Control
983
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.116. STIsClosed - Tests if a servo tool is closed
Usage
STIsClosed is used to test if a servo tool is closed.
Basic examples
Basic examples of the instruction STIsClosed are illustrated below.
Example 1
IF STIsClosed(gun1) THEN
!Start the weld process
Set weld_start;
ELSE
...
ENDIF
Check if the gun is closed or not.
Example 2
STClose "sgun", 1000, 3 \Conc;
WHILE NOT(STIsClosed("sgun"\RetThickness:=thickness)) DO
WaitTime 0.1;
ENDWHILE
IF thickness > max_thickness THEN...
Start to close the gun named sgun . Continue immediately with the next instruction in which
the program waits for the gun to be closed. Read the achieved thickness value when the
instruction STIsClosed has returned TRUE .
Example 3
Examples of non valid combinations:
STClose "sgun", 1000, 3 \RetThickness:=thickness \Conc;
WHILE NOT(STIsClosed("sgun"\RetThickness:=thickness_2)) DO;
...
Close the gun. The parameter thickness will not hold any valid value since the \Conc switch
is used. Wait until the gun is closed. When the gun is closed and STIsClosed returns TRUE ,
the parameter thickness_2 will hold a valid value since the \Conc switch was used for the
STClose .
STClose "sgun", 1000, 3 \RetThickness:=thickness;
WHILE NOT(STIsClosed("sgun"\RetThickness:=thickness_2)) DO;
...
Close the gun. The parameter thickness will hold a valid value when the gun has been closed
since the \Conc switch is not used. The parameter thickness_2 will not hold any valid value
since the \Conc switch was not used in the STClose instruction.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 985
|
2 Functions
2.115. STIsCalib - Tests if a servo tool is calibrated
Servo Tool Control
3HAC 16581-1 Revision: J
982
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
STIsCalib´(´
[ ´ToolName ´:=´ ] < expression ( IN ) of string >
[ ´\´sguninit ] | [ ´\´sgunsynch ] ´)´
A function with a return value of the data type bool .
Related information
For information about
See
Calibrating a servo tool
STCalib - Calibrate a Servo Tool on page 492
Continued
2 Functions
2.116. STIsClosed - Tests if a servo tool is closed
Servo Tool Control
983
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.116. STIsClosed - Tests if a servo tool is closed
Usage
STIsClosed is used to test if a servo tool is closed.
Basic examples
Basic examples of the instruction STIsClosed are illustrated below.
Example 1
IF STIsClosed(gun1) THEN
!Start the weld process
Set weld_start;
ELSE
...
ENDIF
Check if the gun is closed or not.
Example 2
STClose "sgun", 1000, 3 \Conc;
WHILE NOT(STIsClosed("sgun"\RetThickness:=thickness)) DO
WaitTime 0.1;
ENDWHILE
IF thickness > max_thickness THEN...
Start to close the gun named sgun . Continue immediately with the next instruction in which
the program waits for the gun to be closed. Read the achieved thickness value when the
instruction STIsClosed has returned TRUE .
Example 3
Examples of non valid combinations:
STClose "sgun", 1000, 3 \RetThickness:=thickness \Conc;
WHILE NOT(STIsClosed("sgun"\RetThickness:=thickness_2)) DO;
...
Close the gun. The parameter thickness will not hold any valid value since the \Conc switch
is used. Wait until the gun is closed. When the gun is closed and STIsClosed returns TRUE ,
the parameter thickness_2 will hold a valid value since the \Conc switch was used for the
STClose .
STClose "sgun", 1000, 3 \RetThickness:=thickness;
WHILE NOT(STIsClosed("sgun"\RetThickness:=thickness_2)) DO;
...
Close the gun. The parameter thickness will hold a valid value when the gun has been closed
since the \Conc switch is not used. The parameter thickness_2 will not hold any valid value
since the \Conc switch was not used in the STClose instruction.
Continues on next page
2 Functions
2.116. STIsClosed - Tests if a servo tool is closed
Servo Tool Control
3HAC 16581-1 Revision: J
984
© Copyright 2004-2010 ABB. All rights reserved.
Return value
Data type: bool
TRUE if the tested tool is closed, i.e. the desired tip force is achieved.
FALSE if the tested tool is not closed.
Arguments
STIsClosed (ToolName)
ToolName
Data type: string
The name of the mechanical unit.
[\RetThickness]
Data type: num
The achieved thickness [mm].
NOTE! Only valid if \Conc has been used in a preceding STClose instruction.
Syntax
STIsClosed’(‘
[ ’ToolName ’:=’ ] < expression ( IN ) of string > ‘)’
[‘\’’ RetThickness’ :=’ < variable or persistent ( INOUT ) of num
> ]
A function with a return value of the data type bool .
Related information
For information about
See
Open a servo tool
STOpen - Open a Servo Tool on page 513
Close a servo tool
STClose - Close a Servo Tool on page 496
Test if a servo tool is open
STIsOpen - Tests if a servo tool is open on page 986
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 986
|
2 Functions
2.116. STIsClosed - Tests if a servo tool is closed
Servo Tool Control
983
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.116. STIsClosed - Tests if a servo tool is closed
Usage
STIsClosed is used to test if a servo tool is closed.
Basic examples
Basic examples of the instruction STIsClosed are illustrated below.
Example 1
IF STIsClosed(gun1) THEN
!Start the weld process
Set weld_start;
ELSE
...
ENDIF
Check if the gun is closed or not.
Example 2
STClose "sgun", 1000, 3 \Conc;
WHILE NOT(STIsClosed("sgun"\RetThickness:=thickness)) DO
WaitTime 0.1;
ENDWHILE
IF thickness > max_thickness THEN...
Start to close the gun named sgun . Continue immediately with the next instruction in which
the program waits for the gun to be closed. Read the achieved thickness value when the
instruction STIsClosed has returned TRUE .
Example 3
Examples of non valid combinations:
STClose "sgun", 1000, 3 \RetThickness:=thickness \Conc;
WHILE NOT(STIsClosed("sgun"\RetThickness:=thickness_2)) DO;
...
Close the gun. The parameter thickness will not hold any valid value since the \Conc switch
is used. Wait until the gun is closed. When the gun is closed and STIsClosed returns TRUE ,
the parameter thickness_2 will hold a valid value since the \Conc switch was used for the
STClose .
STClose "sgun", 1000, 3 \RetThickness:=thickness;
WHILE NOT(STIsClosed("sgun"\RetThickness:=thickness_2)) DO;
...
Close the gun. The parameter thickness will hold a valid value when the gun has been closed
since the \Conc switch is not used. The parameter thickness_2 will not hold any valid value
since the \Conc switch was not used in the STClose instruction.
Continues on next page
2 Functions
2.116. STIsClosed - Tests if a servo tool is closed
Servo Tool Control
3HAC 16581-1 Revision: J
984
© Copyright 2004-2010 ABB. All rights reserved.
Return value
Data type: bool
TRUE if the tested tool is closed, i.e. the desired tip force is achieved.
FALSE if the tested tool is not closed.
Arguments
STIsClosed (ToolName)
ToolName
Data type: string
The name of the mechanical unit.
[\RetThickness]
Data type: num
The achieved thickness [mm].
NOTE! Only valid if \Conc has been used in a preceding STClose instruction.
Syntax
STIsClosed’(‘
[ ’ToolName ’:=’ ] < expression ( IN ) of string > ‘)’
[‘\’’ RetThickness’ :=’ < variable or persistent ( INOUT ) of num
> ]
A function with a return value of the data type bool .
Related information
For information about
See
Open a servo tool
STOpen - Open a Servo Tool on page 513
Close a servo tool
STClose - Close a Servo Tool on page 496
Test if a servo tool is open
STIsOpen - Tests if a servo tool is open on page 986
Continued
2 Functions
2.117. STIsIndGun - Tests if a servo tool is in independent mode
Servo Tool Control
985
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.117. STIsIndGun - Tests if a servo tool is in independent mode
Usage
STIsIndGun is used to test if a servo tool is in independent mode.
Basic examples
Basic example of the function STIsIndGun is illustrated below.
Example 1
IF STIsIndGun(gun1) THEN
Start the gun calibration
STCalib gun1\???????;
ELSE
...
ENDIF
Return value
Data type: bool
TRUE if the tested tool is in independent mode - that is, the gun can be moved independently
of the robot movements.
FALSE if the tested tool is not in independent mode.
Arguments
STIsIndGun(ToolName)
ToolName
Data type: string
The name of the mechanical unit.
Syntax
STIsIndGun´(´
[ ´ToolName ´:=´ ] < expression ( IN ) of string > ´)´
A function with a return value of the data type bool .
Related information
For information about
See
Calibrating a servo tool
STCalib - Calibrate a Servo Tool on page 492
Setting the gun in independent mode
STIndGun - Sets the gun in independent
mode on page 501
Resetting the gun from independent mode
STIndGunReset - Resets the gun from
independent mode on page 503
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 987
|
2 Functions
2.116. STIsClosed - Tests if a servo tool is closed
Servo Tool Control
3HAC 16581-1 Revision: J
984
© Copyright 2004-2010 ABB. All rights reserved.
Return value
Data type: bool
TRUE if the tested tool is closed, i.e. the desired tip force is achieved.
FALSE if the tested tool is not closed.
Arguments
STIsClosed (ToolName)
ToolName
Data type: string
The name of the mechanical unit.
[\RetThickness]
Data type: num
The achieved thickness [mm].
NOTE! Only valid if \Conc has been used in a preceding STClose instruction.
Syntax
STIsClosed’(‘
[ ’ToolName ’:=’ ] < expression ( IN ) of string > ‘)’
[‘\’’ RetThickness’ :=’ < variable or persistent ( INOUT ) of num
> ]
A function with a return value of the data type bool .
Related information
For information about
See
Open a servo tool
STOpen - Open a Servo Tool on page 513
Close a servo tool
STClose - Close a Servo Tool on page 496
Test if a servo tool is open
STIsOpen - Tests if a servo tool is open on page 986
Continued
2 Functions
2.117. STIsIndGun - Tests if a servo tool is in independent mode
Servo Tool Control
985
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.117. STIsIndGun - Tests if a servo tool is in independent mode
Usage
STIsIndGun is used to test if a servo tool is in independent mode.
Basic examples
Basic example of the function STIsIndGun is illustrated below.
Example 1
IF STIsIndGun(gun1) THEN
Start the gun calibration
STCalib gun1\???????;
ELSE
...
ENDIF
Return value
Data type: bool
TRUE if the tested tool is in independent mode - that is, the gun can be moved independently
of the robot movements.
FALSE if the tested tool is not in independent mode.
Arguments
STIsIndGun(ToolName)
ToolName
Data type: string
The name of the mechanical unit.
Syntax
STIsIndGun´(´
[ ´ToolName ´:=´ ] < expression ( IN ) of string > ´)´
A function with a return value of the data type bool .
Related information
For information about
See
Calibrating a servo tool
STCalib - Calibrate a Servo Tool on page 492
Setting the gun in independent mode
STIndGun - Sets the gun in independent
mode on page 501
Resetting the gun from independent mode
STIndGunReset - Resets the gun from
independent mode on page 503
2 Functions
2.118. STIsOpen - Tests if a servo tool is open
Servo Tool Control
3HAC 16581-1 Revision: J
986
© Copyright 2004-2010 ABB. All rights reserved.
2.118. STIsOpen - Tests if a servo tool is open
Usage
STIsOpen is used to test if a servo tool is open.
Basic examples
Basic examples of the instruction STIsOpen are illustrated below.
Example 1
IF STIsOpen(gun1) THEN
!Start the motion
MoveL ...
ELSE
...
ENDIF
Check if the gun is open or not.
Example 2
STCalib "sgun" \TipWear \Conc;§
WHILE NOT(STIsOpen("sgun") \RetTipWear:=tipwear
\RetPosAdj:=posadj) DO;
WaitTime 0.1;
ENDWHILE
IF tipwear > 20...
IF posadj > 25...
Perform a tip wear calibration. Wait until the gun sgun is open. Read the tip wear and
positional adjustment values.
Example 3
Examples of non valid combinations:
STCalib "sgun" \TipWear \RetTipWear:=tipwear_1 \Conc;
WHILE NOT(STIsOpen("sgun") \RetTipWear:=tipwear_2) DO;
WaitTime 0.1;
ENDWHILE
Start a tip wear calibration. The parameter tipwear_1 will not hold any valid value since
the \Conc switch is used. When the calibration is ready and the STIsOpen returns TRUE , the
parameter tipwear_2 will hold a valid value.
STCalib "sgun" \TipWear \RetTipWear:=tipwear_1;
WHILE NOT(STIsOpen("sgun") \RetTipWear:=tipwear_2) DO;
WaitTime 0.1;
ENDWHILE
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 988
|
2 Functions
2.117. STIsIndGun - Tests if a servo tool is in independent mode
Servo Tool Control
985
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.117. STIsIndGun - Tests if a servo tool is in independent mode
Usage
STIsIndGun is used to test if a servo tool is in independent mode.
Basic examples
Basic example of the function STIsIndGun is illustrated below.
Example 1
IF STIsIndGun(gun1) THEN
Start the gun calibration
STCalib gun1\???????;
ELSE
...
ENDIF
Return value
Data type: bool
TRUE if the tested tool is in independent mode - that is, the gun can be moved independently
of the robot movements.
FALSE if the tested tool is not in independent mode.
Arguments
STIsIndGun(ToolName)
ToolName
Data type: string
The name of the mechanical unit.
Syntax
STIsIndGun´(´
[ ´ToolName ´:=´ ] < expression ( IN ) of string > ´)´
A function with a return value of the data type bool .
Related information
For information about
See
Calibrating a servo tool
STCalib - Calibrate a Servo Tool on page 492
Setting the gun in independent mode
STIndGun - Sets the gun in independent
mode on page 501
Resetting the gun from independent mode
STIndGunReset - Resets the gun from
independent mode on page 503
2 Functions
2.118. STIsOpen - Tests if a servo tool is open
Servo Tool Control
3HAC 16581-1 Revision: J
986
© Copyright 2004-2010 ABB. All rights reserved.
2.118. STIsOpen - Tests if a servo tool is open
Usage
STIsOpen is used to test if a servo tool is open.
Basic examples
Basic examples of the instruction STIsOpen are illustrated below.
Example 1
IF STIsOpen(gun1) THEN
!Start the motion
MoveL ...
ELSE
...
ENDIF
Check if the gun is open or not.
Example 2
STCalib "sgun" \TipWear \Conc;§
WHILE NOT(STIsOpen("sgun") \RetTipWear:=tipwear
\RetPosAdj:=posadj) DO;
WaitTime 0.1;
ENDWHILE
IF tipwear > 20...
IF posadj > 25...
Perform a tip wear calibration. Wait until the gun sgun is open. Read the tip wear and
positional adjustment values.
Example 3
Examples of non valid combinations:
STCalib "sgun" \TipWear \RetTipWear:=tipwear_1 \Conc;
WHILE NOT(STIsOpen("sgun") \RetTipWear:=tipwear_2) DO;
WaitTime 0.1;
ENDWHILE
Start a tip wear calibration. The parameter tipwear_1 will not hold any valid value since
the \Conc switch is used. When the calibration is ready and the STIsOpen returns TRUE , the
parameter tipwear_2 will hold a valid value.
STCalib "sgun" \TipWear \RetTipWear:=tipwear_1;
WHILE NOT(STIsOpen("sgun") \RetTipWear:=tipwear_2) DO;
WaitTime 0.1;
ENDWHILE
Continues on next page
2 Functions
2.118. STIsOpen - Tests if a servo tool is open
Servo Tool Control
987
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Perform a tip wear calibration. The parameter tipwear_1 will hold a valid value since the
\Conc switch is not used. When STIsOpen returns TRUE , the parameter tipwear_2 will not
hold any valid value since the \Conc switch was not used in STCalib .
Return value
Data type: bool
TRUE if the tested tool is open, i.e. the tool arm is in the programmed open position.
FALSE if the tested tool is not open.
Arguments
STIsOpen (ToolName)
ToolName
Data type: string
The name of the mechanical unit.
[\RetTipWear]
Data type: num
The achieved tip wear [mm].
NOTE! Only valid if \Conc has been used in a preceding STCalib instruction and if
STIsOpen returns TRUE .
[\RetPosAdj]
Data type: num
The positional adjustment since the last calibration [mm].
NOTE! Only valid if \Conc has been used in a preceding STCalib instruction and if
STIsOpen returns TRUE .
Syntax
STIsOpen’(‘
[ ’ToolName ’:=’ ] < expression ( IN ) of string > ‘)’
[’ \’RetTipWear’ :=’ < variable or persistent( INOUT ) of num >
]’;’
[ ’\’RetPosAdj’ :=’ < variable or persistent( INOUT ) of num > ]
A function with a return value of the data type bool .
Related information
For information about
See
Open a servo tool
STOpen - Open a Servo Tool on page 513
Close a servo tool
STClose - Close a Servo Tool on page 496
Test if a servo tool is closed
STIsClosed - Tests if a servo tool is closed on page 983
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 989
|
2 Functions
2.118. STIsOpen - Tests if a servo tool is open
Servo Tool Control
3HAC 16581-1 Revision: J
986
© Copyright 2004-2010 ABB. All rights reserved.
2.118. STIsOpen - Tests if a servo tool is open
Usage
STIsOpen is used to test if a servo tool is open.
Basic examples
Basic examples of the instruction STIsOpen are illustrated below.
Example 1
IF STIsOpen(gun1) THEN
!Start the motion
MoveL ...
ELSE
...
ENDIF
Check if the gun is open or not.
Example 2
STCalib "sgun" \TipWear \Conc;§
WHILE NOT(STIsOpen("sgun") \RetTipWear:=tipwear
\RetPosAdj:=posadj) DO;
WaitTime 0.1;
ENDWHILE
IF tipwear > 20...
IF posadj > 25...
Perform a tip wear calibration. Wait until the gun sgun is open. Read the tip wear and
positional adjustment values.
Example 3
Examples of non valid combinations:
STCalib "sgun" \TipWear \RetTipWear:=tipwear_1 \Conc;
WHILE NOT(STIsOpen("sgun") \RetTipWear:=tipwear_2) DO;
WaitTime 0.1;
ENDWHILE
Start a tip wear calibration. The parameter tipwear_1 will not hold any valid value since
the \Conc switch is used. When the calibration is ready and the STIsOpen returns TRUE , the
parameter tipwear_2 will hold a valid value.
STCalib "sgun" \TipWear \RetTipWear:=tipwear_1;
WHILE NOT(STIsOpen("sgun") \RetTipWear:=tipwear_2) DO;
WaitTime 0.1;
ENDWHILE
Continues on next page
2 Functions
2.118. STIsOpen - Tests if a servo tool is open
Servo Tool Control
987
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Perform a tip wear calibration. The parameter tipwear_1 will hold a valid value since the
\Conc switch is not used. When STIsOpen returns TRUE , the parameter tipwear_2 will not
hold any valid value since the \Conc switch was not used in STCalib .
Return value
Data type: bool
TRUE if the tested tool is open, i.e. the tool arm is in the programmed open position.
FALSE if the tested tool is not open.
Arguments
STIsOpen (ToolName)
ToolName
Data type: string
The name of the mechanical unit.
[\RetTipWear]
Data type: num
The achieved tip wear [mm].
NOTE! Only valid if \Conc has been used in a preceding STCalib instruction and if
STIsOpen returns TRUE .
[\RetPosAdj]
Data type: num
The positional adjustment since the last calibration [mm].
NOTE! Only valid if \Conc has been used in a preceding STCalib instruction and if
STIsOpen returns TRUE .
Syntax
STIsOpen’(‘
[ ’ToolName ’:=’ ] < expression ( IN ) of string > ‘)’
[’ \’RetTipWear’ :=’ < variable or persistent( INOUT ) of num >
]’;’
[ ’\’RetPosAdj’ :=’ < variable or persistent( INOUT ) of num > ]
A function with a return value of the data type bool .
Related information
For information about
See
Open a servo tool
STOpen - Open a Servo Tool on page 513
Close a servo tool
STClose - Close a Servo Tool on page 496
Test if a servo tool is closed
STIsClosed - Tests if a servo tool is closed on page 983
Continued
2 Functions
2.119. StrDigCalc - Arithmetic operations with datatype stringdig
RobotWare - OS
3HAC 16581-1 Revision: J
988
© Copyright 2004-2010 ABB. All rights reserved.
2.119. StrDigCalc - Arithmetic operations with datatype stringdig
Usage
StrDigCalc is used to perform arithmetic operations (+, -, *, /, %) on two positive digit
strings in the same way as numeric arithmetic operations on positive integer values.
This function can handle positive integers above 8 388 608 with exact representation.
Basic examples
Basic examples of the function StrDigCalc are illustrated below.
See also More examples on page 989 .
Example 1
res := StrDigCalc(str1, OpAdd, str2);
res is assigned the result of the addition operation on the values represented by the digital
strings str1 and str2 .
Return value
Data type: stringdig
stringdig is used to represent big positive integers in a string with only digits.
This data type is introduced because the data type num cannot handle positive integers above
8 388 608 with exact representation.
Arguments
StrDigCalc (StrDig1 Operation StrDig2)
StrDig1
String Digit 1
Data type: stringdig
String representing a positive integer value.
Operation
Arithmetic operator
Data type: opcalc
Defines the arithmetic operation to perform on the two digit strings. Following arithmetic
operatons of data type opcalc can be used; OpAdd, OpSub, OpMult, OpDiv and OpMod .
StrDig2
String Digit 2
Data type: stringdig
String representing a positive integer value.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 990
|
2 Functions
2.118. STIsOpen - Tests if a servo tool is open
Servo Tool Control
987
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Perform a tip wear calibration. The parameter tipwear_1 will hold a valid value since the
\Conc switch is not used. When STIsOpen returns TRUE , the parameter tipwear_2 will not
hold any valid value since the \Conc switch was not used in STCalib .
Return value
Data type: bool
TRUE if the tested tool is open, i.e. the tool arm is in the programmed open position.
FALSE if the tested tool is not open.
Arguments
STIsOpen (ToolName)
ToolName
Data type: string
The name of the mechanical unit.
[\RetTipWear]
Data type: num
The achieved tip wear [mm].
NOTE! Only valid if \Conc has been used in a preceding STCalib instruction and if
STIsOpen returns TRUE .
[\RetPosAdj]
Data type: num
The positional adjustment since the last calibration [mm].
NOTE! Only valid if \Conc has been used in a preceding STCalib instruction and if
STIsOpen returns TRUE .
Syntax
STIsOpen’(‘
[ ’ToolName ’:=’ ] < expression ( IN ) of string > ‘)’
[’ \’RetTipWear’ :=’ < variable or persistent( INOUT ) of num >
]’;’
[ ’\’RetPosAdj’ :=’ < variable or persistent( INOUT ) of num > ]
A function with a return value of the data type bool .
Related information
For information about
See
Open a servo tool
STOpen - Open a Servo Tool on page 513
Close a servo tool
STClose - Close a Servo Tool on page 496
Test if a servo tool is closed
STIsClosed - Tests if a servo tool is closed on page 983
Continued
2 Functions
2.119. StrDigCalc - Arithmetic operations with datatype stringdig
RobotWare - OS
3HAC 16581-1 Revision: J
988
© Copyright 2004-2010 ABB. All rights reserved.
2.119. StrDigCalc - Arithmetic operations with datatype stringdig
Usage
StrDigCalc is used to perform arithmetic operations (+, -, *, /, %) on two positive digit
strings in the same way as numeric arithmetic operations on positive integer values.
This function can handle positive integers above 8 388 608 with exact representation.
Basic examples
Basic examples of the function StrDigCalc are illustrated below.
See also More examples on page 989 .
Example 1
res := StrDigCalc(str1, OpAdd, str2);
res is assigned the result of the addition operation on the values represented by the digital
strings str1 and str2 .
Return value
Data type: stringdig
stringdig is used to represent big positive integers in a string with only digits.
This data type is introduced because the data type num cannot handle positive integers above
8 388 608 with exact representation.
Arguments
StrDigCalc (StrDig1 Operation StrDig2)
StrDig1
String Digit 1
Data type: stringdig
String representing a positive integer value.
Operation
Arithmetic operator
Data type: opcalc
Defines the arithmetic operation to perform on the two digit strings. Following arithmetic
operatons of data type opcalc can be used; OpAdd, OpSub, OpMult, OpDiv and OpMod .
StrDig2
String Digit 2
Data type: stringdig
String representing a positive integer value.
Continues on next page
2 Functions
2.119. StrDigCalc - Arithmetic operations with datatype stringdig
RobotWare - OS
989
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Program execution
This function will:
•
Check only digits 0...9 in StrDig1 and StrDig2
•
Convert the two digital strings to long integers
•
Perform an arithmetic operation on the two long integers
•
Convert the result from long integer to stringdig
More examples
More examples of how to use the function StrDigCalc are illustrated below.
Example 1
res := StrDigCalc(str1, OpSub, str2);
res is assigned the result of the substration operation on the values represented by the digital
strings str1 and str2 .
Example 2
res := StrDigCalc(str1, OpMult, str2);
res is assigned the result of the multiplication operartion on the values represented by the
digital strings str1 and str2 .
Example 3
res := StrDigCalc(str1, OpDiv, str2);
res is assigned the result of the division operation on the values represented by the digital
strings str1 and str2 .
Example 4
res := StrDigCalc(str1, OpMod, str2);
res is assigned the result of the modulus operation on the values represented by the digital
strings str1 and str2 .
Error handling
The following errors can be handled in a Rapid error handler.
Limitations
StrDigCalc only accepts strings that contain digits (characters 0...9). All other characters in
stringdig will result in error.
This function can only handle positive integers up to 4 294 967 295.
Error code
Description
ERR_INT_NOTVAL
Input values not only digits or modulus by zero
ERR_INT_MAXVAL
Input value above 4294967295
ERR_CALC_OVERFLOW
Result out of range 0...4294967295
ERR_CALC_NEG
Negative substraction i.e. StrDig2 > StrDig1
ERR_CALC_DIVZERO
Division by zero
Continued
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 991
|
2 Functions
2.119. StrDigCalc - Arithmetic operations with datatype stringdig
RobotWare - OS
3HAC 16581-1 Revision: J
988
© Copyright 2004-2010 ABB. All rights reserved.
2.119. StrDigCalc - Arithmetic operations with datatype stringdig
Usage
StrDigCalc is used to perform arithmetic operations (+, -, *, /, %) on two positive digit
strings in the same way as numeric arithmetic operations on positive integer values.
This function can handle positive integers above 8 388 608 with exact representation.
Basic examples
Basic examples of the function StrDigCalc are illustrated below.
See also More examples on page 989 .
Example 1
res := StrDigCalc(str1, OpAdd, str2);
res is assigned the result of the addition operation on the values represented by the digital
strings str1 and str2 .
Return value
Data type: stringdig
stringdig is used to represent big positive integers in a string with only digits.
This data type is introduced because the data type num cannot handle positive integers above
8 388 608 with exact representation.
Arguments
StrDigCalc (StrDig1 Operation StrDig2)
StrDig1
String Digit 1
Data type: stringdig
String representing a positive integer value.
Operation
Arithmetic operator
Data type: opcalc
Defines the arithmetic operation to perform on the two digit strings. Following arithmetic
operatons of data type opcalc can be used; OpAdd, OpSub, OpMult, OpDiv and OpMod .
StrDig2
String Digit 2
Data type: stringdig
String representing a positive integer value.
Continues on next page
2 Functions
2.119. StrDigCalc - Arithmetic operations with datatype stringdig
RobotWare - OS
989
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Program execution
This function will:
•
Check only digits 0...9 in StrDig1 and StrDig2
•
Convert the two digital strings to long integers
•
Perform an arithmetic operation on the two long integers
•
Convert the result from long integer to stringdig
More examples
More examples of how to use the function StrDigCalc are illustrated below.
Example 1
res := StrDigCalc(str1, OpSub, str2);
res is assigned the result of the substration operation on the values represented by the digital
strings str1 and str2 .
Example 2
res := StrDigCalc(str1, OpMult, str2);
res is assigned the result of the multiplication operartion on the values represented by the
digital strings str1 and str2 .
Example 3
res := StrDigCalc(str1, OpDiv, str2);
res is assigned the result of the division operation on the values represented by the digital
strings str1 and str2 .
Example 4
res := StrDigCalc(str1, OpMod, str2);
res is assigned the result of the modulus operation on the values represented by the digital
strings str1 and str2 .
Error handling
The following errors can be handled in a Rapid error handler.
Limitations
StrDigCalc only accepts strings that contain digits (characters 0...9). All other characters in
stringdig will result in error.
This function can only handle positive integers up to 4 294 967 295.
Error code
Description
ERR_INT_NOTVAL
Input values not only digits or modulus by zero
ERR_INT_MAXVAL
Input value above 4294967295
ERR_CALC_OVERFLOW
Result out of range 0...4294967295
ERR_CALC_NEG
Negative substraction i.e. StrDig2 > StrDig1
ERR_CALC_DIVZERO
Division by zero
Continued
Continues on next page
2 Functions
2.119. StrDigCalc - Arithmetic operations with datatype stringdig
RobotWare - OS
3HAC 16581-1 Revision: J
990
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
StrDigCalc‘(‘
[ StrDig1 ‘:=’ ] < expression ( IN ) of stringdig > ’,’
[ Operation‘ :=’ ] < expression ( IN ) of opcalc > ‘,’
[ StrDig2‘ :=’ ] < expression ( IN ) of stringdig > ‘)‘
A function with a return value of the data type stringdig .
Related information
For information about
See
Strings with only digits.
stringdig - String with only digits on page 1197
Arithmetic operators.
opcalc - Arithmetic Operator on page 1148
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 992
|
2 Functions
2.119. StrDigCalc - Arithmetic operations with datatype stringdig
RobotWare - OS
989
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Program execution
This function will:
•
Check only digits 0...9 in StrDig1 and StrDig2
•
Convert the two digital strings to long integers
•
Perform an arithmetic operation on the two long integers
•
Convert the result from long integer to stringdig
More examples
More examples of how to use the function StrDigCalc are illustrated below.
Example 1
res := StrDigCalc(str1, OpSub, str2);
res is assigned the result of the substration operation on the values represented by the digital
strings str1 and str2 .
Example 2
res := StrDigCalc(str1, OpMult, str2);
res is assigned the result of the multiplication operartion on the values represented by the
digital strings str1 and str2 .
Example 3
res := StrDigCalc(str1, OpDiv, str2);
res is assigned the result of the division operation on the values represented by the digital
strings str1 and str2 .
Example 4
res := StrDigCalc(str1, OpMod, str2);
res is assigned the result of the modulus operation on the values represented by the digital
strings str1 and str2 .
Error handling
The following errors can be handled in a Rapid error handler.
Limitations
StrDigCalc only accepts strings that contain digits (characters 0...9). All other characters in
stringdig will result in error.
This function can only handle positive integers up to 4 294 967 295.
Error code
Description
ERR_INT_NOTVAL
Input values not only digits or modulus by zero
ERR_INT_MAXVAL
Input value above 4294967295
ERR_CALC_OVERFLOW
Result out of range 0...4294967295
ERR_CALC_NEG
Negative substraction i.e. StrDig2 > StrDig1
ERR_CALC_DIVZERO
Division by zero
Continued
Continues on next page
2 Functions
2.119. StrDigCalc - Arithmetic operations with datatype stringdig
RobotWare - OS
3HAC 16581-1 Revision: J
990
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
StrDigCalc‘(‘
[ StrDig1 ‘:=’ ] < expression ( IN ) of stringdig > ’,’
[ Operation‘ :=’ ] < expression ( IN ) of opcalc > ‘,’
[ StrDig2‘ :=’ ] < expression ( IN ) of stringdig > ‘)‘
A function with a return value of the data type stringdig .
Related information
For information about
See
Strings with only digits.
stringdig - String with only digits on page 1197
Arithmetic operators.
opcalc - Arithmetic Operator on page 1148
Continued
2 Functions
2.120. StrDigCmp - Compare two strings with only digits
RobotWare - OS
991
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.120. StrDigCmp - Compare two strings with only digits
Usage
StrDigCmp is used to compare two positive digit strings in the same way as numeric compare
of positive integers.
This function can handle positive integers above 8 388 608 with exact representation.
Basic examples
Basic examples of the function StrDigCmp are illustrated below.
Example 1
VAR stringdig digits1 := "1234";
VAR stringdig digits2 := "1256";
VAR bool is_equal;
is_equal := StrDigCmp(digits1, EQ, digits2);
The variable is_equal will be set to FALSE , because the numeric value 1234 is not equal to
1256 .
Example 2
CONST string file_path := "...";
CONST string mod_name := "...";
VAR num num_file_time:
VAR stringdig dig_file_time;
VAR num num_mod_time;
VAR stringdig dig_mod_time;
...
num_file_time := FileTime(file_path, \ModifyTime,
\StrDig:=dig_file_time);
num_mod_time := ModTime(mod_name,\StrDig:=dig_mod_time);
IF StrDigCmp(dig_file_time, GT, dig_mod_time) THEN
! Load the new program module
ENDIF
Both FileTime and ModTime returns number of seconds since 00:00:00 GMT jan 1
1970 which cannot be represented with exact representation in a num variable. Because of
this limitation, function StrDigCmp and data type stringdig are used.
In variable dig_file_time , the last modified time of the module file on disk is stored. In
variable dig_mod_time , the last modify time of the file for the same module before it was
loaded into the program memory in the controller is stored. Compare of the two digit strings,
show that the module on the disk is newer, so it should be loaded into the program memory.
Return value
Data type: bool
TRUE if the given condition is met, FALSE if not.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 993
|
2 Functions
2.119. StrDigCalc - Arithmetic operations with datatype stringdig
RobotWare - OS
3HAC 16581-1 Revision: J
990
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
StrDigCalc‘(‘
[ StrDig1 ‘:=’ ] < expression ( IN ) of stringdig > ’,’
[ Operation‘ :=’ ] < expression ( IN ) of opcalc > ‘,’
[ StrDig2‘ :=’ ] < expression ( IN ) of stringdig > ‘)‘
A function with a return value of the data type stringdig .
Related information
For information about
See
Strings with only digits.
stringdig - String with only digits on page 1197
Arithmetic operators.
opcalc - Arithmetic Operator on page 1148
Continued
2 Functions
2.120. StrDigCmp - Compare two strings with only digits
RobotWare - OS
991
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.120. StrDigCmp - Compare two strings with only digits
Usage
StrDigCmp is used to compare two positive digit strings in the same way as numeric compare
of positive integers.
This function can handle positive integers above 8 388 608 with exact representation.
Basic examples
Basic examples of the function StrDigCmp are illustrated below.
Example 1
VAR stringdig digits1 := "1234";
VAR stringdig digits2 := "1256";
VAR bool is_equal;
is_equal := StrDigCmp(digits1, EQ, digits2);
The variable is_equal will be set to FALSE , because the numeric value 1234 is not equal to
1256 .
Example 2
CONST string file_path := "...";
CONST string mod_name := "...";
VAR num num_file_time:
VAR stringdig dig_file_time;
VAR num num_mod_time;
VAR stringdig dig_mod_time;
...
num_file_time := FileTime(file_path, \ModifyTime,
\StrDig:=dig_file_time);
num_mod_time := ModTime(mod_name,\StrDig:=dig_mod_time);
IF StrDigCmp(dig_file_time, GT, dig_mod_time) THEN
! Load the new program module
ENDIF
Both FileTime and ModTime returns number of seconds since 00:00:00 GMT jan 1
1970 which cannot be represented with exact representation in a num variable. Because of
this limitation, function StrDigCmp and data type stringdig are used.
In variable dig_file_time , the last modified time of the module file on disk is stored. In
variable dig_mod_time , the last modify time of the file for the same module before it was
loaded into the program memory in the controller is stored. Compare of the two digit strings,
show that the module on the disk is newer, so it should be loaded into the program memory.
Return value
Data type: bool
TRUE if the given condition is met, FALSE if not.
Continues on next page
2 Functions
2.120. StrDigCmp - Compare two strings with only digits
RobotWare - OS
3HAC 16581-1 Revision: J
992
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
StrDigCmp (StrDig1 Relation StrDig2)
StrDig1
String Digit 1
Data type: stringdig
The first string with only digits to be numerical compared.
Relation
Data type: opnum
Defines how to compare the two digit strings. Following predefined constants of data type
opnum can be used LT, LTEQ, EQ, NOTEQ, GTEQ or GT .
StrDig2
String Digit 2
Data type: stringdig
The second string with only digits to be numerical compared.
Program execution
This function will:
•
Check that only digits 0...9 are used in StrDig1 and StrDig2
•
Convert the two digital strings to long integers
•
Numerically compare the two long integers
Error handling
The following errors can be handled in a Rapid error handler.
Limitations
StrDigCmp only accepts strings that contain digits (characters 0...9). All other characters in
stringdig will result in error.
This function can only handle positive integers up to 4 294 967 295.
Syntax
StrDigCmp‘(‘
[ StrDig1 ‘:=’ ] < expression ( IN ) of stringdig > ’,’
[ Relation‘ :=’ ] < expression ( IN ) of opnum > ‘,’
[ StrDig2‘ :=’ ] < expression ( IN ) of stringdig > ‘)‘
A function with a return value of the data type bool .
Error code
Description
ERR_INT_NOTVAL
Input values not only digits
ERR_INT_MAXVAL
Value above 4294967295
Continued
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 994
|
2 Functions
2.120. StrDigCmp - Compare two strings with only digits
RobotWare - OS
991
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.120. StrDigCmp - Compare two strings with only digits
Usage
StrDigCmp is used to compare two positive digit strings in the same way as numeric compare
of positive integers.
This function can handle positive integers above 8 388 608 with exact representation.
Basic examples
Basic examples of the function StrDigCmp are illustrated below.
Example 1
VAR stringdig digits1 := "1234";
VAR stringdig digits2 := "1256";
VAR bool is_equal;
is_equal := StrDigCmp(digits1, EQ, digits2);
The variable is_equal will be set to FALSE , because the numeric value 1234 is not equal to
1256 .
Example 2
CONST string file_path := "...";
CONST string mod_name := "...";
VAR num num_file_time:
VAR stringdig dig_file_time;
VAR num num_mod_time;
VAR stringdig dig_mod_time;
...
num_file_time := FileTime(file_path, \ModifyTime,
\StrDig:=dig_file_time);
num_mod_time := ModTime(mod_name,\StrDig:=dig_mod_time);
IF StrDigCmp(dig_file_time, GT, dig_mod_time) THEN
! Load the new program module
ENDIF
Both FileTime and ModTime returns number of seconds since 00:00:00 GMT jan 1
1970 which cannot be represented with exact representation in a num variable. Because of
this limitation, function StrDigCmp and data type stringdig are used.
In variable dig_file_time , the last modified time of the module file on disk is stored. In
variable dig_mod_time , the last modify time of the file for the same module before it was
loaded into the program memory in the controller is stored. Compare of the two digit strings,
show that the module on the disk is newer, so it should be loaded into the program memory.
Return value
Data type: bool
TRUE if the given condition is met, FALSE if not.
Continues on next page
2 Functions
2.120. StrDigCmp - Compare two strings with only digits
RobotWare - OS
3HAC 16581-1 Revision: J
992
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
StrDigCmp (StrDig1 Relation StrDig2)
StrDig1
String Digit 1
Data type: stringdig
The first string with only digits to be numerical compared.
Relation
Data type: opnum
Defines how to compare the two digit strings. Following predefined constants of data type
opnum can be used LT, LTEQ, EQ, NOTEQ, GTEQ or GT .
StrDig2
String Digit 2
Data type: stringdig
The second string with only digits to be numerical compared.
Program execution
This function will:
•
Check that only digits 0...9 are used in StrDig1 and StrDig2
•
Convert the two digital strings to long integers
•
Numerically compare the two long integers
Error handling
The following errors can be handled in a Rapid error handler.
Limitations
StrDigCmp only accepts strings that contain digits (characters 0...9). All other characters in
stringdig will result in error.
This function can only handle positive integers up to 4 294 967 295.
Syntax
StrDigCmp‘(‘
[ StrDig1 ‘:=’ ] < expression ( IN ) of stringdig > ’,’
[ Relation‘ :=’ ] < expression ( IN ) of opnum > ‘,’
[ StrDig2‘ :=’ ] < expression ( IN ) of stringdig > ‘)‘
A function with a return value of the data type bool .
Error code
Description
ERR_INT_NOTVAL
Input values not only digits
ERR_INT_MAXVAL
Value above 4294967295
Continued
Continues on next page
2 Functions
2.120. StrDigCmp - Compare two strings with only digits
RobotWare - OS
993
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
String with only digits
stringdig - String with only digits on page 1197
Comparison operators
opnum - Comparison operator on page 1149
File time information
FileTime - Retrieve time information about a
file on page 845
File modify time of the loaded module
ModTime - Get file modify time for the loaded
module on page 896
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 995
|
2 Functions
2.120. StrDigCmp - Compare two strings with only digits
RobotWare - OS
3HAC 16581-1 Revision: J
992
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
StrDigCmp (StrDig1 Relation StrDig2)
StrDig1
String Digit 1
Data type: stringdig
The first string with only digits to be numerical compared.
Relation
Data type: opnum
Defines how to compare the two digit strings. Following predefined constants of data type
opnum can be used LT, LTEQ, EQ, NOTEQ, GTEQ or GT .
StrDig2
String Digit 2
Data type: stringdig
The second string with only digits to be numerical compared.
Program execution
This function will:
•
Check that only digits 0...9 are used in StrDig1 and StrDig2
•
Convert the two digital strings to long integers
•
Numerically compare the two long integers
Error handling
The following errors can be handled in a Rapid error handler.
Limitations
StrDigCmp only accepts strings that contain digits (characters 0...9). All other characters in
stringdig will result in error.
This function can only handle positive integers up to 4 294 967 295.
Syntax
StrDigCmp‘(‘
[ StrDig1 ‘:=’ ] < expression ( IN ) of stringdig > ’,’
[ Relation‘ :=’ ] < expression ( IN ) of opnum > ‘,’
[ StrDig2‘ :=’ ] < expression ( IN ) of stringdig > ‘)‘
A function with a return value of the data type bool .
Error code
Description
ERR_INT_NOTVAL
Input values not only digits
ERR_INT_MAXVAL
Value above 4294967295
Continued
Continues on next page
2 Functions
2.120. StrDigCmp - Compare two strings with only digits
RobotWare - OS
993
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
String with only digits
stringdig - String with only digits on page 1197
Comparison operators
opnum - Comparison operator on page 1149
File time information
FileTime - Retrieve time information about a
file on page 845
File modify time of the loaded module
ModTime - Get file modify time for the loaded
module on page 896
Continued
2 Functions
2.121. StrFind - Searches for a character in a string
RobotWare - OS
3HAC 16581-1 Revision: J
994
© Copyright 2004-2010 ABB. All rights reserved.
2.121. StrFind - Searches for a character in a string
Usage
StrFind ( String Find ) is used to search in a string, starting at a specified position, for a
character that belongs to a specified set of characters.
Basic examples
Basic examples of the function StrFind are illustrated below.
Example 1
VAR num found;
found := StrFind("Robotics",1,"aeiou");
The variable found is given the value 2.
found := StrFind("Robotics",1,"aeiou"\NotInSet);
The variable found is given the value 1
found := StrFind("IRB 6400",1,STR_DIGIT);
The variable found is given the value 5.
found := StrFind("IRB 6400",1,STR_WHITE);
The variable found is given the value 4 .
Return value
Data type: num
The character position of the first character at or past the specified position that belongs to the
specified set. If no such character is found, string length +1 is returned.
Arguments
StrFind (Str ChPos Set [\NotInSet])
Str
String
Data type: string
The string to search in.
ChPos
Character Position
Data type: num
Start character position. A runtime error is generated if the position is outside the string.
Set
Data type: string
Set of characters to test against. See also Predefined data on page 995 .
[\NotInSet]
Data type: switch
Search for a character not in the set of characters presented in Set .
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 996
|
2 Functions
2.120. StrDigCmp - Compare two strings with only digits
RobotWare - OS
993
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
String with only digits
stringdig - String with only digits on page 1197
Comparison operators
opnum - Comparison operator on page 1149
File time information
FileTime - Retrieve time information about a
file on page 845
File modify time of the loaded module
ModTime - Get file modify time for the loaded
module on page 896
Continued
2 Functions
2.121. StrFind - Searches for a character in a string
RobotWare - OS
3HAC 16581-1 Revision: J
994
© Copyright 2004-2010 ABB. All rights reserved.
2.121. StrFind - Searches for a character in a string
Usage
StrFind ( String Find ) is used to search in a string, starting at a specified position, for a
character that belongs to a specified set of characters.
Basic examples
Basic examples of the function StrFind are illustrated below.
Example 1
VAR num found;
found := StrFind("Robotics",1,"aeiou");
The variable found is given the value 2.
found := StrFind("Robotics",1,"aeiou"\NotInSet);
The variable found is given the value 1
found := StrFind("IRB 6400",1,STR_DIGIT);
The variable found is given the value 5.
found := StrFind("IRB 6400",1,STR_WHITE);
The variable found is given the value 4 .
Return value
Data type: num
The character position of the first character at or past the specified position that belongs to the
specified set. If no such character is found, string length +1 is returned.
Arguments
StrFind (Str ChPos Set [\NotInSet])
Str
String
Data type: string
The string to search in.
ChPos
Character Position
Data type: num
Start character position. A runtime error is generated if the position is outside the string.
Set
Data type: string
Set of characters to test against. See also Predefined data on page 995 .
[\NotInSet]
Data type: switch
Search for a character not in the set of characters presented in Set .
Continues on next page
2 Functions
2.121. StrFind - Searches for a character in a string
RobotWare - OS
995
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
StrFind’(’
[ Str ’:=’ ] <expression ( IN ) of string> ’,’
[ ChPos ’:=’ ] <expression ( IN ) of num> ’,’
[ Set ’:=’ ] <expression ( IN ) of string>
[’\’NotInSet ]
’)’
A function with a return value of the data type num .
Predefined data
A number of predefined string constants are available in the system and can be used together
with string functions.
Related information
Name
Character set
STR_DIGIT
<digit> ::=
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
STR_UPPER
<upper case 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 | À | Á | Â | Ã
| Ä | Å | Æ | Ç | È | É | Ê | Ë | Ì | Í
| Î | Ï | 1)| Ñ | Ò | Ó | Ô | Õ | Ö | Ø
| Ù | Ú | Û | Ü | 2) | 3)
STR_LOWER
<lower case 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 | à | á | â | ã
| ä | å | æ | ç | è | é | ê | ë | ì | í
| î | ï | 1) | ñ | ò | ó | ô | õ | ö | ø
| ù | ú | û | ü | 2) | 3) | ß | ÿ-
STR_WHITE
<blank character> ::=
For information about
See
String functions
Technical reference manual - RAPID overview ,
section RAPID summary - String functions
Definition of string
string - Strings on page 1195
String values
Technical reference manual - RAPID overview ,
section Basic characteristics - Basic elements
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 997
|
2 Functions
2.121. StrFind - Searches for a character in a string
RobotWare - OS
3HAC 16581-1 Revision: J
994
© Copyright 2004-2010 ABB. All rights reserved.
2.121. StrFind - Searches for a character in a string
Usage
StrFind ( String Find ) is used to search in a string, starting at a specified position, for a
character that belongs to a specified set of characters.
Basic examples
Basic examples of the function StrFind are illustrated below.
Example 1
VAR num found;
found := StrFind("Robotics",1,"aeiou");
The variable found is given the value 2.
found := StrFind("Robotics",1,"aeiou"\NotInSet);
The variable found is given the value 1
found := StrFind("IRB 6400",1,STR_DIGIT);
The variable found is given the value 5.
found := StrFind("IRB 6400",1,STR_WHITE);
The variable found is given the value 4 .
Return value
Data type: num
The character position of the first character at or past the specified position that belongs to the
specified set. If no such character is found, string length +1 is returned.
Arguments
StrFind (Str ChPos Set [\NotInSet])
Str
String
Data type: string
The string to search in.
ChPos
Character Position
Data type: num
Start character position. A runtime error is generated if the position is outside the string.
Set
Data type: string
Set of characters to test against. See also Predefined data on page 995 .
[\NotInSet]
Data type: switch
Search for a character not in the set of characters presented in Set .
Continues on next page
2 Functions
2.121. StrFind - Searches for a character in a string
RobotWare - OS
995
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
StrFind’(’
[ Str ’:=’ ] <expression ( IN ) of string> ’,’
[ ChPos ’:=’ ] <expression ( IN ) of num> ’,’
[ Set ’:=’ ] <expression ( IN ) of string>
[’\’NotInSet ]
’)’
A function with a return value of the data type num .
Predefined data
A number of predefined string constants are available in the system and can be used together
with string functions.
Related information
Name
Character set
STR_DIGIT
<digit> ::=
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
STR_UPPER
<upper case 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 | À | Á | Â | Ã
| Ä | Å | Æ | Ç | È | É | Ê | Ë | Ì | Í
| Î | Ï | 1)| Ñ | Ò | Ó | Ô | Õ | Ö | Ø
| Ù | Ú | Û | Ü | 2) | 3)
STR_LOWER
<lower case 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 | à | á | â | ã
| ä | å | æ | ç | è | é | ê | ë | ì | í
| î | ï | 1) | ñ | ò | ó | ô | õ | ö | ø
| ù | ú | û | ü | 2) | 3) | ß | ÿ-
STR_WHITE
<blank character> ::=
For information about
See
String functions
Technical reference manual - RAPID overview ,
section RAPID summary - String functions
Definition of string
string - Strings on page 1195
String values
Technical reference manual - RAPID overview ,
section Basic characteristics - Basic elements
Continued
2 Functions
2.122. StrLen - Gets the string length
RobotWare - OS
3HAC 16581-1 Revision: J
996
© Copyright 2004-2010 ABB. All rights reserved.
2.122. StrLen - Gets the string length
Usage
StrLen ( String Length ) is used to find the current length of a string.
Basic examples
Basic examples of the function StrLen are illustrated below.
Example 1
VAR num len;
len := StrLen("Robotics");
The variable len is given the value 8 .
Return value
Data type: num
The number of characters in the string (>=0).
Arguments
StrLen (Str)
Str
String
Data type: string
The string in which the number of characters is to be counted.
Syntax
StrLen’(’
[ Str ’:=’ ] <expression ( IN ) of string>’ )’
A function with a return value of the data type num .
Related information
For information about
See
String functions
Technical reference manual - RAPID Instruc-
tions, Functions and Data types , section
RAPID summary - String Functions
Definition of string
string - Strings on page 1195
String values
Technical reference manual - RAPID Instruc-
tions, Functions and Data types , section Basic
characteristics - Basic elements
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 998
|
2 Functions
2.121. StrFind - Searches for a character in a string
RobotWare - OS
995
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
StrFind’(’
[ Str ’:=’ ] <expression ( IN ) of string> ’,’
[ ChPos ’:=’ ] <expression ( IN ) of num> ’,’
[ Set ’:=’ ] <expression ( IN ) of string>
[’\’NotInSet ]
’)’
A function with a return value of the data type num .
Predefined data
A number of predefined string constants are available in the system and can be used together
with string functions.
Related information
Name
Character set
STR_DIGIT
<digit> ::=
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
STR_UPPER
<upper case 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 | À | Á | Â | Ã
| Ä | Å | Æ | Ç | È | É | Ê | Ë | Ì | Í
| Î | Ï | 1)| Ñ | Ò | Ó | Ô | Õ | Ö | Ø
| Ù | Ú | Û | Ü | 2) | 3)
STR_LOWER
<lower case 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 | à | á | â | ã
| ä | å | æ | ç | è | é | ê | ë | ì | í
| î | ï | 1) | ñ | ò | ó | ô | õ | ö | ø
| ù | ú | û | ü | 2) | 3) | ß | ÿ-
STR_WHITE
<blank character> ::=
For information about
See
String functions
Technical reference manual - RAPID overview ,
section RAPID summary - String functions
Definition of string
string - Strings on page 1195
String values
Technical reference manual - RAPID overview ,
section Basic characteristics - Basic elements
Continued
2 Functions
2.122. StrLen - Gets the string length
RobotWare - OS
3HAC 16581-1 Revision: J
996
© Copyright 2004-2010 ABB. All rights reserved.
2.122. StrLen - Gets the string length
Usage
StrLen ( String Length ) is used to find the current length of a string.
Basic examples
Basic examples of the function StrLen are illustrated below.
Example 1
VAR num len;
len := StrLen("Robotics");
The variable len is given the value 8 .
Return value
Data type: num
The number of characters in the string (>=0).
Arguments
StrLen (Str)
Str
String
Data type: string
The string in which the number of characters is to be counted.
Syntax
StrLen’(’
[ Str ’:=’ ] <expression ( IN ) of string>’ )’
A function with a return value of the data type num .
Related information
For information about
See
String functions
Technical reference manual - RAPID Instruc-
tions, Functions and Data types , section
RAPID summary - String Functions
Definition of string
string - Strings on page 1195
String values
Technical reference manual - RAPID Instruc-
tions, Functions and Data types , section Basic
characteristics - Basic elements
2 Functions
2.123. StrMap - Maps a string
RobotWare - OS
997
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.123. StrMap - Maps a string
Usage
StrMap ( String Mapping ) is used to create a copy of a string in which all characters are
translated according to a specified mapping.
Basic examples
Basic examples of the function StrMap are illustrated below.
Example 1
VAR string str;
str := StrMap("Robotics","aeiou","AEIOU");
The variable str is given the value " RObOtIcs ".
Example 2
str := StrMap("Robotics",STR_LOWER, STR_UPPER);
The variable str is given the value " ROBOTICS ".
Return value
Data type: string
The string created by translating the characters in the specified string, as specified by the
"from" and "to" strings. Each character from the specified string that is found in the "from"
string is replaced by the character at the corresponding position in the "to" string. Characters
for which no mapping is defined are copied unchanged to the resulting string.
Arguments
StrMap ( Str FromMap ToMap)
Str
String
Data type: string
The string to translate.
FromMap
Data type: string
Index part of mapping. See also Predefined data on page 998 .
ToMap
Data type: string
Value part of mapping. See also Predefined data on page 998 .
Syntax
StrMap’(’
[ Str ’:=’ ] <expression ( IN ) of string> ´,´
[ FromMap’:=’ ] <expression ( IN ) of string> ´,´
[ ToMap’:=’ ] <expression ( IN ) of string>
’)’
A function with a return value of the data type string .
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 999
|
2 Functions
2.122. StrLen - Gets the string length
RobotWare - OS
3HAC 16581-1 Revision: J
996
© Copyright 2004-2010 ABB. All rights reserved.
2.122. StrLen - Gets the string length
Usage
StrLen ( String Length ) is used to find the current length of a string.
Basic examples
Basic examples of the function StrLen are illustrated below.
Example 1
VAR num len;
len := StrLen("Robotics");
The variable len is given the value 8 .
Return value
Data type: num
The number of characters in the string (>=0).
Arguments
StrLen (Str)
Str
String
Data type: string
The string in which the number of characters is to be counted.
Syntax
StrLen’(’
[ Str ’:=’ ] <expression ( IN ) of string>’ )’
A function with a return value of the data type num .
Related information
For information about
See
String functions
Technical reference manual - RAPID Instruc-
tions, Functions and Data types , section
RAPID summary - String Functions
Definition of string
string - Strings on page 1195
String values
Technical reference manual - RAPID Instruc-
tions, Functions and Data types , section Basic
characteristics - Basic elements
2 Functions
2.123. StrMap - Maps a string
RobotWare - OS
997
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.123. StrMap - Maps a string
Usage
StrMap ( String Mapping ) is used to create a copy of a string in which all characters are
translated according to a specified mapping.
Basic examples
Basic examples of the function StrMap are illustrated below.
Example 1
VAR string str;
str := StrMap("Robotics","aeiou","AEIOU");
The variable str is given the value " RObOtIcs ".
Example 2
str := StrMap("Robotics",STR_LOWER, STR_UPPER);
The variable str is given the value " ROBOTICS ".
Return value
Data type: string
The string created by translating the characters in the specified string, as specified by the
"from" and "to" strings. Each character from the specified string that is found in the "from"
string is replaced by the character at the corresponding position in the "to" string. Characters
for which no mapping is defined are copied unchanged to the resulting string.
Arguments
StrMap ( Str FromMap ToMap)
Str
String
Data type: string
The string to translate.
FromMap
Data type: string
Index part of mapping. See also Predefined data on page 998 .
ToMap
Data type: string
Value part of mapping. See also Predefined data on page 998 .
Syntax
StrMap’(’
[ Str ’:=’ ] <expression ( IN ) of string> ´,´
[ FromMap’:=’ ] <expression ( IN ) of string> ´,´
[ ToMap’:=’ ] <expression ( IN ) of string>
’)’
A function with a return value of the data type string .
Continues on next page
2 Functions
2.123. StrMap - Maps a string
RobotWare - OS
3HAC 16581-1 Revision: J
998
© Copyright 2004-2010 ABB. All rights reserved.
Predefined data
A number of predefined string constants are available in the system and can be used together
with string functions.
Related information
Name
Character set
STR_DIGIT
<digit> ::=
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
STR_UPPER
<upper case 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 | À | Á | Â | Ã
| Ä | Å | Æ | Ç | È | É | Ê | Ë | Ì | Í
| Î | Ï | 1)| Ñ | Ò | Ó | Ô | Õ | Ö | Ø
| Ù | Ú | Û | Ü | 2) | 3)
STR_LOWER
<lower case 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 | à | á | â | ã
| ä | å | æ | ç | è | é | ê | ë | ì | í
| î | ï | 1) | ñ | ò | ó | ô | õ | ö | ø
| ù | ú | û | ü | 2) | 3) | ß | ÿ-
STR_WHITE
<blank character> ::=
For information about
See
String functions
Technical reference manual - RAPID overview , section
RAPID summary - String functions
Definition of string
string - Strings on page 1195
String values
Technical reference manual - RAPID overview , section
Basic characteristics - Basic elements
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 1,000
|
2 Functions
2.123. StrMap - Maps a string
RobotWare - OS
997
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.123. StrMap - Maps a string
Usage
StrMap ( String Mapping ) is used to create a copy of a string in which all characters are
translated according to a specified mapping.
Basic examples
Basic examples of the function StrMap are illustrated below.
Example 1
VAR string str;
str := StrMap("Robotics","aeiou","AEIOU");
The variable str is given the value " RObOtIcs ".
Example 2
str := StrMap("Robotics",STR_LOWER, STR_UPPER);
The variable str is given the value " ROBOTICS ".
Return value
Data type: string
The string created by translating the characters in the specified string, as specified by the
"from" and "to" strings. Each character from the specified string that is found in the "from"
string is replaced by the character at the corresponding position in the "to" string. Characters
for which no mapping is defined are copied unchanged to the resulting string.
Arguments
StrMap ( Str FromMap ToMap)
Str
String
Data type: string
The string to translate.
FromMap
Data type: string
Index part of mapping. See also Predefined data on page 998 .
ToMap
Data type: string
Value part of mapping. See also Predefined data on page 998 .
Syntax
StrMap’(’
[ Str ’:=’ ] <expression ( IN ) of string> ´,´
[ FromMap’:=’ ] <expression ( IN ) of string> ´,´
[ ToMap’:=’ ] <expression ( IN ) of string>
’)’
A function with a return value of the data type string .
Continues on next page
2 Functions
2.123. StrMap - Maps a string
RobotWare - OS
3HAC 16581-1 Revision: J
998
© Copyright 2004-2010 ABB. All rights reserved.
Predefined data
A number of predefined string constants are available in the system and can be used together
with string functions.
Related information
Name
Character set
STR_DIGIT
<digit> ::=
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
STR_UPPER
<upper case 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 | À | Á | Â | Ã
| Ä | Å | Æ | Ç | È | É | Ê | Ë | Ì | Í
| Î | Ï | 1)| Ñ | Ò | Ó | Ô | Õ | Ö | Ø
| Ù | Ú | Û | Ü | 2) | 3)
STR_LOWER
<lower case 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 | à | á | â | ã
| ä | å | æ | ç | è | é | ê | ë | ì | í
| î | ï | 1) | ñ | ò | ó | ô | õ | ö | ø
| ù | ú | û | ü | 2) | 3) | ß | ÿ-
STR_WHITE
<blank character> ::=
For information about
See
String functions
Technical reference manual - RAPID overview , section
RAPID summary - String functions
Definition of string
string - Strings on page 1195
String values
Technical reference manual - RAPID overview , section
Basic characteristics - Basic elements
Continued
2 Functions
2.124. StrMatch - Search for pattern in string
RobotWare - OS
999
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.124. StrMatch - Search for pattern in string
Usage
StrMatch ( String Match ) is used to search in a string, starting at a specified position, for a
specified pattern.
Basic examples
Basic examples of the function StrMatch are illustrated below.
Example 1
VAR num found;
found := StrMatch("Robotics",1,"bo");
The variable found is given the value 3 .
Return value
Data type: num
The character position of the first substring, at or past the specified position, that is equal to
the specified pattern string. If no such substring is found, string length +1 is returned.
Arguments
StrMatch (Str ChPos Pattern)
Str
String
Data type: string
The string to search in.
ChPos
Character Position
Data type: num
Start character position. A runtime error is generated if the position is outside the string.
Pattern
Data type: string
Pattern string to search for.
Syntax
StrMatch’(’
[ Str ’:=’ ] <expression ( IN ) of string>´,´
[ ChPos ’:=’ ] <expression ( IN ) of num> ´,´
[ Pattern’:=’ ] <expression ( IN ) of string>
´)´
A function with a return value of the data type num .
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 1,001
|
2 Functions
2.123. StrMap - Maps a string
RobotWare - OS
3HAC 16581-1 Revision: J
998
© Copyright 2004-2010 ABB. All rights reserved.
Predefined data
A number of predefined string constants are available in the system and can be used together
with string functions.
Related information
Name
Character set
STR_DIGIT
<digit> ::=
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
STR_UPPER
<upper case 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 | À | Á | Â | Ã
| Ä | Å | Æ | Ç | È | É | Ê | Ë | Ì | Í
| Î | Ï | 1)| Ñ | Ò | Ó | Ô | Õ | Ö | Ø
| Ù | Ú | Û | Ü | 2) | 3)
STR_LOWER
<lower case 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 | à | á | â | ã
| ä | å | æ | ç | è | é | ê | ë | ì | í
| î | ï | 1) | ñ | ò | ó | ô | õ | ö | ø
| ù | ú | û | ü | 2) | 3) | ß | ÿ-
STR_WHITE
<blank character> ::=
For information about
See
String functions
Technical reference manual - RAPID overview , section
RAPID summary - String functions
Definition of string
string - Strings on page 1195
String values
Technical reference manual - RAPID overview , section
Basic characteristics - Basic elements
Continued
2 Functions
2.124. StrMatch - Search for pattern in string
RobotWare - OS
999
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.124. StrMatch - Search for pattern in string
Usage
StrMatch ( String Match ) is used to search in a string, starting at a specified position, for a
specified pattern.
Basic examples
Basic examples of the function StrMatch are illustrated below.
Example 1
VAR num found;
found := StrMatch("Robotics",1,"bo");
The variable found is given the value 3 .
Return value
Data type: num
The character position of the first substring, at or past the specified position, that is equal to
the specified pattern string. If no such substring is found, string length +1 is returned.
Arguments
StrMatch (Str ChPos Pattern)
Str
String
Data type: string
The string to search in.
ChPos
Character Position
Data type: num
Start character position. A runtime error is generated if the position is outside the string.
Pattern
Data type: string
Pattern string to search for.
Syntax
StrMatch’(’
[ Str ’:=’ ] <expression ( IN ) of string>´,´
[ ChPos ’:=’ ] <expression ( IN ) of num> ´,´
[ Pattern’:=’ ] <expression ( IN ) of string>
´)´
A function with a return value of the data type num .
Continues on next page
2 Functions
2.124. StrMatch - Search for pattern in string
RobotWare - OS
3HAC 16581-1 Revision: J
1000
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
String functions
Technical reference manual - RAPID overview , section
RAPID summary - String functions
Definition of string
string - Strings on page 1195
String values
Technical reference manual - RAPID overview , section
Basic characteristics - Basic elements
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 1,002
|
2 Functions
2.124. StrMatch - Search for pattern in string
RobotWare - OS
999
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.124. StrMatch - Search for pattern in string
Usage
StrMatch ( String Match ) is used to search in a string, starting at a specified position, for a
specified pattern.
Basic examples
Basic examples of the function StrMatch are illustrated below.
Example 1
VAR num found;
found := StrMatch("Robotics",1,"bo");
The variable found is given the value 3 .
Return value
Data type: num
The character position of the first substring, at or past the specified position, that is equal to
the specified pattern string. If no such substring is found, string length +1 is returned.
Arguments
StrMatch (Str ChPos Pattern)
Str
String
Data type: string
The string to search in.
ChPos
Character Position
Data type: num
Start character position. A runtime error is generated if the position is outside the string.
Pattern
Data type: string
Pattern string to search for.
Syntax
StrMatch’(’
[ Str ’:=’ ] <expression ( IN ) of string>´,´
[ ChPos ’:=’ ] <expression ( IN ) of num> ´,´
[ Pattern’:=’ ] <expression ( IN ) of string>
´)´
A function with a return value of the data type num .
Continues on next page
2 Functions
2.124. StrMatch - Search for pattern in string
RobotWare - OS
3HAC 16581-1 Revision: J
1000
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
String functions
Technical reference manual - RAPID overview , section
RAPID summary - String functions
Definition of string
string - Strings on page 1195
String values
Technical reference manual - RAPID overview , section
Basic characteristics - Basic elements
Continued
2 Functions
2.125. StrMemb - Checks if a character belongs to a set
RobotWare - OS
1001
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.125. StrMemb - Checks if a character belongs to a set
Usage
StrMemb ( String Member ) is used to check whether a specified character in a string belongs
to a specified set of characters.
Basic examples
Basic examples of the function StrMemb are illustrated below.
Example 1
VAR bool memb;
memb := StrMemb("Robotics",2,"aeiou");
The variable memb is given the value TRUE , as o is a member of the set "aeiou" .
memb := StrMemb("Robotics",3,"aeiou");
The variable memb is given the value FALSE , as b is not a member of the set "aeiou" .
memb := StrMemb("S-721 68 VÄSTERÅS",3,STR_DIGIT);
The variable memb is given the value TRUE , as 7 is a member of the set STR_DIGIT .
Return value
Data type: bool
TRUE if the character at the specified position in the specified string belongs to the specified
set of characters.
Arguments
StrMemb (Str ChPos Set)
Str
String
Data type: string
The string to check in.
ChPos
Character Position
Data type: num
The character position to check. A runtime error is generated if the position is outside the
string.
Set
Data type: string
Set of characters to test against.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 1,003
|
2 Functions
2.124. StrMatch - Search for pattern in string
RobotWare - OS
3HAC 16581-1 Revision: J
1000
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
String functions
Technical reference manual - RAPID overview , section
RAPID summary - String functions
Definition of string
string - Strings on page 1195
String values
Technical reference manual - RAPID overview , section
Basic characteristics - Basic elements
Continued
2 Functions
2.125. StrMemb - Checks if a character belongs to a set
RobotWare - OS
1001
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.125. StrMemb - Checks if a character belongs to a set
Usage
StrMemb ( String Member ) is used to check whether a specified character in a string belongs
to a specified set of characters.
Basic examples
Basic examples of the function StrMemb are illustrated below.
Example 1
VAR bool memb;
memb := StrMemb("Robotics",2,"aeiou");
The variable memb is given the value TRUE , as o is a member of the set "aeiou" .
memb := StrMemb("Robotics",3,"aeiou");
The variable memb is given the value FALSE , as b is not a member of the set "aeiou" .
memb := StrMemb("S-721 68 VÄSTERÅS",3,STR_DIGIT);
The variable memb is given the value TRUE , as 7 is a member of the set STR_DIGIT .
Return value
Data type: bool
TRUE if the character at the specified position in the specified string belongs to the specified
set of characters.
Arguments
StrMemb (Str ChPos Set)
Str
String
Data type: string
The string to check in.
ChPos
Character Position
Data type: num
The character position to check. A runtime error is generated if the position is outside the
string.
Set
Data type: string
Set of characters to test against.
Continues on next page
2 Functions
2.125. StrMemb - Checks if a character belongs to a set
RobotWare - OS
3HAC 16581-1 Revision: J
1002
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
StrMemb’(’
[ Str ’:=’ ] <expression ( IN ) of string> ’,’
[ ChPos ’:=’ ] <expression ( IN ) of num> ’,’
[ Set ’:=’ ] <expression ( IN ) of string>
’)’
A function with a return value of the data type bool .
Predefined data
A number of predefined string constants are available in the system and can be used together
with string functions.
Related information
Name
Character set
STR_DIGIT
<digit> ::=
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
STR_UPPER
<upper case 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 | À | Á | Â | Ã
| Î | Ï | 1)| Ñ | Ò | Ó | Ô | Õ | Ö | Ø
| Ù | Ú | Û | Ü | 2) | 3)
STR_LOWER
<lower case 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 | à | á | â | ã
| ä | å | æ | ç | è | é | ê | ë | ì | í
| î | ï | 1) | ñ | ò | ó | ô | õ | ö | ø
| ù | ú | û | ü | 2) | 3) | ß | ÿ-
STR_WHITE
<blank character> ::=
For information about
See
String functions
Technical reference manual - RAPID overview , section
RAPID Summary - String Functions
Definition of string
string - Strings on page 1195
String values
Technical reference manual - RAPID overview , section
Basic characteristics - Basic elements
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 1,004
|
2 Functions
2.125. StrMemb - Checks if a character belongs to a set
RobotWare - OS
1001
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.125. StrMemb - Checks if a character belongs to a set
Usage
StrMemb ( String Member ) is used to check whether a specified character in a string belongs
to a specified set of characters.
Basic examples
Basic examples of the function StrMemb are illustrated below.
Example 1
VAR bool memb;
memb := StrMemb("Robotics",2,"aeiou");
The variable memb is given the value TRUE , as o is a member of the set "aeiou" .
memb := StrMemb("Robotics",3,"aeiou");
The variable memb is given the value FALSE , as b is not a member of the set "aeiou" .
memb := StrMemb("S-721 68 VÄSTERÅS",3,STR_DIGIT);
The variable memb is given the value TRUE , as 7 is a member of the set STR_DIGIT .
Return value
Data type: bool
TRUE if the character at the specified position in the specified string belongs to the specified
set of characters.
Arguments
StrMemb (Str ChPos Set)
Str
String
Data type: string
The string to check in.
ChPos
Character Position
Data type: num
The character position to check. A runtime error is generated if the position is outside the
string.
Set
Data type: string
Set of characters to test against.
Continues on next page
2 Functions
2.125. StrMemb - Checks if a character belongs to a set
RobotWare - OS
3HAC 16581-1 Revision: J
1002
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
StrMemb’(’
[ Str ’:=’ ] <expression ( IN ) of string> ’,’
[ ChPos ’:=’ ] <expression ( IN ) of num> ’,’
[ Set ’:=’ ] <expression ( IN ) of string>
’)’
A function with a return value of the data type bool .
Predefined data
A number of predefined string constants are available in the system and can be used together
with string functions.
Related information
Name
Character set
STR_DIGIT
<digit> ::=
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
STR_UPPER
<upper case 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 | À | Á | Â | Ã
| Î | Ï | 1)| Ñ | Ò | Ó | Ô | Õ | Ö | Ø
| Ù | Ú | Û | Ü | 2) | 3)
STR_LOWER
<lower case 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 | à | á | â | ã
| ä | å | æ | ç | è | é | ê | ë | ì | í
| î | ï | 1) | ñ | ò | ó | ô | õ | ö | ø
| ù | ú | û | ü | 2) | 3) | ß | ÿ-
STR_WHITE
<blank character> ::=
For information about
See
String functions
Technical reference manual - RAPID overview , section
RAPID Summary - String Functions
Definition of string
string - Strings on page 1195
String values
Technical reference manual - RAPID overview , section
Basic characteristics - Basic elements
Continued
2 Functions
2.126. StrOrder - Checks if strings are ordered
RobotWare - OS
1003
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.126. StrOrder - Checks if strings are ordered
Usage
StrOrder ( String Order ) compares two strings (character by character ) and returns a
boolean indicating whether the two strings are in order according to a specified character
ordering sequence.
Basic examples
Basic examples of the function StrOrder are illustrated below.
Example 1
VAR bool le;
le := StrOrder("FIRST","SECOND",STR_UPPER);
The variable le is given the value TRUE , because " F " comes before " S " in the character
ordering sequence STR_UPPER .
Example 2
VAR bool le;
le := StrOrder("FIRST","FIRSTB",STR_UPPER);
The variable le is given the value TRUE , because Str2 "FIRSTB" has an additional
character in the character ordering sequence (no character compared to "B" ).
Example 3
VAR bool le;
le := StrOrder("FIRSTB","FIRST",STR_UPPER);
The variable le is given the value FALSE , because Str1 "FIRSTB" has an additional
character in the character ordering sequence ( "B" compared to no character).
Return value
Data type: bool
TRUE if the first string comes before the second string ( Str1 <= Str2 ) when characters are
ordered as specified.
Characters that are not included in the defined ordering are all assumed to follow the present
ones.
Arguments
StrOrder ( Str1 Str2 Order)
Str1
String 1
Data type: string
First string value.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 1,005
|
2 Functions
2.125. StrMemb - Checks if a character belongs to a set
RobotWare - OS
3HAC 16581-1 Revision: J
1002
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
StrMemb’(’
[ Str ’:=’ ] <expression ( IN ) of string> ’,’
[ ChPos ’:=’ ] <expression ( IN ) of num> ’,’
[ Set ’:=’ ] <expression ( IN ) of string>
’)’
A function with a return value of the data type bool .
Predefined data
A number of predefined string constants are available in the system and can be used together
with string functions.
Related information
Name
Character set
STR_DIGIT
<digit> ::=
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
STR_UPPER
<upper case 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 | À | Á | Â | Ã
| Î | Ï | 1)| Ñ | Ò | Ó | Ô | Õ | Ö | Ø
| Ù | Ú | Û | Ü | 2) | 3)
STR_LOWER
<lower case 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 | à | á | â | ã
| ä | å | æ | ç | è | é | ê | ë | ì | í
| î | ï | 1) | ñ | ò | ó | ô | õ | ö | ø
| ù | ú | û | ü | 2) | 3) | ß | ÿ-
STR_WHITE
<blank character> ::=
For information about
See
String functions
Technical reference manual - RAPID overview , section
RAPID Summary - String Functions
Definition of string
string - Strings on page 1195
String values
Technical reference manual - RAPID overview , section
Basic characteristics - Basic elements
Continued
2 Functions
2.126. StrOrder - Checks if strings are ordered
RobotWare - OS
1003
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.126. StrOrder - Checks if strings are ordered
Usage
StrOrder ( String Order ) compares two strings (character by character ) and returns a
boolean indicating whether the two strings are in order according to a specified character
ordering sequence.
Basic examples
Basic examples of the function StrOrder are illustrated below.
Example 1
VAR bool le;
le := StrOrder("FIRST","SECOND",STR_UPPER);
The variable le is given the value TRUE , because " F " comes before " S " in the character
ordering sequence STR_UPPER .
Example 2
VAR bool le;
le := StrOrder("FIRST","FIRSTB",STR_UPPER);
The variable le is given the value TRUE , because Str2 "FIRSTB" has an additional
character in the character ordering sequence (no character compared to "B" ).
Example 3
VAR bool le;
le := StrOrder("FIRSTB","FIRST",STR_UPPER);
The variable le is given the value FALSE , because Str1 "FIRSTB" has an additional
character in the character ordering sequence ( "B" compared to no character).
Return value
Data type: bool
TRUE if the first string comes before the second string ( Str1 <= Str2 ) when characters are
ordered as specified.
Characters that are not included in the defined ordering are all assumed to follow the present
ones.
Arguments
StrOrder ( Str1 Str2 Order)
Str1
String 1
Data type: string
First string value.
Continues on next page
2 Functions
2.126. StrOrder - Checks if strings are ordered
RobotWare - OS
3HAC 16581-1 Revision: J
1004
© Copyright 2004-2010 ABB. All rights reserved.
Str2
String 2
Data type: string
Second string value.
Order
Data type: string
Sequence of characters that define the ordering. See also Predefined data on page 1004 .
Syntax
StrOrder’(’
[ Str1 ’:=’ ] <expression ( IN ) of string> ´,´
[ Str2 ’:=’ ] <expression ( IN ) of string> ´,´
[ Order ’:=’ ] <expression ( IN ) of string>
’)’
A function with a return value of the data type bool .
Predefined data
A number of predefined string constants are available in the system and can be used together
with string functions.
Related information
Name
Character set
STR_DIGIT
<digit> ::=
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
STR_UPPER
<upper case 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 | À | Á | Â | Ã
| Ä | Å | Æ | Ç | È | É | Ê | Ë | Ì | Í
| Î | Ï | 1)| Ñ | Ò | Ó | Ô | Õ | Ö | Ø
| Ù | Ú | Û | Ü | 2) | 3)
STR_LOWER
<lower case 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 | à | á | â | ã
| ä | å | æ | ç | è | é | ê | ë | ì | í
| î | ï | 1) | ñ | ò | ó | ô | õ | ö | ø
| ù | ú | û | ü | 2) | 3) | ß | ÿ-
STR_WHITE
<blank character> ::=
For information about
See
String functions
Technical reference manual - RAPID overview , section
RAPID summary - String functions
Definition of string
string - Strings on page 1195
String values
Technical reference manual - RAPID overview , section
Basic characteristics - Basic elements
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 1,006
|
2 Functions
2.126. StrOrder - Checks if strings are ordered
RobotWare - OS
1003
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.126. StrOrder - Checks if strings are ordered
Usage
StrOrder ( String Order ) compares two strings (character by character ) and returns a
boolean indicating whether the two strings are in order according to a specified character
ordering sequence.
Basic examples
Basic examples of the function StrOrder are illustrated below.
Example 1
VAR bool le;
le := StrOrder("FIRST","SECOND",STR_UPPER);
The variable le is given the value TRUE , because " F " comes before " S " in the character
ordering sequence STR_UPPER .
Example 2
VAR bool le;
le := StrOrder("FIRST","FIRSTB",STR_UPPER);
The variable le is given the value TRUE , because Str2 "FIRSTB" has an additional
character in the character ordering sequence (no character compared to "B" ).
Example 3
VAR bool le;
le := StrOrder("FIRSTB","FIRST",STR_UPPER);
The variable le is given the value FALSE , because Str1 "FIRSTB" has an additional
character in the character ordering sequence ( "B" compared to no character).
Return value
Data type: bool
TRUE if the first string comes before the second string ( Str1 <= Str2 ) when characters are
ordered as specified.
Characters that are not included in the defined ordering are all assumed to follow the present
ones.
Arguments
StrOrder ( Str1 Str2 Order)
Str1
String 1
Data type: string
First string value.
Continues on next page
2 Functions
2.126. StrOrder - Checks if strings are ordered
RobotWare - OS
3HAC 16581-1 Revision: J
1004
© Copyright 2004-2010 ABB. All rights reserved.
Str2
String 2
Data type: string
Second string value.
Order
Data type: string
Sequence of characters that define the ordering. See also Predefined data on page 1004 .
Syntax
StrOrder’(’
[ Str1 ’:=’ ] <expression ( IN ) of string> ´,´
[ Str2 ’:=’ ] <expression ( IN ) of string> ´,´
[ Order ’:=’ ] <expression ( IN ) of string>
’)’
A function with a return value of the data type bool .
Predefined data
A number of predefined string constants are available in the system and can be used together
with string functions.
Related information
Name
Character set
STR_DIGIT
<digit> ::=
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
STR_UPPER
<upper case 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 | À | Á | Â | Ã
| Ä | Å | Æ | Ç | È | É | Ê | Ë | Ì | Í
| Î | Ï | 1)| Ñ | Ò | Ó | Ô | Õ | Ö | Ø
| Ù | Ú | Û | Ü | 2) | 3)
STR_LOWER
<lower case 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 | à | á | â | ã
| ä | å | æ | ç | è | é | ê | ë | ì | í
| î | ï | 1) | ñ | ò | ó | ô | õ | ö | ø
| ù | ú | û | ü | 2) | 3) | ß | ÿ-
STR_WHITE
<blank character> ::=
For information about
See
String functions
Technical reference manual - RAPID overview , section
RAPID summary - String functions
Definition of string
string - Strings on page 1195
String values
Technical reference manual - RAPID overview , section
Basic characteristics - Basic elements
Continued
2 Functions
2.127. StrPart - Finds a part of a string
RobotWare - OS
1005
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.127. StrPart - Finds a part of a string
Usage
StrPart ( String Part) is used to find a part of a string, as a new string.
Basic examples
Basic examples of the function StrPart are illustrated below.
Example 1
VAR string part;
part := StrPart("Robotics",1,5);
The variable part is given the value "Robot" .
Return value
Data type: string
The substring of the specified string which has the specified length and starts at the specified
character position.
Arguments
StrPart (Str ChPos Len)
Str
String
Data type: string
The string in which a part is to be found.
ChPos
Character Position
Start character position. A runtime error is generated if the position is outside the string.
Len
Length
Data type: num
Length of string part. A runtime error is generated if the length is negative or greater than the
length of the string, or if the substring is (partially) outside the string.
Syntax
StrPart’(’
[ Str ’:=’ ] <expression ( IN ) of string> ’,’
[ ChPos ’:=’ ] <expression ( IN ) of num> ’,’
[ Len ’:=’ ] <expression ( IN ) of num>
’)’
A function with a return value of the data type string .
Continues on next page
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.