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
| 307
|
1 Instructions
1.108. PathRecMoveBwd - Move path recorder backwards
Path Recovery
3HAC 16581-1 Revision: J
304
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
Movements using the path recorder cannot be performed on base level, i.e. StorePath has
to be executed prior to PathRecMoveBwd .
It is never possible to move backwards through a SynchMoveOff statement.
It is never possible to move backwards through a WaitSyncTask statement.
SyncMoveOn must be preceded by at least one independent movement if it is desired to move
back to the position where the synchronized movement started.
If it is not desired to return to the point where PathRecMoveBwd was executed (by executing
PathRecMoveFwd ) then the PathRecorder has to be stopped by the means of PathRecStop .
PathRecStop\Clear also clears the recorded path.
PathRecMoveBwd cannot be executed in a RAPID routine connected to any of the following
special system events: PowerOn, Stop, QStop, Restart, Reset or Step.
Syntax
PathRecMoveBwd
[ ´\’ ID ´:=’ < variable ( VAR ) of pathrecid > ]
[ ´\’ ToolOffs´:=’ <expression ( IN ) of pos> ]
[ ´\’ Speed‘:=’ <expression ( IN ) of speeddata> ]’;’
Related information
For information about
See
Path Recorder Identifier
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 for valid recorded path
PathRecValidBwd - Is there a valid backward
path recorded on page 921
PathRecValidFwd - Is there a valid forward path
recorded on page 924
Move path recorder forward
PathRecMoveFwd - Move path recorder forward
on page 305
Store - restore paths
StorePath - Stores the path when an interrupt
occurs on page 521
RestoPath - Restores the path after an interrupt
on page 362
Other positioning instructions
Technical reference manual - RAPID overview ,
section RAPID summary - Motion
Error Recovery
Technical reference manual - RAPID overview ,
section Basic characteristics - Error recovery
Continued
1 Instructions
1.109. PathRecMoveFwd - Move path recorder forward
PathRecovery
305
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.109. PathRecMoveFwd - Move path recorder forward
Usage
PathRecMoveFwd is used to move the robot back to the position where PathRecMoveBwd
was executed. It is also possible to move the robot partly forward by supplying an identifier
that has been passed during the backward movement.
Basic examples
Basic examples of how to use the instruction PathRecMoveFwd are illustrated below.
See also More examples on page 306 .
Example 1
PathRecMoveFwd;
The robot is moved back to the position where the path recorder started the backward
movement.
Arguments
PathRecMoveFwd [\ID] [\ToolOffs] [\Speed]
[\ID]
Identifier
Data type: pathrecid
Variable that specifies the ID position to move forward to. Data type pathrecid is a non-
value type only used as an identifier for naming the recording position.
If no ID position is specified then the forward movement will always be done to interrupt
position on the original path.
[\ToolOffs]
Tool Offset
Data type: pos
Provides clearance offset for TCP during motion. A cartesian coordinate is applied to the TCP
coordinates. This is useful when the robot runs a process adding material.
[\Speed]
Data type: speeddata
Speed overrides the original speed used during forward motion. Speeddata defines the
velocity for the tool center point, the tool reorientation, and the external axis. If present, this
speed will be used throughout the forward movement. If omitted, the forward motion will
execute with the speed in the original motion instructions.
Program execution
The path recorder is activated with the PathRecStart instruction. After the recorder has
been started the robot can be moved backwards along its executed path by executing
PathRecMoveBwd . The robot can thereafter be ordered back to the position where the
backward execution started by calling PathRecMoveFwd . It is also possible to move the
robot partly forward by supplying an identifier that has been passed during the backward
movement.
Continues on next page
1 Instructions
1.109. PathRecMoveFwd - Move path recorder forward
PathRecovery
3HAC 16581-1 Revision: J
306
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of how to use the instruction PathRecMoveFwd are illustrated below.
VAR pathrecid start_id;
VAR pathrecid mid_id;
CONST robtarget p1 := [...];
CONST robtarget p2 := [...];
CONST robtarget p3 := [...];
PathRecStart start_id;
MoveL p1, vmax, z50, tool1;
MoveL p2, vmax, z50, tool1;
PathRecStart mid_id;
MoveL p3, vmax, z50, tool1;
StorePath;
PathRecMoveBwd \ID:=start_id;
PathRecMoveFwd \ID:=mid_id;
PathRecMoveFwd;
RestoPath;
xx0500002133
The example above will start the path recorder and the starting point will be tagged with the
path identifier start_id . Thereafter the robot will move forward with traditional move
instructions and then move back to the path recorder identifier start_id using the recorded
path. Finally it will move forward again in two steps by the means of PathRecMoveFwd .
Limitations
Movements using the path recorder have to be performed on trap-level, i.e. StorePath must
execute prior to PathRecMoveFwd .
To be able to execute PathRecMoveFwd a PathRecMoveBwd must have been executed
before.
If it is not desired to return to the point where PathRecMoveBwd was executed (by executing
PathRecMoveFwd ) then the PathRecorder has to be stopped by the means of PathRecStop .
PathRecStop\Clear also clears recorded path.
PathRecMoveFwd cannot be executed in a RAPID routine connected to any of the following
special system events: PowerOn, Stop, QStop, Restart, Reset or Step.
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
| 308
|
1 Instructions
1.109. PathRecMoveFwd - Move path recorder forward
PathRecovery
305
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.109. PathRecMoveFwd - Move path recorder forward
Usage
PathRecMoveFwd is used to move the robot back to the position where PathRecMoveBwd
was executed. It is also possible to move the robot partly forward by supplying an identifier
that has been passed during the backward movement.
Basic examples
Basic examples of how to use the instruction PathRecMoveFwd are illustrated below.
See also More examples on page 306 .
Example 1
PathRecMoveFwd;
The robot is moved back to the position where the path recorder started the backward
movement.
Arguments
PathRecMoveFwd [\ID] [\ToolOffs] [\Speed]
[\ID]
Identifier
Data type: pathrecid
Variable that specifies the ID position to move forward to. Data type pathrecid is a non-
value type only used as an identifier for naming the recording position.
If no ID position is specified then the forward movement will always be done to interrupt
position on the original path.
[\ToolOffs]
Tool Offset
Data type: pos
Provides clearance offset for TCP during motion. A cartesian coordinate is applied to the TCP
coordinates. This is useful when the robot runs a process adding material.
[\Speed]
Data type: speeddata
Speed overrides the original speed used during forward motion. Speeddata defines the
velocity for the tool center point, the tool reorientation, and the external axis. If present, this
speed will be used throughout the forward movement. If omitted, the forward motion will
execute with the speed in the original motion instructions.
Program execution
The path recorder is activated with the PathRecStart instruction. After the recorder has
been started the robot can be moved backwards along its executed path by executing
PathRecMoveBwd . The robot can thereafter be ordered back to the position where the
backward execution started by calling PathRecMoveFwd . It is also possible to move the
robot partly forward by supplying an identifier that has been passed during the backward
movement.
Continues on next page
1 Instructions
1.109. PathRecMoveFwd - Move path recorder forward
PathRecovery
3HAC 16581-1 Revision: J
306
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of how to use the instruction PathRecMoveFwd are illustrated below.
VAR pathrecid start_id;
VAR pathrecid mid_id;
CONST robtarget p1 := [...];
CONST robtarget p2 := [...];
CONST robtarget p3 := [...];
PathRecStart start_id;
MoveL p1, vmax, z50, tool1;
MoveL p2, vmax, z50, tool1;
PathRecStart mid_id;
MoveL p3, vmax, z50, tool1;
StorePath;
PathRecMoveBwd \ID:=start_id;
PathRecMoveFwd \ID:=mid_id;
PathRecMoveFwd;
RestoPath;
xx0500002133
The example above will start the path recorder and the starting point will be tagged with the
path identifier start_id . Thereafter the robot will move forward with traditional move
instructions and then move back to the path recorder identifier start_id using the recorded
path. Finally it will move forward again in two steps by the means of PathRecMoveFwd .
Limitations
Movements using the path recorder have to be performed on trap-level, i.e. StorePath must
execute prior to PathRecMoveFwd .
To be able to execute PathRecMoveFwd a PathRecMoveBwd must have been executed
before.
If it is not desired to return to the point where PathRecMoveBwd was executed (by executing
PathRecMoveFwd ) then the PathRecorder has to be stopped by the means of PathRecStop .
PathRecStop\Clear also clears recorded path.
PathRecMoveFwd cannot be executed in a RAPID routine connected to any of the following
special system events: PowerOn, Stop, QStop, Restart, Reset or Step.
Continued
Continues on next page
1 Instructions
1.109. PathRecMoveFwd - Move path recorder forward
PathRecovery
307
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
PathRecMoveFwd’ (’
[ ‘\’ ID‘ :=’ < variable ( VAR ) of pathid > ]
[ ‘\’ ToolOffs‘ :=’ <expression ( IN ) of pos> ]
[ ‘\’ Speed‘ :=’ <expression ( IN ) of speeddata> ]’;’
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
Check for valid recorded path
PathRecValidBwd - Is there a valid backward path
recorded on page 921
PathRecValidFwd - Is there a valid forward path
recorded on page 924
Move path recorder backward
PathRecMoveBwd - Move path recorder backwards
on page 298
Store - restore paths
StorePath - Stores the path when an interrupt
occurs on page 521
RestoPath - Restores the path after an interrupt on
page 362
Other positioning instructions
Technical reference manual - RAPID overview ,
section RAPID summary - Motion
Error Recovery
Technical reference manual - RAPID overview ,
section RAPID summary - Error recovery
Technical reference manual - RAPID overview ,
section Basic characteristics - Error recovery
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 309
|
1 Instructions
1.109. PathRecMoveFwd - Move path recorder forward
PathRecovery
3HAC 16581-1 Revision: J
306
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of how to use the instruction PathRecMoveFwd are illustrated below.
VAR pathrecid start_id;
VAR pathrecid mid_id;
CONST robtarget p1 := [...];
CONST robtarget p2 := [...];
CONST robtarget p3 := [...];
PathRecStart start_id;
MoveL p1, vmax, z50, tool1;
MoveL p2, vmax, z50, tool1;
PathRecStart mid_id;
MoveL p3, vmax, z50, tool1;
StorePath;
PathRecMoveBwd \ID:=start_id;
PathRecMoveFwd \ID:=mid_id;
PathRecMoveFwd;
RestoPath;
xx0500002133
The example above will start the path recorder and the starting point will be tagged with the
path identifier start_id . Thereafter the robot will move forward with traditional move
instructions and then move back to the path recorder identifier start_id using the recorded
path. Finally it will move forward again in two steps by the means of PathRecMoveFwd .
Limitations
Movements using the path recorder have to be performed on trap-level, i.e. StorePath must
execute prior to PathRecMoveFwd .
To be able to execute PathRecMoveFwd a PathRecMoveBwd must have been executed
before.
If it is not desired to return to the point where PathRecMoveBwd was executed (by executing
PathRecMoveFwd ) then the PathRecorder has to be stopped by the means of PathRecStop .
PathRecStop\Clear also clears recorded path.
PathRecMoveFwd cannot be executed in a RAPID routine connected to any of the following
special system events: PowerOn, Stop, QStop, Restart, Reset or Step.
Continued
Continues on next page
1 Instructions
1.109. PathRecMoveFwd - Move path recorder forward
PathRecovery
307
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
PathRecMoveFwd’ (’
[ ‘\’ ID‘ :=’ < variable ( VAR ) of pathid > ]
[ ‘\’ ToolOffs‘ :=’ <expression ( IN ) of pos> ]
[ ‘\’ Speed‘ :=’ <expression ( IN ) of speeddata> ]’;’
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
Check for valid recorded path
PathRecValidBwd - Is there a valid backward path
recorded on page 921
PathRecValidFwd - Is there a valid forward path
recorded on page 924
Move path recorder backward
PathRecMoveBwd - Move path recorder backwards
on page 298
Store - restore paths
StorePath - Stores the path when an interrupt
occurs on page 521
RestoPath - Restores the path after an interrupt on
page 362
Other positioning instructions
Technical reference manual - RAPID overview ,
section RAPID summary - Motion
Error Recovery
Technical reference manual - RAPID overview ,
section RAPID summary - Error recovery
Technical reference manual - RAPID overview ,
section Basic characteristics - Error recovery
Continued
1 Instructions
1.110. PathRecStart - Start the path recorder
Path Recovery
3HAC 16581-1 Revision: J
308
© Copyright 2004-2010 ABB. All rights reserved.
1.110. PathRecStart - Start the path recorder
Usage
PathRecStart is used to start recording the robot’s path. The path recorder will store path
information during execution of the RAPID program.
Basic examples
Basic examples of the instruction PathRecStart are illustrated below.
Example 1
VAR pathrecid fixture_id;
PathRecStart fixture_id;
The path recorder is started and the starting point (the instruction’s position in the RAPID
program) is tagged with the identifier fixture_id .
Arguments
PathRecStart 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
When the path recorder is ordered to start the robot path will be recorded internally in the
robot controller. The recorded sequence of program positions can be traversed backwards by
means of PathRecMoveBwd causing the robot to move backwards along its executed 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
| 310
|
1 Instructions
1.109. PathRecMoveFwd - Move path recorder forward
PathRecovery
307
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
PathRecMoveFwd’ (’
[ ‘\’ ID‘ :=’ < variable ( VAR ) of pathid > ]
[ ‘\’ ToolOffs‘ :=’ <expression ( IN ) of pos> ]
[ ‘\’ Speed‘ :=’ <expression ( IN ) of speeddata> ]’;’
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
Check for valid recorded path
PathRecValidBwd - Is there a valid backward path
recorded on page 921
PathRecValidFwd - Is there a valid forward path
recorded on page 924
Move path recorder backward
PathRecMoveBwd - Move path recorder backwards
on page 298
Store - restore paths
StorePath - Stores the path when an interrupt
occurs on page 521
RestoPath - Restores the path after an interrupt on
page 362
Other positioning instructions
Technical reference manual - RAPID overview ,
section RAPID summary - Motion
Error Recovery
Technical reference manual - RAPID overview ,
section RAPID summary - Error recovery
Technical reference manual - RAPID overview ,
section Basic characteristics - Error recovery
Continued
1 Instructions
1.110. PathRecStart - Start the path recorder
Path Recovery
3HAC 16581-1 Revision: J
308
© Copyright 2004-2010 ABB. All rights reserved.
1.110. PathRecStart - Start the path recorder
Usage
PathRecStart is used to start recording the robot’s path. The path recorder will store path
information during execution of the RAPID program.
Basic examples
Basic examples of the instruction PathRecStart are illustrated below.
Example 1
VAR pathrecid fixture_id;
PathRecStart fixture_id;
The path recorder is started and the starting point (the instruction’s position in the RAPID
program) is tagged with the identifier fixture_id .
Arguments
PathRecStart 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
When the path recorder is ordered to start the robot path will be recorded internally in the
robot controller. The recorded sequence of program positions can be traversed backwards by
means of PathRecMoveBwd causing the robot to move backwards along its executed path.
Continues on next page
1 Instructions
1.110. PathRecStart - Start the path recorder
Path Recovery
309
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of how to use the instruction PathRecStart are illustrated below.
Example 1
VAR pathrecid origin_id;
VAR pathrecid corner_id;
VAR num choice;
MoveJ p1, vmax, z50, tool1;
PathRecStart origin_id;
MoveJ p2, vmax, z50, tool1;
PathRecStart corner_id;
MoveL p3, vmax, z50, tool1;
MoveAbsJ jt4, vmax, fine, tool1;
ERROR
TPReadFK choice,"Extract
to:",stEmpty,stEmpty,stEmpty,"Origin","Corner";
IF choice=4 OR choice=5 THEN
StorePath;
IF choice=4 THEN
PathRecMoveBwd \ID:=origin_id;
ELSE
PathRecMoveBwd \ID:=corner_id;
ENDIF
Stop;
!Fix problem
PathRecMoveFwd;
RestoPath;
StartMove;
RETRY;
ENDIF
In the example above the path recorder is used for moving the robot to a service position if
an error during normal execution occurs.
The robot is executing along a path. After the position p1 the path recorder is started. After
the point p2 another path identifier is inserted. Assume that a recoverable error occurs while
moving from position p3 to position jt4 . The error handler will now be invoked, and the user
can choose between extracting the robot to position Origin (point p1 ) or Corner (point p2 ).
Then the path level is switched with StorePath to be able to restart at the error location
later on. When the robot has backed out from the error location it’s up to the user solving the
error (usually fixing the robots surrounding equipment).
Then the robot is ordered back to the error location. The path level is switched back to normal,
and a retry attempt is made.
Limitations
The path recorder can only be started and will only record the path in the base path level, i.e.
movements at StorePath level are not recorded.
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
| 311
|
1 Instructions
1.110. PathRecStart - Start the path recorder
Path Recovery
3HAC 16581-1 Revision: J
308
© Copyright 2004-2010 ABB. All rights reserved.
1.110. PathRecStart - Start the path recorder
Usage
PathRecStart is used to start recording the robot’s path. The path recorder will store path
information during execution of the RAPID program.
Basic examples
Basic examples of the instruction PathRecStart are illustrated below.
Example 1
VAR pathrecid fixture_id;
PathRecStart fixture_id;
The path recorder is started and the starting point (the instruction’s position in the RAPID
program) is tagged with the identifier fixture_id .
Arguments
PathRecStart 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
When the path recorder is ordered to start the robot path will be recorded internally in the
robot controller. The recorded sequence of program positions can be traversed backwards by
means of PathRecMoveBwd causing the robot to move backwards along its executed path.
Continues on next page
1 Instructions
1.110. PathRecStart - Start the path recorder
Path Recovery
309
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of how to use the instruction PathRecStart are illustrated below.
Example 1
VAR pathrecid origin_id;
VAR pathrecid corner_id;
VAR num choice;
MoveJ p1, vmax, z50, tool1;
PathRecStart origin_id;
MoveJ p2, vmax, z50, tool1;
PathRecStart corner_id;
MoveL p3, vmax, z50, tool1;
MoveAbsJ jt4, vmax, fine, tool1;
ERROR
TPReadFK choice,"Extract
to:",stEmpty,stEmpty,stEmpty,"Origin","Corner";
IF choice=4 OR choice=5 THEN
StorePath;
IF choice=4 THEN
PathRecMoveBwd \ID:=origin_id;
ELSE
PathRecMoveBwd \ID:=corner_id;
ENDIF
Stop;
!Fix problem
PathRecMoveFwd;
RestoPath;
StartMove;
RETRY;
ENDIF
In the example above the path recorder is used for moving the robot to a service position if
an error during normal execution occurs.
The robot is executing along a path. After the position p1 the path recorder is started. After
the point p2 another path identifier is inserted. Assume that a recoverable error occurs while
moving from position p3 to position jt4 . The error handler will now be invoked, and the user
can choose between extracting the robot to position Origin (point p1 ) or Corner (point p2 ).
Then the path level is switched with StorePath to be able to restart at the error location
later on. When the robot has backed out from the error location it’s up to the user solving the
error (usually fixing the robots surrounding equipment).
Then the robot is ordered back to the error location. The path level is switched back to normal,
and a retry attempt is made.
Limitations
The path recorder can only be started and will only record the path in the base path level, i.e.
movements at StorePath level are not recorded.
Continued
Continues on next page
1 Instructions
1.110. PathRecStart - Start the path recorder
Path Recovery
3HAC 16581-1 Revision: J
310
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
PathRecStart
[ ID ’:=’] < variable ( VAR ) of pathrecid> ´;´
Related information
For information about
See
Path Recorder Identifiers
pathrecid - Path recorder identifier on page 1158
Stop the path recorder
PathRecStop - Stop the path recorder on page 311
Check for valid recorded path
PathRecValidBwd - Is there a valid backward path
recorded on page 921
PathRecValidFwd - Is there a valid forward path
recorded on page 924
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
| 312
|
1 Instructions
1.110. PathRecStart - Start the path recorder
Path Recovery
309
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of how to use the instruction PathRecStart are illustrated below.
Example 1
VAR pathrecid origin_id;
VAR pathrecid corner_id;
VAR num choice;
MoveJ p1, vmax, z50, tool1;
PathRecStart origin_id;
MoveJ p2, vmax, z50, tool1;
PathRecStart corner_id;
MoveL p3, vmax, z50, tool1;
MoveAbsJ jt4, vmax, fine, tool1;
ERROR
TPReadFK choice,"Extract
to:",stEmpty,stEmpty,stEmpty,"Origin","Corner";
IF choice=4 OR choice=5 THEN
StorePath;
IF choice=4 THEN
PathRecMoveBwd \ID:=origin_id;
ELSE
PathRecMoveBwd \ID:=corner_id;
ENDIF
Stop;
!Fix problem
PathRecMoveFwd;
RestoPath;
StartMove;
RETRY;
ENDIF
In the example above the path recorder is used for moving the robot to a service position if
an error during normal execution occurs.
The robot is executing along a path. After the position p1 the path recorder is started. After
the point p2 another path identifier is inserted. Assume that a recoverable error occurs while
moving from position p3 to position jt4 . The error handler will now be invoked, and the user
can choose between extracting the robot to position Origin (point p1 ) or Corner (point p2 ).
Then the path level is switched with StorePath to be able to restart at the error location
later on. When the robot has backed out from the error location it’s up to the user solving the
error (usually fixing the robots surrounding equipment).
Then the robot is ordered back to the error location. The path level is switched back to normal,
and a retry attempt is made.
Limitations
The path recorder can only be started and will only record the path in the base path level, i.e.
movements at StorePath level are not recorded.
Continued
Continues on next page
1 Instructions
1.110. PathRecStart - Start the path recorder
Path Recovery
3HAC 16581-1 Revision: J
310
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
PathRecStart
[ ID ’:=’] < variable ( VAR ) of pathrecid> ´;´
Related information
For information about
See
Path Recorder Identifiers
pathrecid - Path recorder identifier on page 1158
Stop the path recorder
PathRecStop - Stop the path recorder on page 311
Check for valid recorded path
PathRecValidBwd - Is there a valid backward path
recorded on page 921
PathRecValidFwd - Is there a valid forward path
recorded on page 924
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
1 Instructions
1.111. PathRecStop - Stop the path recorder
Path Recovery
311
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.111. PathRecStop - Stop the path recorder
Usage
PathRecStop is used to stop recording the robot’s path.
Basic examples
Basic examples of the instruction PathRecStop are illustrated below.
See also More examples below.
Example 1
PathRecStop \Clear;
The path recorder is stopped and the buffer of stored path information is cleared.
Arguments
PathRecStop [\Clear]
[\Clear]
Data type: switch
Clear the recorded path.
Program execution
When the path recorder is ordered to stop the recording of the path will stop. The optional
argument \Clear will clear the buffer of stored path information preventing the recorded
path to be executed by mistake.
After the recorder has been stopped with PathRecStop , earlier recorded paths cannot be
used for back-up movements ( PathRecMoveBwd ). However, it is possible to use earlier
recorded paths if PathRecStart is ordered again from the same position that the path
recorder was stopped in. See the example below.
More examples
More examples of how to use the instruction PathRecStop are illustrated below.
LOCAL VAR pathrecid id1;
LOCAL VAR pathrecid id2;
LOCAL CONST robtarget p0:= [...];
......
LOCAL CONST robtarget p6 := [...];
PROC example1()
MoveL p0, vmax, z50, tool1;
PathRecStart id1;
MoveL p1, vmax, z50, tool1;
MoveL p2, vmax, z50, tool1;
PathRecStop;
MoveL p3, vmax, z50, tool1;
MoveL p4, vmax, z50, tool1;
MoveL p2, vmax, z50, tool1;
PathRecStart id2;
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 313
|
1 Instructions
1.110. PathRecStart - Start the path recorder
Path Recovery
3HAC 16581-1 Revision: J
310
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
PathRecStart
[ ID ’:=’] < variable ( VAR ) of pathrecid> ´;´
Related information
For information about
See
Path Recorder Identifiers
pathrecid - Path recorder identifier on page 1158
Stop the path recorder
PathRecStop - Stop the path recorder on page 311
Check for valid recorded path
PathRecValidBwd - Is there a valid backward path
recorded on page 921
PathRecValidFwd - Is there a valid forward path
recorded on page 924
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
1 Instructions
1.111. PathRecStop - Stop the path recorder
Path Recovery
311
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.111. PathRecStop - Stop the path recorder
Usage
PathRecStop is used to stop recording the robot’s path.
Basic examples
Basic examples of the instruction PathRecStop are illustrated below.
See also More examples below.
Example 1
PathRecStop \Clear;
The path recorder is stopped and the buffer of stored path information is cleared.
Arguments
PathRecStop [\Clear]
[\Clear]
Data type: switch
Clear the recorded path.
Program execution
When the path recorder is ordered to stop the recording of the path will stop. The optional
argument \Clear will clear the buffer of stored path information preventing the recorded
path to be executed by mistake.
After the recorder has been stopped with PathRecStop , earlier recorded paths cannot be
used for back-up movements ( PathRecMoveBwd ). However, it is possible to use earlier
recorded paths if PathRecStart is ordered again from the same position that the path
recorder was stopped in. See the example below.
More examples
More examples of how to use the instruction PathRecStop are illustrated below.
LOCAL VAR pathrecid id1;
LOCAL VAR pathrecid id2;
LOCAL CONST robtarget p0:= [...];
......
LOCAL CONST robtarget p6 := [...];
PROC example1()
MoveL p0, vmax, z50, tool1;
PathRecStart id1;
MoveL p1, vmax, z50, tool1;
MoveL p2, vmax, z50, tool1;
PathRecStop;
MoveL p3, vmax, z50, tool1;
MoveL p4, vmax, z50, tool1;
MoveL p2, vmax, z50, tool1;
PathRecStart id2;
Continues on next page
1 Instructions
1.111. PathRecStop - Stop the path recorder
Path Recovery
3HAC 16581-1 Revision: J
312
© Copyright 2004-2010 ABB. All rights reserved.
MoveL p5, vmax, z50, tool1;
MoveL p6, vmax, z50, tool1;
StorePath;
PathRecMoveBwd \ID:=id1;
PathRecMoveFwd;
RestoPath;
StartMove;
MoveL p7, vmax, z50, tool1;
ENDPROC
PROC example2()
MoveL p0, vmax, z50, tool1;
PathRecStart id1;
MoveL p1, vmax, z50, tool1;
MoveL p2, vmax, z50, tool1;
PathRecStop;
MoveL p3, vmax, z50, tool1;
MoveL p4, vmax, z50, tool1;
PathRecStart id2;
MoveL p2, vmax, z50, tool1;
MoveL p5, vmax, z50, tool1;
MoveL p6, vmax, z50, tool1;
StorePath;
PathRecMoveBwd \ID:=id1;
PathRecMoveFwd;
RestoPath;
StartMove;
MoveL p7, vmax, z50, tool1;
ENDPROC
xx0500002101
The above examples describe recording of the robot path when the recording is stopped in the
middle of the sequence. In example1 the PathRecMoveBwd \ID:=id1; order is valid and
the robot will execute the following path: p6 -> p5 -> p2 -> p1 -> p0
The reason that the order is valid is due to the recorder being stopped and started in the exact
same robot position. If this behavior isn’t desirable the stop order should include the optional
argument \Clear . In that way the recorded path will be cleared and it will never be possible
to back-up to previous path recorder identifiers.
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
| 314
|
1 Instructions
1.111. PathRecStop - Stop the path recorder
Path Recovery
311
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.111. PathRecStop - Stop the path recorder
Usage
PathRecStop is used to stop recording the robot’s path.
Basic examples
Basic examples of the instruction PathRecStop are illustrated below.
See also More examples below.
Example 1
PathRecStop \Clear;
The path recorder is stopped and the buffer of stored path information is cleared.
Arguments
PathRecStop [\Clear]
[\Clear]
Data type: switch
Clear the recorded path.
Program execution
When the path recorder is ordered to stop the recording of the path will stop. The optional
argument \Clear will clear the buffer of stored path information preventing the recorded
path to be executed by mistake.
After the recorder has been stopped with PathRecStop , earlier recorded paths cannot be
used for back-up movements ( PathRecMoveBwd ). However, it is possible to use earlier
recorded paths if PathRecStart is ordered again from the same position that the path
recorder was stopped in. See the example below.
More examples
More examples of how to use the instruction PathRecStop are illustrated below.
LOCAL VAR pathrecid id1;
LOCAL VAR pathrecid id2;
LOCAL CONST robtarget p0:= [...];
......
LOCAL CONST robtarget p6 := [...];
PROC example1()
MoveL p0, vmax, z50, tool1;
PathRecStart id1;
MoveL p1, vmax, z50, tool1;
MoveL p2, vmax, z50, tool1;
PathRecStop;
MoveL p3, vmax, z50, tool1;
MoveL p4, vmax, z50, tool1;
MoveL p2, vmax, z50, tool1;
PathRecStart id2;
Continues on next page
1 Instructions
1.111. PathRecStop - Stop the path recorder
Path Recovery
3HAC 16581-1 Revision: J
312
© Copyright 2004-2010 ABB. All rights reserved.
MoveL p5, vmax, z50, tool1;
MoveL p6, vmax, z50, tool1;
StorePath;
PathRecMoveBwd \ID:=id1;
PathRecMoveFwd;
RestoPath;
StartMove;
MoveL p7, vmax, z50, tool1;
ENDPROC
PROC example2()
MoveL p0, vmax, z50, tool1;
PathRecStart id1;
MoveL p1, vmax, z50, tool1;
MoveL p2, vmax, z50, tool1;
PathRecStop;
MoveL p3, vmax, z50, tool1;
MoveL p4, vmax, z50, tool1;
PathRecStart id2;
MoveL p2, vmax, z50, tool1;
MoveL p5, vmax, z50, tool1;
MoveL p6, vmax, z50, tool1;
StorePath;
PathRecMoveBwd \ID:=id1;
PathRecMoveFwd;
RestoPath;
StartMove;
MoveL p7, vmax, z50, tool1;
ENDPROC
xx0500002101
The above examples describe recording of the robot path when the recording is stopped in the
middle of the sequence. In example1 the PathRecMoveBwd \ID:=id1; order is valid and
the robot will execute the following path: p6 -> p5 -> p2 -> p1 -> p0
The reason that the order is valid is due to the recorder being stopped and started in the exact
same robot position. If this behavior isn’t desirable the stop order should include the optional
argument \Clear . In that way the recorded path will be cleared and it will never be possible
to back-up to previous path recorder identifiers.
Continued
Continues on next page
1 Instructions
1.111. PathRecStop - Stop the path recorder
Path Recovery
313
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
The only difference in example2 is where the recorder was started the second time. In this
case PathRecMoveBwd \ID:=id1 will cause an error. This is because no recorded path
exists between p4 , p3 and p2 . However, it is possible to execute PathRecMoveBwd
\ID:=id2 .
Syntax
PathRecStop
[ ´\’switch Clear ] ´;’
Related information
For information about
See
Path Recorder Identifiers
pathrecid - Path recorder identifier on page 1158
Start the path recorder
PathRecStart - Start the path recorder on page 308
Check for valid recorded path
PathRecValidBwd - Is there a valid backward path
recorded on page 921
PathRecValidFwd - Is there a valid forward path
recorded on page 924
Play the recorder backward
PathRecMoveBwd - Move path recorder
backwards on page 298
Play the recorder forwards
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
| 315
|
1 Instructions
1.111. PathRecStop - Stop the path recorder
Path Recovery
3HAC 16581-1 Revision: J
312
© Copyright 2004-2010 ABB. All rights reserved.
MoveL p5, vmax, z50, tool1;
MoveL p6, vmax, z50, tool1;
StorePath;
PathRecMoveBwd \ID:=id1;
PathRecMoveFwd;
RestoPath;
StartMove;
MoveL p7, vmax, z50, tool1;
ENDPROC
PROC example2()
MoveL p0, vmax, z50, tool1;
PathRecStart id1;
MoveL p1, vmax, z50, tool1;
MoveL p2, vmax, z50, tool1;
PathRecStop;
MoveL p3, vmax, z50, tool1;
MoveL p4, vmax, z50, tool1;
PathRecStart id2;
MoveL p2, vmax, z50, tool1;
MoveL p5, vmax, z50, tool1;
MoveL p6, vmax, z50, tool1;
StorePath;
PathRecMoveBwd \ID:=id1;
PathRecMoveFwd;
RestoPath;
StartMove;
MoveL p7, vmax, z50, tool1;
ENDPROC
xx0500002101
The above examples describe recording of the robot path when the recording is stopped in the
middle of the sequence. In example1 the PathRecMoveBwd \ID:=id1; order is valid and
the robot will execute the following path: p6 -> p5 -> p2 -> p1 -> p0
The reason that the order is valid is due to the recorder being stopped and started in the exact
same robot position. If this behavior isn’t desirable the stop order should include the optional
argument \Clear . In that way the recorded path will be cleared and it will never be possible
to back-up to previous path recorder identifiers.
Continued
Continues on next page
1 Instructions
1.111. PathRecStop - Stop the path recorder
Path Recovery
313
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
The only difference in example2 is where the recorder was started the second time. In this
case PathRecMoveBwd \ID:=id1 will cause an error. This is because no recorded path
exists between p4 , p3 and p2 . However, it is possible to execute PathRecMoveBwd
\ID:=id2 .
Syntax
PathRecStop
[ ´\’switch Clear ] ´;’
Related information
For information about
See
Path Recorder Identifiers
pathrecid - Path recorder identifier on page 1158
Start the path recorder
PathRecStart - Start the path recorder on page 308
Check for valid recorded path
PathRecValidBwd - Is there a valid backward path
recorded on page 921
PathRecValidFwd - Is there a valid forward path
recorded on page 924
Play the recorder backward
PathRecMoveBwd - Move path recorder
backwards on page 298
Play the recorder forwards
PathRecMoveFwd - Move path recorder forward
on page 305
Motion in general
Technical reference manual - RAPID overview ,
section Motion and I/O principles
Continued
1 Instructions
1.112. PathResol - Override path resolution
RobotWare - OS
3HAC 16581-1 Revision: J
314
© Copyright 2004-2010 ABB. All rights reserved.
1.112. PathResol - Override path resolution
Usage
PathResol ( Path Resolution ) is used to override the configured geometric path sample time
defined in the system parameters for the mechanical units that are controlled from current
program task.
This instruction can only be used in the main task T_ROB1 or, if in a MultiMove system, in
any motion tasks.
Description
The path resolution affects the accuracy of the interpolated path and the program cycle time.
The path accuracy is improved and the cycle time is often reduced when the parameter
PathSampleTime is decreased. A value for parameter PathSampleTime , which is too low,
may cause CPU load problems in some demanding applications. However, use of the standard
configured path resolution ( PathSampleTime 100%) will avoid CPU load problems and
provide sufficient path accuracy in most situations.
Example of PathResol usage:
Dynamically critical movements (max payload, high speed, combined joint motions close to
the border of the work area) may cause CPU load problems. Increase the parameter
PathSampleTime .
Low performance external axes may cause CPU load problems during coordination. Increase
the parameter PathSampleTime .
Arc-welding with high frequency weaving may require high resolution of the interpolated
path. Decrease the parameter PathSampleTime .
Small circles or combined small movements with direction changes can decrease the path
performance quality and increase the cycle time. Decrease the parameter PathSampleTime .
Gluing with large reorientations and small corner zones can cause speed variations. Decrease
the parameter PathSampleTime .
Basic examples
Basic examples of the instruction PathResol are illustrated below.
MoveJ p1,v1000,fine,tool1;
PathResol 150;
With the robot at a stop point the path sample time is increased to 150 % of the configured.
Arguments
PathResol PathSampleTime
PathSampleTime
Data type: num
Override as a percent of the configured path sample time. 100% corresponds to the configured
path sample time. Within the range 25-400%.
A lower value of the parameter PathSampleTime improves the path resolution (path
accuracy).
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 316
|
1 Instructions
1.111. PathRecStop - Stop the path recorder
Path Recovery
313
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
The only difference in example2 is where the recorder was started the second time. In this
case PathRecMoveBwd \ID:=id1 will cause an error. This is because no recorded path
exists between p4 , p3 and p2 . However, it is possible to execute PathRecMoveBwd
\ID:=id2 .
Syntax
PathRecStop
[ ´\’switch Clear ] ´;’
Related information
For information about
See
Path Recorder Identifiers
pathrecid - Path recorder identifier on page 1158
Start the path recorder
PathRecStart - Start the path recorder on page 308
Check for valid recorded path
PathRecValidBwd - Is there a valid backward path
recorded on page 921
PathRecValidFwd - Is there a valid forward path
recorded on page 924
Play the recorder backward
PathRecMoveBwd - Move path recorder
backwards on page 298
Play the recorder forwards
PathRecMoveFwd - Move path recorder forward
on page 305
Motion in general
Technical reference manual - RAPID overview ,
section Motion and I/O principles
Continued
1 Instructions
1.112. PathResol - Override path resolution
RobotWare - OS
3HAC 16581-1 Revision: J
314
© Copyright 2004-2010 ABB. All rights reserved.
1.112. PathResol - Override path resolution
Usage
PathResol ( Path Resolution ) is used to override the configured geometric path sample time
defined in the system parameters for the mechanical units that are controlled from current
program task.
This instruction can only be used in the main task T_ROB1 or, if in a MultiMove system, in
any motion tasks.
Description
The path resolution affects the accuracy of the interpolated path and the program cycle time.
The path accuracy is improved and the cycle time is often reduced when the parameter
PathSampleTime is decreased. A value for parameter PathSampleTime , which is too low,
may cause CPU load problems in some demanding applications. However, use of the standard
configured path resolution ( PathSampleTime 100%) will avoid CPU load problems and
provide sufficient path accuracy in most situations.
Example of PathResol usage:
Dynamically critical movements (max payload, high speed, combined joint motions close to
the border of the work area) may cause CPU load problems. Increase the parameter
PathSampleTime .
Low performance external axes may cause CPU load problems during coordination. Increase
the parameter PathSampleTime .
Arc-welding with high frequency weaving may require high resolution of the interpolated
path. Decrease the parameter PathSampleTime .
Small circles or combined small movements with direction changes can decrease the path
performance quality and increase the cycle time. Decrease the parameter PathSampleTime .
Gluing with large reorientations and small corner zones can cause speed variations. Decrease
the parameter PathSampleTime .
Basic examples
Basic examples of the instruction PathResol are illustrated below.
MoveJ p1,v1000,fine,tool1;
PathResol 150;
With the robot at a stop point the path sample time is increased to 150 % of the configured.
Arguments
PathResol PathSampleTime
PathSampleTime
Data type: num
Override as a percent of the configured path sample time. 100% corresponds to the configured
path sample time. Within the range 25-400%.
A lower value of the parameter PathSampleTime improves the path resolution (path
accuracy).
Continues on next page
1 Instructions
1.112. PathResol - Override path resolution
RobotWare - OS
315
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Program execution
The path resolutions of all subsequent positioning instructions are affected until a new
PathResol instruction is executed. This will affect the path resolution during all program
execution of movements (default path level and path level after StorePath ) and also during
jogging.
In a MultiMove system at synchronized coordinated mode the following points are valid:
•
All mechanical units involved in synchronized coordinated mode will run with the
current path resolution for actual (used) motion planner.
•
New path resolution order against actual motion planner affects the synchronized
coordinated movement and future independent movement in that motion planner.
•
New path resolution order against another motion planner only affects future
independent movement in that motion planner.
About connection between program task and motion planner see Application manual -
MultiMove .
The default value for override of path sample time is 100%. This value is automatically set
•
at a cold start-up.
•
when a new program is loaded.
•
when starting program execution from the beginning.
The current override of path sample time can be read from the variable C_MOTSET (data type
motsetdata ) in the component pathresol .
Limitation
If this instruction is preceded by a move instruction then that move instruction must be
programmed with a stop point (zonedata fine ), not a fly-by point. Otherwise restart after
power failure will not be possible.
PathResol cannot be executed in a RAPID routine connected to any of following special
system events: PowerOn, Stop, QStop, Restart, or Step.
Syntax
PathResol
[PathSampleTime ’:=’ ] < expression ( IN ) of num> ’;’
Related information
For information about
See
Positioning instructions
Technical reference manual - RAPID overview , section
Motion and I/O principles
Motion settings
Technical reference manual - RAPID overview , section
RAPID summary - Motion settings
Configuration of path resolution
Technical reference manual - System parameters ,
section Motion Planner - CPU Load Equalization
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 317
|
1 Instructions
1.112. PathResol - Override path resolution
RobotWare - OS
3HAC 16581-1 Revision: J
314
© Copyright 2004-2010 ABB. All rights reserved.
1.112. PathResol - Override path resolution
Usage
PathResol ( Path Resolution ) is used to override the configured geometric path sample time
defined in the system parameters for the mechanical units that are controlled from current
program task.
This instruction can only be used in the main task T_ROB1 or, if in a MultiMove system, in
any motion tasks.
Description
The path resolution affects the accuracy of the interpolated path and the program cycle time.
The path accuracy is improved and the cycle time is often reduced when the parameter
PathSampleTime is decreased. A value for parameter PathSampleTime , which is too low,
may cause CPU load problems in some demanding applications. However, use of the standard
configured path resolution ( PathSampleTime 100%) will avoid CPU load problems and
provide sufficient path accuracy in most situations.
Example of PathResol usage:
Dynamically critical movements (max payload, high speed, combined joint motions close to
the border of the work area) may cause CPU load problems. Increase the parameter
PathSampleTime .
Low performance external axes may cause CPU load problems during coordination. Increase
the parameter PathSampleTime .
Arc-welding with high frequency weaving may require high resolution of the interpolated
path. Decrease the parameter PathSampleTime .
Small circles or combined small movements with direction changes can decrease the path
performance quality and increase the cycle time. Decrease the parameter PathSampleTime .
Gluing with large reorientations and small corner zones can cause speed variations. Decrease
the parameter PathSampleTime .
Basic examples
Basic examples of the instruction PathResol are illustrated below.
MoveJ p1,v1000,fine,tool1;
PathResol 150;
With the robot at a stop point the path sample time is increased to 150 % of the configured.
Arguments
PathResol PathSampleTime
PathSampleTime
Data type: num
Override as a percent of the configured path sample time. 100% corresponds to the configured
path sample time. Within the range 25-400%.
A lower value of the parameter PathSampleTime improves the path resolution (path
accuracy).
Continues on next page
1 Instructions
1.112. PathResol - Override path resolution
RobotWare - OS
315
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Program execution
The path resolutions of all subsequent positioning instructions are affected until a new
PathResol instruction is executed. This will affect the path resolution during all program
execution of movements (default path level and path level after StorePath ) and also during
jogging.
In a MultiMove system at synchronized coordinated mode the following points are valid:
•
All mechanical units involved in synchronized coordinated mode will run with the
current path resolution for actual (used) motion planner.
•
New path resolution order against actual motion planner affects the synchronized
coordinated movement and future independent movement in that motion planner.
•
New path resolution order against another motion planner only affects future
independent movement in that motion planner.
About connection between program task and motion planner see Application manual -
MultiMove .
The default value for override of path sample time is 100%. This value is automatically set
•
at a cold start-up.
•
when a new program is loaded.
•
when starting program execution from the beginning.
The current override of path sample time can be read from the variable C_MOTSET (data type
motsetdata ) in the component pathresol .
Limitation
If this instruction is preceded by a move instruction then that move instruction must be
programmed with a stop point (zonedata fine ), not a fly-by point. Otherwise restart after
power failure will not be possible.
PathResol cannot be executed in a RAPID routine connected to any of following special
system events: PowerOn, Stop, QStop, Restart, or Step.
Syntax
PathResol
[PathSampleTime ’:=’ ] < expression ( IN ) of num> ’;’
Related information
For information about
See
Positioning instructions
Technical reference manual - RAPID overview , section
Motion and I/O principles
Motion settings
Technical reference manual - RAPID overview , section
RAPID summary - Motion settings
Configuration of path resolution
Technical reference manual - System parameters ,
section Motion Planner - CPU Load Equalization
Continued
1 Instructions
1.113. PDispOff - Deactivates program displacement
RobotWare - OS
3HAC 16581-1 Revision: J
316
© Copyright 2004-2010 ABB. All rights reserved.
1.113. PDispOff - Deactivates program displacement
Usage
PDispOff ( Program Displacement Off ) is used to deactivate a program displacement.
Program displacement is activated by the instruction PDispSet or PDispOn and applies to
all movements until some other program displacement is activated or until program
displacement is deactivated.
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 instruction PDispOff are illustrated below.
Example 1
PDispOff;
Deactivation of a program displacement.
Example 2
MoveL p10, v500, z10, tool1;
PDispOn \ExeP:=p10, p11, tool1;
MoveL p20, v500, z10, tool1;
MoveL p30, v500, z10, tool1;
PDispOff;
MoveL p40, v500, z10, tool1;
A program displacement is defined as the difference between the positions p10 and p11 . This
displacement affects the movement to p20 and p30 but not to p40 .
Program execution
Active program displacement is reset. This means that the program displacement coordinate
system is the same as the object coordinate system, and thus all programmed positions will
be related to the latter.
Syntax
PDispOff ´;’
Related information
For information about
See
Definition of program displacement using
two positions
PDispOn - Activates program displacement on
page 317
Definition of program displacement using
known frame
PDispSet - Activates program displacement
using known frame on page 321
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 318
|
1 Instructions
1.112. PathResol - Override path resolution
RobotWare - OS
315
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Program execution
The path resolutions of all subsequent positioning instructions are affected until a new
PathResol instruction is executed. This will affect the path resolution during all program
execution of movements (default path level and path level after StorePath ) and also during
jogging.
In a MultiMove system at synchronized coordinated mode the following points are valid:
•
All mechanical units involved in synchronized coordinated mode will run with the
current path resolution for actual (used) motion planner.
•
New path resolution order against actual motion planner affects the synchronized
coordinated movement and future independent movement in that motion planner.
•
New path resolution order against another motion planner only affects future
independent movement in that motion planner.
About connection between program task and motion planner see Application manual -
MultiMove .
The default value for override of path sample time is 100%. This value is automatically set
•
at a cold start-up.
•
when a new program is loaded.
•
when starting program execution from the beginning.
The current override of path sample time can be read from the variable C_MOTSET (data type
motsetdata ) in the component pathresol .
Limitation
If this instruction is preceded by a move instruction then that move instruction must be
programmed with a stop point (zonedata fine ), not a fly-by point. Otherwise restart after
power failure will not be possible.
PathResol cannot be executed in a RAPID routine connected to any of following special
system events: PowerOn, Stop, QStop, Restart, or Step.
Syntax
PathResol
[PathSampleTime ’:=’ ] < expression ( IN ) of num> ’;’
Related information
For information about
See
Positioning instructions
Technical reference manual - RAPID overview , section
Motion and I/O principles
Motion settings
Technical reference manual - RAPID overview , section
RAPID summary - Motion settings
Configuration of path resolution
Technical reference manual - System parameters ,
section Motion Planner - CPU Load Equalization
Continued
1 Instructions
1.113. PDispOff - Deactivates program displacement
RobotWare - OS
3HAC 16581-1 Revision: J
316
© Copyright 2004-2010 ABB. All rights reserved.
1.113. PDispOff - Deactivates program displacement
Usage
PDispOff ( Program Displacement Off ) is used to deactivate a program displacement.
Program displacement is activated by the instruction PDispSet or PDispOn and applies to
all movements until some other program displacement is activated or until program
displacement is deactivated.
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 instruction PDispOff are illustrated below.
Example 1
PDispOff;
Deactivation of a program displacement.
Example 2
MoveL p10, v500, z10, tool1;
PDispOn \ExeP:=p10, p11, tool1;
MoveL p20, v500, z10, tool1;
MoveL p30, v500, z10, tool1;
PDispOff;
MoveL p40, v500, z10, tool1;
A program displacement is defined as the difference between the positions p10 and p11 . This
displacement affects the movement to p20 and p30 but not to p40 .
Program execution
Active program displacement is reset. This means that the program displacement coordinate
system is the same as the object coordinate system, and thus all programmed positions will
be related to the latter.
Syntax
PDispOff ´;’
Related information
For information about
See
Definition of program displacement using
two positions
PDispOn - Activates program displacement on
page 317
Definition of program displacement using
known frame
PDispSet - Activates program displacement
using known frame on page 321
1 Instructions
1.114. PDispOn - Activates program displacement
RobotWare - OS
317
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.114. PDispOn - Activates program displacement
Usage
PDispOn ( Program Displacement On ) is used to define and activate a program displacement
using two robot positions.
Program displacement is used, for example, after a search has been carried out or when
similar motion patterns are repeated at several different places in the program.
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 instruction PDispOn are illustrated below.
See also More examples on page 319 .
Example 1
MoveL p10, v500, z10, tool1;
PDispOn \ExeP:=p10, p20, tool1;
Activation of a program displacement (parallel displacement). This is calculated based on the
difference between positions p10 and p20 .
Example 2
MoveL p10, v500, fine \Inpos := inpos50, tool1;
PDispOn *, tool1;
Activation of a program displacement (parallel displacement). Since a stop point that is
accurately defined has been used in the previous instruction the argument \ExeP does not
have to be used. The displacement is calculated on the basis of the difference between the
robot’s actual position and the programmed point (*) stored in the instruction.
Example 3
PDispOn \Rot \ExeP:=p10, p20, tool1;
Activation of a program displacement including a rotation. This is calculated based on the
difference between positions p10 and p20 .
Arguments
PDispOn [\Rot] [\ExeP] ProgPoint Tool [\WObj]
[ \Rot ]
Rotation
Data type: switch
The difference in the tool orientation is taken into consideration and this involves a rotation
of the program.
[ \ExeP ]
Executed Point
Data type: robtarget
The new robot position used for calculation of the displacement. If this argument is omitted
then the robot’s current position at the time of the program execution is used.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 319
|
1 Instructions
1.113. PDispOff - Deactivates program displacement
RobotWare - OS
3HAC 16581-1 Revision: J
316
© Copyright 2004-2010 ABB. All rights reserved.
1.113. PDispOff - Deactivates program displacement
Usage
PDispOff ( Program Displacement Off ) is used to deactivate a program displacement.
Program displacement is activated by the instruction PDispSet or PDispOn and applies to
all movements until some other program displacement is activated or until program
displacement is deactivated.
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 instruction PDispOff are illustrated below.
Example 1
PDispOff;
Deactivation of a program displacement.
Example 2
MoveL p10, v500, z10, tool1;
PDispOn \ExeP:=p10, p11, tool1;
MoveL p20, v500, z10, tool1;
MoveL p30, v500, z10, tool1;
PDispOff;
MoveL p40, v500, z10, tool1;
A program displacement is defined as the difference between the positions p10 and p11 . This
displacement affects the movement to p20 and p30 but not to p40 .
Program execution
Active program displacement is reset. This means that the program displacement coordinate
system is the same as the object coordinate system, and thus all programmed positions will
be related to the latter.
Syntax
PDispOff ´;’
Related information
For information about
See
Definition of program displacement using
two positions
PDispOn - Activates program displacement on
page 317
Definition of program displacement using
known frame
PDispSet - Activates program displacement
using known frame on page 321
1 Instructions
1.114. PDispOn - Activates program displacement
RobotWare - OS
317
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.114. PDispOn - Activates program displacement
Usage
PDispOn ( Program Displacement On ) is used to define and activate a program displacement
using two robot positions.
Program displacement is used, for example, after a search has been carried out or when
similar motion patterns are repeated at several different places in the program.
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 instruction PDispOn are illustrated below.
See also More examples on page 319 .
Example 1
MoveL p10, v500, z10, tool1;
PDispOn \ExeP:=p10, p20, tool1;
Activation of a program displacement (parallel displacement). This is calculated based on the
difference between positions p10 and p20 .
Example 2
MoveL p10, v500, fine \Inpos := inpos50, tool1;
PDispOn *, tool1;
Activation of a program displacement (parallel displacement). Since a stop point that is
accurately defined has been used in the previous instruction the argument \ExeP does not
have to be used. The displacement is calculated on the basis of the difference between the
robot’s actual position and the programmed point (*) stored in the instruction.
Example 3
PDispOn \Rot \ExeP:=p10, p20, tool1;
Activation of a program displacement including a rotation. This is calculated based on the
difference between positions p10 and p20 .
Arguments
PDispOn [\Rot] [\ExeP] ProgPoint Tool [\WObj]
[ \Rot ]
Rotation
Data type: switch
The difference in the tool orientation is taken into consideration and this involves a rotation
of the program.
[ \ExeP ]
Executed Point
Data type: robtarget
The new robot position used for calculation of the displacement. If this argument is omitted
then the robot’s current position at the time of the program execution is used.
Continues on next page
1 Instructions
1.114. PDispOn - Activates program displacement
RobotWare - OS
3HAC 16581-1 Revision: J
318
© Copyright 2004-2010 ABB. All rights reserved.
ProgPoint
Programmed Point
Data type: robtarget
The robot’s original position at the time of programming.
Tool
Data type: tooldata
The tool used during programming, i.e. the TCP to which the ProgPoint position is related.
[ \WObj ]
Work Object
Data type: wobjdata
The work object (coordinate system) to which the ProgPoint position is related.
This argument can be omitted and if so then the position is related to the world coordinate
system. However, if a stationary TCP or coordinated external axes are used then this
argument must be specified.
The arguments Tool and \WObj are used both to calculate the ProgPoint during
programming and to calculate the current position during program execution if no \ExeP
argument is programmed.
Program execution
Program displacement means that the ProgDisp coordinate system is translated in relation
to the object coordinate system. Since all positions are related to the ProgDisp coordinate
system, all programmed positions will also be displaced. See figure below, which shows
parallel displacement of a programmed position using program displacement.
xx0500002186
Program displacement is activated when the instruction PDispOn is executed and remains
active until some other program displacement is activated (the instruction PDispSet or
PDispOn ) or until program displacement is deactivated (the instruction PDispOff ).
Only one program displacement can be active at the same time. Several PDispOn
instructions, on the other hand, can be programmed one after the other and in this case the
different program displacements will be added.
Program displacement is calculated as the difference between ExeP and ProgPoint . If ExeP
has not been specified then the current position of the robot at the time of the program
execution is used instead. Since it is the actual position of the robot that is used, the robot
should not move when PDispOn is executed.
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
| 320
|
1 Instructions
1.114. PDispOn - Activates program displacement
RobotWare - OS
317
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.114. PDispOn - Activates program displacement
Usage
PDispOn ( Program Displacement On ) is used to define and activate a program displacement
using two robot positions.
Program displacement is used, for example, after a search has been carried out or when
similar motion patterns are repeated at several different places in the program.
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 instruction PDispOn are illustrated below.
See also More examples on page 319 .
Example 1
MoveL p10, v500, z10, tool1;
PDispOn \ExeP:=p10, p20, tool1;
Activation of a program displacement (parallel displacement). This is calculated based on the
difference between positions p10 and p20 .
Example 2
MoveL p10, v500, fine \Inpos := inpos50, tool1;
PDispOn *, tool1;
Activation of a program displacement (parallel displacement). Since a stop point that is
accurately defined has been used in the previous instruction the argument \ExeP does not
have to be used. The displacement is calculated on the basis of the difference between the
robot’s actual position and the programmed point (*) stored in the instruction.
Example 3
PDispOn \Rot \ExeP:=p10, p20, tool1;
Activation of a program displacement including a rotation. This is calculated based on the
difference between positions p10 and p20 .
Arguments
PDispOn [\Rot] [\ExeP] ProgPoint Tool [\WObj]
[ \Rot ]
Rotation
Data type: switch
The difference in the tool orientation is taken into consideration and this involves a rotation
of the program.
[ \ExeP ]
Executed Point
Data type: robtarget
The new robot position used for calculation of the displacement. If this argument is omitted
then the robot’s current position at the time of the program execution is used.
Continues on next page
1 Instructions
1.114. PDispOn - Activates program displacement
RobotWare - OS
3HAC 16581-1 Revision: J
318
© Copyright 2004-2010 ABB. All rights reserved.
ProgPoint
Programmed Point
Data type: robtarget
The robot’s original position at the time of programming.
Tool
Data type: tooldata
The tool used during programming, i.e. the TCP to which the ProgPoint position is related.
[ \WObj ]
Work Object
Data type: wobjdata
The work object (coordinate system) to which the ProgPoint position is related.
This argument can be omitted and if so then the position is related to the world coordinate
system. However, if a stationary TCP or coordinated external axes are used then this
argument must be specified.
The arguments Tool and \WObj are used both to calculate the ProgPoint during
programming and to calculate the current position during program execution if no \ExeP
argument is programmed.
Program execution
Program displacement means that the ProgDisp coordinate system is translated in relation
to the object coordinate system. Since all positions are related to the ProgDisp coordinate
system, all programmed positions will also be displaced. See figure below, which shows
parallel displacement of a programmed position using program displacement.
xx0500002186
Program displacement is activated when the instruction PDispOn is executed and remains
active until some other program displacement is activated (the instruction PDispSet or
PDispOn ) or until program displacement is deactivated (the instruction PDispOff ).
Only one program displacement can be active at the same time. Several PDispOn
instructions, on the other hand, can be programmed one after the other and in this case the
different program displacements will be added.
Program displacement is calculated as the difference between ExeP and ProgPoint . If ExeP
has not been specified then the current position of the robot at the time of the program
execution is used instead. Since it is the actual position of the robot that is used, the robot
should not move when PDispOn is executed.
Continued
Continues on next page
1 Instructions
1.114. PDispOn - Activates program displacement
RobotWare - OS
319
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
If the argument \Rot is used then the rotation is also calculated based on the tool orientation
at the two positions. The displacement will be calculated in such a way that the new position
( ExeP ) will have the same position and orientation in relation to the displaced coordinate
system, ProgDisp , as the old position ( ProgPoint ) had in relation to the original object
coordinate system. See the figure below, which shows translation and rotation of a
programmed position.
xx0500002187
The program displacement is automatically reset
•
at a cold start-up.
•
when a new program is loaded.
•
when starting program execution from the beginning.
More examples
More examples of how to use the instruction PDispOn are illustrated below.
Example 1
PROC draw_square()
PDispOn *, tool1;
MoveL *, v500, z10, tool1;
MoveL *, v500, z10, tool1;
MoveL *, v500, z10, tool1;
MoveL *, v500, z10, tool1;
PDispOff;
ENDPROC
...
MoveL p10, v500, fine \Inpos := inpos50, tool1;
draw_square;
MoveL p20, v500, fine \Inpos := inpos50, tool1;
draw_square;
MoveL p30, v500, fine \Inpos := inpos50, tool1;
draw_square;
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
| 321
|
1 Instructions
1.114. PDispOn - Activates program displacement
RobotWare - OS
3HAC 16581-1 Revision: J
318
© Copyright 2004-2010 ABB. All rights reserved.
ProgPoint
Programmed Point
Data type: robtarget
The robot’s original position at the time of programming.
Tool
Data type: tooldata
The tool used during programming, i.e. the TCP to which the ProgPoint position is related.
[ \WObj ]
Work Object
Data type: wobjdata
The work object (coordinate system) to which the ProgPoint position is related.
This argument can be omitted and if so then the position is related to the world coordinate
system. However, if a stationary TCP or coordinated external axes are used then this
argument must be specified.
The arguments Tool and \WObj are used both to calculate the ProgPoint during
programming and to calculate the current position during program execution if no \ExeP
argument is programmed.
Program execution
Program displacement means that the ProgDisp coordinate system is translated in relation
to the object coordinate system. Since all positions are related to the ProgDisp coordinate
system, all programmed positions will also be displaced. See figure below, which shows
parallel displacement of a programmed position using program displacement.
xx0500002186
Program displacement is activated when the instruction PDispOn is executed and remains
active until some other program displacement is activated (the instruction PDispSet or
PDispOn ) or until program displacement is deactivated (the instruction PDispOff ).
Only one program displacement can be active at the same time. Several PDispOn
instructions, on the other hand, can be programmed one after the other and in this case the
different program displacements will be added.
Program displacement is calculated as the difference between ExeP and ProgPoint . If ExeP
has not been specified then the current position of the robot at the time of the program
execution is used instead. Since it is the actual position of the robot that is used, the robot
should not move when PDispOn is executed.
Continued
Continues on next page
1 Instructions
1.114. PDispOn - Activates program displacement
RobotWare - OS
319
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
If the argument \Rot is used then the rotation is also calculated based on the tool orientation
at the two positions. The displacement will be calculated in such a way that the new position
( ExeP ) will have the same position and orientation in relation to the displaced coordinate
system, ProgDisp , as the old position ( ProgPoint ) had in relation to the original object
coordinate system. See the figure below, which shows translation and rotation of a
programmed position.
xx0500002187
The program displacement is automatically reset
•
at a cold start-up.
•
when a new program is loaded.
•
when starting program execution from the beginning.
More examples
More examples of how to use the instruction PDispOn are illustrated below.
Example 1
PROC draw_square()
PDispOn *, tool1;
MoveL *, v500, z10, tool1;
MoveL *, v500, z10, tool1;
MoveL *, v500, z10, tool1;
MoveL *, v500, z10, tool1;
PDispOff;
ENDPROC
...
MoveL p10, v500, fine \Inpos := inpos50, tool1;
draw_square;
MoveL p20, v500, fine \Inpos := inpos50, tool1;
draw_square;
MoveL p30, v500, fine \Inpos := inpos50, tool1;
draw_square;
Continued
Continues on next page
1 Instructions
1.114. PDispOn - Activates program displacement
RobotWare - OS
3HAC 16581-1 Revision: J
320
© Copyright 2004-2010 ABB. All rights reserved.
The routine draw_square is used to execute the same motion pattern at three different
positions based on the positions p10 , p20 , and p30 . See the figure below, which shows that
when using program displacement the motion patterns can be reused.
xx0500002185
Example 2
SearchL sen1, psearch, p10, v100, tool1\WObj:=fixture1;
PDispOn \ExeP:=psearch, *, tool1 \WObj:=fixture1;
A search is carried out in which the robot’s searched position is stored in the position
psearch . Any movement carried out after this starts from this position using a program
displacement (parallel displacement). The latter is calculated based on the difference between
the searched position and the programmed point ( * ) stored in the instruction. All positions are
based on the fixture1 object coordinate system.
Syntax
PDispOn
[ [ ’\’ Rot ]
[’\’ ExeP ’:=’ < expression ( IN ) of robtarget>]’,’]
[ ProgPoint’ :=’ ] < expression ( IN ) of robtarget> ’,’
[ Tool ’:=’ ] < persistent ( PERS ) of tooldata>
[ ´\’WObj’ :=’ < persistent ( PERS ) of wobjdata> ] ´;’
Related information
For information about
See
Deactivation of program displacement
PDispOff - Deactivates program displacement
on page 316
Definition of program displacement using
known frame
PDispSet - Activates program displacement
using known frame on page 321
Coordinate systems
Technical reference manual - System
parameters , section Motion and I/O principles -
Coordinate systems
Definition of tools
tooldata - Tool data on page 1207
Definition of work objects
wobjdata - Work object data on page 1224
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 322
|
1 Instructions
1.114. PDispOn - Activates program displacement
RobotWare - OS
319
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
If the argument \Rot is used then the rotation is also calculated based on the tool orientation
at the two positions. The displacement will be calculated in such a way that the new position
( ExeP ) will have the same position and orientation in relation to the displaced coordinate
system, ProgDisp , as the old position ( ProgPoint ) had in relation to the original object
coordinate system. See the figure below, which shows translation and rotation of a
programmed position.
xx0500002187
The program displacement is automatically reset
•
at a cold start-up.
•
when a new program is loaded.
•
when starting program execution from the beginning.
More examples
More examples of how to use the instruction PDispOn are illustrated below.
Example 1
PROC draw_square()
PDispOn *, tool1;
MoveL *, v500, z10, tool1;
MoveL *, v500, z10, tool1;
MoveL *, v500, z10, tool1;
MoveL *, v500, z10, tool1;
PDispOff;
ENDPROC
...
MoveL p10, v500, fine \Inpos := inpos50, tool1;
draw_square;
MoveL p20, v500, fine \Inpos := inpos50, tool1;
draw_square;
MoveL p30, v500, fine \Inpos := inpos50, tool1;
draw_square;
Continued
Continues on next page
1 Instructions
1.114. PDispOn - Activates program displacement
RobotWare - OS
3HAC 16581-1 Revision: J
320
© Copyright 2004-2010 ABB. All rights reserved.
The routine draw_square is used to execute the same motion pattern at three different
positions based on the positions p10 , p20 , and p30 . See the figure below, which shows that
when using program displacement the motion patterns can be reused.
xx0500002185
Example 2
SearchL sen1, psearch, p10, v100, tool1\WObj:=fixture1;
PDispOn \ExeP:=psearch, *, tool1 \WObj:=fixture1;
A search is carried out in which the robot’s searched position is stored in the position
psearch . Any movement carried out after this starts from this position using a program
displacement (parallel displacement). The latter is calculated based on the difference between
the searched position and the programmed point ( * ) stored in the instruction. All positions are
based on the fixture1 object coordinate system.
Syntax
PDispOn
[ [ ’\’ Rot ]
[’\’ ExeP ’:=’ < expression ( IN ) of robtarget>]’,’]
[ ProgPoint’ :=’ ] < expression ( IN ) of robtarget> ’,’
[ Tool ’:=’ ] < persistent ( PERS ) of tooldata>
[ ´\’WObj’ :=’ < persistent ( PERS ) of wobjdata> ] ´;’
Related information
For information about
See
Deactivation of program displacement
PDispOff - Deactivates program displacement
on page 316
Definition of program displacement using
known frame
PDispSet - Activates program displacement
using known frame on page 321
Coordinate systems
Technical reference manual - System
parameters , section Motion and I/O principles -
Coordinate systems
Definition of tools
tooldata - Tool data on page 1207
Definition of work objects
wobjdata - Work object data on page 1224
Continued
1 Instructions
1.115. PDispSet - Activates program displacement using known frame
RobotWare - OS
321
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.115. PDispSet - Activates program displacement using known frame
Usage
PDispSet ( Program Displacement Set ) is used to define and activate a program
displacement using known frame.
Program displacement is used, for example, when similar motion patterns are repeated at
several different places in the program.
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 instruction PDispSet are illustrated below.
Example 1
VAR pose xp100 := [ [100, 0, 0], [1, 0, 0, 0] ];
...
PDispSet xp100;
Activation of the xp100 program displacement meaning that:
•
The ProgDisp coordinate system is displaced 100 mm from the object coordinate
system in the direction of the positive x-axis (see figure below).
•
As long as this program displacement is active all positions will be displaced 100 mm
in the direction of the x-axis.
The figure shows a 100 mm program displacement along the x-axis.
xx0500002199
Arguments
PDispSet DispFrame
DispFrame
Displacement Frame
Datatype: pose
The program displacement is defined as data of the 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
| 323
|
1 Instructions
1.114. PDispOn - Activates program displacement
RobotWare - OS
3HAC 16581-1 Revision: J
320
© Copyright 2004-2010 ABB. All rights reserved.
The routine draw_square is used to execute the same motion pattern at three different
positions based on the positions p10 , p20 , and p30 . See the figure below, which shows that
when using program displacement the motion patterns can be reused.
xx0500002185
Example 2
SearchL sen1, psearch, p10, v100, tool1\WObj:=fixture1;
PDispOn \ExeP:=psearch, *, tool1 \WObj:=fixture1;
A search is carried out in which the robot’s searched position is stored in the position
psearch . Any movement carried out after this starts from this position using a program
displacement (parallel displacement). The latter is calculated based on the difference between
the searched position and the programmed point ( * ) stored in the instruction. All positions are
based on the fixture1 object coordinate system.
Syntax
PDispOn
[ [ ’\’ Rot ]
[’\’ ExeP ’:=’ < expression ( IN ) of robtarget>]’,’]
[ ProgPoint’ :=’ ] < expression ( IN ) of robtarget> ’,’
[ Tool ’:=’ ] < persistent ( PERS ) of tooldata>
[ ´\’WObj’ :=’ < persistent ( PERS ) of wobjdata> ] ´;’
Related information
For information about
See
Deactivation of program displacement
PDispOff - Deactivates program displacement
on page 316
Definition of program displacement using
known frame
PDispSet - Activates program displacement
using known frame on page 321
Coordinate systems
Technical reference manual - System
parameters , section Motion and I/O principles -
Coordinate systems
Definition of tools
tooldata - Tool data on page 1207
Definition of work objects
wobjdata - Work object data on page 1224
Continued
1 Instructions
1.115. PDispSet - Activates program displacement using known frame
RobotWare - OS
321
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.115. PDispSet - Activates program displacement using known frame
Usage
PDispSet ( Program Displacement Set ) is used to define and activate a program
displacement using known frame.
Program displacement is used, for example, when similar motion patterns are repeated at
several different places in the program.
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 instruction PDispSet are illustrated below.
Example 1
VAR pose xp100 := [ [100, 0, 0], [1, 0, 0, 0] ];
...
PDispSet xp100;
Activation of the xp100 program displacement meaning that:
•
The ProgDisp coordinate system is displaced 100 mm from the object coordinate
system in the direction of the positive x-axis (see figure below).
•
As long as this program displacement is active all positions will be displaced 100 mm
in the direction of the x-axis.
The figure shows a 100 mm program displacement along the x-axis.
xx0500002199
Arguments
PDispSet DispFrame
DispFrame
Displacement Frame
Datatype: pose
The program displacement is defined as data of the type pose .
Continues on next page
1 Instructions
1.115. PDispSet - Activates program displacement using known frame
RobotWare - OS
3HAC 16581-1 Revision: J
322
© Copyright 2004-2010 ABB. All rights reserved.
Program execution
Program displacement involves translating and/or rotating the ProgDisp coordinate system
relative to the object coordinate system. Since all positions are related to the ProgDisp
coordinate system, all programmed positions will also be displaced. See the figure below,
which shows translation and rotation of a programmed position.
xx0500002204
Program displacement is activated when the instruction PDispSet is executed and remains
active until some other program displacement is activated (the instruction PDispSet or
PDispOn ) or until program displacement is deactivated (the instruction PDispOff ).
Only one program displacement can be active at the same time. Program displacements
cannot be added to one another using PDispSet .
The program displacement is automatically reset
•
at a cold start-up.
•
when a new program is loaded.
•
when starting program execution from the beginning.
Syntax
PDispSet
[ DispFrame ’:=’ ] < expression ( IN ) of pose> ’;’
Related information
For information about
See
Deactivation of program displacement
PDispOff - Deactivates program displacement
on page 316
Definition of program displacement using
two positions
PDispOn - Activates program displacement on
page 317
Definition of data of the type pose
pose - Coordinate transformations on page 1162
Coordinate systems
Technical reference manual - RAPID overview ,
section Motion and I/O principles - Coordinate
systems
Examples of how program displacement
can be used
PDispOn - Activates program displacement on
page 317
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 324
|
1 Instructions
1.115. PDispSet - Activates program displacement using known frame
RobotWare - OS
321
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.115. PDispSet - Activates program displacement using known frame
Usage
PDispSet ( Program Displacement Set ) is used to define and activate a program
displacement using known frame.
Program displacement is used, for example, when similar motion patterns are repeated at
several different places in the program.
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 instruction PDispSet are illustrated below.
Example 1
VAR pose xp100 := [ [100, 0, 0], [1, 0, 0, 0] ];
...
PDispSet xp100;
Activation of the xp100 program displacement meaning that:
•
The ProgDisp coordinate system is displaced 100 mm from the object coordinate
system in the direction of the positive x-axis (see figure below).
•
As long as this program displacement is active all positions will be displaced 100 mm
in the direction of the x-axis.
The figure shows a 100 mm program displacement along the x-axis.
xx0500002199
Arguments
PDispSet DispFrame
DispFrame
Displacement Frame
Datatype: pose
The program displacement is defined as data of the type pose .
Continues on next page
1 Instructions
1.115. PDispSet - Activates program displacement using known frame
RobotWare - OS
3HAC 16581-1 Revision: J
322
© Copyright 2004-2010 ABB. All rights reserved.
Program execution
Program displacement involves translating and/or rotating the ProgDisp coordinate system
relative to the object coordinate system. Since all positions are related to the ProgDisp
coordinate system, all programmed positions will also be displaced. See the figure below,
which shows translation and rotation of a programmed position.
xx0500002204
Program displacement is activated when the instruction PDispSet is executed and remains
active until some other program displacement is activated (the instruction PDispSet or
PDispOn ) or until program displacement is deactivated (the instruction PDispOff ).
Only one program displacement can be active at the same time. Program displacements
cannot be added to one another using PDispSet .
The program displacement is automatically reset
•
at a cold start-up.
•
when a new program is loaded.
•
when starting program execution from the beginning.
Syntax
PDispSet
[ DispFrame ’:=’ ] < expression ( IN ) of pose> ’;’
Related information
For information about
See
Deactivation of program displacement
PDispOff - Deactivates program displacement
on page 316
Definition of program displacement using
two positions
PDispOn - Activates program displacement on
page 317
Definition of data of the type pose
pose - Coordinate transformations on page 1162
Coordinate systems
Technical reference manual - RAPID overview ,
section Motion and I/O principles - Coordinate
systems
Examples of how program displacement
can be used
PDispOn - Activates program displacement on
page 317
Continued
1 Instructions
1.116. ProcCall - Calls a new procedure
RobotWare - OS
323
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.116. ProcCall - Calls a new procedure
Usage
A procedure call is used to transfer program execution to another procedure. When the
procedure has been fully executed the program execution continues with the instruction
following the procedure call.
It is usually possible to send a number of arguments to the new procedure. These control the
behavior of the procedure and make it possible for the same procedure to be used for different
things.
Basic examples
Basic examples of the instruction ProcCall are illustrated below.
Example 1
weldpipe1;
Calls the weldpipe1 procedure.
Example 2
errormessage;
Set do1;
...
PROC errormessage()
TPWrite "ERROR";
ENDPROC
The errormessage procedure is called. When this procedure is ready the program
execution returns to the instruction following the procedure call, Set do1 .
Arguments
Procedure { Argument }
Procedure
Identifier
The name of the procedure to be called.
Argument
Data type: In accordance with the procedure declaration.
The procedure arguments (in accordance with the parameters of the procedure).
Basic examples
Basic examples of the instruction ProcCall are illustrated below.
Example 1
weldpipe2 10, lowspeed;
Calls the weldpipe2 procedure including two arguments.
Example 2
weldpipe3 10 \speed:=20;
Calls the weldpipe3 procedure including one mandatory and one optional argument.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 325
|
1 Instructions
1.115. PDispSet - Activates program displacement using known frame
RobotWare - OS
3HAC 16581-1 Revision: J
322
© Copyright 2004-2010 ABB. All rights reserved.
Program execution
Program displacement involves translating and/or rotating the ProgDisp coordinate system
relative to the object coordinate system. Since all positions are related to the ProgDisp
coordinate system, all programmed positions will also be displaced. See the figure below,
which shows translation and rotation of a programmed position.
xx0500002204
Program displacement is activated when the instruction PDispSet is executed and remains
active until some other program displacement is activated (the instruction PDispSet or
PDispOn ) or until program displacement is deactivated (the instruction PDispOff ).
Only one program displacement can be active at the same time. Program displacements
cannot be added to one another using PDispSet .
The program displacement is automatically reset
•
at a cold start-up.
•
when a new program is loaded.
•
when starting program execution from the beginning.
Syntax
PDispSet
[ DispFrame ’:=’ ] < expression ( IN ) of pose> ’;’
Related information
For information about
See
Deactivation of program displacement
PDispOff - Deactivates program displacement
on page 316
Definition of program displacement using
two positions
PDispOn - Activates program displacement on
page 317
Definition of data of the type pose
pose - Coordinate transformations on page 1162
Coordinate systems
Technical reference manual - RAPID overview ,
section Motion and I/O principles - Coordinate
systems
Examples of how program displacement
can be used
PDispOn - Activates program displacement on
page 317
Continued
1 Instructions
1.116. ProcCall - Calls a new procedure
RobotWare - OS
323
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.116. ProcCall - Calls a new procedure
Usage
A procedure call is used to transfer program execution to another procedure. When the
procedure has been fully executed the program execution continues with the instruction
following the procedure call.
It is usually possible to send a number of arguments to the new procedure. These control the
behavior of the procedure and make it possible for the same procedure to be used for different
things.
Basic examples
Basic examples of the instruction ProcCall are illustrated below.
Example 1
weldpipe1;
Calls the weldpipe1 procedure.
Example 2
errormessage;
Set do1;
...
PROC errormessage()
TPWrite "ERROR";
ENDPROC
The errormessage procedure is called. When this procedure is ready the program
execution returns to the instruction following the procedure call, Set do1 .
Arguments
Procedure { Argument }
Procedure
Identifier
The name of the procedure to be called.
Argument
Data type: In accordance with the procedure declaration.
The procedure arguments (in accordance with the parameters of the procedure).
Basic examples
Basic examples of the instruction ProcCall are illustrated below.
Example 1
weldpipe2 10, lowspeed;
Calls the weldpipe2 procedure including two arguments.
Example 2
weldpipe3 10 \speed:=20;
Calls the weldpipe3 procedure including one mandatory and one optional argument.
Continues on next page
1 Instructions
1.116. ProcCall - Calls a new procedure
RobotWare - OS
3HAC 16581-1 Revision: J
324
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
The procedure’s arguments must agree with its parameters:
•
All mandatory arguments must be included.
•
They must be placed in the same order.
•
They must be of the same data type.
•
They must be of the correct type with respect to the access-mode (input, variable, or
persistent).
A routine can call a routine which, in turn, calls another routine, etc. A routine can also call
itself, i.e. a recursive call. The number of routine levels permitted depends on the number of
parameters. More than 10 levels are usually permitted.
Syntax
(EBNF)
<procedure> [ <argument list> ] ’;’
<procedure> ::= <identifier>
Related information
For information about
See
Arguments, 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
| 326
|
1 Instructions
1.116. ProcCall - Calls a new procedure
RobotWare - OS
323
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.116. ProcCall - Calls a new procedure
Usage
A procedure call is used to transfer program execution to another procedure. When the
procedure has been fully executed the program execution continues with the instruction
following the procedure call.
It is usually possible to send a number of arguments to the new procedure. These control the
behavior of the procedure and make it possible for the same procedure to be used for different
things.
Basic examples
Basic examples of the instruction ProcCall are illustrated below.
Example 1
weldpipe1;
Calls the weldpipe1 procedure.
Example 2
errormessage;
Set do1;
...
PROC errormessage()
TPWrite "ERROR";
ENDPROC
The errormessage procedure is called. When this procedure is ready the program
execution returns to the instruction following the procedure call, Set do1 .
Arguments
Procedure { Argument }
Procedure
Identifier
The name of the procedure to be called.
Argument
Data type: In accordance with the procedure declaration.
The procedure arguments (in accordance with the parameters of the procedure).
Basic examples
Basic examples of the instruction ProcCall are illustrated below.
Example 1
weldpipe2 10, lowspeed;
Calls the weldpipe2 procedure including two arguments.
Example 2
weldpipe3 10 \speed:=20;
Calls the weldpipe3 procedure including one mandatory and one optional argument.
Continues on next page
1 Instructions
1.116. ProcCall - Calls a new procedure
RobotWare - OS
3HAC 16581-1 Revision: J
324
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
The procedure’s arguments must agree with its parameters:
•
All mandatory arguments must be included.
•
They must be placed in the same order.
•
They must be of the same data type.
•
They must be of the correct type with respect to the access-mode (input, variable, or
persistent).
A routine can call a routine which, in turn, calls another routine, etc. A routine can also call
itself, i.e. a recursive call. The number of routine levels permitted depends on the number of
parameters. More than 10 levels are usually permitted.
Syntax
(EBNF)
<procedure> [ <argument list> ] ’;’
<procedure> ::= <identifier>
Related information
For information about
See
Arguments, parameters
Technical reference manual - RAPID overview ,
section Basic characteristics - Routines
Continued
1 Instructions
1.117. ProcerrRecovery - Generate and recover from process-move error
RobotWare - OS
325
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.117. ProcerrRecovery - Generate and recover from process-move error
Usage
ProcerrRecovery can be used to generate process error during robot movement and get the
possibility to handle the error and restart the process and the movement from an ERROR
handler.
Basic examples
Basic examples of the instruction ProcerrRecovery are illustrated below.
See also More examples on page 327 .
The examples below are not realistic but are shown for pedagogic reasons.
Example 1
MoveL p1, v50, z30, tool2;
ProcerrRecovery \SyncOrgMoveInst;
MoveL p2, v50, z30, tool2;
ERROR
IF ERRNO = ERR_PATH_STOP THEN
StartMove;
RETRY;
ENDIF
The robot movement stops on its way to p1 and the program execution transfers to the ERROR
handler in the routine that created the actual path on which the error occurred, in this case the
path to MoveL p1 . The movement is restarted with StartMove and the execution is
continued with RETRY .
Example 2
MoveL p1, v50, fine, tool2;
ProcerrRecovery \SyncLastMoveInst;
MoveL p2, v50, z30, tool2;
ERROR
IF ERRNO = ERR_PATH_STOP THEN
StartMove;
RETRY;
ENDIF
The robot movement stops at once on its way to p2 . The program execution transfers to the
ERROR handler in the routine where the program is currently executing or is going to execute
a move instruction when the error occurred, in this case MoveL p2 . The movement is
restarted with StartMove and the execution is continued with RETRY .
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 327
|
1 Instructions
1.116. ProcCall - Calls a new procedure
RobotWare - OS
3HAC 16581-1 Revision: J
324
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
The procedure’s arguments must agree with its parameters:
•
All mandatory arguments must be included.
•
They must be placed in the same order.
•
They must be of the same data type.
•
They must be of the correct type with respect to the access-mode (input, variable, or
persistent).
A routine can call a routine which, in turn, calls another routine, etc. A routine can also call
itself, i.e. a recursive call. The number of routine levels permitted depends on the number of
parameters. More than 10 levels are usually permitted.
Syntax
(EBNF)
<procedure> [ <argument list> ] ’;’
<procedure> ::= <identifier>
Related information
For information about
See
Arguments, parameters
Technical reference manual - RAPID overview ,
section Basic characteristics - Routines
Continued
1 Instructions
1.117. ProcerrRecovery - Generate and recover from process-move error
RobotWare - OS
325
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.117. ProcerrRecovery - Generate and recover from process-move error
Usage
ProcerrRecovery can be used to generate process error during robot movement and get the
possibility to handle the error and restart the process and the movement from an ERROR
handler.
Basic examples
Basic examples of the instruction ProcerrRecovery are illustrated below.
See also More examples on page 327 .
The examples below are not realistic but are shown for pedagogic reasons.
Example 1
MoveL p1, v50, z30, tool2;
ProcerrRecovery \SyncOrgMoveInst;
MoveL p2, v50, z30, tool2;
ERROR
IF ERRNO = ERR_PATH_STOP THEN
StartMove;
RETRY;
ENDIF
The robot movement stops on its way to p1 and the program execution transfers to the ERROR
handler in the routine that created the actual path on which the error occurred, in this case the
path to MoveL p1 . The movement is restarted with StartMove and the execution is
continued with RETRY .
Example 2
MoveL p1, v50, fine, tool2;
ProcerrRecovery \SyncLastMoveInst;
MoveL p2, v50, z30, tool2;
ERROR
IF ERRNO = ERR_PATH_STOP THEN
StartMove;
RETRY;
ENDIF
The robot movement stops at once on its way to p2 . The program execution transfers to the
ERROR handler in the routine where the program is currently executing or is going to execute
a move instruction when the error occurred, in this case MoveL p2 . The movement is
restarted with StartMove and the execution is continued with RETRY .
Continues on next page
1 Instructions
1.117. ProcerrRecovery - Generate and recover from process-move error
RobotWare - OS
3HAC 16581-1 Revision: J
326
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
ProcerrRecovery[\SyncOrgMoveInst] | [\SyncLastMoveInst]
[\ProcSignal]
[\SyncOrgMoveInst]
Data type: switch
The error can be handled in the routine that created the actual path on which the error
occurred.
[\SyncLastMoveInst]
Data type: switch
The error can be handled in the routine where the program is currently executing a move
instruction when the error occurred.
If the program is currently not executing a move instruction when the error occurred then the
transfer of the execution to the ERROR handler will be delayed until the program executes the
next move instruction. This means that the transfer to the ERROR handler will be delayed if
the robot is in a stop point or between the prefetch point and the middle of the corner path.
The error can be handled in that routine.
[\ProcSignal ]
Data type: signaldo
Optional parameter that let the user turn on/off the use of the instruction. If this parameter is
used and the signal value is 0, an recoverable error will be thrown, and no process error will
be generated.
Program execution
Execution of ProcerrRecovery in continuous mode results in the following:
•
At once the robot is stopped on its path.
•
The variable ERRNO is set to ERR_PATH_STOP .
•
The execution is transferred to some ERROR handler according the rules for
asynchronously raised errors.
This instruction does nothing in any step mode.
For description of asynchronously raised errors that are generated with ProcerrRecovery
see RAPID kernel reference/Error recovery/Asynchronously raised errors.
ProcerrRecovery can also be used in MultiMove system to transfer the execution to the
ERROR handler in several program tasks if running in synchronized mode.
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
| 328
|
1 Instructions
1.117. ProcerrRecovery - Generate and recover from process-move error
RobotWare - OS
325
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.117. ProcerrRecovery - Generate and recover from process-move error
Usage
ProcerrRecovery can be used to generate process error during robot movement and get the
possibility to handle the error and restart the process and the movement from an ERROR
handler.
Basic examples
Basic examples of the instruction ProcerrRecovery are illustrated below.
See also More examples on page 327 .
The examples below are not realistic but are shown for pedagogic reasons.
Example 1
MoveL p1, v50, z30, tool2;
ProcerrRecovery \SyncOrgMoveInst;
MoveL p2, v50, z30, tool2;
ERROR
IF ERRNO = ERR_PATH_STOP THEN
StartMove;
RETRY;
ENDIF
The robot movement stops on its way to p1 and the program execution transfers to the ERROR
handler in the routine that created the actual path on which the error occurred, in this case the
path to MoveL p1 . The movement is restarted with StartMove and the execution is
continued with RETRY .
Example 2
MoveL p1, v50, fine, tool2;
ProcerrRecovery \SyncLastMoveInst;
MoveL p2, v50, z30, tool2;
ERROR
IF ERRNO = ERR_PATH_STOP THEN
StartMove;
RETRY;
ENDIF
The robot movement stops at once on its way to p2 . The program execution transfers to the
ERROR handler in the routine where the program is currently executing or is going to execute
a move instruction when the error occurred, in this case MoveL p2 . The movement is
restarted with StartMove and the execution is continued with RETRY .
Continues on next page
1 Instructions
1.117. ProcerrRecovery - Generate and recover from process-move error
RobotWare - OS
3HAC 16581-1 Revision: J
326
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
ProcerrRecovery[\SyncOrgMoveInst] | [\SyncLastMoveInst]
[\ProcSignal]
[\SyncOrgMoveInst]
Data type: switch
The error can be handled in the routine that created the actual path on which the error
occurred.
[\SyncLastMoveInst]
Data type: switch
The error can be handled in the routine where the program is currently executing a move
instruction when the error occurred.
If the program is currently not executing a move instruction when the error occurred then the
transfer of the execution to the ERROR handler will be delayed until the program executes the
next move instruction. This means that the transfer to the ERROR handler will be delayed if
the robot is in a stop point or between the prefetch point and the middle of the corner path.
The error can be handled in that routine.
[\ProcSignal ]
Data type: signaldo
Optional parameter that let the user turn on/off the use of the instruction. If this parameter is
used and the signal value is 0, an recoverable error will be thrown, and no process error will
be generated.
Program execution
Execution of ProcerrRecovery in continuous mode results in the following:
•
At once the robot is stopped on its path.
•
The variable ERRNO is set to ERR_PATH_STOP .
•
The execution is transferred to some ERROR handler according the rules for
asynchronously raised errors.
This instruction does nothing in any step mode.
For description of asynchronously raised errors that are generated with ProcerrRecovery
see RAPID kernel reference/Error recovery/Asynchronously raised errors.
ProcerrRecovery can also be used in MultiMove system to transfer the execution to the
ERROR handler in several program tasks if running in synchronized mode.
Continued
Continues on next page
1 Instructions
1.117. ProcerrRecovery - Generate and recover from process-move error
RobotWare - OS
327
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of how to use the instruction ProcerrRecovery are illustrated below.
Example with ProcerrRecovery\SyncOrgMoveInst
MODULE user_module
VAR intnum proc_sup_int;
PROC main()
...
MoveL p1, v1000, fine, tool1;
do_process;
...
ENDPROC
PROC do_process()
my_proc_on;
MoveL p2, v200, z10, tool1;
MoveL p3, v200, fine, tool1;
my_proc_off;
ERROR
IF ERRNO = ERR_PATH_STOP THEN
my_proc_on;
StartMove;
RETRY;
ENDIF
ENDPROC
TRAP iprocfail
my_proc_off;
ProcerrRecovery \SyncOrgMoveInst;
ENDTRAP
PROC my_proc_on()
SetDO do_myproc, 1;
CONNECT proc_sup_int WITH iprocfail;
ISignalDI di_proc_sup, 1, proc_sup_int;
ENDPROC
PROC my_proc_off()
SetDO do_myproc, 0;
IDelete proc_sup_int;
ENDPROC
ENDMODULE
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
| 329
|
1 Instructions
1.117. ProcerrRecovery - Generate and recover from process-move error
RobotWare - OS
3HAC 16581-1 Revision: J
326
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
ProcerrRecovery[\SyncOrgMoveInst] | [\SyncLastMoveInst]
[\ProcSignal]
[\SyncOrgMoveInst]
Data type: switch
The error can be handled in the routine that created the actual path on which the error
occurred.
[\SyncLastMoveInst]
Data type: switch
The error can be handled in the routine where the program is currently executing a move
instruction when the error occurred.
If the program is currently not executing a move instruction when the error occurred then the
transfer of the execution to the ERROR handler will be delayed until the program executes the
next move instruction. This means that the transfer to the ERROR handler will be delayed if
the robot is in a stop point or between the prefetch point and the middle of the corner path.
The error can be handled in that routine.
[\ProcSignal ]
Data type: signaldo
Optional parameter that let the user turn on/off the use of the instruction. If this parameter is
used and the signal value is 0, an recoverable error will be thrown, and no process error will
be generated.
Program execution
Execution of ProcerrRecovery in continuous mode results in the following:
•
At once the robot is stopped on its path.
•
The variable ERRNO is set to ERR_PATH_STOP .
•
The execution is transferred to some ERROR handler according the rules for
asynchronously raised errors.
This instruction does nothing in any step mode.
For description of asynchronously raised errors that are generated with ProcerrRecovery
see RAPID kernel reference/Error recovery/Asynchronously raised errors.
ProcerrRecovery can also be used in MultiMove system to transfer the execution to the
ERROR handler in several program tasks if running in synchronized mode.
Continued
Continues on next page
1 Instructions
1.117. ProcerrRecovery - Generate and recover from process-move error
RobotWare - OS
327
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of how to use the instruction ProcerrRecovery are illustrated below.
Example with ProcerrRecovery\SyncOrgMoveInst
MODULE user_module
VAR intnum proc_sup_int;
PROC main()
...
MoveL p1, v1000, fine, tool1;
do_process;
...
ENDPROC
PROC do_process()
my_proc_on;
MoveL p2, v200, z10, tool1;
MoveL p3, v200, fine, tool1;
my_proc_off;
ERROR
IF ERRNO = ERR_PATH_STOP THEN
my_proc_on;
StartMove;
RETRY;
ENDIF
ENDPROC
TRAP iprocfail
my_proc_off;
ProcerrRecovery \SyncOrgMoveInst;
ENDTRAP
PROC my_proc_on()
SetDO do_myproc, 1;
CONNECT proc_sup_int WITH iprocfail;
ISignalDI di_proc_sup, 1, proc_sup_int;
ENDPROC
PROC my_proc_off()
SetDO do_myproc, 0;
IDelete proc_sup_int;
ENDPROC
ENDMODULE
Continued
Continues on next page
1 Instructions
1.117. ProcerrRecovery - Generate and recover from process-move error
RobotWare - OS
3HAC 16581-1 Revision: J
328
© Copyright 2004-2010 ABB. All rights reserved.
Asynchronously raised errors generated by ProcerrRecovery with switch
\ SyncOrgMoveInst can, in this example, be treated in the routine do_process because the
path on which the error occurred is always created in the routine d o_process .
A process flow is started by setting the signal do_myproc to 1 . The signal di_proc_sup
supervise the process, and an asynchronous error is raised if di_proc_sup becomes 1 . In
this simple example the error is resolved by setting do_myproc to 1 again before resuming
the movement.
Example with ProcerrRecovery\SyncLastMoveInst
MODULE user_module
PROC main()
...
MoveL p1, v1000, fine, tool1;
do_process;
...
ENDPROC
PROC do_process()
proc_on;
proc_move p2, v200, z10, tool1;
proc_move p3, v200, fine, tool1;
proc_off;
ERROR
IF ERRNO = ERR_PATH_STOP THEN
StorePath;
p4 := CRobT(\Tool:=tool1);
! Move to service station and fix the problem
MoveL p4, v200, fine, tool1;
RestoPath;
proc_on;
StartMoveRetry;
ENDIF
ENDPROC
ENDMODULE
MODULE proc_module (SYSMODULE, NOSTEPIN)
VAR intnum proc_sup_int;
VAR num try_no := 0;
TRAP iprocfail
proc_off;
ProcerrRecovery \SyncLastMoveInst;
ENDTRAP
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
| 330
|
1 Instructions
1.117. ProcerrRecovery - Generate and recover from process-move error
RobotWare - OS
327
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of how to use the instruction ProcerrRecovery are illustrated below.
Example with ProcerrRecovery\SyncOrgMoveInst
MODULE user_module
VAR intnum proc_sup_int;
PROC main()
...
MoveL p1, v1000, fine, tool1;
do_process;
...
ENDPROC
PROC do_process()
my_proc_on;
MoveL p2, v200, z10, tool1;
MoveL p3, v200, fine, tool1;
my_proc_off;
ERROR
IF ERRNO = ERR_PATH_STOP THEN
my_proc_on;
StartMove;
RETRY;
ENDIF
ENDPROC
TRAP iprocfail
my_proc_off;
ProcerrRecovery \SyncOrgMoveInst;
ENDTRAP
PROC my_proc_on()
SetDO do_myproc, 1;
CONNECT proc_sup_int WITH iprocfail;
ISignalDI di_proc_sup, 1, proc_sup_int;
ENDPROC
PROC my_proc_off()
SetDO do_myproc, 0;
IDelete proc_sup_int;
ENDPROC
ENDMODULE
Continued
Continues on next page
1 Instructions
1.117. ProcerrRecovery - Generate and recover from process-move error
RobotWare - OS
3HAC 16581-1 Revision: J
328
© Copyright 2004-2010 ABB. All rights reserved.
Asynchronously raised errors generated by ProcerrRecovery with switch
\ SyncOrgMoveInst can, in this example, be treated in the routine do_process because the
path on which the error occurred is always created in the routine d o_process .
A process flow is started by setting the signal do_myproc to 1 . The signal di_proc_sup
supervise the process, and an asynchronous error is raised if di_proc_sup becomes 1 . In
this simple example the error is resolved by setting do_myproc to 1 again before resuming
the movement.
Example with ProcerrRecovery\SyncLastMoveInst
MODULE user_module
PROC main()
...
MoveL p1, v1000, fine, tool1;
do_process;
...
ENDPROC
PROC do_process()
proc_on;
proc_move p2, v200, z10, tool1;
proc_move p3, v200, fine, tool1;
proc_off;
ERROR
IF ERRNO = ERR_PATH_STOP THEN
StorePath;
p4 := CRobT(\Tool:=tool1);
! Move to service station and fix the problem
MoveL p4, v200, fine, tool1;
RestoPath;
proc_on;
StartMoveRetry;
ENDIF
ENDPROC
ENDMODULE
MODULE proc_module (SYSMODULE, NOSTEPIN)
VAR intnum proc_sup_int;
VAR num try_no := 0;
TRAP iprocfail
proc_off;
ProcerrRecovery \SyncLastMoveInst;
ENDTRAP
Continued
Continues on next page
1 Instructions
1.117. ProcerrRecovery - Generate and recover from process-move error
RobotWare - OS
329
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
PROC proc_on()
SetDO do_proc, 1;
CONNECT proc_sup_int WITH iprocfail;
ISignalDI di_proc_sup, 1, proc_sup_int;
ENDPROC
PROC proc_off()
SetDO do_proc, 0;
IDelete proc_sup_int;
ENDPROC
PROC proc_move (robtarget ToPoint, speeddata Speed, zonedata Zone,
PERS tooldata Tool)
MoveL ToPoint, Speed, Zone, Tool;
ERROR
IF ERRNO = ERR_PATH_STOP THEN
try_no := try_no + 1;
IF try_no < 4 THEN
proc_on;
StartMoveRetry;
ELSE
RaiseToUser \Continue;
ENDIF
ENDPROC
ENDMODULE
Asynchronously raised errors generated by ProcerrRecovery with switch
\SyncLastMoveInst can in this example be treated in the routine proc_move because all
move instructions are always created in the routine proc_move. When program pointer is in
routine do_process the transfer to ERROR handler will be delayed until running the next
MoveL in routine proc_move. Note that the movements are always stopped at once.
A process flow is started by setting the signal do_myproc to 1 . The signal di_proc_sup
supervise the process, and an asynchronous error is raised if di_proc_sup becomes 1 . In
this simple example the error is resolved by setting do_myproc to 1 again before resuming
the movement.
When using predefined NOSTEPIN routine we recommend using the option switch parameter
\ SyncLastMoveInst because then the predefined routine can make the decision to handle
some error situation within the routine while others must be handled by the end user.
Error handling
Following recoverable errors can be generated. The errors can be handled in an error handler.
If the optional parameter \ProcSignal is used and if the signal is off when the instruction
is executed, the system variable ERRNO is set to ERR_PROCSIGNAL_OFF and the execution
continues in the error handler.
If there is no contact with the I/O unit, the system variable ERRNO is set to ERR_NORUNUNIT
and the execution continues 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
| 331
|
1 Instructions
1.117. ProcerrRecovery - Generate and recover from process-move error
RobotWare - OS
3HAC 16581-1 Revision: J
328
© Copyright 2004-2010 ABB. All rights reserved.
Asynchronously raised errors generated by ProcerrRecovery with switch
\ SyncOrgMoveInst can, in this example, be treated in the routine do_process because the
path on which the error occurred is always created in the routine d o_process .
A process flow is started by setting the signal do_myproc to 1 . The signal di_proc_sup
supervise the process, and an asynchronous error is raised if di_proc_sup becomes 1 . In
this simple example the error is resolved by setting do_myproc to 1 again before resuming
the movement.
Example with ProcerrRecovery\SyncLastMoveInst
MODULE user_module
PROC main()
...
MoveL p1, v1000, fine, tool1;
do_process;
...
ENDPROC
PROC do_process()
proc_on;
proc_move p2, v200, z10, tool1;
proc_move p3, v200, fine, tool1;
proc_off;
ERROR
IF ERRNO = ERR_PATH_STOP THEN
StorePath;
p4 := CRobT(\Tool:=tool1);
! Move to service station and fix the problem
MoveL p4, v200, fine, tool1;
RestoPath;
proc_on;
StartMoveRetry;
ENDIF
ENDPROC
ENDMODULE
MODULE proc_module (SYSMODULE, NOSTEPIN)
VAR intnum proc_sup_int;
VAR num try_no := 0;
TRAP iprocfail
proc_off;
ProcerrRecovery \SyncLastMoveInst;
ENDTRAP
Continued
Continues on next page
1 Instructions
1.117. ProcerrRecovery - Generate and recover from process-move error
RobotWare - OS
329
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
PROC proc_on()
SetDO do_proc, 1;
CONNECT proc_sup_int WITH iprocfail;
ISignalDI di_proc_sup, 1, proc_sup_int;
ENDPROC
PROC proc_off()
SetDO do_proc, 0;
IDelete proc_sup_int;
ENDPROC
PROC proc_move (robtarget ToPoint, speeddata Speed, zonedata Zone,
PERS tooldata Tool)
MoveL ToPoint, Speed, Zone, Tool;
ERROR
IF ERRNO = ERR_PATH_STOP THEN
try_no := try_no + 1;
IF try_no < 4 THEN
proc_on;
StartMoveRetry;
ELSE
RaiseToUser \Continue;
ENDIF
ENDPROC
ENDMODULE
Asynchronously raised errors generated by ProcerrRecovery with switch
\SyncLastMoveInst can in this example be treated in the routine proc_move because all
move instructions are always created in the routine proc_move. When program pointer is in
routine do_process the transfer to ERROR handler will be delayed until running the next
MoveL in routine proc_move. Note that the movements are always stopped at once.
A process flow is started by setting the signal do_myproc to 1 . The signal di_proc_sup
supervise the process, and an asynchronous error is raised if di_proc_sup becomes 1 . In
this simple example the error is resolved by setting do_myproc to 1 again before resuming
the movement.
When using predefined NOSTEPIN routine we recommend using the option switch parameter
\ SyncLastMoveInst because then the predefined routine can make the decision to handle
some error situation within the routine while others must be handled by the end user.
Error handling
Following recoverable errors can be generated. The errors can be handled in an error handler.
If the optional parameter \ProcSignal is used and if the signal is off when the instruction
is executed, the system variable ERRNO is set to ERR_PROCSIGNAL_OFF and the execution
continues in the error handler.
If there is no contact with the I/O unit, the system variable ERRNO is set to ERR_NORUNUNIT
and the execution continues in the error handler.
Continued
Continues on next page
1 Instructions
1.117. ProcerrRecovery - Generate and recover from process-move error
RobotWare - OS
3HAC 16581-1 Revision: J
330
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
Error recovery from asynchronously raised process errors can only be done if the motion task
with the process move instruction is executing on base level when the process error occurs.
So error recovery can not be done if the program task with the process instruction executes in:
•
any event routine
•
any routine handler ( ERROR , BACKWARD or UNDO )
•
user execution level (service routine)
See RAPID reference manual - RAPID kernel , Error recovery , Asynchronously raised errors .
If no error handler with a StartMove + RETRY or a StartMoveRetry is used, the program
execcution will hang. The only way to reset this is to do a PP to main.
Syntax
ProcerrRecovery
[ ’\’ SyncOrgMoveInst ] | [’ \’ SyncLastMoveInst ]
[ ’\’ ProcSignal’ :=’ ] < variable ( VAR ) of signaldo > ’;’
Related information
For information about
See
Error handlers
Technical reference manual - RAPID overview ,
section Basic Characteristics - Error Recovery
Asynchronously raised errors
RAPID reference manual - RAPID kernel - Error
recover
Propagates an error to user level
RaiseToUser - Propagates an error to user level
on page 337
Resume movement and program
execution
StartMoveRetry - Restarts robot movement and
execution on page 489
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 332
|
1 Instructions
1.117. ProcerrRecovery - Generate and recover from process-move error
RobotWare - OS
329
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
PROC proc_on()
SetDO do_proc, 1;
CONNECT proc_sup_int WITH iprocfail;
ISignalDI di_proc_sup, 1, proc_sup_int;
ENDPROC
PROC proc_off()
SetDO do_proc, 0;
IDelete proc_sup_int;
ENDPROC
PROC proc_move (robtarget ToPoint, speeddata Speed, zonedata Zone,
PERS tooldata Tool)
MoveL ToPoint, Speed, Zone, Tool;
ERROR
IF ERRNO = ERR_PATH_STOP THEN
try_no := try_no + 1;
IF try_no < 4 THEN
proc_on;
StartMoveRetry;
ELSE
RaiseToUser \Continue;
ENDIF
ENDPROC
ENDMODULE
Asynchronously raised errors generated by ProcerrRecovery with switch
\SyncLastMoveInst can in this example be treated in the routine proc_move because all
move instructions are always created in the routine proc_move. When program pointer is in
routine do_process the transfer to ERROR handler will be delayed until running the next
MoveL in routine proc_move. Note that the movements are always stopped at once.
A process flow is started by setting the signal do_myproc to 1 . The signal di_proc_sup
supervise the process, and an asynchronous error is raised if di_proc_sup becomes 1 . In
this simple example the error is resolved by setting do_myproc to 1 again before resuming
the movement.
When using predefined NOSTEPIN routine we recommend using the option switch parameter
\ SyncLastMoveInst because then the predefined routine can make the decision to handle
some error situation within the routine while others must be handled by the end user.
Error handling
Following recoverable errors can be generated. The errors can be handled in an error handler.
If the optional parameter \ProcSignal is used and if the signal is off when the instruction
is executed, the system variable ERRNO is set to ERR_PROCSIGNAL_OFF and the execution
continues in the error handler.
If there is no contact with the I/O unit, the system variable ERRNO is set to ERR_NORUNUNIT
and the execution continues in the error handler.
Continued
Continues on next page
1 Instructions
1.117. ProcerrRecovery - Generate and recover from process-move error
RobotWare - OS
3HAC 16581-1 Revision: J
330
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
Error recovery from asynchronously raised process errors can only be done if the motion task
with the process move instruction is executing on base level when the process error occurs.
So error recovery can not be done if the program task with the process instruction executes in:
•
any event routine
•
any routine handler ( ERROR , BACKWARD or UNDO )
•
user execution level (service routine)
See RAPID reference manual - RAPID kernel , Error recovery , Asynchronously raised errors .
If no error handler with a StartMove + RETRY or a StartMoveRetry is used, the program
execcution will hang. The only way to reset this is to do a PP to main.
Syntax
ProcerrRecovery
[ ’\’ SyncOrgMoveInst ] | [’ \’ SyncLastMoveInst ]
[ ’\’ ProcSignal’ :=’ ] < variable ( VAR ) of signaldo > ’;’
Related information
For information about
See
Error handlers
Technical reference manual - RAPID overview ,
section Basic Characteristics - Error Recovery
Asynchronously raised errors
RAPID reference manual - RAPID kernel - Error
recover
Propagates an error to user level
RaiseToUser - Propagates an error to user level
on page 337
Resume movement and program
execution
StartMoveRetry - Restarts robot movement and
execution on page 489
Continued
1 Instructions
1.118. PulseDO - Generates a pulse on a digital output signal
RobotWare - OS
331
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.118. PulseDO - Generates a pulse on a digital output signal
Usage
PulseDO is used to generate a pulse on a digital output signal.
Basic examples
Basic examples of the instruction PulseDO are illustrated below.
Example 1
PulseDO do15;
A pulse with a pulse length of 0.2 s is generated on the output signal do15 .
Example 2
PulseDO \PLength:=1.0, ignition;
A pulse of length 1.0 s is generated on the signal ignition .
Example 3
! Program task MAIN
PulseDO \High, do3;
! At almost the same time in program task BCK1
PulseDO \High, do3;
Positive pulse (value 1) is generated on the signal do3 from two program tasks at almost the
same time. It will result in one positive pulse with a pulse length longer than the default 0.2
s or two positive pulses after each other with a pulse length of 0.2 s.
Arguments
PulseDO [ \High ] [ \PLength ] Signal
[ \High ]
High level
Data type: switch
Specifies that the signal value should always be set to high (value 1) when the instruction is
executed independently of its current state.
[ \PLength ]
Pulse Length
Data type: num
The length of the pulse in seconds (0.001 - 2000 s). If the argument is omitted a 0.2 second
pulse is generated.
Signal
Data type: signaldo
The name of the signal on which a pulse is to be generated.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 333
|
1 Instructions
1.117. ProcerrRecovery - Generate and recover from process-move error
RobotWare - OS
3HAC 16581-1 Revision: J
330
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
Error recovery from asynchronously raised process errors can only be done if the motion task
with the process move instruction is executing on base level when the process error occurs.
So error recovery can not be done if the program task with the process instruction executes in:
•
any event routine
•
any routine handler ( ERROR , BACKWARD or UNDO )
•
user execution level (service routine)
See RAPID reference manual - RAPID kernel , Error recovery , Asynchronously raised errors .
If no error handler with a StartMove + RETRY or a StartMoveRetry is used, the program
execcution will hang. The only way to reset this is to do a PP to main.
Syntax
ProcerrRecovery
[ ’\’ SyncOrgMoveInst ] | [’ \’ SyncLastMoveInst ]
[ ’\’ ProcSignal’ :=’ ] < variable ( VAR ) of signaldo > ’;’
Related information
For information about
See
Error handlers
Technical reference manual - RAPID overview ,
section Basic Characteristics - Error Recovery
Asynchronously raised errors
RAPID reference manual - RAPID kernel - Error
recover
Propagates an error to user level
RaiseToUser - Propagates an error to user level
on page 337
Resume movement and program
execution
StartMoveRetry - Restarts robot movement and
execution on page 489
Continued
1 Instructions
1.118. PulseDO - Generates a pulse on a digital output signal
RobotWare - OS
331
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.118. PulseDO - Generates a pulse on a digital output signal
Usage
PulseDO is used to generate a pulse on a digital output signal.
Basic examples
Basic examples of the instruction PulseDO are illustrated below.
Example 1
PulseDO do15;
A pulse with a pulse length of 0.2 s is generated on the output signal do15 .
Example 2
PulseDO \PLength:=1.0, ignition;
A pulse of length 1.0 s is generated on the signal ignition .
Example 3
! Program task MAIN
PulseDO \High, do3;
! At almost the same time in program task BCK1
PulseDO \High, do3;
Positive pulse (value 1) is generated on the signal do3 from two program tasks at almost the
same time. It will result in one positive pulse with a pulse length longer than the default 0.2
s or two positive pulses after each other with a pulse length of 0.2 s.
Arguments
PulseDO [ \High ] [ \PLength ] Signal
[ \High ]
High level
Data type: switch
Specifies that the signal value should always be set to high (value 1) when the instruction is
executed independently of its current state.
[ \PLength ]
Pulse Length
Data type: num
The length of the pulse in seconds (0.001 - 2000 s). If the argument is omitted a 0.2 second
pulse is generated.
Signal
Data type: signaldo
The name of the signal on which a pulse is to be generated.
Continues on next page
1 Instructions
1.118. PulseDO - Generates a pulse on a digital output signal
RobotWare - OS
3HAC 16581-1 Revision: J
332
© Copyright 2004-2010 ABB. All rights reserved.
Program execution
The next instruction after PulseDO is executed directly after the pulse starts. The pulse can
then be set/reset without affecting the rest of the program execution.
The figure below shows examples of generation of pulses on a digital output signal.
xx0500002217
The next instruction is executed directly after the pulse starts. The pulse can then be set/reset
without affecting the rest of the program execution.
Limitations
The length of the pulse has a resolution off 0.001 seconds. Programmed values that differ
from this are rounded off.
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
| 334
|
1 Instructions
1.118. PulseDO - Generates a pulse on a digital output signal
RobotWare - OS
331
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.118. PulseDO - Generates a pulse on a digital output signal
Usage
PulseDO is used to generate a pulse on a digital output signal.
Basic examples
Basic examples of the instruction PulseDO are illustrated below.
Example 1
PulseDO do15;
A pulse with a pulse length of 0.2 s is generated on the output signal do15 .
Example 2
PulseDO \PLength:=1.0, ignition;
A pulse of length 1.0 s is generated on the signal ignition .
Example 3
! Program task MAIN
PulseDO \High, do3;
! At almost the same time in program task BCK1
PulseDO \High, do3;
Positive pulse (value 1) is generated on the signal do3 from two program tasks at almost the
same time. It will result in one positive pulse with a pulse length longer than the default 0.2
s or two positive pulses after each other with a pulse length of 0.2 s.
Arguments
PulseDO [ \High ] [ \PLength ] Signal
[ \High ]
High level
Data type: switch
Specifies that the signal value should always be set to high (value 1) when the instruction is
executed independently of its current state.
[ \PLength ]
Pulse Length
Data type: num
The length of the pulse in seconds (0.001 - 2000 s). If the argument is omitted a 0.2 second
pulse is generated.
Signal
Data type: signaldo
The name of the signal on which a pulse is to be generated.
Continues on next page
1 Instructions
1.118. PulseDO - Generates a pulse on a digital output signal
RobotWare - OS
3HAC 16581-1 Revision: J
332
© Copyright 2004-2010 ABB. All rights reserved.
Program execution
The next instruction after PulseDO is executed directly after the pulse starts. The pulse can
then be set/reset without affecting the rest of the program execution.
The figure below shows examples of generation of pulses on a digital output signal.
xx0500002217
The next instruction is executed directly after the pulse starts. The pulse can then be set/reset
without affecting the rest of the program execution.
Limitations
The length of the pulse has a resolution off 0.001 seconds. Programmed values that differ
from this are rounded off.
Continued
Continues on next page
1 Instructions
1.118. PulseDO - Generates a pulse on a digital output signal
RobotWare - OS
333
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Error handling
Following a recoverable error can be generated. The error can be handled in an error handler.
The system variable ERRNO will be set to:
ERR_NORUNUNIT
if there is no contact with the unit.
Syntax
PulseDO
[ ’\’High]
[ ’\’PLength’ :=’ < expression ( IN ) of num >] ´,’
[ Signal ’:=’ ] < variable ( VAR ) of signaldo > ’;’
Related information
For information about
See
Input/Output instructions
Technical reference manual - RAPID overview ,
section RAPID summary - Input and output signals
Input/Output functionality in general
Technical reference manual - RAPID overview ,
section Motion and I/O principles - I/O principles
Configuration of I/O
Technical reference manual - System parameters
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 335
|
1 Instructions
1.118. PulseDO - Generates a pulse on a digital output signal
RobotWare - OS
3HAC 16581-1 Revision: J
332
© Copyright 2004-2010 ABB. All rights reserved.
Program execution
The next instruction after PulseDO is executed directly after the pulse starts. The pulse can
then be set/reset without affecting the rest of the program execution.
The figure below shows examples of generation of pulses on a digital output signal.
xx0500002217
The next instruction is executed directly after the pulse starts. The pulse can then be set/reset
without affecting the rest of the program execution.
Limitations
The length of the pulse has a resolution off 0.001 seconds. Programmed values that differ
from this are rounded off.
Continued
Continues on next page
1 Instructions
1.118. PulseDO - Generates a pulse on a digital output signal
RobotWare - OS
333
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Error handling
Following a recoverable error can be generated. The error can be handled in an error handler.
The system variable ERRNO will be set to:
ERR_NORUNUNIT
if there is no contact with the unit.
Syntax
PulseDO
[ ’\’High]
[ ’\’PLength’ :=’ < expression ( IN ) of num >] ´,’
[ Signal ’:=’ ] < variable ( VAR ) of signaldo > ’;’
Related information
For information about
See
Input/Output instructions
Technical reference manual - RAPID overview ,
section RAPID summary - Input and output signals
Input/Output functionality in general
Technical reference manual - RAPID overview ,
section Motion and I/O principles - I/O principles
Configuration of I/O
Technical reference manual - System parameters
Continued
1 Instructions
1.119. RAISE - Calls an error handler
RobotWare-OS
3HAC 16581-1 Revision: J
334
© Copyright 2004-2010 ABB. All rights reserved.
1.119. RAISE - Calls an error handler
Usage
RAISE is used to create an error in the program and then to call the error handler of the
routine.
RAISE can also be used in the error handler to propagate the current error to the error handler
of the calling routine.
This instruction can, for example, be used to jump back to a higher level in the structure of
the program, e.g. to the error handler in the main routine if an error occurs at a lower level.
Basic examples
Basic examples of the instruction RAISE are illustrated below.
See also More examples on page 335 .
Example 1
MODULE MainModule .
VAR errnum ERR_MY_ERR := -1;
PROC main()
BookErrNo ERR_MY_ERR;
IF di1 = 0 THEN
RAISE ERR_MY_ERR;
ENDIF
ERROR
IF ERRNO = ERR_MY_ERR THEN
TPWrite "di1 equals 0";
ENDIF
ENDPROC
ENDMODULE
For this implementation di1 equals 0 is regarded as an error. RAISE will force the execution
to the error handler. In this example the user has created his own error number to handle the
specific error. BookErrNo belongs to the base functionality Advanced RAPID .
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 336
|
1 Instructions
1.118. PulseDO - Generates a pulse on a digital output signal
RobotWare - OS
333
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Error handling
Following a recoverable error can be generated. The error can be handled in an error handler.
The system variable ERRNO will be set to:
ERR_NORUNUNIT
if there is no contact with the unit.
Syntax
PulseDO
[ ’\’High]
[ ’\’PLength’ :=’ < expression ( IN ) of num >] ´,’
[ Signal ’:=’ ] < variable ( VAR ) of signaldo > ’;’
Related information
For information about
See
Input/Output instructions
Technical reference manual - RAPID overview ,
section RAPID summary - Input and output signals
Input/Output functionality in general
Technical reference manual - RAPID overview ,
section Motion and I/O principles - I/O principles
Configuration of I/O
Technical reference manual - System parameters
Continued
1 Instructions
1.119. RAISE - Calls an error handler
RobotWare-OS
3HAC 16581-1 Revision: J
334
© Copyright 2004-2010 ABB. All rights reserved.
1.119. RAISE - Calls an error handler
Usage
RAISE is used to create an error in the program and then to call the error handler of the
routine.
RAISE can also be used in the error handler to propagate the current error to the error handler
of the calling routine.
This instruction can, for example, be used to jump back to a higher level in the structure of
the program, e.g. to the error handler in the main routine if an error occurs at a lower level.
Basic examples
Basic examples of the instruction RAISE are illustrated below.
See also More examples on page 335 .
Example 1
MODULE MainModule .
VAR errnum ERR_MY_ERR := -1;
PROC main()
BookErrNo ERR_MY_ERR;
IF di1 = 0 THEN
RAISE ERR_MY_ERR;
ENDIF
ERROR
IF ERRNO = ERR_MY_ERR THEN
TPWrite "di1 equals 0";
ENDIF
ENDPROC
ENDMODULE
For this implementation di1 equals 0 is regarded as an error. RAISE will force the execution
to the error handler. In this example the user has created his own error number to handle the
specific error. BookErrNo belongs to the base functionality Advanced RAPID .
Continues on next page
1 Instructions
1.119. RAISE - Calls an error handler
RobotWare-OS
335
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
RAISE [ Error no. ]
Error no.
Data type: errnum
Error number: Any number between 1 and 90 which the error handler can use to locate the
error that has occurred (the ERRNO system variable).
It is also possible to book an error number outside the range 1-90 with the instruction
BookErrNo .
The error number must be specified outside the error handler in a RAISE instruction in order
to be able to transfer execution to the error handler of that routine.
If the instruction is present in a routine’s error handler then the error is propagated to the error
handler of the calling routine. In this case the error number does not have to be specified.
More examples
More examples of the instruction RAISE are illustrated below.
Example 1
MODULE MainModule
VAR num value1 := 10;
VAR num value2 := 0;
PROC main()
routine1;
ERROR
IF ERRNO = ERR_DIVZERO THEN
value2 := 1;
RETRY;
ENDIF
ENDPROC
PROC routine1()
value1 := 5/value2;!This will lead to an error when value2 is
equal to 0.
ERROR
RAISE;
ENDPROC
ENDMODULE
In this example the division with zero will result in an error. In the ERROR -handler RAISE will
propagate the error to the ERROR-handler in the calling routine "main". The same error
number remains active. RETRY will re-run the whole routine "routine1".
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
| 337
|
1 Instructions
1.119. RAISE - Calls an error handler
RobotWare-OS
3HAC 16581-1 Revision: J
334
© Copyright 2004-2010 ABB. All rights reserved.
1.119. RAISE - Calls an error handler
Usage
RAISE is used to create an error in the program and then to call the error handler of the
routine.
RAISE can also be used in the error handler to propagate the current error to the error handler
of the calling routine.
This instruction can, for example, be used to jump back to a higher level in the structure of
the program, e.g. to the error handler in the main routine if an error occurs at a lower level.
Basic examples
Basic examples of the instruction RAISE are illustrated below.
See also More examples on page 335 .
Example 1
MODULE MainModule .
VAR errnum ERR_MY_ERR := -1;
PROC main()
BookErrNo ERR_MY_ERR;
IF di1 = 0 THEN
RAISE ERR_MY_ERR;
ENDIF
ERROR
IF ERRNO = ERR_MY_ERR THEN
TPWrite "di1 equals 0";
ENDIF
ENDPROC
ENDMODULE
For this implementation di1 equals 0 is regarded as an error. RAISE will force the execution
to the error handler. In this example the user has created his own error number to handle the
specific error. BookErrNo belongs to the base functionality Advanced RAPID .
Continues on next page
1 Instructions
1.119. RAISE - Calls an error handler
RobotWare-OS
335
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
RAISE [ Error no. ]
Error no.
Data type: errnum
Error number: Any number between 1 and 90 which the error handler can use to locate the
error that has occurred (the ERRNO system variable).
It is also possible to book an error number outside the range 1-90 with the instruction
BookErrNo .
The error number must be specified outside the error handler in a RAISE instruction in order
to be able to transfer execution to the error handler of that routine.
If the instruction is present in a routine’s error handler then the error is propagated to the error
handler of the calling routine. In this case the error number does not have to be specified.
More examples
More examples of the instruction RAISE are illustrated below.
Example 1
MODULE MainModule
VAR num value1 := 10;
VAR num value2 := 0;
PROC main()
routine1;
ERROR
IF ERRNO = ERR_DIVZERO THEN
value2 := 1;
RETRY;
ENDIF
ENDPROC
PROC routine1()
value1 := 5/value2;!This will lead to an error when value2 is
equal to 0.
ERROR
RAISE;
ENDPROC
ENDMODULE
In this example the division with zero will result in an error. In the ERROR -handler RAISE will
propagate the error to the ERROR-handler in the calling routine "main". The same error
number remains active. RETRY will re-run the whole routine "routine1".
Continued
Continues on next page
1 Instructions
1.119. RAISE - Calls an error handler
RobotWare-OS
3HAC 16581-1 Revision: J
336
© Copyright 2004-2010 ABB. All rights reserved.
Program execution
Program execution continues in the routine’s error handler. After the error handler has been
executed the program execution can continue with:
•
the routine that called the routine in question (RETURN).
•
the error handler of the routine that called the routine in question (RAISE).
A RAISE instruction in a routine’s error handler also has another feature. It can be used for
long jump (see“ Error Recovery With Long Jump”). With a long jump it is possible to
propagate an error from an error handler from a deep nested call chain to a higher level in one
step.
If the RAISE instruction is present in a trap routine, the error is dealt with by the system’s
error handler.
Error handling
If the error number is out of range then the system variable ERRNO is set to ERR_ILLRAISE
(see "Data types - errnum"). This error can be handled in the error handler.
Syntax
(EBNF)
RAISE [<error number>] ’;’
<error number> ::= <expression>
Related information
For information about
See
Error handling
Technical reference manual - System parameters ,
section Basic Characteristics - Error Recovery
Error recovery with long jump
Technical reference manual - System parameters ,
section Basic Characteristics - Error Recovery
Booking error numbers
BookErrNo - Book a RAPID system error number
on page 30
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 338
|
1 Instructions
1.119. RAISE - Calls an error handler
RobotWare-OS
335
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
RAISE [ Error no. ]
Error no.
Data type: errnum
Error number: Any number between 1 and 90 which the error handler can use to locate the
error that has occurred (the ERRNO system variable).
It is also possible to book an error number outside the range 1-90 with the instruction
BookErrNo .
The error number must be specified outside the error handler in a RAISE instruction in order
to be able to transfer execution to the error handler of that routine.
If the instruction is present in a routine’s error handler then the error is propagated to the error
handler of the calling routine. In this case the error number does not have to be specified.
More examples
More examples of the instruction RAISE are illustrated below.
Example 1
MODULE MainModule
VAR num value1 := 10;
VAR num value2 := 0;
PROC main()
routine1;
ERROR
IF ERRNO = ERR_DIVZERO THEN
value2 := 1;
RETRY;
ENDIF
ENDPROC
PROC routine1()
value1 := 5/value2;!This will lead to an error when value2 is
equal to 0.
ERROR
RAISE;
ENDPROC
ENDMODULE
In this example the division with zero will result in an error. In the ERROR -handler RAISE will
propagate the error to the ERROR-handler in the calling routine "main". The same error
number remains active. RETRY will re-run the whole routine "routine1".
Continued
Continues on next page
1 Instructions
1.119. RAISE - Calls an error handler
RobotWare-OS
3HAC 16581-1 Revision: J
336
© Copyright 2004-2010 ABB. All rights reserved.
Program execution
Program execution continues in the routine’s error handler. After the error handler has been
executed the program execution can continue with:
•
the routine that called the routine in question (RETURN).
•
the error handler of the routine that called the routine in question (RAISE).
A RAISE instruction in a routine’s error handler also has another feature. It can be used for
long jump (see“ Error Recovery With Long Jump”). With a long jump it is possible to
propagate an error from an error handler from a deep nested call chain to a higher level in one
step.
If the RAISE instruction is present in a trap routine, the error is dealt with by the system’s
error handler.
Error handling
If the error number is out of range then the system variable ERRNO is set to ERR_ILLRAISE
(see "Data types - errnum"). This error can be handled in the error handler.
Syntax
(EBNF)
RAISE [<error number>] ’;’
<error number> ::= <expression>
Related information
For information about
See
Error handling
Technical reference manual - System parameters ,
section Basic Characteristics - Error Recovery
Error recovery with long jump
Technical reference manual - System parameters ,
section Basic Characteristics - Error Recovery
Booking error numbers
BookErrNo - Book a RAPID system error number
on page 30
Continued
1 Instructions
1.120. RaiseToUser - Propagates an error to user level
RobotWare - OS
337
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.120. RaiseToUser - Propagates an error to user level
Usage
RaiseToUser is used in an error handler in nostepin routines to propagate the current error
or any other defined error to the error handler at user level. User level is in this case the first
routine in a call chain above a nostepin routine.
Basic examples
Basic examples of the instruction RaiseToUser are illustrated below.
Example 1
MODULE MyModule
VAR errnum ERR_MYDIVZERO:= -1;
PROC main()
BookErrNo ERR_MYDIVZERO;
...
routine1;
...
ERROR
IF ERRNO = ERR_MYDIVZERO THEN
TRYNEXT;
ELSE
RETRY;
ENDIF
ENDPROC
ENDMODULE
MODULE MySysModule (SYSMODULE, NOSTEPIN, VIEWONLY)
PROC routine1()
...
routine2;
...
UNDO
! Free allocated resources
ENDPROC
PROC routine2()
VAR num n:=0;
...
reg1:=reg2/n;
...
ERROR
IF ERRNO = ERR_DIVZERO THEN
RaiseToUser \Continue \ErrorNumber:=ERR_MYDIVZERO;
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 339
|
1 Instructions
1.119. RAISE - Calls an error handler
RobotWare-OS
3HAC 16581-1 Revision: J
336
© Copyright 2004-2010 ABB. All rights reserved.
Program execution
Program execution continues in the routine’s error handler. After the error handler has been
executed the program execution can continue with:
•
the routine that called the routine in question (RETURN).
•
the error handler of the routine that called the routine in question (RAISE).
A RAISE instruction in a routine’s error handler also has another feature. It can be used for
long jump (see“ Error Recovery With Long Jump”). With a long jump it is possible to
propagate an error from an error handler from a deep nested call chain to a higher level in one
step.
If the RAISE instruction is present in a trap routine, the error is dealt with by the system’s
error handler.
Error handling
If the error number is out of range then the system variable ERRNO is set to ERR_ILLRAISE
(see "Data types - errnum"). This error can be handled in the error handler.
Syntax
(EBNF)
RAISE [<error number>] ’;’
<error number> ::= <expression>
Related information
For information about
See
Error handling
Technical reference manual - System parameters ,
section Basic Characteristics - Error Recovery
Error recovery with long jump
Technical reference manual - System parameters ,
section Basic Characteristics - Error Recovery
Booking error numbers
BookErrNo - Book a RAPID system error number
on page 30
Continued
1 Instructions
1.120. RaiseToUser - Propagates an error to user level
RobotWare - OS
337
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.120. RaiseToUser - Propagates an error to user level
Usage
RaiseToUser is used in an error handler in nostepin routines to propagate the current error
or any other defined error to the error handler at user level. User level is in this case the first
routine in a call chain above a nostepin routine.
Basic examples
Basic examples of the instruction RaiseToUser are illustrated below.
Example 1
MODULE MyModule
VAR errnum ERR_MYDIVZERO:= -1;
PROC main()
BookErrNo ERR_MYDIVZERO;
...
routine1;
...
ERROR
IF ERRNO = ERR_MYDIVZERO THEN
TRYNEXT;
ELSE
RETRY;
ENDIF
ENDPROC
ENDMODULE
MODULE MySysModule (SYSMODULE, NOSTEPIN, VIEWONLY)
PROC routine1()
...
routine2;
...
UNDO
! Free allocated resources
ENDPROC
PROC routine2()
VAR num n:=0;
...
reg1:=reg2/n;
...
ERROR
IF ERRNO = ERR_DIVZERO THEN
RaiseToUser \Continue \ErrorNumber:=ERR_MYDIVZERO;
Continues on next page
1 Instructions
1.120. RaiseToUser - Propagates an error to user level
RobotWare - OS
3HAC 16581-1 Revision: J
338
© Copyright 2004-2010 ABB. All rights reserved.
ELSE
RaiseToUser \BreakOff;
ENDIF
ENDPROC
ENDMODULE
The division by zero in routine2 will propagate up to the error handler in main routine with
the errno set to ERR_MYDIVZERO . The TRYNEXT instruction in main error handler will then
cause the program execution to continue with the instruction after the division by zero in
routine2 . The \Continue switch controls this behavior.
If any other errors occur in routine2 then the \BreakOff switch forces the execution to
continue from the error handler in the main routine. In this case the undo handler in routine1
will be executed while raising it to user level. The RETRY instruction in the error handler in
the main routine will execute routine1 from the beginning once again.
The undo handler in routine1 will also be executed in the \Continue case if a following RAISE
or RETURN is done on the user level.
Arguments
RaiseToUser[ \Continue] | [ \BreakOff][ \ErrorNumber]
[\Continue ]
Data type: switch
Continue the execution in the routine that caused the error.
[\BreakOff]
Data type: switch
Break off the call chain and continue the execution at the user level. Any undo handler in the
call chain will be executed apart from the undo handler in the routine that raised the error.
One of the arguments \Continue or \BreakOff must be programmed to avoid an execution
error.
[\ErrorNumber]
Data type: errnum
Any number between 1 and 90 that the error handler can use to locate the error that has
occurred (the ERRNO system variable).
It is also possible to book an error number outside the range 1-90 with the instruction
BookErrNo .
If the argument \ErrorNumber is not specified then the original error number propagates to
the error handler in the routine at user level.
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
| 340
|
1 Instructions
1.120. RaiseToUser - Propagates an error to user level
RobotWare - OS
337
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.120. RaiseToUser - Propagates an error to user level
Usage
RaiseToUser is used in an error handler in nostepin routines to propagate the current error
or any other defined error to the error handler at user level. User level is in this case the first
routine in a call chain above a nostepin routine.
Basic examples
Basic examples of the instruction RaiseToUser are illustrated below.
Example 1
MODULE MyModule
VAR errnum ERR_MYDIVZERO:= -1;
PROC main()
BookErrNo ERR_MYDIVZERO;
...
routine1;
...
ERROR
IF ERRNO = ERR_MYDIVZERO THEN
TRYNEXT;
ELSE
RETRY;
ENDIF
ENDPROC
ENDMODULE
MODULE MySysModule (SYSMODULE, NOSTEPIN, VIEWONLY)
PROC routine1()
...
routine2;
...
UNDO
! Free allocated resources
ENDPROC
PROC routine2()
VAR num n:=0;
...
reg1:=reg2/n;
...
ERROR
IF ERRNO = ERR_DIVZERO THEN
RaiseToUser \Continue \ErrorNumber:=ERR_MYDIVZERO;
Continues on next page
1 Instructions
1.120. RaiseToUser - Propagates an error to user level
RobotWare - OS
3HAC 16581-1 Revision: J
338
© Copyright 2004-2010 ABB. All rights reserved.
ELSE
RaiseToUser \BreakOff;
ENDIF
ENDPROC
ENDMODULE
The division by zero in routine2 will propagate up to the error handler in main routine with
the errno set to ERR_MYDIVZERO . The TRYNEXT instruction in main error handler will then
cause the program execution to continue with the instruction after the division by zero in
routine2 . The \Continue switch controls this behavior.
If any other errors occur in routine2 then the \BreakOff switch forces the execution to
continue from the error handler in the main routine. In this case the undo handler in routine1
will be executed while raising it to user level. The RETRY instruction in the error handler in
the main routine will execute routine1 from the beginning once again.
The undo handler in routine1 will also be executed in the \Continue case if a following RAISE
or RETURN is done on the user level.
Arguments
RaiseToUser[ \Continue] | [ \BreakOff][ \ErrorNumber]
[\Continue ]
Data type: switch
Continue the execution in the routine that caused the error.
[\BreakOff]
Data type: switch
Break off the call chain and continue the execution at the user level. Any undo handler in the
call chain will be executed apart from the undo handler in the routine that raised the error.
One of the arguments \Continue or \BreakOff must be programmed to avoid an execution
error.
[\ErrorNumber]
Data type: errnum
Any number between 1 and 90 that the error handler can use to locate the error that has
occurred (the ERRNO system variable).
It is also possible to book an error number outside the range 1-90 with the instruction
BookErrNo .
If the argument \ErrorNumber is not specified then the original error number propagates to
the error handler in the routine at user level.
Continued
Continues on next page
1 Instructions
1.120. RaiseToUser - Propagates an error to user level
RobotWare - OS
339
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Program execution
RaiseToUser can only be used in an error handler in a nostepin routine.
Program execution continues in the error handler of the routine at user level. The error
number remains active if the optional parameter \ ErrorNumber is not present. The system’s
error handler deals with the error if there is no error handler on user level. The system’s error
handler is called if none of the argument \ Continue or \ BreakOff is specified.
There are two different behaviors after the error handler has been executed. The program
execution continues in the routine with RaiseToUser if the \Continue switch is on. The
program execution continues at the user level if the \ BreakOff switch is on.
Program execution can continue with:
•
the instruction that caused the error ( RETRY )
•
the following instruction ( TRYNEXT )
•
the error handler of the routine that called the routine at user level ( RAISE )
•
the routine that called the routine at user level ( RETURN )
Error handling
If the error number is out of range then the system variable ERRNO is set to ERR_ILLRAISE
(see "Data types - errnum"). The system’s error handler deals with this error.
Syntax
RaiseToUser
[ ‘\’Continue ]
´|’ [ ‘\’BreakOff ]
[ ‘\’ErrorNumber’ :=’ ] < expression ( IN ) of errnum>‘;’
Related information
For information about
See
Error handling
Technical reference manual - RAPID overview ,
section Basic Characteristics - Error Recovery
Undo handling
Technical reference manual - RAPID overview ,
section Basic Characteristics - UNDO
Booking error numbers
BookErrNo - Book a RAPID system error number
on page 30
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 341
|
1 Instructions
1.120. RaiseToUser - Propagates an error to user level
RobotWare - OS
3HAC 16581-1 Revision: J
338
© Copyright 2004-2010 ABB. All rights reserved.
ELSE
RaiseToUser \BreakOff;
ENDIF
ENDPROC
ENDMODULE
The division by zero in routine2 will propagate up to the error handler in main routine with
the errno set to ERR_MYDIVZERO . The TRYNEXT instruction in main error handler will then
cause the program execution to continue with the instruction after the division by zero in
routine2 . The \Continue switch controls this behavior.
If any other errors occur in routine2 then the \BreakOff switch forces the execution to
continue from the error handler in the main routine. In this case the undo handler in routine1
will be executed while raising it to user level. The RETRY instruction in the error handler in
the main routine will execute routine1 from the beginning once again.
The undo handler in routine1 will also be executed in the \Continue case if a following RAISE
or RETURN is done on the user level.
Arguments
RaiseToUser[ \Continue] | [ \BreakOff][ \ErrorNumber]
[\Continue ]
Data type: switch
Continue the execution in the routine that caused the error.
[\BreakOff]
Data type: switch
Break off the call chain and continue the execution at the user level. Any undo handler in the
call chain will be executed apart from the undo handler in the routine that raised the error.
One of the arguments \Continue or \BreakOff must be programmed to avoid an execution
error.
[\ErrorNumber]
Data type: errnum
Any number between 1 and 90 that the error handler can use to locate the error that has
occurred (the ERRNO system variable).
It is also possible to book an error number outside the range 1-90 with the instruction
BookErrNo .
If the argument \ErrorNumber is not specified then the original error number propagates to
the error handler in the routine at user level.
Continued
Continues on next page
1 Instructions
1.120. RaiseToUser - Propagates an error to user level
RobotWare - OS
339
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Program execution
RaiseToUser can only be used in an error handler in a nostepin routine.
Program execution continues in the error handler of the routine at user level. The error
number remains active if the optional parameter \ ErrorNumber is not present. The system’s
error handler deals with the error if there is no error handler on user level. The system’s error
handler is called if none of the argument \ Continue or \ BreakOff is specified.
There are two different behaviors after the error handler has been executed. The program
execution continues in the routine with RaiseToUser if the \Continue switch is on. The
program execution continues at the user level if the \ BreakOff switch is on.
Program execution can continue with:
•
the instruction that caused the error ( RETRY )
•
the following instruction ( TRYNEXT )
•
the error handler of the routine that called the routine at user level ( RAISE )
•
the routine that called the routine at user level ( RETURN )
Error handling
If the error number is out of range then the system variable ERRNO is set to ERR_ILLRAISE
(see "Data types - errnum"). The system’s error handler deals with this error.
Syntax
RaiseToUser
[ ‘\’Continue ]
´|’ [ ‘\’BreakOff ]
[ ‘\’ErrorNumber’ :=’ ] < expression ( IN ) of errnum>‘;’
Related information
For information about
See
Error handling
Technical reference manual - RAPID overview ,
section Basic Characteristics - Error Recovery
Undo handling
Technical reference manual - RAPID overview ,
section Basic Characteristics - UNDO
Booking error numbers
BookErrNo - Book a RAPID system error number
on page 30
Continued
1 Instructions
1.121. ReadAnyBin - Read data from a binary serial channel or file
RobotWare - OS
3HAC 16581-1 Revision: J
340
© Copyright 2004-2010 ABB. All rights reserved.
1.121. ReadAnyBin - Read data from a binary serial channel or file
Usage
ReadAnyBin ( Read Any Binary ) is used to read any type of data from a binary serial channel
or file.
Basic examples
Basic examples of the instruction ReadAnyBin are illustrated below.
See also More examples on page 341 .
Example 1
VAR iodev channel2;
VAR robtarget next_target;
...
Open "com2:", channel2 \Bin;
ReadAnyBin channel2, next_target;
The next robot target to be executed, next_target , is read from the channel referred to by
channel2 .
Arguments
ReadAnyBin IODevice Data [\Time]
IODevice
Data type: iodev
The name (reference) of the binary serial channel or file to be read.
Data
Data type: ANYTYPE
The VAR or PERS to which the read data will be stored.
[\Time]
Data type: num
The max. time for the reading operation (timeout) in seconds. If this argument is not specified
then 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 then the error handler will be called
with the error code ERR_DEV_MAXTIME . If there is no error handler then 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
As many bytes as are required for the specified data are read from the specified binary serial
channel or file.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 342
|
1 Instructions
1.120. RaiseToUser - Propagates an error to user level
RobotWare - OS
339
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Program execution
RaiseToUser can only be used in an error handler in a nostepin routine.
Program execution continues in the error handler of the routine at user level. The error
number remains active if the optional parameter \ ErrorNumber is not present. The system’s
error handler deals with the error if there is no error handler on user level. The system’s error
handler is called if none of the argument \ Continue or \ BreakOff is specified.
There are two different behaviors after the error handler has been executed. The program
execution continues in the routine with RaiseToUser if the \Continue switch is on. The
program execution continues at the user level if the \ BreakOff switch is on.
Program execution can continue with:
•
the instruction that caused the error ( RETRY )
•
the following instruction ( TRYNEXT )
•
the error handler of the routine that called the routine at user level ( RAISE )
•
the routine that called the routine at user level ( RETURN )
Error handling
If the error number is out of range then the system variable ERRNO is set to ERR_ILLRAISE
(see "Data types - errnum"). The system’s error handler deals with this error.
Syntax
RaiseToUser
[ ‘\’Continue ]
´|’ [ ‘\’BreakOff ]
[ ‘\’ErrorNumber’ :=’ ] < expression ( IN ) of errnum>‘;’
Related information
For information about
See
Error handling
Technical reference manual - RAPID overview ,
section Basic Characteristics - Error Recovery
Undo handling
Technical reference manual - RAPID overview ,
section Basic Characteristics - UNDO
Booking error numbers
BookErrNo - Book a RAPID system error number
on page 30
Continued
1 Instructions
1.121. ReadAnyBin - Read data from a binary serial channel or file
RobotWare - OS
3HAC 16581-1 Revision: J
340
© Copyright 2004-2010 ABB. All rights reserved.
1.121. ReadAnyBin - Read data from a binary serial channel or file
Usage
ReadAnyBin ( Read Any Binary ) is used to read any type of data from a binary serial channel
or file.
Basic examples
Basic examples of the instruction ReadAnyBin are illustrated below.
See also More examples on page 341 .
Example 1
VAR iodev channel2;
VAR robtarget next_target;
...
Open "com2:", channel2 \Bin;
ReadAnyBin channel2, next_target;
The next robot target to be executed, next_target , is read from the channel referred to by
channel2 .
Arguments
ReadAnyBin IODevice Data [\Time]
IODevice
Data type: iodev
The name (reference) of the binary serial channel or file to be read.
Data
Data type: ANYTYPE
The VAR or PERS to which the read data will be stored.
[\Time]
Data type: num
The max. time for the reading operation (timeout) in seconds. If this argument is not specified
then 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 then the error handler will be called
with the error code ERR_DEV_MAXTIME . If there is no error handler then 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
As many bytes as are required for the specified data are read from the specified binary serial
channel or file.
Continues on next page
1 Instructions
1.121. ReadAnyBin - Read data from a binary serial channel or file
RobotWare - OS
341
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of the instruction ReadAnyBin are illustrated below.
Example 1
CONST num NEW_ROBT:=12;
CONST num NEW_WOBJ:=20;
VAR iodev channel;
VAR num input;
VAR robtarget cur_robt;
VAR wobjdata cur_wobj;
Open "com2:", channel\Bin;
! Wait for the opcode character
input := ReadBin (channel \Time:= 0.1);
TEST input
CASE NEW_ROBT:
ReadAnyBin channel, cur_robt;
CASE NEW_WOBJ:
ReadAnyBin channel, cur_wobj;
ENDTEST
Close channel;
As a first step the opcode of the message is read from the serial channel. According to this
opcode a robtarget or a wobjdata is read from the serial channel.
Error handling
If an error occurs during reading then the system variable ERRNO is set to ERR_FILEACC .
If timeout before the read operation is finished then the system variable ERRNO is set to
ERR_DEV_MAXTIME.
If there is a checksum error in the data read then the system variable ERRNO is set to
ERR_RANYBIN_CHK.
If the end of the file is detected before all the bytes are read then the system variable ERRNO
is set to ERR_RANYBIN_EOF.
These errors can then be dealt with by the error handler.
Limitations
This instruction can only be used for serial channels or files that have been opened for binary
reading.
The data to be read by this instruction ReadAnyBin must be a value data type such as num ,
bool , or string . Record, record component, array, or array element of these value data types
can also be used. Entire data or partial data with semi-value or non-value data types cannot
be used.
NOTE!
The VAR or PERS variable, for storage of the read data, can be updated in several steps.
Therefore, always wait until the whole data structure is updated before using read data from
a TRAP or another program task.
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
| 343
|
1 Instructions
1.121. ReadAnyBin - Read data from a binary serial channel or file
RobotWare - OS
3HAC 16581-1 Revision: J
340
© Copyright 2004-2010 ABB. All rights reserved.
1.121. ReadAnyBin - Read data from a binary serial channel or file
Usage
ReadAnyBin ( Read Any Binary ) is used to read any type of data from a binary serial channel
or file.
Basic examples
Basic examples of the instruction ReadAnyBin are illustrated below.
See also More examples on page 341 .
Example 1
VAR iodev channel2;
VAR robtarget next_target;
...
Open "com2:", channel2 \Bin;
ReadAnyBin channel2, next_target;
The next robot target to be executed, next_target , is read from the channel referred to by
channel2 .
Arguments
ReadAnyBin IODevice Data [\Time]
IODevice
Data type: iodev
The name (reference) of the binary serial channel or file to be read.
Data
Data type: ANYTYPE
The VAR or PERS to which the read data will be stored.
[\Time]
Data type: num
The max. time for the reading operation (timeout) in seconds. If this argument is not specified
then 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 then the error handler will be called
with the error code ERR_DEV_MAXTIME . If there is no error handler then 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
As many bytes as are required for the specified data are read from the specified binary serial
channel or file.
Continues on next page
1 Instructions
1.121. ReadAnyBin - Read data from a binary serial channel or file
RobotWare - OS
341
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of the instruction ReadAnyBin are illustrated below.
Example 1
CONST num NEW_ROBT:=12;
CONST num NEW_WOBJ:=20;
VAR iodev channel;
VAR num input;
VAR robtarget cur_robt;
VAR wobjdata cur_wobj;
Open "com2:", channel\Bin;
! Wait for the opcode character
input := ReadBin (channel \Time:= 0.1);
TEST input
CASE NEW_ROBT:
ReadAnyBin channel, cur_robt;
CASE NEW_WOBJ:
ReadAnyBin channel, cur_wobj;
ENDTEST
Close channel;
As a first step the opcode of the message is read from the serial channel. According to this
opcode a robtarget or a wobjdata is read from the serial channel.
Error handling
If an error occurs during reading then the system variable ERRNO is set to ERR_FILEACC .
If timeout before the read operation is finished then the system variable ERRNO is set to
ERR_DEV_MAXTIME.
If there is a checksum error in the data read then the system variable ERRNO is set to
ERR_RANYBIN_CHK.
If the end of the file is detected before all the bytes are read then the system variable ERRNO
is set to ERR_RANYBIN_EOF.
These errors can then be dealt with by the error handler.
Limitations
This instruction can only be used for serial channels or files that have been opened for binary
reading.
The data to be read by this instruction ReadAnyBin must be a value data type such as num ,
bool , or string . Record, record component, array, or array element of these value data types
can also be used. Entire data or partial data with semi-value or non-value data types cannot
be used.
NOTE!
The VAR or PERS variable, for storage of the read data, can be updated in several steps.
Therefore, always wait until the whole data structure is updated before using read data from
a TRAP or another program task.
Continued
Continues on next page
1 Instructions
1.121. ReadAnyBin - Read data from a binary serial channel or file
RobotWare - OS
3HAC 16581-1 Revision: J
342
© Copyright 2004-2010 ABB. All rights reserved.
Because WriteAnyBin-ReadAnyBin are designed to only handle internal binary controller
data with serial channel or files between or within IRC5 control systems, no data protocol is
released and the data cannot be interpreted on any PC .
Control software development can break the compatibility so it is not possible to use
WriteAnyBin-ReadAnyBin between different software versions of RobotWare. If a
WriteAnyBin to file is done with RobotWare version 5.07, the file cannot be read by
instruction ReadAnyBin with RobotWare version 5.08. And the opposite case, if a
WriteAnyBin to file is done with RobotWare version 5.08, the file cannot be read by
instruction ReadAnyBin with RobotWare version 5.07.
Version 0 for IRC5 controller software equal or less than RW5.07
Version 1 for IRC5 controller software equal or greater than RW5.08
Always compatible within all revisions of any software versions.
Syntax
ReadAnyBin
[IODevice’:=’] <variable ( VAR ) of iodev>’,’
[Data’:=’] <var or pers ( INOUT ) of ANYTYPE>
[’\’Time’:=’ <expression ( IN ) of num>]’;’
Related information
For information about
See
Opening, etc. of serial channels or files
Technical reference manual - RAPID overview ,
section RAPID summary - Communication
Write data to a binary serial channel or
file
WriteAnyBin - Writes data to a binary serial
channel or file on page 713
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 344
|
1 Instructions
1.121. ReadAnyBin - Read data from a binary serial channel or file
RobotWare - OS
341
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of the instruction ReadAnyBin are illustrated below.
Example 1
CONST num NEW_ROBT:=12;
CONST num NEW_WOBJ:=20;
VAR iodev channel;
VAR num input;
VAR robtarget cur_robt;
VAR wobjdata cur_wobj;
Open "com2:", channel\Bin;
! Wait for the opcode character
input := ReadBin (channel \Time:= 0.1);
TEST input
CASE NEW_ROBT:
ReadAnyBin channel, cur_robt;
CASE NEW_WOBJ:
ReadAnyBin channel, cur_wobj;
ENDTEST
Close channel;
As a first step the opcode of the message is read from the serial channel. According to this
opcode a robtarget or a wobjdata is read from the serial channel.
Error handling
If an error occurs during reading then the system variable ERRNO is set to ERR_FILEACC .
If timeout before the read operation is finished then the system variable ERRNO is set to
ERR_DEV_MAXTIME.
If there is a checksum error in the data read then the system variable ERRNO is set to
ERR_RANYBIN_CHK.
If the end of the file is detected before all the bytes are read then the system variable ERRNO
is set to ERR_RANYBIN_EOF.
These errors can then be dealt with by the error handler.
Limitations
This instruction can only be used for serial channels or files that have been opened for binary
reading.
The data to be read by this instruction ReadAnyBin must be a value data type such as num ,
bool , or string . Record, record component, array, or array element of these value data types
can also be used. Entire data or partial data with semi-value or non-value data types cannot
be used.
NOTE!
The VAR or PERS variable, for storage of the read data, can be updated in several steps.
Therefore, always wait until the whole data structure is updated before using read data from
a TRAP or another program task.
Continued
Continues on next page
1 Instructions
1.121. ReadAnyBin - Read data from a binary serial channel or file
RobotWare - OS
3HAC 16581-1 Revision: J
342
© Copyright 2004-2010 ABB. All rights reserved.
Because WriteAnyBin-ReadAnyBin are designed to only handle internal binary controller
data with serial channel or files between or within IRC5 control systems, no data protocol is
released and the data cannot be interpreted on any PC .
Control software development can break the compatibility so it is not possible to use
WriteAnyBin-ReadAnyBin between different software versions of RobotWare. If a
WriteAnyBin to file is done with RobotWare version 5.07, the file cannot be read by
instruction ReadAnyBin with RobotWare version 5.08. And the opposite case, if a
WriteAnyBin to file is done with RobotWare version 5.08, the file cannot be read by
instruction ReadAnyBin with RobotWare version 5.07.
Version 0 for IRC5 controller software equal or less than RW5.07
Version 1 for IRC5 controller software equal or greater than RW5.08
Always compatible within all revisions of any software versions.
Syntax
ReadAnyBin
[IODevice’:=’] <variable ( VAR ) of iodev>’,’
[Data’:=’] <var or pers ( INOUT ) of ANYTYPE>
[’\’Time’:=’ <expression ( IN ) of num>]’;’
Related information
For information about
See
Opening, etc. of serial channels or files
Technical reference manual - RAPID overview ,
section RAPID summary - Communication
Write data to a binary serial channel or
file
WriteAnyBin - Writes data to a binary serial
channel or file on page 713
Continued
1 Instructions
1.122. ReadBlock - read a block of data from device
Sensor Interface
343
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.122. ReadBlock - read a block of data from device
Usage
ReadBlock is used to read a block of data from a device connected to the serial sensor
interface . The data is stored in a file.
The sensor interface communicates with two 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 instruction ReadBlock are illustrated below.
Example 1
CONST string SensorPar := "flp1:senpar.cfg";
CONST num ParBlock:= 1;
! Connect to the sensor device "sen1:" (defined in sio.cfg).
SenDevice "sen1:";
! Read sensor parameters from sensor datablock 1
! and store on flp1:senpar.cfg
ReadBlock "sen1:", ParBlock, SensorPar;
Arguments
ReadBlock device BlockNo FileName [ \TaskName ]
device
Data type: string
The I/O device name configured in sio.cfg for the sensor used.
BlockNo
Data type: num
The argument BlockNo is used to select the data block in the sensor to be read.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 345
|
1 Instructions
1.121. ReadAnyBin - Read data from a binary serial channel or file
RobotWare - OS
3HAC 16581-1 Revision: J
342
© Copyright 2004-2010 ABB. All rights reserved.
Because WriteAnyBin-ReadAnyBin are designed to only handle internal binary controller
data with serial channel or files between or within IRC5 control systems, no data protocol is
released and the data cannot be interpreted on any PC .
Control software development can break the compatibility so it is not possible to use
WriteAnyBin-ReadAnyBin between different software versions of RobotWare. If a
WriteAnyBin to file is done with RobotWare version 5.07, the file cannot be read by
instruction ReadAnyBin with RobotWare version 5.08. And the opposite case, if a
WriteAnyBin to file is done with RobotWare version 5.08, the file cannot be read by
instruction ReadAnyBin with RobotWare version 5.07.
Version 0 for IRC5 controller software equal or less than RW5.07
Version 1 for IRC5 controller software equal or greater than RW5.08
Always compatible within all revisions of any software versions.
Syntax
ReadAnyBin
[IODevice’:=’] <variable ( VAR ) of iodev>’,’
[Data’:=’] <var or pers ( INOUT ) of ANYTYPE>
[’\’Time’:=’ <expression ( IN ) of num>]’;’
Related information
For information about
See
Opening, etc. of serial channels or files
Technical reference manual - RAPID overview ,
section RAPID summary - Communication
Write data to a binary serial channel or
file
WriteAnyBin - Writes data to a binary serial
channel or file on page 713
Continued
1 Instructions
1.122. ReadBlock - read a block of data from device
Sensor Interface
343
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.122. ReadBlock - read a block of data from device
Usage
ReadBlock is used to read a block of data from a device connected to the serial sensor
interface . The data is stored in a file.
The sensor interface communicates with two 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 instruction ReadBlock are illustrated below.
Example 1
CONST string SensorPar := "flp1:senpar.cfg";
CONST num ParBlock:= 1;
! Connect to the sensor device "sen1:" (defined in sio.cfg).
SenDevice "sen1:";
! Read sensor parameters from sensor datablock 1
! and store on flp1:senpar.cfg
ReadBlock "sen1:", ParBlock, SensorPar;
Arguments
ReadBlock device BlockNo FileName [ \TaskName ]
device
Data type: string
The I/O device name configured in sio.cfg for the sensor used.
BlockNo
Data type: num
The argument BlockNo is used to select the data block in the sensor to be read.
Continues on next page
1 Instructions
1.122. ReadBlock - read a block of data from device
Sensor Interface
3HAC 16581-1 Revision: J
344
© Copyright 2004-2010 ABB. All rights reserved.
FileName
Data type: string
The argument FileName is used to define a file to which data is written from the data block
in the sensor selected by the BlockNo argument.
[ \TaskName ]
Data type: string
The argument TaskName makes it possible to access devices in other RAPID tasks.
Fault management
Syntax
ReadBlock
[ device ‘:=’ ] < expression( IN ) of string>’,’
[ BlockNo’ :=’ ] < expression ( IN ) of num > ‘,’
[ FileName’ :=’ ] < expression ( IN ) of string > ‘,’
[ ’\’ TaskName’ :=’ < expression ( IN ) of string > ] ‘;’
Related information
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
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
Read a sensor variable
ReadVar - Read variable from a device on page 958
Write a sensor data block
WriteBlock - write block of data to device on page 719
Configuration of sensor com-
munication
Technical reference manual - System parameters , section
Communication
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 346
|
1 Instructions
1.122. ReadBlock - read a block of data from device
Sensor Interface
343
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.122. ReadBlock - read a block of data from device
Usage
ReadBlock is used to read a block of data from a device connected to the serial sensor
interface . The data is stored in a file.
The sensor interface communicates with two 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 instruction ReadBlock are illustrated below.
Example 1
CONST string SensorPar := "flp1:senpar.cfg";
CONST num ParBlock:= 1;
! Connect to the sensor device "sen1:" (defined in sio.cfg).
SenDevice "sen1:";
! Read sensor parameters from sensor datablock 1
! and store on flp1:senpar.cfg
ReadBlock "sen1:", ParBlock, SensorPar;
Arguments
ReadBlock device BlockNo FileName [ \TaskName ]
device
Data type: string
The I/O device name configured in sio.cfg for the sensor used.
BlockNo
Data type: num
The argument BlockNo is used to select the data block in the sensor to be read.
Continues on next page
1 Instructions
1.122. ReadBlock - read a block of data from device
Sensor Interface
3HAC 16581-1 Revision: J
344
© Copyright 2004-2010 ABB. All rights reserved.
FileName
Data type: string
The argument FileName is used to define a file to which data is written from the data block
in the sensor selected by the BlockNo argument.
[ \TaskName ]
Data type: string
The argument TaskName makes it possible to access devices in other RAPID tasks.
Fault management
Syntax
ReadBlock
[ device ‘:=’ ] < expression( IN ) of string>’,’
[ BlockNo’ :=’ ] < expression ( IN ) of num > ‘,’
[ FileName’ :=’ ] < expression ( IN ) of string > ‘,’
[ ’\’ TaskName’ :=’ < expression ( IN ) of string > ] ‘;’
Related information
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
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
Read a sensor variable
ReadVar - Read variable from a device on page 958
Write a sensor data block
WriteBlock - write block of data to device on page 719
Configuration of sensor com-
munication
Technical reference manual - System parameters , section
Communication
Continued
1 Instructions
1.123. ReadCfgData - Reads attribute of a system parameter
RobotWare - OS
345
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.123. ReadCfgData - Reads attribute of a system parameter
Usage
ReadCfgData is used to read one attribute of a system parameter (configuration data).
Besides to reading named parameters it is also possible to search for unnamed parameters.
Basic examples
Basic examples of the instruction ReadCfgData are illustrated below. Both of these
examples show how to read named parameters.
Example 1
VAR num offset1;
...
ReadCfgData "/MOC/MOTOR_CALIB/rob1_1","cal_offset",offset1;
Reads the value of the calibration offset for axis 1 for rob_ 1 into the num variable offset1 .
Example 2
VAR string io_unit;
...
ReadCfgData "/EIO/EIO_SIGNAL/process_error","Unit",io_unit;
Reads the name of the I/O unit where the signal process_error is defined into the string
variable io_unit .
Arguments
ReadCfgData InstancePath Attribute CfgData [\ListNo]
InstancePath
Data type: string
Specifies a path to the parameter to be accessed.
For named parameters the format of this string is /DOMAIN/TYPE/ParameterName .
For unnamed parameters the format of this string is /DOMAIN/TYPE/Attribute/
AttributeValue .
Attribute
Data type: string
The name of the attribute of the parameter to be read.
CfgData
Data type: any type
The variable where the attribute value will be stored. Depending on the attribute type the valid
types are bool , num , or 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
| 347
|
1 Instructions
1.122. ReadBlock - read a block of data from device
Sensor Interface
3HAC 16581-1 Revision: J
344
© Copyright 2004-2010 ABB. All rights reserved.
FileName
Data type: string
The argument FileName is used to define a file to which data is written from the data block
in the sensor selected by the BlockNo argument.
[ \TaskName ]
Data type: string
The argument TaskName makes it possible to access devices in other RAPID tasks.
Fault management
Syntax
ReadBlock
[ device ‘:=’ ] < expression( IN ) of string>’,’
[ BlockNo’ :=’ ] < expression ( IN ) of num > ‘,’
[ FileName’ :=’ ] < expression ( IN ) of string > ‘,’
[ ’\’ TaskName’ :=’ < expression ( IN ) of string > ] ‘;’
Related information
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
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
Read a sensor variable
ReadVar - Read variable from a device on page 958
Write a sensor data block
WriteBlock - write block of data to device on page 719
Configuration of sensor com-
munication
Technical reference manual - System parameters , section
Communication
Continued
1 Instructions
1.123. ReadCfgData - Reads attribute of a system parameter
RobotWare - OS
345
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.123. ReadCfgData - Reads attribute of a system parameter
Usage
ReadCfgData is used to read one attribute of a system parameter (configuration data).
Besides to reading named parameters it is also possible to search for unnamed parameters.
Basic examples
Basic examples of the instruction ReadCfgData are illustrated below. Both of these
examples show how to read named parameters.
Example 1
VAR num offset1;
...
ReadCfgData "/MOC/MOTOR_CALIB/rob1_1","cal_offset",offset1;
Reads the value of the calibration offset for axis 1 for rob_ 1 into the num variable offset1 .
Example 2
VAR string io_unit;
...
ReadCfgData "/EIO/EIO_SIGNAL/process_error","Unit",io_unit;
Reads the name of the I/O unit where the signal process_error is defined into the string
variable io_unit .
Arguments
ReadCfgData InstancePath Attribute CfgData [\ListNo]
InstancePath
Data type: string
Specifies a path to the parameter to be accessed.
For named parameters the format of this string is /DOMAIN/TYPE/ParameterName .
For unnamed parameters the format of this string is /DOMAIN/TYPE/Attribute/
AttributeValue .
Attribute
Data type: string
The name of the attribute of the parameter to be read.
CfgData
Data type: any type
The variable where the attribute value will be stored. Depending on the attribute type the valid
types are bool , num , or string .
Continues on next page
1 Instructions
1.123. ReadCfgData - Reads attribute of a system parameter
RobotWare - OS
3HAC 16581-1 Revision: J
346
© Copyright 2004-2010 ABB. All rights reserved.
[\ListNo]
Data type: num
Variable holding the instance number of the Attribute + AttributeValue to be found.
First occurrence of the Attribute + AttributeValue has an instance number 0. If more
instances are searched for then the returned value in \ListNo will be incremented with 1.
Otherwise, if there are no more instances then the returned value will be -1. The predefined
constant END_OF_LIST can be used to check if more instances are to be search for.
Program execution
The value of the attribute specified by the Attribute argument is stored in the variable
specified by the CfgData argument.
If using format /DOMAIN/TYPE/ParameterName in InstancePath , only named
parameters can be accessed, i.e. parameters where the first attribute is name , Name , or NAME .
For unnamed parameters use the optional parameter \ListNo to selects from which instance
to read the attribute value. It is updated after each successful read to the next available
instance.
More examples
More examples of the instruction ReadCfgdata are illustrated below. Both these examples
show how to read unnamed parameters.
Example 1
VAR num list_index;
VAR string read_str;
...
list_index:=0;
ReadCfgData "/EIO/EIO_CROSS/Act1/do_13", "Res", read_str,
\ListNo:=list_index;
TPWrite "Resultant signal for signal do_13 is: " + read_str;
Reads the resultant signal for the unnamed digital actor signal di_13 and places the name in
the string variable read_str .
In this example domain EIO has the following cfg code:
EIO_CROSS:
-Res "di_1" -Act1 "do_2"
-Res "di_2" -Act1 "do_2"
-Res "di_13" -Act1 "do_13"
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
| 348
|
1 Instructions
1.123. ReadCfgData - Reads attribute of a system parameter
RobotWare - OS
345
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.123. ReadCfgData - Reads attribute of a system parameter
Usage
ReadCfgData is used to read one attribute of a system parameter (configuration data).
Besides to reading named parameters it is also possible to search for unnamed parameters.
Basic examples
Basic examples of the instruction ReadCfgData are illustrated below. Both of these
examples show how to read named parameters.
Example 1
VAR num offset1;
...
ReadCfgData "/MOC/MOTOR_CALIB/rob1_1","cal_offset",offset1;
Reads the value of the calibration offset for axis 1 for rob_ 1 into the num variable offset1 .
Example 2
VAR string io_unit;
...
ReadCfgData "/EIO/EIO_SIGNAL/process_error","Unit",io_unit;
Reads the name of the I/O unit where the signal process_error is defined into the string
variable io_unit .
Arguments
ReadCfgData InstancePath Attribute CfgData [\ListNo]
InstancePath
Data type: string
Specifies a path to the parameter to be accessed.
For named parameters the format of this string is /DOMAIN/TYPE/ParameterName .
For unnamed parameters the format of this string is /DOMAIN/TYPE/Attribute/
AttributeValue .
Attribute
Data type: string
The name of the attribute of the parameter to be read.
CfgData
Data type: any type
The variable where the attribute value will be stored. Depending on the attribute type the valid
types are bool , num , or string .
Continues on next page
1 Instructions
1.123. ReadCfgData - Reads attribute of a system parameter
RobotWare - OS
3HAC 16581-1 Revision: J
346
© Copyright 2004-2010 ABB. All rights reserved.
[\ListNo]
Data type: num
Variable holding the instance number of the Attribute + AttributeValue to be found.
First occurrence of the Attribute + AttributeValue has an instance number 0. If more
instances are searched for then the returned value in \ListNo will be incremented with 1.
Otherwise, if there are no more instances then the returned value will be -1. The predefined
constant END_OF_LIST can be used to check if more instances are to be search for.
Program execution
The value of the attribute specified by the Attribute argument is stored in the variable
specified by the CfgData argument.
If using format /DOMAIN/TYPE/ParameterName in InstancePath , only named
parameters can be accessed, i.e. parameters where the first attribute is name , Name , or NAME .
For unnamed parameters use the optional parameter \ListNo to selects from which instance
to read the attribute value. It is updated after each successful read to the next available
instance.
More examples
More examples of the instruction ReadCfgdata are illustrated below. Both these examples
show how to read unnamed parameters.
Example 1
VAR num list_index;
VAR string read_str;
...
list_index:=0;
ReadCfgData "/EIO/EIO_CROSS/Act1/do_13", "Res", read_str,
\ListNo:=list_index;
TPWrite "Resultant signal for signal do_13 is: " + read_str;
Reads the resultant signal for the unnamed digital actor signal di_13 and places the name in
the string variable read_str .
In this example domain EIO has the following cfg code:
EIO_CROSS:
-Res "di_1" -Act1 "do_2"
-Res "di_2" -Act1 "do_2"
-Res "di_13" -Act1 "do_13"
Continued
Continues on next page
1 Instructions
1.123. ReadCfgData - Reads attribute of a system parameter
RobotWare - OS
347
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Example 2
VAR num list_index;
VAR string read_str;
...
list_index:=0;
WHILE list_index <> END_OF_LIST DO
ReadCfgData "/EIO/EIO_SIGNAL/Unit/USERIO", "Name", read_str,
\ListNo:=list_index;
IF list_index <> END_OF_LIST THEN
TPWrite "Signal: " + read_str;
ENDIF
ENDWHILE
Read the names of all signals defined for the I/O unit USERIO .
In this example domain EIO has the following cfg code:
EIO_SIGNAL:
-Name "USERDO1" -SignalType "DO" -Unit "USERIO" -UnitMap "0"
-Name "USERDO2" -SignalType "DO" -Unit "USERIO" -UnitMap "1"
-Name "USERDO3" -SignalType "DO" -Unit "USERIO" -UnitMap "2"
Error handling
If it is not possible to find the data specified with “ InstancePath + Attribute ” in the
configuration database then the system variable ERRNO is set to ERR_CFG_NOTFND .
If the data type for parameter CfgData is not equal to the real data type for the found data
specified with“ InstancePath + Attribute ” in the configuration database then the system
variable ERRNO is set to ERR_CFG_ILLTYPE .
If trying to read internal data then the system variable ERRNO is set to ERR_CFG_INTERNAL .
If variable in argument \ListNo has a value outside range of available instances (0 ... n)
when executing the instruction then ERRNO is set to ERR_CFG_OUTOFBOUNDS .
These errors can then be handled in the error handler.
Limitations
The conversion from system parameter units (m, radian, second, etc.) to RAPID program
units (mm, degree, second, etc.) for CfgData of data type num must be done by the user in
the RAPID program.
If using format /DOMAIN/TYPE/ParameterName in InstancePath then only named
parameters can be accessed, i.e. parameters where the first attribute is name , Name , or NAME .
RAPID strings are limited to 80 characters. In some cases this can be in theory too small for
the definition InstancePath , Attribute or CfgData .
Predefined data
The predefined constant END_OF_LIST with value -1 can be used to stop reading when no
more instances can be found.
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
| 349
|
1 Instructions
1.123. ReadCfgData - Reads attribute of a system parameter
RobotWare - OS
3HAC 16581-1 Revision: J
346
© Copyright 2004-2010 ABB. All rights reserved.
[\ListNo]
Data type: num
Variable holding the instance number of the Attribute + AttributeValue to be found.
First occurrence of the Attribute + AttributeValue has an instance number 0. If more
instances are searched for then the returned value in \ListNo will be incremented with 1.
Otherwise, if there are no more instances then the returned value will be -1. The predefined
constant END_OF_LIST can be used to check if more instances are to be search for.
Program execution
The value of the attribute specified by the Attribute argument is stored in the variable
specified by the CfgData argument.
If using format /DOMAIN/TYPE/ParameterName in InstancePath , only named
parameters can be accessed, i.e. parameters where the first attribute is name , Name , or NAME .
For unnamed parameters use the optional parameter \ListNo to selects from which instance
to read the attribute value. It is updated after each successful read to the next available
instance.
More examples
More examples of the instruction ReadCfgdata are illustrated below. Both these examples
show how to read unnamed parameters.
Example 1
VAR num list_index;
VAR string read_str;
...
list_index:=0;
ReadCfgData "/EIO/EIO_CROSS/Act1/do_13", "Res", read_str,
\ListNo:=list_index;
TPWrite "Resultant signal for signal do_13 is: " + read_str;
Reads the resultant signal for the unnamed digital actor signal di_13 and places the name in
the string variable read_str .
In this example domain EIO has the following cfg code:
EIO_CROSS:
-Res "di_1" -Act1 "do_2"
-Res "di_2" -Act1 "do_2"
-Res "di_13" -Act1 "do_13"
Continued
Continues on next page
1 Instructions
1.123. ReadCfgData - Reads attribute of a system parameter
RobotWare - OS
347
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Example 2
VAR num list_index;
VAR string read_str;
...
list_index:=0;
WHILE list_index <> END_OF_LIST DO
ReadCfgData "/EIO/EIO_SIGNAL/Unit/USERIO", "Name", read_str,
\ListNo:=list_index;
IF list_index <> END_OF_LIST THEN
TPWrite "Signal: " + read_str;
ENDIF
ENDWHILE
Read the names of all signals defined for the I/O unit USERIO .
In this example domain EIO has the following cfg code:
EIO_SIGNAL:
-Name "USERDO1" -SignalType "DO" -Unit "USERIO" -UnitMap "0"
-Name "USERDO2" -SignalType "DO" -Unit "USERIO" -UnitMap "1"
-Name "USERDO3" -SignalType "DO" -Unit "USERIO" -UnitMap "2"
Error handling
If it is not possible to find the data specified with “ InstancePath + Attribute ” in the
configuration database then the system variable ERRNO is set to ERR_CFG_NOTFND .
If the data type for parameter CfgData is not equal to the real data type for the found data
specified with“ InstancePath + Attribute ” in the configuration database then the system
variable ERRNO is set to ERR_CFG_ILLTYPE .
If trying to read internal data then the system variable ERRNO is set to ERR_CFG_INTERNAL .
If variable in argument \ListNo has a value outside range of available instances (0 ... n)
when executing the instruction then ERRNO is set to ERR_CFG_OUTOFBOUNDS .
These errors can then be handled in the error handler.
Limitations
The conversion from system parameter units (m, radian, second, etc.) to RAPID program
units (mm, degree, second, etc.) for CfgData of data type num must be done by the user in
the RAPID program.
If using format /DOMAIN/TYPE/ParameterName in InstancePath then only named
parameters can be accessed, i.e. parameters where the first attribute is name , Name , or NAME .
RAPID strings are limited to 80 characters. In some cases this can be in theory too small for
the definition InstancePath , Attribute or CfgData .
Predefined data
The predefined constant END_OF_LIST with value -1 can be used to stop reading when no
more instances can be found.
Continued
Continues on next page
1 Instructions
1.123. ReadCfgData - Reads attribute of a system parameter
RobotWare - OS
3HAC 16581-1 Revision: J
348
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
ReadCfgData
[ InstancePath ’:=’ ] < expression ( IN ) of string >’,’
[ Attribute’ :=’ ] < expression ( IN ) of string >’,’
[ CfgData’ :=’ ] < variable ( VAR ) of anytype >
[’\’ListNo’:=’ < variable ( VAR ) of num >]’;’
Related information
For information about
See
Definition of string
string - Strings on page 1195
Write attribute of a system parameter
WriteCfgData - Writes attribute of a system
parameter on page 721
Get robot name in current task
RobName - Get the TCP robot name on page 966
Configuration
Technical reference manual - System parameters
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 350
|
1 Instructions
1.123. ReadCfgData - Reads attribute of a system parameter
RobotWare - OS
347
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Example 2
VAR num list_index;
VAR string read_str;
...
list_index:=0;
WHILE list_index <> END_OF_LIST DO
ReadCfgData "/EIO/EIO_SIGNAL/Unit/USERIO", "Name", read_str,
\ListNo:=list_index;
IF list_index <> END_OF_LIST THEN
TPWrite "Signal: " + read_str;
ENDIF
ENDWHILE
Read the names of all signals defined for the I/O unit USERIO .
In this example domain EIO has the following cfg code:
EIO_SIGNAL:
-Name "USERDO1" -SignalType "DO" -Unit "USERIO" -UnitMap "0"
-Name "USERDO2" -SignalType "DO" -Unit "USERIO" -UnitMap "1"
-Name "USERDO3" -SignalType "DO" -Unit "USERIO" -UnitMap "2"
Error handling
If it is not possible to find the data specified with “ InstancePath + Attribute ” in the
configuration database then the system variable ERRNO is set to ERR_CFG_NOTFND .
If the data type for parameter CfgData is not equal to the real data type for the found data
specified with“ InstancePath + Attribute ” in the configuration database then the system
variable ERRNO is set to ERR_CFG_ILLTYPE .
If trying to read internal data then the system variable ERRNO is set to ERR_CFG_INTERNAL .
If variable in argument \ListNo has a value outside range of available instances (0 ... n)
when executing the instruction then ERRNO is set to ERR_CFG_OUTOFBOUNDS .
These errors can then be handled in the error handler.
Limitations
The conversion from system parameter units (m, radian, second, etc.) to RAPID program
units (mm, degree, second, etc.) for CfgData of data type num must be done by the user in
the RAPID program.
If using format /DOMAIN/TYPE/ParameterName in InstancePath then only named
parameters can be accessed, i.e. parameters where the first attribute is name , Name , or NAME .
RAPID strings are limited to 80 characters. In some cases this can be in theory too small for
the definition InstancePath , Attribute or CfgData .
Predefined data
The predefined constant END_OF_LIST with value -1 can be used to stop reading when no
more instances can be found.
Continued
Continues on next page
1 Instructions
1.123. ReadCfgData - Reads attribute of a system parameter
RobotWare - OS
3HAC 16581-1 Revision: J
348
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
ReadCfgData
[ InstancePath ’:=’ ] < expression ( IN ) of string >’,’
[ Attribute’ :=’ ] < expression ( IN ) of string >’,’
[ CfgData’ :=’ ] < variable ( VAR ) of anytype >
[’\’ListNo’:=’ < variable ( VAR ) of num >]’;’
Related information
For information about
See
Definition of string
string - Strings on page 1195
Write attribute of a system parameter
WriteCfgData - Writes attribute of a system
parameter on page 721
Get robot name in current task
RobName - Get the TCP robot name on page 966
Configuration
Technical reference manual - System parameters
Continued
1 Instructions
1.124. ReadErrData - Gets information about an error
RobotWare - OS
349
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.124. ReadErrData - Gets information about an error
Usage
ReadErrData is to be used in a trap routine, to get information (domain, type, number and
intermixed strings %s etc.) about an error, a state change, or a warning that caused the trap
routine to be executed.
Basic examples
Basic examples of the instruction ReadErrData are illustrated below.
See also More examples on page 350
Example 1
VAR errdomain err_domain;
VAR num err_number;
VAR errtype err_type;
VAR trapdata err_data;
VAR string string1;
VAR string string2;
...
TRAP trap_err
GetTrapData err_data;
ReadErrData err_data, err_domain, err_number,
err_type \Str1:=string1 \Str2:=string2;
ENDTRAP
When an error is trapped to the trap routine trap_err the error domain, the error number,
the error type, and the two first intermixed strings in the error message are saved into
appropriate variables.
Arguments
ReadErrData TrapEvent ErrorDomain ErrorId ErrorType
[\Str1] [\Str2] [\Str3] [\Str4] [\Str5]
TrapEvent
Data type: trapdata
Variable containing the information about what caused the trap to be executed.
ErrorDomain
Data type: errdomain
Variable to store the error domain to which the error, state change, or warning that occurred
belongs. Ref. to predefined data of type errdomain .
ErrorId
Data type: num
Variable to store the number of the error that occurred. The error number is returned without
the first digit (error domain) and without the initial zeros of the complete error number.
E.g. 10008 Program restarted is returned as 8.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 351
|
1 Instructions
1.123. ReadCfgData - Reads attribute of a system parameter
RobotWare - OS
3HAC 16581-1 Revision: J
348
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
ReadCfgData
[ InstancePath ’:=’ ] < expression ( IN ) of string >’,’
[ Attribute’ :=’ ] < expression ( IN ) of string >’,’
[ CfgData’ :=’ ] < variable ( VAR ) of anytype >
[’\’ListNo’:=’ < variable ( VAR ) of num >]’;’
Related information
For information about
See
Definition of string
string - Strings on page 1195
Write attribute of a system parameter
WriteCfgData - Writes attribute of a system
parameter on page 721
Get robot name in current task
RobName - Get the TCP robot name on page 966
Configuration
Technical reference manual - System parameters
Continued
1 Instructions
1.124. ReadErrData - Gets information about an error
RobotWare - OS
349
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.124. ReadErrData - Gets information about an error
Usage
ReadErrData is to be used in a trap routine, to get information (domain, type, number and
intermixed strings %s etc.) about an error, a state change, or a warning that caused the trap
routine to be executed.
Basic examples
Basic examples of the instruction ReadErrData are illustrated below.
See also More examples on page 350
Example 1
VAR errdomain err_domain;
VAR num err_number;
VAR errtype err_type;
VAR trapdata err_data;
VAR string string1;
VAR string string2;
...
TRAP trap_err
GetTrapData err_data;
ReadErrData err_data, err_domain, err_number,
err_type \Str1:=string1 \Str2:=string2;
ENDTRAP
When an error is trapped to the trap routine trap_err the error domain, the error number,
the error type, and the two first intermixed strings in the error message are saved into
appropriate variables.
Arguments
ReadErrData TrapEvent ErrorDomain ErrorId ErrorType
[\Str1] [\Str2] [\Str3] [\Str4] [\Str5]
TrapEvent
Data type: trapdata
Variable containing the information about what caused the trap to be executed.
ErrorDomain
Data type: errdomain
Variable to store the error domain to which the error, state change, or warning that occurred
belongs. Ref. to predefined data of type errdomain .
ErrorId
Data type: num
Variable to store the number of the error that occurred. The error number is returned without
the first digit (error domain) and without the initial zeros of the complete error number.
E.g. 10008 Program restarted is returned as 8.
Continues on next page
1 Instructions
1.124. ReadErrData - Gets information about an error
RobotWare - OS
3HAC 16581-1 Revision: J
350
© Copyright 2004-2010 ABB. All rights reserved.
ErrorType
Data type: errtype
Variable to store the type of event such as error, state change, or warning that occurred. Ref.
to predefined data of type errtype .
[ \Str1 ] ... [ \Str5 ]
Data type: string
Update the specified string variable with argument that is intermixed in the error message.
There could be up to five arguments in a message of type %s, %f, %d or %ld, which always
will be converted to a string at execution of this instruction. Str1 will hold the first argument,
Str2 will hold the second argument, and so on. Information about how many arguments there
are in a message is found in Operating manual - Trouble shooting . The intermixed arguments
is marked as arg in that document.
Program execution
The ErrorDomain , ErrorId , ErrorType and Str1 ... Str5 variables are updated
according to the contents of TrapEvent .
If different events are connected to the same trap routine then the program must make sure
that the event is related to error monitoring. This can be done by testing that INTNO matches
the interrupt number used in the instruction IError ;
More examples
More examples of the instruction ReadErrData are illustrated below.
Example 1
VAR intnum err_interrupt;
VAR trapdata err_data;
VAR errdomain err_domain;
VAR num err_number;
VAR errtype err_type;
...
CONNECT err_interrupt WITH trap_err;
IError COMMON_ERR, TYPE_ERR, err_interupt;
...
IDelete err_interrupt;
...
TRAP trap_err
GetTrapData err_data;
ReadErrData err_data, err_domain, err_number, err_type;
! Set domain no 1 ... 11
SetGO go_err1, err_domain;
! Set error no 1 ...9999
SetGO go_err2, err_number;
ENDTRAP
When an error occurs (only errors, not warning or state change) the error number is retrieved
in the trap routine and its value is used to set 2 groups of digital output signals.
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
| 352
|
1 Instructions
1.124. ReadErrData - Gets information about an error
RobotWare - OS
349
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.124. ReadErrData - Gets information about an error
Usage
ReadErrData is to be used in a trap routine, to get information (domain, type, number and
intermixed strings %s etc.) about an error, a state change, or a warning that caused the trap
routine to be executed.
Basic examples
Basic examples of the instruction ReadErrData are illustrated below.
See also More examples on page 350
Example 1
VAR errdomain err_domain;
VAR num err_number;
VAR errtype err_type;
VAR trapdata err_data;
VAR string string1;
VAR string string2;
...
TRAP trap_err
GetTrapData err_data;
ReadErrData err_data, err_domain, err_number,
err_type \Str1:=string1 \Str2:=string2;
ENDTRAP
When an error is trapped to the trap routine trap_err the error domain, the error number,
the error type, and the two first intermixed strings in the error message are saved into
appropriate variables.
Arguments
ReadErrData TrapEvent ErrorDomain ErrorId ErrorType
[\Str1] [\Str2] [\Str3] [\Str4] [\Str5]
TrapEvent
Data type: trapdata
Variable containing the information about what caused the trap to be executed.
ErrorDomain
Data type: errdomain
Variable to store the error domain to which the error, state change, or warning that occurred
belongs. Ref. to predefined data of type errdomain .
ErrorId
Data type: num
Variable to store the number of the error that occurred. The error number is returned without
the first digit (error domain) and without the initial zeros of the complete error number.
E.g. 10008 Program restarted is returned as 8.
Continues on next page
1 Instructions
1.124. ReadErrData - Gets information about an error
RobotWare - OS
3HAC 16581-1 Revision: J
350
© Copyright 2004-2010 ABB. All rights reserved.
ErrorType
Data type: errtype
Variable to store the type of event such as error, state change, or warning that occurred. Ref.
to predefined data of type errtype .
[ \Str1 ] ... [ \Str5 ]
Data type: string
Update the specified string variable with argument that is intermixed in the error message.
There could be up to five arguments in a message of type %s, %f, %d or %ld, which always
will be converted to a string at execution of this instruction. Str1 will hold the first argument,
Str2 will hold the second argument, and so on. Information about how many arguments there
are in a message is found in Operating manual - Trouble shooting . The intermixed arguments
is marked as arg in that document.
Program execution
The ErrorDomain , ErrorId , ErrorType and Str1 ... Str5 variables are updated
according to the contents of TrapEvent .
If different events are connected to the same trap routine then the program must make sure
that the event is related to error monitoring. This can be done by testing that INTNO matches
the interrupt number used in the instruction IError ;
More examples
More examples of the instruction ReadErrData are illustrated below.
Example 1
VAR intnum err_interrupt;
VAR trapdata err_data;
VAR errdomain err_domain;
VAR num err_number;
VAR errtype err_type;
...
CONNECT err_interrupt WITH trap_err;
IError COMMON_ERR, TYPE_ERR, err_interupt;
...
IDelete err_interrupt;
...
TRAP trap_err
GetTrapData err_data;
ReadErrData err_data, err_domain, err_number, err_type;
! Set domain no 1 ... 11
SetGO go_err1, err_domain;
! Set error no 1 ...9999
SetGO go_err2, err_number;
ENDTRAP
When an error occurs (only errors, not warning or state change) the error number is retrieved
in the trap routine and its value is used to set 2 groups of digital output signals.
Continued
Continues on next page
1 Instructions
1.124. ReadErrData - Gets information about an error
RobotWare - OS
351
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Limitation
It is not possible obtain information about internal errors.
Syntax
ReadErrData
[TrapEvent ’:=’] <variable ( VAR ) of trapdata>’,’
[ErrorDomain’ :=’] <variable ( VAR ) of errdomain>’,’
[ErrorId’:=’] <variable ( VAR ) of num>’,’
[ErrorType’ :=’] <variable ( VAR ) of errtype>
[‘\’Str1 ´:=’<variable ( VAR ) of string>]
[‘\’Str2 ´:=’<variable ( VAR ) of string>]
[‘\’Str3 ´:=’<variable ( VAR ) of string>]
[‘\’Str4 ´:=’<variable ( VAR ) of string>]
[‘\’Str5 ´:=’<variable ( VAR ) of string>]’;’
Related information
For information about
See
Summary of interrupts
Technical reference manual - RAPID overview ,
section RAPID summary - Interrupts
More information on interrupt
management
Technical reference manual - RAPID overview ,
section Basic characteristics - Interrupts
Error domains, predefined constants
errdomain - Error domain on page 1106
Error types, predefined constants
errtype - Error type on page 1115
Orders an interrupt on errors
IError - Orders an interrupt on errors on page 126
Get interrupt data for current TRAP
GetTrapData - Get interrupt data for current TRAP on
page 115
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 353
|
1 Instructions
1.124. ReadErrData - Gets information about an error
RobotWare - OS
3HAC 16581-1 Revision: J
350
© Copyright 2004-2010 ABB. All rights reserved.
ErrorType
Data type: errtype
Variable to store the type of event such as error, state change, or warning that occurred. Ref.
to predefined data of type errtype .
[ \Str1 ] ... [ \Str5 ]
Data type: string
Update the specified string variable with argument that is intermixed in the error message.
There could be up to five arguments in a message of type %s, %f, %d or %ld, which always
will be converted to a string at execution of this instruction. Str1 will hold the first argument,
Str2 will hold the second argument, and so on. Information about how many arguments there
are in a message is found in Operating manual - Trouble shooting . The intermixed arguments
is marked as arg in that document.
Program execution
The ErrorDomain , ErrorId , ErrorType and Str1 ... Str5 variables are updated
according to the contents of TrapEvent .
If different events are connected to the same trap routine then the program must make sure
that the event is related to error monitoring. This can be done by testing that INTNO matches
the interrupt number used in the instruction IError ;
More examples
More examples of the instruction ReadErrData are illustrated below.
Example 1
VAR intnum err_interrupt;
VAR trapdata err_data;
VAR errdomain err_domain;
VAR num err_number;
VAR errtype err_type;
...
CONNECT err_interrupt WITH trap_err;
IError COMMON_ERR, TYPE_ERR, err_interupt;
...
IDelete err_interrupt;
...
TRAP trap_err
GetTrapData err_data;
ReadErrData err_data, err_domain, err_number, err_type;
! Set domain no 1 ... 11
SetGO go_err1, err_domain;
! Set error no 1 ...9999
SetGO go_err2, err_number;
ENDTRAP
When an error occurs (only errors, not warning or state change) the error number is retrieved
in the trap routine and its value is used to set 2 groups of digital output signals.
Continued
Continues on next page
1 Instructions
1.124. ReadErrData - Gets information about an error
RobotWare - OS
351
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Limitation
It is not possible obtain information about internal errors.
Syntax
ReadErrData
[TrapEvent ’:=’] <variable ( VAR ) of trapdata>’,’
[ErrorDomain’ :=’] <variable ( VAR ) of errdomain>’,’
[ErrorId’:=’] <variable ( VAR ) of num>’,’
[ErrorType’ :=’] <variable ( VAR ) of errtype>
[‘\’Str1 ´:=’<variable ( VAR ) of string>]
[‘\’Str2 ´:=’<variable ( VAR ) of string>]
[‘\’Str3 ´:=’<variable ( VAR ) of string>]
[‘\’Str4 ´:=’<variable ( VAR ) of string>]
[‘\’Str5 ´:=’<variable ( VAR ) of string>]’;’
Related information
For information about
See
Summary of interrupts
Technical reference manual - RAPID overview ,
section RAPID summary - Interrupts
More information on interrupt
management
Technical reference manual - RAPID overview ,
section Basic characteristics - Interrupts
Error domains, predefined constants
errdomain - Error domain on page 1106
Error types, predefined constants
errtype - Error type on page 1115
Orders an interrupt on errors
IError - Orders an interrupt on errors on page 126
Get interrupt data for current TRAP
GetTrapData - Get interrupt data for current TRAP on
page 115
Continued
1 Instructions
1.125. ReadRawBytes - Read rawbytes data
RobotWare - OS
3HAC 16581-1 Revision: J
352
© Copyright 2004-2010 ABB. All rights reserved.
1.125. ReadRawBytes - Read rawbytes data
Usage
ReadRawBytes is used to read data of type rawbytes from a device opened with Open\Bin .
Basic examples
Basic examples of the instruction ReadRawBytes are illustrated below.
Example 1
VAR iodev io_device;
VAR rawbytes raw_data_out;
VAR rawbytes raw_data_in;
VAR num float := 0.2;
VAR string answer;
ClearRawBytes raw_data_out;
PackDNHeader "10", "20 1D 24 01 30 64", raw_data_out;
PackRawBytes float, raw_data_out, (RawBytesLen(raw_data_out)+1)
\Float4;
Open "/FC1:/dsqc328_1", io_device \Bin;
WriteRawBytes io_device, raw_data_out;
ReadRawBytes io_device, raw_data_in \Time:=1;
Close io_device;
UnpackRawBytes raw_data_in, 1, answer \ASCII:=10;
In this example raw_data_out is cleared and then packed with DeviceNet header and a float
with value 0.2 .
A device, "/FC1:/dsqc328_1" , is opened and the current valid data in raw_data_out is
written to the device. Then the program waits for at most 1 second to read from the device,
which is stored in the raw_data_in .
After having closed the device "/FC1:/dsqc328_1" , the read data is unpacked as a string
of characters and stored in answer .
Arguments
ReadRawBytes IODevice RawData [\Time]
IODevice
Data type: iodev
IODevice is the identifier of the device from which data shall be read.
RawData
Data type: rawbytes
RawData is the data container that stores read data from IODevice starting at index 1.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 354
|
1 Instructions
1.124. ReadErrData - Gets information about an error
RobotWare - OS
351
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Limitation
It is not possible obtain information about internal errors.
Syntax
ReadErrData
[TrapEvent ’:=’] <variable ( VAR ) of trapdata>’,’
[ErrorDomain’ :=’] <variable ( VAR ) of errdomain>’,’
[ErrorId’:=’] <variable ( VAR ) of num>’,’
[ErrorType’ :=’] <variable ( VAR ) of errtype>
[‘\’Str1 ´:=’<variable ( VAR ) of string>]
[‘\’Str2 ´:=’<variable ( VAR ) of string>]
[‘\’Str3 ´:=’<variable ( VAR ) of string>]
[‘\’Str4 ´:=’<variable ( VAR ) of string>]
[‘\’Str5 ´:=’<variable ( VAR ) of string>]’;’
Related information
For information about
See
Summary of interrupts
Technical reference manual - RAPID overview ,
section RAPID summary - Interrupts
More information on interrupt
management
Technical reference manual - RAPID overview ,
section Basic characteristics - Interrupts
Error domains, predefined constants
errdomain - Error domain on page 1106
Error types, predefined constants
errtype - Error type on page 1115
Orders an interrupt on errors
IError - Orders an interrupt on errors on page 126
Get interrupt data for current TRAP
GetTrapData - Get interrupt data for current TRAP on
page 115
Continued
1 Instructions
1.125. ReadRawBytes - Read rawbytes data
RobotWare - OS
3HAC 16581-1 Revision: J
352
© Copyright 2004-2010 ABB. All rights reserved.
1.125. ReadRawBytes - Read rawbytes data
Usage
ReadRawBytes is used to read data of type rawbytes from a device opened with Open\Bin .
Basic examples
Basic examples of the instruction ReadRawBytes are illustrated below.
Example 1
VAR iodev io_device;
VAR rawbytes raw_data_out;
VAR rawbytes raw_data_in;
VAR num float := 0.2;
VAR string answer;
ClearRawBytes raw_data_out;
PackDNHeader "10", "20 1D 24 01 30 64", raw_data_out;
PackRawBytes float, raw_data_out, (RawBytesLen(raw_data_out)+1)
\Float4;
Open "/FC1:/dsqc328_1", io_device \Bin;
WriteRawBytes io_device, raw_data_out;
ReadRawBytes io_device, raw_data_in \Time:=1;
Close io_device;
UnpackRawBytes raw_data_in, 1, answer \ASCII:=10;
In this example raw_data_out is cleared and then packed with DeviceNet header and a float
with value 0.2 .
A device, "/FC1:/dsqc328_1" , is opened and the current valid data in raw_data_out is
written to the device. Then the program waits for at most 1 second to read from the device,
which is stored in the raw_data_in .
After having closed the device "/FC1:/dsqc328_1" , the read data is unpacked as a string
of characters and stored in answer .
Arguments
ReadRawBytes IODevice RawData [\Time]
IODevice
Data type: iodev
IODevice is the identifier of the device from which data shall be read.
RawData
Data type: rawbytes
RawData is the data container that stores read data from IODevice starting at index 1.
Continues on next page
1 Instructions
1.125. ReadRawBytes - Read rawbytes data
RobotWare - OS
353
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
[\Time]
Data type: num
The max. time for the reading operation (timeout) in seconds (resolution 0,001s). If this
argument is not specified then 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 then the error handler will be
called with the error code ERR_DEV_MAXTIME . If there is no error handler then 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
During program execution the data is read from the device indicated by IODevice .
If using WriteRawBytes for field bus commands such as DeviceNet then the field bus
always sends an answer. The answer must be handled in RAPID with the ReadRawBytes
instruction.
The current length of valid bytes in the RawData variable is set to the read number of bytes.
The data starts at index 1 in RawData .
Error handling
If an error occurs during reading then the system variable ERRNO is set to ERR_FILEACC .
If time out before the read operation is finished then nothing in the variable RawData is
affected, and the system variable ERRNO is set to ERR_DEV_MAXTIME .
These errors can then be dealt with by the error handler.
Syntax
ReadRawBytes
[IODevice ’:=’ ] < variable ( VAR ) of iodev>’ ,’
[RawData ’:=’ ] < variable ( VAR ) of rawbytes> ’,’
[ ’\’ Time ´:=’ < expression ( IN ) of num>] ’;’
Related information
For information about
See
rawbytes data
rawbytes - Raw data on page 1165
Get the length of rawbytes data
RawBytesLen - Get the length of rawbytes data
on page 940
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
Write rawbytes data
WriteRawBytes - Write rawbytes data on page
725
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
| 355
|
1 Instructions
1.125. ReadRawBytes - Read rawbytes data
RobotWare - OS
3HAC 16581-1 Revision: J
352
© Copyright 2004-2010 ABB. All rights reserved.
1.125. ReadRawBytes - Read rawbytes data
Usage
ReadRawBytes is used to read data of type rawbytes from a device opened with Open\Bin .
Basic examples
Basic examples of the instruction ReadRawBytes are illustrated below.
Example 1
VAR iodev io_device;
VAR rawbytes raw_data_out;
VAR rawbytes raw_data_in;
VAR num float := 0.2;
VAR string answer;
ClearRawBytes raw_data_out;
PackDNHeader "10", "20 1D 24 01 30 64", raw_data_out;
PackRawBytes float, raw_data_out, (RawBytesLen(raw_data_out)+1)
\Float4;
Open "/FC1:/dsqc328_1", io_device \Bin;
WriteRawBytes io_device, raw_data_out;
ReadRawBytes io_device, raw_data_in \Time:=1;
Close io_device;
UnpackRawBytes raw_data_in, 1, answer \ASCII:=10;
In this example raw_data_out is cleared and then packed with DeviceNet header and a float
with value 0.2 .
A device, "/FC1:/dsqc328_1" , is opened and the current valid data in raw_data_out is
written to the device. Then the program waits for at most 1 second to read from the device,
which is stored in the raw_data_in .
After having closed the device "/FC1:/dsqc328_1" , the read data is unpacked as a string
of characters and stored in answer .
Arguments
ReadRawBytes IODevice RawData [\Time]
IODevice
Data type: iodev
IODevice is the identifier of the device from which data shall be read.
RawData
Data type: rawbytes
RawData is the data container that stores read data from IODevice starting at index 1.
Continues on next page
1 Instructions
1.125. ReadRawBytes - Read rawbytes data
RobotWare - OS
353
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
[\Time]
Data type: num
The max. time for the reading operation (timeout) in seconds (resolution 0,001s). If this
argument is not specified then 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 then the error handler will be
called with the error code ERR_DEV_MAXTIME . If there is no error handler then 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
During program execution the data is read from the device indicated by IODevice .
If using WriteRawBytes for field bus commands such as DeviceNet then the field bus
always sends an answer. The answer must be handled in RAPID with the ReadRawBytes
instruction.
The current length of valid bytes in the RawData variable is set to the read number of bytes.
The data starts at index 1 in RawData .
Error handling
If an error occurs during reading then the system variable ERRNO is set to ERR_FILEACC .
If time out before the read operation is finished then nothing in the variable RawData is
affected, and the system variable ERRNO is set to ERR_DEV_MAXTIME .
These errors can then be dealt with by the error handler.
Syntax
ReadRawBytes
[IODevice ’:=’ ] < variable ( VAR ) of iodev>’ ,’
[RawData ’:=’ ] < variable ( VAR ) of rawbytes> ’,’
[ ’\’ Time ´:=’ < expression ( IN ) of num>] ’;’
Related information
For information about
See
rawbytes data
rawbytes - Raw data on page 1165
Get the length of rawbytes data
RawBytesLen - Get the length of rawbytes data
on page 940
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
Write rawbytes data
WriteRawBytes - Write rawbytes data on page
725
Continued
Continues on next page
1 Instructions
1.125. ReadRawBytes - Read rawbytes data
RobotWare - OS
3HAC 16581-1 Revision: J
354
© Copyright 2004-2010 ABB. All rights reserved.
Unpack data from rawbytes data
UnpackRawBytes - Unpack data from rawbytes
data on page 658
For information about
See
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 356
|
1 Instructions
1.125. ReadRawBytes - Read rawbytes data
RobotWare - OS
353
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
[\Time]
Data type: num
The max. time for the reading operation (timeout) in seconds (resolution 0,001s). If this
argument is not specified then 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 then the error handler will be
called with the error code ERR_DEV_MAXTIME . If there is no error handler then 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
During program execution the data is read from the device indicated by IODevice .
If using WriteRawBytes for field bus commands such as DeviceNet then the field bus
always sends an answer. The answer must be handled in RAPID with the ReadRawBytes
instruction.
The current length of valid bytes in the RawData variable is set to the read number of bytes.
The data starts at index 1 in RawData .
Error handling
If an error occurs during reading then the system variable ERRNO is set to ERR_FILEACC .
If time out before the read operation is finished then nothing in the variable RawData is
affected, and the system variable ERRNO is set to ERR_DEV_MAXTIME .
These errors can then be dealt with by the error handler.
Syntax
ReadRawBytes
[IODevice ’:=’ ] < variable ( VAR ) of iodev>’ ,’
[RawData ’:=’ ] < variable ( VAR ) of rawbytes> ’,’
[ ’\’ Time ´:=’ < expression ( IN ) of num>] ’;’
Related information
For information about
See
rawbytes data
rawbytes - Raw data on page 1165
Get the length of rawbytes data
RawBytesLen - Get the length of rawbytes data
on page 940
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
Write rawbytes data
WriteRawBytes - Write rawbytes data on page
725
Continued
Continues on next page
1 Instructions
1.125. ReadRawBytes - Read rawbytes data
RobotWare - OS
3HAC 16581-1 Revision: J
354
© Copyright 2004-2010 ABB. All rights reserved.
Unpack data from rawbytes data
UnpackRawBytes - Unpack data from rawbytes
data on page 658
For information about
See
Continued
1 Instructions
1.126. RemoveDir - Delete a directory
RobotWare - OS
355
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.126. RemoveDir - Delete a directory
Usage
RemoveDir is used to remove a directory.
The user must have write and execute permission for the directory and the directory must be
empty.
Basic examples
Basic examples of the instruction RemoveDir are illustrated below.
Example 1
RemoveDir "HOME:/mydir";
In this example the mydir directory under HOME: is deleted.
Arguments
RemoveDir Path
Path
Data type: string
The name of the directory to be removed, specified with full or relative path.
Error handling
If the directory does not exist, or the directory is not empty, or the user does not have write
and execute permission to the library then the system variable ERRNO is set to ERR_FILEACC .
This error can then be handled in the error handler.
Syntax
RemoveDir
[ Path’:=’ ] < expression ( IN ) of string>’;’
Related information
For information about
See
Directory
dir - File directory structure on page 1103
Open a directory
OpenDir - Open a directory on page 285
Read a directory
ReadDir - Read next entry in a directory on
page 944
Close a directory
CloseDir - Close a directory on page 56
Make a directory
MakeDir - Create a new directory on page
218
Rename a file
RenameFile - Rename a file on page 357
Remove a file
RemoveFile - Delete a file on page 356
Copy a file
CopyFile - Copy a file on page 65
Check file type
IsFile - Check the type of a file on page 878
Check file size
FileSize - Retrieve the size of a file on page
842
Check file system size
FSSize - Retrieve the size of a file system on
page 848
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 357
|
1 Instructions
1.125. ReadRawBytes - Read rawbytes data
RobotWare - OS
3HAC 16581-1 Revision: J
354
© Copyright 2004-2010 ABB. All rights reserved.
Unpack data from rawbytes data
UnpackRawBytes - Unpack data from rawbytes
data on page 658
For information about
See
Continued
1 Instructions
1.126. RemoveDir - Delete a directory
RobotWare - OS
355
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.126. RemoveDir - Delete a directory
Usage
RemoveDir is used to remove a directory.
The user must have write and execute permission for the directory and the directory must be
empty.
Basic examples
Basic examples of the instruction RemoveDir are illustrated below.
Example 1
RemoveDir "HOME:/mydir";
In this example the mydir directory under HOME: is deleted.
Arguments
RemoveDir Path
Path
Data type: string
The name of the directory to be removed, specified with full or relative path.
Error handling
If the directory does not exist, or the directory is not empty, or the user does not have write
and execute permission to the library then the system variable ERRNO is set to ERR_FILEACC .
This error can then be handled in the error handler.
Syntax
RemoveDir
[ Path’:=’ ] < expression ( IN ) of string>’;’
Related information
For information about
See
Directory
dir - File directory structure on page 1103
Open a directory
OpenDir - Open a directory on page 285
Read a directory
ReadDir - Read next entry in a directory on
page 944
Close a directory
CloseDir - Close a directory on page 56
Make a directory
MakeDir - Create a new directory on page
218
Rename a file
RenameFile - Rename a file on page 357
Remove a file
RemoveFile - Delete a file on page 356
Copy a file
CopyFile - Copy a file on page 65
Check file type
IsFile - Check the type of a file on page 878
Check file size
FileSize - Retrieve the size of a file on page
842
Check file system size
FSSize - Retrieve the size of a file system on
page 848
1 Instructions
1.127. RemoveFile - Delete a file
RobotWare - OS
3HAC 16581-1 Revision: J
356
© Copyright 2004-2010 ABB. All rights reserved.
1.127. RemoveFile - Delete a file
Usage
RemoveFile is used to remove a file. The user must have write and execute permission for
the directory where the file resides and the user must have write permission for the file itself.
Basic examples
Basic examples of the instruction RemoveFile are illustrated below.
Example 1
RemoveFile "HOME:/mydir/myfile.log";
In this example the file myfile.log in directory mydir on disk HOME: is deleted.
Arguments
RemoveFile Path
Path
Data type: string
The name of the file to be deleted, specified with full or relative path.
Error handling
If the file does not exist then the system variable ERRNO is set to ERR_FILEACC . This error
can then be handled in the error handler.
Syntax
RemoveFile
[ Path’:=’ ] < expression ( IN ) of string>’;’
Related information
For information about
See
Make a directory
MakeDir - Create a new directory on page
218
Remove a directory
RemoveDir - Delete a directory on page 355
Rename a file
RenameFile - Rename a file on page 357
Copy a file
CopyFile - Copy a file on page 65
Check file type
IsFile - Check the type of a file on page 878
Check file size
FileSize - Retrieve the size of a file on page
842
Check file system size
FSSize - Retrieve the size of a file system on
page 848
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 358
|
1 Instructions
1.126. RemoveDir - Delete a directory
RobotWare - OS
355
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.126. RemoveDir - Delete a directory
Usage
RemoveDir is used to remove a directory.
The user must have write and execute permission for the directory and the directory must be
empty.
Basic examples
Basic examples of the instruction RemoveDir are illustrated below.
Example 1
RemoveDir "HOME:/mydir";
In this example the mydir directory under HOME: is deleted.
Arguments
RemoveDir Path
Path
Data type: string
The name of the directory to be removed, specified with full or relative path.
Error handling
If the directory does not exist, or the directory is not empty, or the user does not have write
and execute permission to the library then the system variable ERRNO is set to ERR_FILEACC .
This error can then be handled in the error handler.
Syntax
RemoveDir
[ Path’:=’ ] < expression ( IN ) of string>’;’
Related information
For information about
See
Directory
dir - File directory structure on page 1103
Open a directory
OpenDir - Open a directory on page 285
Read a directory
ReadDir - Read next entry in a directory on
page 944
Close a directory
CloseDir - Close a directory on page 56
Make a directory
MakeDir - Create a new directory on page
218
Rename a file
RenameFile - Rename a file on page 357
Remove a file
RemoveFile - Delete a file on page 356
Copy a file
CopyFile - Copy a file on page 65
Check file type
IsFile - Check the type of a file on page 878
Check file size
FileSize - Retrieve the size of a file on page
842
Check file system size
FSSize - Retrieve the size of a file system on
page 848
1 Instructions
1.127. RemoveFile - Delete a file
RobotWare - OS
3HAC 16581-1 Revision: J
356
© Copyright 2004-2010 ABB. All rights reserved.
1.127. RemoveFile - Delete a file
Usage
RemoveFile is used to remove a file. The user must have write and execute permission for
the directory where the file resides and the user must have write permission for the file itself.
Basic examples
Basic examples of the instruction RemoveFile are illustrated below.
Example 1
RemoveFile "HOME:/mydir/myfile.log";
In this example the file myfile.log in directory mydir on disk HOME: is deleted.
Arguments
RemoveFile Path
Path
Data type: string
The name of the file to be deleted, specified with full or relative path.
Error handling
If the file does not exist then the system variable ERRNO is set to ERR_FILEACC . This error
can then be handled in the error handler.
Syntax
RemoveFile
[ Path’:=’ ] < expression ( IN ) of string>’;’
Related information
For information about
See
Make a directory
MakeDir - Create a new directory on page
218
Remove a directory
RemoveDir - Delete a directory on page 355
Rename a file
RenameFile - Rename a file on page 357
Copy a file
CopyFile - Copy a file on page 65
Check file type
IsFile - Check the type of a file on page 878
Check file size
FileSize - Retrieve the size of a file on page
842
Check file system size
FSSize - Retrieve the size of a file system on
page 848
1 Instructions
1.128. RenameFile - Rename a file
RobotWare - OS
357
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.128. RenameFile - Rename a file
Usage
RenameFile is used to give a new name to an existing file. It can also be used to move a file
from one place to another in the directory structure.
Basic examples
Basic examples of the instruction RenameFile are illustrated below.
Example 1
RenameFile "HOME:/myfile", "HOME:/yourfile;
The file myfile is given the name yourfile .
RenameFile "HOME:/myfile", "HOME:/mydir/yourfile";
The file myfile is given the name yourfile and is moved to the directory mydir .
Arguments
RenameFile OldPath NewPath
OldPath
Data type: string
The complete path of the file to be renamed.
NewPath
Data type: string
The complete path of the renamed file.
Program execution
The file specified in OldPath will be given the name specified in NewPath . If the path in
NewPath is different from the path in OldPath then the file will also be moved to the new
location.
Error Handling
If the file specified in NewPath already exists then the system variable ERRNO is set to
ERR_FILEEXIST . This error can then be handled in the error handler.
Syntax
RenameFile
[ OldPath’ :=’ ] < expression ( IN ) of string > ’,’
[ NewPath’ :=’ ] < expression ( IN ) of 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
| 359
|
1 Instructions
1.127. RemoveFile - Delete a file
RobotWare - OS
3HAC 16581-1 Revision: J
356
© Copyright 2004-2010 ABB. All rights reserved.
1.127. RemoveFile - Delete a file
Usage
RemoveFile is used to remove a file. The user must have write and execute permission for
the directory where the file resides and the user must have write permission for the file itself.
Basic examples
Basic examples of the instruction RemoveFile are illustrated below.
Example 1
RemoveFile "HOME:/mydir/myfile.log";
In this example the file myfile.log in directory mydir on disk HOME: is deleted.
Arguments
RemoveFile Path
Path
Data type: string
The name of the file to be deleted, specified with full or relative path.
Error handling
If the file does not exist then the system variable ERRNO is set to ERR_FILEACC . This error
can then be handled in the error handler.
Syntax
RemoveFile
[ Path’:=’ ] < expression ( IN ) of string>’;’
Related information
For information about
See
Make a directory
MakeDir - Create a new directory on page
218
Remove a directory
RemoveDir - Delete a directory on page 355
Rename a file
RenameFile - Rename a file on page 357
Copy a file
CopyFile - Copy a file on page 65
Check file type
IsFile - Check the type of a file on page 878
Check file size
FileSize - Retrieve the size of a file on page
842
Check file system size
FSSize - Retrieve the size of a file system on
page 848
1 Instructions
1.128. RenameFile - Rename a file
RobotWare - OS
357
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.128. RenameFile - Rename a file
Usage
RenameFile is used to give a new name to an existing file. It can also be used to move a file
from one place to another in the directory structure.
Basic examples
Basic examples of the instruction RenameFile are illustrated below.
Example 1
RenameFile "HOME:/myfile", "HOME:/yourfile;
The file myfile is given the name yourfile .
RenameFile "HOME:/myfile", "HOME:/mydir/yourfile";
The file myfile is given the name yourfile and is moved to the directory mydir .
Arguments
RenameFile OldPath NewPath
OldPath
Data type: string
The complete path of the file to be renamed.
NewPath
Data type: string
The complete path of the renamed file.
Program execution
The file specified in OldPath will be given the name specified in NewPath . If the path in
NewPath is different from the path in OldPath then the file will also be moved to the new
location.
Error Handling
If the file specified in NewPath already exists then the system variable ERRNO is set to
ERR_FILEEXIST . This error can then be handled in the error handler.
Syntax
RenameFile
[ OldPath’ :=’ ] < expression ( IN ) of string > ’,’
[ NewPath’ :=’ ] < expression ( IN ) of string >’;’
Continues on next page
1 Instructions
1.128. RenameFile - Rename a file
RobotWare - OS
3HAC 16581-1 Revision: J
358
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Make a directory
MakeDir - Create a new directory on page
218
Remove a directory
RemoveDir - Delete a directory on page 355
Remove a file
RemoveFile - Delete a file on page 356
Copy a file
CopyFile - Copy a file on page 65
Check file type
IsFile - Check the type of a file on page 878
Check file size
FileSize - Retrieve the size of a file on page
842
Check file system size
FSSize - Retrieve the size of a file system on
page 848
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 360
|
1 Instructions
1.128. RenameFile - Rename a file
RobotWare - OS
357
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.128. RenameFile - Rename a file
Usage
RenameFile is used to give a new name to an existing file. It can also be used to move a file
from one place to another in the directory structure.
Basic examples
Basic examples of the instruction RenameFile are illustrated below.
Example 1
RenameFile "HOME:/myfile", "HOME:/yourfile;
The file myfile is given the name yourfile .
RenameFile "HOME:/myfile", "HOME:/mydir/yourfile";
The file myfile is given the name yourfile and is moved to the directory mydir .
Arguments
RenameFile OldPath NewPath
OldPath
Data type: string
The complete path of the file to be renamed.
NewPath
Data type: string
The complete path of the renamed file.
Program execution
The file specified in OldPath will be given the name specified in NewPath . If the path in
NewPath is different from the path in OldPath then the file will also be moved to the new
location.
Error Handling
If the file specified in NewPath already exists then the system variable ERRNO is set to
ERR_FILEEXIST . This error can then be handled in the error handler.
Syntax
RenameFile
[ OldPath’ :=’ ] < expression ( IN ) of string > ’,’
[ NewPath’ :=’ ] < expression ( IN ) of string >’;’
Continues on next page
1 Instructions
1.128. RenameFile - Rename a file
RobotWare - OS
3HAC 16581-1 Revision: J
358
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Make a directory
MakeDir - Create a new directory on page
218
Remove a directory
RemoveDir - Delete a directory on page 355
Remove a file
RemoveFile - Delete a file on page 356
Copy a file
CopyFile - Copy a file on page 65
Check file type
IsFile - Check the type of a file on page 878
Check file size
FileSize - Retrieve the size of a file on page
842
Check file system size
FSSize - Retrieve the size of a file system on
page 848
Continued
1 Instructions
1.129. Reset - Resets a digital output signal
RobotWare - OS
359
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.129. Reset - Resets a digital output signal
Usage
Reset is used to reset the value of a digital output signal to zero.
Basic examples
Basic examples of the instruction Reset are illustrated below.
Example 1
Reset do15;
The signal do15 is set to 0.
Example 2
Reset weld;
The signal weld is set to 0.
Arguments
Reset Signal
Signal
Data type: signaldo
The name of the signal to be reset to zero.
Program execution
The true value depends on the configuration of the signal. If the signal is inverted in the
system parameters then this instruction causes the physical channel to be set to 1.
Error handling
The following recoverable error can be generated. The error can be handled in an error
handler. The system variable ERRNO will be set to:
ERR_NORUNUNIT if there is no contact with the unit.
Syntax
Reset
[ Signal ’:=’ ] < variable ( VAR ) of signaldo > ’;’
Related information
For information about
See
Setting a digital output signal
Set - Sets a digital output signal on page 427
Input/Output instructions
Technical reference manual - RAPID overview ,
section RAPID summary - Input and output
signals
Input/Output functionality in general
Technical reference manual - RAPID overview ,
section Motion and I/O principles - I/O principles
Configuration of I/O
Technical reference manual - System
parameters
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 361
|
1 Instructions
1.128. RenameFile - Rename a file
RobotWare - OS
3HAC 16581-1 Revision: J
358
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Make a directory
MakeDir - Create a new directory on page
218
Remove a directory
RemoveDir - Delete a directory on page 355
Remove a file
RemoveFile - Delete a file on page 356
Copy a file
CopyFile - Copy a file on page 65
Check file type
IsFile - Check the type of a file on page 878
Check file size
FileSize - Retrieve the size of a file on page
842
Check file system size
FSSize - Retrieve the size of a file system on
page 848
Continued
1 Instructions
1.129. Reset - Resets a digital output signal
RobotWare - OS
359
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.129. Reset - Resets a digital output signal
Usage
Reset is used to reset the value of a digital output signal to zero.
Basic examples
Basic examples of the instruction Reset are illustrated below.
Example 1
Reset do15;
The signal do15 is set to 0.
Example 2
Reset weld;
The signal weld is set to 0.
Arguments
Reset Signal
Signal
Data type: signaldo
The name of the signal to be reset to zero.
Program execution
The true value depends on the configuration of the signal. If the signal is inverted in the
system parameters then this instruction causes the physical channel to be set to 1.
Error handling
The following recoverable error can be generated. The error can be handled in an error
handler. The system variable ERRNO will be set to:
ERR_NORUNUNIT if there is no contact with the unit.
Syntax
Reset
[ Signal ’:=’ ] < variable ( VAR ) of signaldo > ’;’
Related information
For information about
See
Setting a digital output signal
Set - Sets a digital output signal on page 427
Input/Output instructions
Technical reference manual - RAPID overview ,
section RAPID summary - Input and output
signals
Input/Output functionality in general
Technical reference manual - RAPID overview ,
section Motion and I/O principles - I/O principles
Configuration of I/O
Technical reference manual - System
parameters
1 Instructions
1.130. ResetPPMoved - Reset state for the program pointer moved in manual mode
RobotWare - OS
3HAC 16581-1 Revision: J
360
© Copyright 2004-2010 ABB. All rights reserved.
1.130. ResetPPMoved - Reset state for the program pointer moved in manual mode
Usage
ResetPPMoved reset state for the program pointer moved in manual mode.
PPMovedInManMode returns TRUE if the user has moved the program pointer while the
controller is in manual mode - that is, the 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 instruction ResetPPMoved is illustrated below.
Example 1
IF PPMovedInManMode() THEN
WarnUserOfPPMovement;
! DO THIS ONLY ONCE
ResetPPMoved;
DoJob;
ELSE
DoJob;
ENDIF
Program execution
Resets state for the program pointer moved in manual mode for current program task.
Syntax
ResetPPMoved’;’
Related information
For information about
See
Test whether program pointer has been
moved in manual mode
PPMovedInManMode - Test whether the
program pointer is moved in manual mode on
page 936
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 362
|
1 Instructions
1.129. Reset - Resets a digital output signal
RobotWare - OS
359
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.129. Reset - Resets a digital output signal
Usage
Reset is used to reset the value of a digital output signal to zero.
Basic examples
Basic examples of the instruction Reset are illustrated below.
Example 1
Reset do15;
The signal do15 is set to 0.
Example 2
Reset weld;
The signal weld is set to 0.
Arguments
Reset Signal
Signal
Data type: signaldo
The name of the signal to be reset to zero.
Program execution
The true value depends on the configuration of the signal. If the signal is inverted in the
system parameters then this instruction causes the physical channel to be set to 1.
Error handling
The following recoverable error can be generated. The error can be handled in an error
handler. The system variable ERRNO will be set to:
ERR_NORUNUNIT if there is no contact with the unit.
Syntax
Reset
[ Signal ’:=’ ] < variable ( VAR ) of signaldo > ’;’
Related information
For information about
See
Setting a digital output signal
Set - Sets a digital output signal on page 427
Input/Output instructions
Technical reference manual - RAPID overview ,
section RAPID summary - Input and output
signals
Input/Output functionality in general
Technical reference manual - RAPID overview ,
section Motion and I/O principles - I/O principles
Configuration of I/O
Technical reference manual - System
parameters
1 Instructions
1.130. ResetPPMoved - Reset state for the program pointer moved in manual mode
RobotWare - OS
3HAC 16581-1 Revision: J
360
© Copyright 2004-2010 ABB. All rights reserved.
1.130. ResetPPMoved - Reset state for the program pointer moved in manual mode
Usage
ResetPPMoved reset state for the program pointer moved in manual mode.
PPMovedInManMode returns TRUE if the user has moved the program pointer while the
controller is in manual mode - that is, the 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 instruction ResetPPMoved is illustrated below.
Example 1
IF PPMovedInManMode() THEN
WarnUserOfPPMovement;
! DO THIS ONLY ONCE
ResetPPMoved;
DoJob;
ELSE
DoJob;
ENDIF
Program execution
Resets state for the program pointer moved in manual mode for current program task.
Syntax
ResetPPMoved’;’
Related information
For information about
See
Test whether program pointer has been
moved in manual mode
PPMovedInManMode - Test whether the
program pointer is moved in manual mode on
page 936
1 Instructions
1.131. ResetRetryCount - Reset the number of retries
RobotWare - OS
361
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.131. ResetRetryCount - Reset the number of retries
Usage
ResetRetryCount is used to reset the number of retries that has been done from an error
handler. The maximum number of retries that can be done is defined in the configuration.
Basic examples
Basic examples of the instruction ResetRetryCount are illustrated below.
Example 1
VAR num myretries := 0;
...
ERROR
IF myretries > 2 THEN
ResetRetryCount;
myretries := 0;
TRYNEXT;
ENDIF
myretries:= myretries + 1;
RETRY;
...
This program will retry the faulty instruction 3 times and then try the next instruction. The
internal system retry counter is reset before trying the next instruction (even if this is done by
the system at TRYNEXT ).
Program execution
For every RETRY made from an error handler an internal system counter will check that the
maximum number of retries, specified in the configuration, isn’t exceeded. Executing the
instruction ResetRetryCount will reset the counter and make it possible to redo a
maximum number of retries again.
Syntax
ResetRetryCount ’;’
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
Number of remaining retries
RemainingRetries - Remaining retries left to do on page
963
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 363
|
1 Instructions
1.130. ResetPPMoved - Reset state for the program pointer moved in manual mode
RobotWare - OS
3HAC 16581-1 Revision: J
360
© Copyright 2004-2010 ABB. All rights reserved.
1.130. ResetPPMoved - Reset state for the program pointer moved in manual mode
Usage
ResetPPMoved reset state for the program pointer moved in manual mode.
PPMovedInManMode returns TRUE if the user has moved the program pointer while the
controller is in manual mode - that is, the 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 instruction ResetPPMoved is illustrated below.
Example 1
IF PPMovedInManMode() THEN
WarnUserOfPPMovement;
! DO THIS ONLY ONCE
ResetPPMoved;
DoJob;
ELSE
DoJob;
ENDIF
Program execution
Resets state for the program pointer moved in manual mode for current program task.
Syntax
ResetPPMoved’;’
Related information
For information about
See
Test whether program pointer has been
moved in manual mode
PPMovedInManMode - Test whether the
program pointer is moved in manual mode on
page 936
1 Instructions
1.131. ResetRetryCount - Reset the number of retries
RobotWare - OS
361
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.131. ResetRetryCount - Reset the number of retries
Usage
ResetRetryCount is used to reset the number of retries that has been done from an error
handler. The maximum number of retries that can be done is defined in the configuration.
Basic examples
Basic examples of the instruction ResetRetryCount are illustrated below.
Example 1
VAR num myretries := 0;
...
ERROR
IF myretries > 2 THEN
ResetRetryCount;
myretries := 0;
TRYNEXT;
ENDIF
myretries:= myretries + 1;
RETRY;
...
This program will retry the faulty instruction 3 times and then try the next instruction. The
internal system retry counter is reset before trying the next instruction (even if this is done by
the system at TRYNEXT ).
Program execution
For every RETRY made from an error handler an internal system counter will check that the
maximum number of retries, specified in the configuration, isn’t exceeded. Executing the
instruction ResetRetryCount will reset the counter and make it possible to redo a
maximum number of retries again.
Syntax
ResetRetryCount ’;’
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
Number of remaining retries
RemainingRetries - Remaining retries left to do on page
963
1 Instructions
1.132. RestoPath - Restores the path after an interrupt
RobotWare - OS
3HAC 16581-1 Revision: J
362
© Copyright 2004-2010 ABB. All rights reserved.
1.132. RestoPath - Restores the path after an interrupt
Usage
RestoPath is used to restore a path that was stored at a previous stage using the instruction
StorePath .
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 instruction RestoPath are illustrated below.
See also More examples below.
Example 1
RestoPath;
Restores the path that was stored earlier using StorePath .
Program execution
The current movement path of the robot and the external axes are deleted and the path stored
earlier using StorePath is restored. Note that nothing moves until the instruction
StartMove is executed or a return is made using RETRY from an error handler.
More examples
More examples of how to use the instruction RestoPath are illustrated below.
Example 1
ArcL p100, v100, seam1, weld5 \Weave:=weave1, z10, gun1;
...
ERROR
IF ERRNO=AW_WELD_ERR THEN
gun_cleaning;
StartMoveRetry;
ENDIF
...
PROC gun_cleaning()
VAR robtarget p1;
StorePath;
p1 := CRobT();
MoveL pclean, v100, fine, gun1;
...
MoveL p1, v100, fine, gun1;
RestoPath;
ENDPROC
In the event of a welding error the program execution continues in the error handler of the
routine which in turn calls gun_cleaning . The movement path being executed at the time
is then stored and the robot moves to the position pclean where the error is rectified. When
this has been done, the robot returns to the position where the error occurred, p1 , and stores
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 364
|
1 Instructions
1.131. ResetRetryCount - Reset the number of retries
RobotWare - OS
361
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.131. ResetRetryCount - Reset the number of retries
Usage
ResetRetryCount is used to reset the number of retries that has been done from an error
handler. The maximum number of retries that can be done is defined in the configuration.
Basic examples
Basic examples of the instruction ResetRetryCount are illustrated below.
Example 1
VAR num myretries := 0;
...
ERROR
IF myretries > 2 THEN
ResetRetryCount;
myretries := 0;
TRYNEXT;
ENDIF
myretries:= myretries + 1;
RETRY;
...
This program will retry the faulty instruction 3 times and then try the next instruction. The
internal system retry counter is reset before trying the next instruction (even if this is done by
the system at TRYNEXT ).
Program execution
For every RETRY made from an error handler an internal system counter will check that the
maximum number of retries, specified in the configuration, isn’t exceeded. Executing the
instruction ResetRetryCount will reset the counter and make it possible to redo a
maximum number of retries again.
Syntax
ResetRetryCount ’;’
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
Number of remaining retries
RemainingRetries - Remaining retries left to do on page
963
1 Instructions
1.132. RestoPath - Restores the path after an interrupt
RobotWare - OS
3HAC 16581-1 Revision: J
362
© Copyright 2004-2010 ABB. All rights reserved.
1.132. RestoPath - Restores the path after an interrupt
Usage
RestoPath is used to restore a path that was stored at a previous stage using the instruction
StorePath .
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 instruction RestoPath are illustrated below.
See also More examples below.
Example 1
RestoPath;
Restores the path that was stored earlier using StorePath .
Program execution
The current movement path of the robot and the external axes are deleted and the path stored
earlier using StorePath is restored. Note that nothing moves until the instruction
StartMove is executed or a return is made using RETRY from an error handler.
More examples
More examples of how to use the instruction RestoPath are illustrated below.
Example 1
ArcL p100, v100, seam1, weld5 \Weave:=weave1, z10, gun1;
...
ERROR
IF ERRNO=AW_WELD_ERR THEN
gun_cleaning;
StartMoveRetry;
ENDIF
...
PROC gun_cleaning()
VAR robtarget p1;
StorePath;
p1 := CRobT();
MoveL pclean, v100, fine, gun1;
...
MoveL p1, v100, fine, gun1;
RestoPath;
ENDPROC
In the event of a welding error the program execution continues in the error handler of the
routine which in turn calls gun_cleaning . The movement path being executed at the time
is then stored and the robot moves to the position pclean where the error is rectified. When
this has been done, the robot returns to the position where the error occurred, p1 , and stores
Continues on next page
1 Instructions
1.132. RestoPath - Restores the path after an interrupt
RobotWare - OS
363
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
the original movement once again. The weld then automatically restarts, meaning that the
robot is first reversed along the path before welding starts and ordinary program execution
can continue.
Limitations
Only the movement path data is stored with the instruction StorePath . If the user wants to
order movements on the new path level then the actual stop position must be stored directly
after StorePath and before RestoPath make a movement to the stored stop position on the
path.
If this instruction is preceded by a move instruction then that move instruction must be
programmed with a stop point (zonedata fine ), not a fly-by point, otherwise restart after
power failure will not be possible.
RestoPath cannot be executed in a RAPID routine connected to any of following special
system events: PowerOn, Stop, QStop, Restart or Step.
Syntax
RestoPath´;´
Related information
For information about
See
Storing paths
StorePath - Stores the path when an interrupt occurs on
page 521
More examples
StorePath - Stores the path when an interrupt occurs on
page 521
PathRecStart - Start the path recorder on page 308
SyncMoveSuspend - Set independent-semicoordinated
movements on page 543
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 365
|
1 Instructions
1.132. RestoPath - Restores the path after an interrupt
RobotWare - OS
3HAC 16581-1 Revision: J
362
© Copyright 2004-2010 ABB. All rights reserved.
1.132. RestoPath - Restores the path after an interrupt
Usage
RestoPath is used to restore a path that was stored at a previous stage using the instruction
StorePath .
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 instruction RestoPath are illustrated below.
See also More examples below.
Example 1
RestoPath;
Restores the path that was stored earlier using StorePath .
Program execution
The current movement path of the robot and the external axes are deleted and the path stored
earlier using StorePath is restored. Note that nothing moves until the instruction
StartMove is executed or a return is made using RETRY from an error handler.
More examples
More examples of how to use the instruction RestoPath are illustrated below.
Example 1
ArcL p100, v100, seam1, weld5 \Weave:=weave1, z10, gun1;
...
ERROR
IF ERRNO=AW_WELD_ERR THEN
gun_cleaning;
StartMoveRetry;
ENDIF
...
PROC gun_cleaning()
VAR robtarget p1;
StorePath;
p1 := CRobT();
MoveL pclean, v100, fine, gun1;
...
MoveL p1, v100, fine, gun1;
RestoPath;
ENDPROC
In the event of a welding error the program execution continues in the error handler of the
routine which in turn calls gun_cleaning . The movement path being executed at the time
is then stored and the robot moves to the position pclean where the error is rectified. When
this has been done, the robot returns to the position where the error occurred, p1 , and stores
Continues on next page
1 Instructions
1.132. RestoPath - Restores the path after an interrupt
RobotWare - OS
363
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
the original movement once again. The weld then automatically restarts, meaning that the
robot is first reversed along the path before welding starts and ordinary program execution
can continue.
Limitations
Only the movement path data is stored with the instruction StorePath . If the user wants to
order movements on the new path level then the actual stop position must be stored directly
after StorePath and before RestoPath make a movement to the stored stop position on the
path.
If this instruction is preceded by a move instruction then that move instruction must be
programmed with a stop point (zonedata fine ), not a fly-by point, otherwise restart after
power failure will not be possible.
RestoPath cannot be executed in a RAPID routine connected to any of following special
system events: PowerOn, Stop, QStop, Restart or Step.
Syntax
RestoPath´;´
Related information
For information about
See
Storing paths
StorePath - Stores the path when an interrupt occurs on
page 521
More examples
StorePath - Stores the path when an interrupt occurs on
page 521
PathRecStart - Start the path recorder on page 308
SyncMoveSuspend - Set independent-semicoordinated
movements on page 543
Continued
1 Instructions
1.133. RETRY - Resume execution after an error
RobotWare - OS
3HAC 16581-1 Revision: J
364
© Copyright 2004-2010 ABB. All rights reserved.
1.133. RETRY - Resume execution after an error
Usage
The RETRY instruction is used to resume program execution after an error starting with (re-
executing) the instruction that caused the error.
Basic examples
Basic examples of the instruction RETRY are illustrated below.
Example 1
reg2 := reg3/reg4;
...
ERROR
IF ERRNO = ERR_DIVZERO THEN
reg4 :=1;
RETRY;
ENDIF
An attempt is made to divide reg3 by reg4. If reg4 is equal to 0 (division by zero) then a
jump is made to the error handler, which initializes reg4 . The RETRY instruction is then used
to jump from the error handler and another attempt is made to complete the division.
Program execution
Program execution continues with (re-executes) the instruction that caused the error.
Error handling
If the maximum number of retries (4 retries) is exceeded then the program execution stops
with an error message. The maximum number of retries can be configured in System
Parameters (type System Misc ).
Limitations
The instruction can only exist in a routine’s error handler. If the error was created using a
RAISE instruction then program execution cannot be restarted with a RETRY instruction. Then
the instruction TRYNEXT should be used.
Syntax
RETRY ’;’
Related information
For information about
See
Error handlers
Technical reference manual - RAPID overview,
section Basic Characteristics-Error Recovery
Configure maximum number of retries
Technical reference manual - System
parameters , section System Misc
Continue with the next instruction
TRYNEXT - Jumps over an instruction which has
caused an error on page 636
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 366
|
1 Instructions
1.132. RestoPath - Restores the path after an interrupt
RobotWare - OS
363
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
the original movement once again. The weld then automatically restarts, meaning that the
robot is first reversed along the path before welding starts and ordinary program execution
can continue.
Limitations
Only the movement path data is stored with the instruction StorePath . If the user wants to
order movements on the new path level then the actual stop position must be stored directly
after StorePath and before RestoPath make a movement to the stored stop position on the
path.
If this instruction is preceded by a move instruction then that move instruction must be
programmed with a stop point (zonedata fine ), not a fly-by point, otherwise restart after
power failure will not be possible.
RestoPath cannot be executed in a RAPID routine connected to any of following special
system events: PowerOn, Stop, QStop, Restart or Step.
Syntax
RestoPath´;´
Related information
For information about
See
Storing paths
StorePath - Stores the path when an interrupt occurs on
page 521
More examples
StorePath - Stores the path when an interrupt occurs on
page 521
PathRecStart - Start the path recorder on page 308
SyncMoveSuspend - Set independent-semicoordinated
movements on page 543
Continued
1 Instructions
1.133. RETRY - Resume execution after an error
RobotWare - OS
3HAC 16581-1 Revision: J
364
© Copyright 2004-2010 ABB. All rights reserved.
1.133. RETRY - Resume execution after an error
Usage
The RETRY instruction is used to resume program execution after an error starting with (re-
executing) the instruction that caused the error.
Basic examples
Basic examples of the instruction RETRY are illustrated below.
Example 1
reg2 := reg3/reg4;
...
ERROR
IF ERRNO = ERR_DIVZERO THEN
reg4 :=1;
RETRY;
ENDIF
An attempt is made to divide reg3 by reg4. If reg4 is equal to 0 (division by zero) then a
jump is made to the error handler, which initializes reg4 . The RETRY instruction is then used
to jump from the error handler and another attempt is made to complete the division.
Program execution
Program execution continues with (re-executes) the instruction that caused the error.
Error handling
If the maximum number of retries (4 retries) is exceeded then the program execution stops
with an error message. The maximum number of retries can be configured in System
Parameters (type System Misc ).
Limitations
The instruction can only exist in a routine’s error handler. If the error was created using a
RAISE instruction then program execution cannot be restarted with a RETRY instruction. Then
the instruction TRYNEXT should be used.
Syntax
RETRY ’;’
Related information
For information about
See
Error handlers
Technical reference manual - RAPID overview,
section Basic Characteristics-Error Recovery
Configure maximum number of retries
Technical reference manual - System
parameters , section System Misc
Continue with the next instruction
TRYNEXT - Jumps over an instruction which has
caused an error on page 636
1 Instructions
1.134. RETURN - Finishes execution of a routine
RobotWare - OS
365
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.134. RETURN - Finishes execution of a routine
Usage
RETURN is used to finish the execution of a routine. If the routine is a function then the
function value is also returned.
Basic examples
Basic examples of the instruction RETURN are illustrated below.
Example 1
errormessage;
Set do1;
...
PROC errormessage()
IF di1=1 THEN
RETURN;
ENDIF
TPWrite "Error";
ENDPROC
The errormessage procedure is called. If the procedure arrives at the RETURN instruction
then program execution returns to the instruction following the procedure call, Set do 1 .
Example 2
FUNC num abs_value(num value)
IF value<0 THEN
RETURN -value;
ELSE
RETURN value;
ENDIF
ENDFUNC
The function returns the absolute value of a number.
Arguments
RETURN [ Return value ]
Return value
Data type: According to the function declaration.
The return value of a function.
The return value must be specified in a RETURN instruction present in a function.
If the instruction is present in a procedure or trap routine then a return value shall not be
specified.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 367
|
1 Instructions
1.133. RETRY - Resume execution after an error
RobotWare - OS
3HAC 16581-1 Revision: J
364
© Copyright 2004-2010 ABB. All rights reserved.
1.133. RETRY - Resume execution after an error
Usage
The RETRY instruction is used to resume program execution after an error starting with (re-
executing) the instruction that caused the error.
Basic examples
Basic examples of the instruction RETRY are illustrated below.
Example 1
reg2 := reg3/reg4;
...
ERROR
IF ERRNO = ERR_DIVZERO THEN
reg4 :=1;
RETRY;
ENDIF
An attempt is made to divide reg3 by reg4. If reg4 is equal to 0 (division by zero) then a
jump is made to the error handler, which initializes reg4 . The RETRY instruction is then used
to jump from the error handler and another attempt is made to complete the division.
Program execution
Program execution continues with (re-executes) the instruction that caused the error.
Error handling
If the maximum number of retries (4 retries) is exceeded then the program execution stops
with an error message. The maximum number of retries can be configured in System
Parameters (type System Misc ).
Limitations
The instruction can only exist in a routine’s error handler. If the error was created using a
RAISE instruction then program execution cannot be restarted with a RETRY instruction. Then
the instruction TRYNEXT should be used.
Syntax
RETRY ’;’
Related information
For information about
See
Error handlers
Technical reference manual - RAPID overview,
section Basic Characteristics-Error Recovery
Configure maximum number of retries
Technical reference manual - System
parameters , section System Misc
Continue with the next instruction
TRYNEXT - Jumps over an instruction which has
caused an error on page 636
1 Instructions
1.134. RETURN - Finishes execution of a routine
RobotWare - OS
365
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.134. RETURN - Finishes execution of a routine
Usage
RETURN is used to finish the execution of a routine. If the routine is a function then the
function value is also returned.
Basic examples
Basic examples of the instruction RETURN are illustrated below.
Example 1
errormessage;
Set do1;
...
PROC errormessage()
IF di1=1 THEN
RETURN;
ENDIF
TPWrite "Error";
ENDPROC
The errormessage procedure is called. If the procedure arrives at the RETURN instruction
then program execution returns to the instruction following the procedure call, Set do 1 .
Example 2
FUNC num abs_value(num value)
IF value<0 THEN
RETURN -value;
ELSE
RETURN value;
ENDIF
ENDFUNC
The function returns the absolute value of a number.
Arguments
RETURN [ Return value ]
Return value
Data type: According to the function declaration.
The return value of a function.
The return value must be specified in a RETURN instruction present in a function.
If the instruction is present in a procedure or trap routine then a return value shall not be
specified.
Continues on next page
1 Instructions
1.134. RETURN - Finishes execution of a routine
RobotWare - OS
3HAC 16581-1 Revision: J
366
© Copyright 2004-2010 ABB. All rights reserved.
Program execution
The result of the RETURN instruction may vary depending on the type of routine it is used in:
•
Main routine: If a program has run mode single cycle then the program stops.
Otherwise, program execution continues with the first instruction of the main routine.
•
Procedure: Program execution continues with the instruction following the procedure
call.
•
Function: Returns the value of the function.
•
Trap routine: Program execution continues from where the interrupt occurred.
•
Error handler in a procedure: Program execution continues with the routine that called
the routine with the error handler (with the instruction following the procedure call).
•
Error handler in a function: The function value is returned.
Syntax
(EBNF)
RETURN [ <expression> ]’;’
Related information
For information about
See
Functions and Procedures
Technical reference manual - RAPID overview ,
section Basic characteristics - Routines
Trap routines
Technical reference manual - RAPID overview ,
section Basic characteristics - Interrupts
Error handlers
Technical reference manual - RAPID overview ,
section Basic characteristics - Error recovery
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 368
|
1 Instructions
1.134. RETURN - Finishes execution of a routine
RobotWare - OS
365
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.134. RETURN - Finishes execution of a routine
Usage
RETURN is used to finish the execution of a routine. If the routine is a function then the
function value is also returned.
Basic examples
Basic examples of the instruction RETURN are illustrated below.
Example 1
errormessage;
Set do1;
...
PROC errormessage()
IF di1=1 THEN
RETURN;
ENDIF
TPWrite "Error";
ENDPROC
The errormessage procedure is called. If the procedure arrives at the RETURN instruction
then program execution returns to the instruction following the procedure call, Set do 1 .
Example 2
FUNC num abs_value(num value)
IF value<0 THEN
RETURN -value;
ELSE
RETURN value;
ENDIF
ENDFUNC
The function returns the absolute value of a number.
Arguments
RETURN [ Return value ]
Return value
Data type: According to the function declaration.
The return value of a function.
The return value must be specified in a RETURN instruction present in a function.
If the instruction is present in a procedure or trap routine then a return value shall not be
specified.
Continues on next page
1 Instructions
1.134. RETURN - Finishes execution of a routine
RobotWare - OS
3HAC 16581-1 Revision: J
366
© Copyright 2004-2010 ABB. All rights reserved.
Program execution
The result of the RETURN instruction may vary depending on the type of routine it is used in:
•
Main routine: If a program has run mode single cycle then the program stops.
Otherwise, program execution continues with the first instruction of the main routine.
•
Procedure: Program execution continues with the instruction following the procedure
call.
•
Function: Returns the value of the function.
•
Trap routine: Program execution continues from where the interrupt occurred.
•
Error handler in a procedure: Program execution continues with the routine that called
the routine with the error handler (with the instruction following the procedure call).
•
Error handler in a function: The function value is returned.
Syntax
(EBNF)
RETURN [ <expression> ]’;’
Related information
For information about
See
Functions and Procedures
Technical reference manual - RAPID overview ,
section Basic characteristics - Routines
Trap routines
Technical reference manual - RAPID overview ,
section Basic characteristics - Interrupts
Error handlers
Technical reference manual - RAPID overview ,
section Basic characteristics - Error recovery
Continued
1 Instructions
1.135. Rewind - Rewind file position
RobotWare - OS
367
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.135. Rewind - Rewind file position
Usage
Rewind sets the file position to the beginning of the file.
Basic examples
Basic examples of the instruction Rewind are illustrated below.
See also More examples on page 367 .
Example 1
Rewind iodev1;
The file referred to by iodev1 will have the file position set to the beginning of the file.
Arguments
Rewind IODevice
IODevice
Data type: iodev
Name (reference) of the file to be rewound.
Program execution
The specified file is rewound to the beginning.
More examples
More examples of the instruction Rewind are illustrated below.
Example 1
! IO device and numeric variable for use together with a binary
! file
VAR iodev dev;
VAR num bindata;
! Open the binary file with \Write switch to erase old contents
Open "HOME:"\File := "bin_file",dev \Write;
Close dev;
! Open the binary file with \Bin switch for binary read and write
! acess
Open "HOME:"\File := "bin_file",dev \Bin;
WriteStrBin dev,"Hello world";
! Rewind the file pointer to the beginning of the binary file
! Read contents of the file and write the binary result on TP
! (gives 72 101 108 108 111 32 119 111 114 108 100 )
Rewind dev;
bindata := ReadBin(dev);
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 369
|
1 Instructions
1.134. RETURN - Finishes execution of a routine
RobotWare - OS
3HAC 16581-1 Revision: J
366
© Copyright 2004-2010 ABB. All rights reserved.
Program execution
The result of the RETURN instruction may vary depending on the type of routine it is used in:
•
Main routine: If a program has run mode single cycle then the program stops.
Otherwise, program execution continues with the first instruction of the main routine.
•
Procedure: Program execution continues with the instruction following the procedure
call.
•
Function: Returns the value of the function.
•
Trap routine: Program execution continues from where the interrupt occurred.
•
Error handler in a procedure: Program execution continues with the routine that called
the routine with the error handler (with the instruction following the procedure call).
•
Error handler in a function: The function value is returned.
Syntax
(EBNF)
RETURN [ <expression> ]’;’
Related information
For information about
See
Functions and Procedures
Technical reference manual - RAPID overview ,
section Basic characteristics - Routines
Trap routines
Technical reference manual - RAPID overview ,
section Basic characteristics - Interrupts
Error handlers
Technical reference manual - RAPID overview ,
section Basic characteristics - Error recovery
Continued
1 Instructions
1.135. Rewind - Rewind file position
RobotWare - OS
367
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.135. Rewind - Rewind file position
Usage
Rewind sets the file position to the beginning of the file.
Basic examples
Basic examples of the instruction Rewind are illustrated below.
See also More examples on page 367 .
Example 1
Rewind iodev1;
The file referred to by iodev1 will have the file position set to the beginning of the file.
Arguments
Rewind IODevice
IODevice
Data type: iodev
Name (reference) of the file to be rewound.
Program execution
The specified file is rewound to the beginning.
More examples
More examples of the instruction Rewind are illustrated below.
Example 1
! IO device and numeric variable for use together with a binary
! file
VAR iodev dev;
VAR num bindata;
! Open the binary file with \Write switch to erase old contents
Open "HOME:"\File := "bin_file",dev \Write;
Close dev;
! Open the binary file with \Bin switch for binary read and write
! acess
Open "HOME:"\File := "bin_file",dev \Bin;
WriteStrBin dev,"Hello world";
! Rewind the file pointer to the beginning of the binary file
! Read contents of the file and write the binary result on TP
! (gives 72 101 108 108 111 32 119 111 114 108 100 )
Rewind dev;
bindata := ReadBin(dev);
Continues on next page
1 Instructions
1.135. Rewind - Rewind file position
RobotWare - OS
3HAC 16581-1 Revision: J
368
© Copyright 2004-2010 ABB. All rights reserved.
WHILE bindata <> EOF_BIN DO
TPWrite " " \Num:=bindata; bindata := ReadBin(dev);
ENDWHILE
! Close the binary file
Close dev;
The instruction Rewind is used to rewind a binary file to the beginning so that the contents
of the file can be read back with ReadBin
Limitations
For the Virtual Controller there is a limitation, if the used file has been opened with a
\Bin or \Bin \Append switch, a Rewind before any type of a Write instruction will be
ineffective. The writing will be done at the end of the file.
Error handling
If an error occurs during the rewind then the system variable ERRNO is set to ERR_FILEACC .
This error can then be handled in the error handler.
Syntax
Rewind [IODevice ’:=’] <variable ( VAR ) of iodev>’;’
Related information
For information about
See
Opening, etc. of files
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
| 370
|
1 Instructions
1.135. Rewind - Rewind file position
RobotWare - OS
367
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.135. Rewind - Rewind file position
Usage
Rewind sets the file position to the beginning of the file.
Basic examples
Basic examples of the instruction Rewind are illustrated below.
See also More examples on page 367 .
Example 1
Rewind iodev1;
The file referred to by iodev1 will have the file position set to the beginning of the file.
Arguments
Rewind IODevice
IODevice
Data type: iodev
Name (reference) of the file to be rewound.
Program execution
The specified file is rewound to the beginning.
More examples
More examples of the instruction Rewind are illustrated below.
Example 1
! IO device and numeric variable for use together with a binary
! file
VAR iodev dev;
VAR num bindata;
! Open the binary file with \Write switch to erase old contents
Open "HOME:"\File := "bin_file",dev \Write;
Close dev;
! Open the binary file with \Bin switch for binary read and write
! acess
Open "HOME:"\File := "bin_file",dev \Bin;
WriteStrBin dev,"Hello world";
! Rewind the file pointer to the beginning of the binary file
! Read contents of the file and write the binary result on TP
! (gives 72 101 108 108 111 32 119 111 114 108 100 )
Rewind dev;
bindata := ReadBin(dev);
Continues on next page
1 Instructions
1.135. Rewind - Rewind file position
RobotWare - OS
3HAC 16581-1 Revision: J
368
© Copyright 2004-2010 ABB. All rights reserved.
WHILE bindata <> EOF_BIN DO
TPWrite " " \Num:=bindata; bindata := ReadBin(dev);
ENDWHILE
! Close the binary file
Close dev;
The instruction Rewind is used to rewind a binary file to the beginning so that the contents
of the file can be read back with ReadBin
Limitations
For the Virtual Controller there is a limitation, if the used file has been opened with a
\Bin or \Bin \Append switch, a Rewind before any type of a Write instruction will be
ineffective. The writing will be done at the end of the file.
Error handling
If an error occurs during the rewind then the system variable ERRNO is set to ERR_FILEACC .
This error can then be handled in the error handler.
Syntax
Rewind [IODevice ’:=’] <variable ( VAR ) of iodev>’;’
Related information
For information about
See
Opening, etc. of files
Technical reference manual - RAPID overview ,
section RAPID summary - Communication
Continued
1 Instructions
1.136. RMQEmptyQueue - Empty RAPID Message Queue
RobotWare - OS
369
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.136. RMQEmptyQueue - Empty RAPID Message Queue
Usage
RMQEmptyQueue empties the RAPID Message Queue (RMQ) in the task that is executing the
instruction.
Basic examples
A basic example of the instruction RMQEmptyQueue is illustrated below.
Example
RMQEmptyQueue;
The RMQEmptyQueue instruction removes all messages from RMQ in the executing task.
Program execution
The RAPID Message Queue owned by the executing task is emptied. The instruction can be
used on all execution levels.
Limitations
RMQEmptyQueue only empties the RAPID Message Queue in the task that is executing the
instruction. All other RAPID Message Queues are left as is.
Syntax
RMQEmptyQueue ';'
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 .
rmqmessage data type
rmqmessage - RAPID Message Queue
message on page 1173 .
Send data to the queue of a RAPID task or
Robot Application Builder client
RMQSendMessage - Send an RMQ data
message on page 386 .
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 .
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 .
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 .
Get the slot name from a specified slot
identity
RMQGetSlotName - Get the name of an
RMQ client on page 964 .
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 371
|
1 Instructions
1.135. Rewind - Rewind file position
RobotWare - OS
3HAC 16581-1 Revision: J
368
© Copyright 2004-2010 ABB. All rights reserved.
WHILE bindata <> EOF_BIN DO
TPWrite " " \Num:=bindata; bindata := ReadBin(dev);
ENDWHILE
! Close the binary file
Close dev;
The instruction Rewind is used to rewind a binary file to the beginning so that the contents
of the file can be read back with ReadBin
Limitations
For the Virtual Controller there is a limitation, if the used file has been opened with a
\Bin or \Bin \Append switch, a Rewind before any type of a Write instruction will be
ineffective. The writing will be done at the end of the file.
Error handling
If an error occurs during the rewind then the system variable ERRNO is set to ERR_FILEACC .
This error can then be handled in the error handler.
Syntax
Rewind [IODevice ’:=’] <variable ( VAR ) of iodev>’;’
Related information
For information about
See
Opening, etc. of files
Technical reference manual - RAPID overview ,
section RAPID summary - Communication
Continued
1 Instructions
1.136. RMQEmptyQueue - Empty RAPID Message Queue
RobotWare - OS
369
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.136. RMQEmptyQueue - Empty RAPID Message Queue
Usage
RMQEmptyQueue empties the RAPID Message Queue (RMQ) in the task that is executing the
instruction.
Basic examples
A basic example of the instruction RMQEmptyQueue is illustrated below.
Example
RMQEmptyQueue;
The RMQEmptyQueue instruction removes all messages from RMQ in the executing task.
Program execution
The RAPID Message Queue owned by the executing task is emptied. The instruction can be
used on all execution levels.
Limitations
RMQEmptyQueue only empties the RAPID Message Queue in the task that is executing the
instruction. All other RAPID Message Queues are left as is.
Syntax
RMQEmptyQueue ';'
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 .
rmqmessage data type
rmqmessage - RAPID Message Queue
message on page 1173 .
Send data to the queue of a RAPID task or
Robot Application Builder client
RMQSendMessage - Send an RMQ data
message on page 386 .
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 .
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 .
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 .
Get the slot name from a specified slot
identity
RMQGetSlotName - Get the name of an
RMQ client on page 964 .
Continues on next page
1 Instructions
1.136. RMQEmptyQueue - Empty RAPID Message Queue
RobotWare - OS
3HAC 16581-1 Revision: J
370
© Copyright 2004-2010 ABB. All rights reserved.
Receive message from RMQ
RMQReadWait - Returns message from
RMQ on page 383 .
Get the first message from a RAPID Message
Queue
RMQGetMessage - Get an RMQ message on
page 373 .
For information about
See
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 372
|
1 Instructions
1.136. RMQEmptyQueue - Empty RAPID Message Queue
RobotWare - OS
369
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.136. RMQEmptyQueue - Empty RAPID Message Queue
Usage
RMQEmptyQueue empties the RAPID Message Queue (RMQ) in the task that is executing the
instruction.
Basic examples
A basic example of the instruction RMQEmptyQueue is illustrated below.
Example
RMQEmptyQueue;
The RMQEmptyQueue instruction removes all messages from RMQ in the executing task.
Program execution
The RAPID Message Queue owned by the executing task is emptied. The instruction can be
used on all execution levels.
Limitations
RMQEmptyQueue only empties the RAPID Message Queue in the task that is executing the
instruction. All other RAPID Message Queues are left as is.
Syntax
RMQEmptyQueue ';'
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 .
rmqmessage data type
rmqmessage - RAPID Message Queue
message on page 1173 .
Send data to the queue of a RAPID task or
Robot Application Builder client
RMQSendMessage - Send an RMQ data
message on page 386 .
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 .
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 .
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 .
Get the slot name from a specified slot
identity
RMQGetSlotName - Get the name of an
RMQ client on page 964 .
Continues on next page
1 Instructions
1.136. RMQEmptyQueue - Empty RAPID Message Queue
RobotWare - OS
3HAC 16581-1 Revision: J
370
© Copyright 2004-2010 ABB. All rights reserved.
Receive message from RMQ
RMQReadWait - Returns message from
RMQ on page 383 .
Get the first message from a RAPID Message
Queue
RMQGetMessage - Get an RMQ message on
page 373 .
For information about
See
Continued
1 Instructions
1.137. RMQFindSlot - Find a slot identity from the slot name
FlexPendant Interface, PC Interface, or Multitasking
371
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.137. RMQFindSlot - Find a slot identity from the slot name
Usage
RMQFindSlot ( RAPID Message Queue Find Slot ) is used to find the slot identity to an RMQ
configured for a RAPID task, or the slot identity to a Robot Application Builder client.
Basic examples
Basic examples of the instruction RMQFindSlot name are illustrated below.
Example 1
VAR rmqslot myrmqslot;
RMQFindSlot myrmqslot, "RMQ_T_ROB2";
Get the identity number for the RMQ "RMQ_T_ROB2" configured for the RAPID task
"T_ROB2" .
Arguments
RMQFindSlot Slot Name
Slot
Data type: rmqslot
The variable in which the numeric identifier is returned.
Name
Data type: string
The name of the client to find the identity number for. The name must be right regarding small
and big letters. If the RAPID task is named T_ROB1, and using the name RMQ_t_rob1 for
the RMQ, this will end up in a error (see error handling chapter below.)
Program execution
The RMQFindSlot instruction is used to find the slot identity for a named RMQ or Robot
Application Builder client.
Error handling
The following recoverable errors can be generated. The errors can be handled in an ERROR
handler. The system variable ERRNO will be set to:
Syntax
RMQFindSlot
[ Slot ‘:=’ ] < variable ( VAR ) of rmqslot > ’,’
[ Name ‘:=’ ] < expression ( IN ) of string >‘;‘
ERR_RMQ_NAME
The given slot name is not valid or not found.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 373
|
1 Instructions
1.136. RMQEmptyQueue - Empty RAPID Message Queue
RobotWare - OS
3HAC 16581-1 Revision: J
370
© Copyright 2004-2010 ABB. All rights reserved.
Receive message from RMQ
RMQReadWait - Returns message from
RMQ on page 383 .
Get the first message from a RAPID Message
Queue
RMQGetMessage - Get an RMQ message on
page 373 .
For information about
See
Continued
1 Instructions
1.137. RMQFindSlot - Find a slot identity from the slot name
FlexPendant Interface, PC Interface, or Multitasking
371
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.137. RMQFindSlot - Find a slot identity from the slot name
Usage
RMQFindSlot ( RAPID Message Queue Find Slot ) is used to find the slot identity to an RMQ
configured for a RAPID task, or the slot identity to a Robot Application Builder client.
Basic examples
Basic examples of the instruction RMQFindSlot name are illustrated below.
Example 1
VAR rmqslot myrmqslot;
RMQFindSlot myrmqslot, "RMQ_T_ROB2";
Get the identity number for the RMQ "RMQ_T_ROB2" configured for the RAPID task
"T_ROB2" .
Arguments
RMQFindSlot Slot Name
Slot
Data type: rmqslot
The variable in which the numeric identifier is returned.
Name
Data type: string
The name of the client to find the identity number for. The name must be right regarding small
and big letters. If the RAPID task is named T_ROB1, and using the name RMQ_t_rob1 for
the RMQ, this will end up in a error (see error handling chapter below.)
Program execution
The RMQFindSlot instruction is used to find the slot identity for a named RMQ or Robot
Application Builder client.
Error handling
The following recoverable errors can be generated. The errors can be handled in an ERROR
handler. The system variable ERRNO will be set to:
Syntax
RMQFindSlot
[ Slot ‘:=’ ] < variable ( VAR ) of rmqslot > ’,’
[ Name ‘:=’ ] < expression ( IN ) of string >‘;‘
ERR_RMQ_NAME
The given slot name is not valid or not found.
Continues on next page
1 Instructions
1.137. RMQFindSlot - Find a slot identity from the slot name
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
372
© Copyright 2004-2010 ABB. All rights reserved.
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 .
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 a rmqmessage RMQGetMsgHeader - Get header
information from an RMQ message on page
380
Order and enable interrupts for a specific data
type
IRMQMessage - Orders RMQ interrupts for a
data type on page 167
Extract the data from a rmqmessage
RMQGetMsgData - Get the data part from an
RMQ message on page 377
Get the slot name from a specified slot
identity
RMQGetSlotName - Get the name of an
RMQ client on page 964
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
| 374
|
1 Instructions
1.137. RMQFindSlot - Find a slot identity from the slot name
FlexPendant Interface, PC Interface, or Multitasking
371
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.137. RMQFindSlot - Find a slot identity from the slot name
Usage
RMQFindSlot ( RAPID Message Queue Find Slot ) is used to find the slot identity to an RMQ
configured for a RAPID task, or the slot identity to a Robot Application Builder client.
Basic examples
Basic examples of the instruction RMQFindSlot name are illustrated below.
Example 1
VAR rmqslot myrmqslot;
RMQFindSlot myrmqslot, "RMQ_T_ROB2";
Get the identity number for the RMQ "RMQ_T_ROB2" configured for the RAPID task
"T_ROB2" .
Arguments
RMQFindSlot Slot Name
Slot
Data type: rmqslot
The variable in which the numeric identifier is returned.
Name
Data type: string
The name of the client to find the identity number for. The name must be right regarding small
and big letters. If the RAPID task is named T_ROB1, and using the name RMQ_t_rob1 for
the RMQ, this will end up in a error (see error handling chapter below.)
Program execution
The RMQFindSlot instruction is used to find the slot identity for a named RMQ or Robot
Application Builder client.
Error handling
The following recoverable errors can be generated. The errors can be handled in an ERROR
handler. The system variable ERRNO will be set to:
Syntax
RMQFindSlot
[ Slot ‘:=’ ] < variable ( VAR ) of rmqslot > ’,’
[ Name ‘:=’ ] < expression ( IN ) of string >‘;‘
ERR_RMQ_NAME
The given slot name is not valid or not found.
Continues on next page
1 Instructions
1.137. RMQFindSlot - Find a slot identity from the slot name
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
372
© Copyright 2004-2010 ABB. All rights reserved.
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 .
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 a rmqmessage RMQGetMsgHeader - Get header
information from an RMQ message on page
380
Order and enable interrupts for a specific data
type
IRMQMessage - Orders RMQ interrupts for a
data type on page 167
Extract the data from a rmqmessage
RMQGetMsgData - Get the data part from an
RMQ message on page 377
Get the slot name from a specified slot
identity
RMQGetSlotName - Get the name of an
RMQ client on page 964
RMQ Slot
rmqslot - Identity number of an RMQ client on
page 1174
Continued
1 Instructions
1.138. RMQGetMessage - Get an RMQ message
FlexPendant Interface, PC Interface, or Multitasking
373
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.138. RMQGetMessage - Get an RMQ message
Usage
RMQGetMessage ( RAPID Message Queue Get Message ) is used to fetch the first RMQ
message from the queue for the actual program task.
Basic examples
Basic examples of the instruction RMQGetMessage are illustrated below.
See also More examples on page 374 .
Example 1
TRAP msghandler
VAR rmqmessage myrmqmsg;
RMQGetMessage myrmqmsg;
...
ENDTRAP
In the TRAP routine msghandler the rmqmessage is fetched from the RMQ and copied to
the variable myrmqmsg .
Arguments
RMQGetMessage Message
Message
Data type: rmqmessage
Variable for storage of the RMQ message.
The maximum size of the data that can be received in a rmqmessage is about 3000 bytes.
Program execution
The instruction RMQGetMessage is used to get the first message from the queue of the task
executing the instruction. If there is a message, it will be copied to the Message variable, and
then removed from the queue to make room for new messages. The instruction is only
supported on the TRAP level.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 375
|
1 Instructions
1.137. RMQFindSlot - Find a slot identity from the slot name
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
372
© Copyright 2004-2010 ABB. All rights reserved.
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 .
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 a rmqmessage RMQGetMsgHeader - Get header
information from an RMQ message on page
380
Order and enable interrupts for a specific data
type
IRMQMessage - Orders RMQ interrupts for a
data type on page 167
Extract the data from a rmqmessage
RMQGetMsgData - Get the data part from an
RMQ message on page 377
Get the slot name from a specified slot
identity
RMQGetSlotName - Get the name of an
RMQ client on page 964
RMQ Slot
rmqslot - Identity number of an RMQ client on
page 1174
Continued
1 Instructions
1.138. RMQGetMessage - Get an RMQ message
FlexPendant Interface, PC Interface, or Multitasking
373
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.138. RMQGetMessage - Get an RMQ message
Usage
RMQGetMessage ( RAPID Message Queue Get Message ) is used to fetch the first RMQ
message from the queue for the actual program task.
Basic examples
Basic examples of the instruction RMQGetMessage are illustrated below.
See also More examples on page 374 .
Example 1
TRAP msghandler
VAR rmqmessage myrmqmsg;
RMQGetMessage myrmqmsg;
...
ENDTRAP
In the TRAP routine msghandler the rmqmessage is fetched from the RMQ and copied to
the variable myrmqmsg .
Arguments
RMQGetMessage Message
Message
Data type: rmqmessage
Variable for storage of the RMQ message.
The maximum size of the data that can be received in a rmqmessage is about 3000 bytes.
Program execution
The instruction RMQGetMessage is used to get the first message from the queue of the task
executing the instruction. If there is a message, it will be copied to the Message variable, and
then removed from the queue to make room for new messages. The instruction is only
supported on the TRAP level.
Continues on next page
1 Instructions
1.138. RMQGetMessage - Get an RMQ message
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
374
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of how to use the instruction RMQGetMessage are illustrated below.
Example 1
RECORD mydatatype
int x;
int y;
ENDRECORD
VAR intnum msgreceive;
VAR mydatatype mydata;
PROC main()
! Setup interrupt
CONNECT msgreceive WITH msghandler;
! Order cyclic interrupt to occur for data type mydatatype
IRMQMessage mydata, msgreceive;
WHILE TRUE DO
! Performing cycle
...
ENDWHILE
ENDPROC
TRAP msghandler
VAR rmgmessage message;
VAR rmqheader header;
! Get the RMQ message
RMQGetMessage message;
! Copy RMQ header information
RMQGetMsgHeader message \Header:=header;
IF header.datatype = "mydatatype" AND header.ndim = 0 THEN
! Copy the data from the message
RMQGetMsgData message, mydata;
ELSE
TPWrite "Received a type not handled or with wrong dimension";
ENDIF
ENDTRAP
When a new message is received, the TRAP routine msghandler is executed and the new
message is copied to the variable message (instruction RMQGetMessage ). Then the RMQ
header data is copied (instruction RMQGetMsgHeader ). If the message is of the expected data
type and has the right dimension, the data is copied to the variable mydata (instruction
RMQGetMsgData ).
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
| 376
|
1 Instructions
1.138. RMQGetMessage - Get an RMQ message
FlexPendant Interface, PC Interface, or Multitasking
373
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.138. RMQGetMessage - Get an RMQ message
Usage
RMQGetMessage ( RAPID Message Queue Get Message ) is used to fetch the first RMQ
message from the queue for the actual program task.
Basic examples
Basic examples of the instruction RMQGetMessage are illustrated below.
See also More examples on page 374 .
Example 1
TRAP msghandler
VAR rmqmessage myrmqmsg;
RMQGetMessage myrmqmsg;
...
ENDTRAP
In the TRAP routine msghandler the rmqmessage is fetched from the RMQ and copied to
the variable myrmqmsg .
Arguments
RMQGetMessage Message
Message
Data type: rmqmessage
Variable for storage of the RMQ message.
The maximum size of the data that can be received in a rmqmessage is about 3000 bytes.
Program execution
The instruction RMQGetMessage is used to get the first message from the queue of the task
executing the instruction. If there is a message, it will be copied to the Message variable, and
then removed from the queue to make room for new messages. The instruction is only
supported on the TRAP level.
Continues on next page
1 Instructions
1.138. RMQGetMessage - Get an RMQ message
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
374
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of how to use the instruction RMQGetMessage are illustrated below.
Example 1
RECORD mydatatype
int x;
int y;
ENDRECORD
VAR intnum msgreceive;
VAR mydatatype mydata;
PROC main()
! Setup interrupt
CONNECT msgreceive WITH msghandler;
! Order cyclic interrupt to occur for data type mydatatype
IRMQMessage mydata, msgreceive;
WHILE TRUE DO
! Performing cycle
...
ENDWHILE
ENDPROC
TRAP msghandler
VAR rmgmessage message;
VAR rmqheader header;
! Get the RMQ message
RMQGetMessage message;
! Copy RMQ header information
RMQGetMsgHeader message \Header:=header;
IF header.datatype = "mydatatype" AND header.ndim = 0 THEN
! Copy the data from the message
RMQGetMsgData message, mydata;
ELSE
TPWrite "Received a type not handled or with wrong dimension";
ENDIF
ENDTRAP
When a new message is received, the TRAP routine msghandler is executed and the new
message is copied to the variable message (instruction RMQGetMessage ). Then the RMQ
header data is copied (instruction RMQGetMsgHeader ). If the message is of the expected data
type and has the right dimension, the data is copied to the variable mydata (instruction
RMQGetMsgData ).
Continued
Continues on next page
1 Instructions
1.138. RMQGetMessage - Get an RMQ message
FlexPendant Interface, PC Interface, or Multitasking
375
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Error handling
The following recoverable errors can be generated. The errors can be handled in an ERROR
handler. The system variable ERRNO will be set to:
Limitations
RMQGetMessage is not supported on the user execution level (i.e. in service routines) or
normal execution level.
The maximum size of the data that can be received in a rmqmessage is about 3000 bytes.
A recommendation is to reuse a variable of the data type rmqmessage as much as possible
to save RAPID memory.
Syntax
RMQGetMessage
[ Message ‘:=’ ] < variable ( VAR ) of rmqmessage >‘;‘
Related information
ERR_RMQ_NOMSG
No message for the moment in the queue. If executing
RMQGetMessage twice in a TRAP routine, this can happen. The
error can also be generated if there is a power failure between
the TRAP being ordered and the instruction RMQGetMessage
being executed.The messages in the RMQ will be lost at power
fail.
ERR_RMQ_INVMSG
This error will be thrown if the message is invalid. This may for
instance happen if a PC application sends a corrupt message.
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
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
Get the slot name from a specified slot
identity
RMQGetSlotName - Get the name of an
RMQ client on page 964
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
| 377
|
1 Instructions
1.138. RMQGetMessage - Get an RMQ message
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
374
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of how to use the instruction RMQGetMessage are illustrated below.
Example 1
RECORD mydatatype
int x;
int y;
ENDRECORD
VAR intnum msgreceive;
VAR mydatatype mydata;
PROC main()
! Setup interrupt
CONNECT msgreceive WITH msghandler;
! Order cyclic interrupt to occur for data type mydatatype
IRMQMessage mydata, msgreceive;
WHILE TRUE DO
! Performing cycle
...
ENDWHILE
ENDPROC
TRAP msghandler
VAR rmgmessage message;
VAR rmqheader header;
! Get the RMQ message
RMQGetMessage message;
! Copy RMQ header information
RMQGetMsgHeader message \Header:=header;
IF header.datatype = "mydatatype" AND header.ndim = 0 THEN
! Copy the data from the message
RMQGetMsgData message, mydata;
ELSE
TPWrite "Received a type not handled or with wrong dimension";
ENDIF
ENDTRAP
When a new message is received, the TRAP routine msghandler is executed and the new
message is copied to the variable message (instruction RMQGetMessage ). Then the RMQ
header data is copied (instruction RMQGetMsgHeader ). If the message is of the expected data
type and has the right dimension, the data is copied to the variable mydata (instruction
RMQGetMsgData ).
Continued
Continues on next page
1 Instructions
1.138. RMQGetMessage - Get an RMQ message
FlexPendant Interface, PC Interface, or Multitasking
375
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Error handling
The following recoverable errors can be generated. The errors can be handled in an ERROR
handler. The system variable ERRNO will be set to:
Limitations
RMQGetMessage is not supported on the user execution level (i.e. in service routines) or
normal execution level.
The maximum size of the data that can be received in a rmqmessage is about 3000 bytes.
A recommendation is to reuse a variable of the data type rmqmessage as much as possible
to save RAPID memory.
Syntax
RMQGetMessage
[ Message ‘:=’ ] < variable ( VAR ) of rmqmessage >‘;‘
Related information
ERR_RMQ_NOMSG
No message for the moment in the queue. If executing
RMQGetMessage twice in a TRAP routine, this can happen. The
error can also be generated if there is a power failure between
the TRAP being ordered and the instruction RMQGetMessage
being executed.The messages in the RMQ will be lost at power
fail.
ERR_RMQ_INVMSG
This error will be thrown if the message is invalid. This may for
instance happen if a PC application sends a corrupt message.
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
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
Get the slot name from a specified slot
identity
RMQGetSlotName - Get the name of an
RMQ client on page 964
Continued
Continues on next page
1 Instructions
1.138. RMQGetMessage - Get an RMQ message
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
376
© Copyright 2004-2010 ABB. All rights reserved.
RMQ Message
rmqmessage - RAPID Message Queue
message on page 1173
For information about
See
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 378
|
1 Instructions
1.138. RMQGetMessage - Get an RMQ message
FlexPendant Interface, PC Interface, or Multitasking
375
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Error handling
The following recoverable errors can be generated. The errors can be handled in an ERROR
handler. The system variable ERRNO will be set to:
Limitations
RMQGetMessage is not supported on the user execution level (i.e. in service routines) or
normal execution level.
The maximum size of the data that can be received in a rmqmessage is about 3000 bytes.
A recommendation is to reuse a variable of the data type rmqmessage as much as possible
to save RAPID memory.
Syntax
RMQGetMessage
[ Message ‘:=’ ] < variable ( VAR ) of rmqmessage >‘;‘
Related information
ERR_RMQ_NOMSG
No message for the moment in the queue. If executing
RMQGetMessage twice in a TRAP routine, this can happen. The
error can also be generated if there is a power failure between
the TRAP being ordered and the instruction RMQGetMessage
being executed.The messages in the RMQ will be lost at power
fail.
ERR_RMQ_INVMSG
This error will be thrown if the message is invalid. This may for
instance happen if a PC application sends a corrupt message.
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
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
Get the slot name from a specified slot
identity
RMQGetSlotName - Get the name of an
RMQ client on page 964
Continued
Continues on next page
1 Instructions
1.138. RMQGetMessage - Get an RMQ message
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
376
© Copyright 2004-2010 ABB. All rights reserved.
RMQ Message
rmqmessage - RAPID Message Queue
message on page 1173
For information about
See
Continued
1 Instructions
1.139. RMQGetMsgData - Get the data part from an RMQ message
FlexPendant Interface, PC Interface, or Multitasking
377
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.139. RMQGetMsgData - Get the data part from an RMQ message
Usage
RMQGetMsgData ( RAPID Message Queue Get Message Data ) is used to get the actual data
within the RMQ message.
Basic examples
Basic examples of the instruction RMQGetMsgData are illustrated below.
See also More Examples .
Example 1
VAR rmqmessage myrmqmsg;
VAR num data;
...
RMQGetMsgData myrmqmsg, data;
! Handle data
Data of the data type num is fetched from the variable myrmqmsg and stored in the variable
data .
Arguments
RMQGetMsgData Message Data
Message
Data type: rmqmessage
Varible containing the received RMQ message.
Data
Data type: anytype
Variable of the expected data type, used for storage of the received data.
Program execution
The instruction RMQGetMsgData is used to get the actual data within the RMQ message,
convert it from ASCII character format to binary data, compile the data to see if it is possible
to store it in the variable specified in the instruction, and then copy it to the variable.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 379
|
1 Instructions
1.138. RMQGetMessage - Get an RMQ message
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
376
© Copyright 2004-2010 ABB. All rights reserved.
RMQ Message
rmqmessage - RAPID Message Queue
message on page 1173
For information about
See
Continued
1 Instructions
1.139. RMQGetMsgData - Get the data part from an RMQ message
FlexPendant Interface, PC Interface, or Multitasking
377
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.139. RMQGetMsgData - Get the data part from an RMQ message
Usage
RMQGetMsgData ( RAPID Message Queue Get Message Data ) is used to get the actual data
within the RMQ message.
Basic examples
Basic examples of the instruction RMQGetMsgData are illustrated below.
See also More Examples .
Example 1
VAR rmqmessage myrmqmsg;
VAR num data;
...
RMQGetMsgData myrmqmsg, data;
! Handle data
Data of the data type num is fetched from the variable myrmqmsg and stored in the variable
data .
Arguments
RMQGetMsgData Message Data
Message
Data type: rmqmessage
Varible containing the received RMQ message.
Data
Data type: anytype
Variable of the expected data type, used for storage of the received data.
Program execution
The instruction RMQGetMsgData is used to get the actual data within the RMQ message,
convert it from ASCII character format to binary data, compile the data to see if it is possible
to store it in the variable specified in the instruction, and then copy it to the variable.
Continues on next page
1 Instructions
1.139. RMQGetMsgData - Get the data part from an RMQ message
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
378
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of how to use the instruction RMQGetMsgData are illustrated below.
Example 1
RECORD mydatatype
int x;
int y;
ENDRECORD
VAR intnum msgreceive;
VAR mydatatype mydata;
PROC main()
! Setup interrupt
CONNECT msgreceive WITH msghandler;
! Order cyclic interrupt to occur for data type mydatatype
IRMQMessage mydata, msgreceive;
WHILE TRUE DO
! Performing cycle
...
ENDWHILE
ENDPROC
TRAP msghandler
VAR rmgmessage message;
VAR rmqheader header;
! Get the RMQ message
RMQGetMessage message;
! Copy RMQ header information
RMQGetMsgHeader message \Header:=header;
IF header.datatype = "mydatatype" AND header.ndim = 0 THEN
! Copy the data from the message
RMQGetMsgData message, mydata;
ELSE
TPWrite "Received a type not handled or with wrong dimension";
ENDIF
ENDTRAP
When a new message is received, the TRAP routine msghandler is executed and the new
message is copied to the variable message (instruction RMQGetMessage ). Then the RMQ
header data is copied (instruction RMQGetMsgHeader ). If the message is of the expected data
type and has the right dimension, the data is copied to the variable mydata (instruction
RMQGetMsgData ).
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
| 380
|
1 Instructions
1.139. RMQGetMsgData - Get the data part from an RMQ message
FlexPendant Interface, PC Interface, or Multitasking
377
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.139. RMQGetMsgData - Get the data part from an RMQ message
Usage
RMQGetMsgData ( RAPID Message Queue Get Message Data ) is used to get the actual data
within the RMQ message.
Basic examples
Basic examples of the instruction RMQGetMsgData are illustrated below.
See also More Examples .
Example 1
VAR rmqmessage myrmqmsg;
VAR num data;
...
RMQGetMsgData myrmqmsg, data;
! Handle data
Data of the data type num is fetched from the variable myrmqmsg and stored in the variable
data .
Arguments
RMQGetMsgData Message Data
Message
Data type: rmqmessage
Varible containing the received RMQ message.
Data
Data type: anytype
Variable of the expected data type, used for storage of the received data.
Program execution
The instruction RMQGetMsgData is used to get the actual data within the RMQ message,
convert it from ASCII character format to binary data, compile the data to see if it is possible
to store it in the variable specified in the instruction, and then copy it to the variable.
Continues on next page
1 Instructions
1.139. RMQGetMsgData - Get the data part from an RMQ message
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
378
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of how to use the instruction RMQGetMsgData are illustrated below.
Example 1
RECORD mydatatype
int x;
int y;
ENDRECORD
VAR intnum msgreceive;
VAR mydatatype mydata;
PROC main()
! Setup interrupt
CONNECT msgreceive WITH msghandler;
! Order cyclic interrupt to occur for data type mydatatype
IRMQMessage mydata, msgreceive;
WHILE TRUE DO
! Performing cycle
...
ENDWHILE
ENDPROC
TRAP msghandler
VAR rmgmessage message;
VAR rmqheader header;
! Get the RMQ message
RMQGetMessage message;
! Copy RMQ header information
RMQGetMsgHeader message \Header:=header;
IF header.datatype = "mydatatype" AND header.ndim = 0 THEN
! Copy the data from the message
RMQGetMsgData message, mydata;
ELSE
TPWrite "Received a type not handled or with wrong dimension";
ENDIF
ENDTRAP
When a new message is received, the TRAP routine msghandler is executed and the new
message is copied to the variable message (instruction RMQGetMessage ). Then the RMQ
header data is copied (instruction RMQGetMsgHeader ). If the message is of the expected data
type and has the right dimension, the data is copied to the variable mydata (instruction
RMQGetMsgData ).
Continued
Continues on next page
1 Instructions
1.139. RMQGetMsgData - Get the data part from an RMQ message
FlexPendant Interface, PC Interface, or Multitasking
379
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Error handling
The following recoverable errors can be generated. The errors can be handled in an ERROR
handler. The system variable ERRNO will be set to:
Syntax
RMQGetMsgData
[ Message ‘:=’ ] < variable ( VAR ) of rmqmessage > ’,’
[ Data ‘:=’ ] < reference ( VAR ) of anytype >‘;‘
Related information
ERR_RMQ_VALUE
The received message and the data type used in argument
Data does not have the same data type.
ERR_RMQ_DIM
The data types are equal, but the dimensions differ between the
data in the message and the variable used in argument Data .
ERR_RMQ_MSGSIZE
The size of the received data is bigger than the maximum
configured size for the RMQ for the receiving task.
ERR_RMQ_INVMSG
This error will be thrown if the message is invalid. This may for
instance happen if a PC application sends a corrupt message.
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
Order and enable interrupts for a specific data
type
IRMQMessage - Orders RMQ interrupts for a
data type on page 167
Get the slot name from a specified slot
identity
RMQGetSlotName - Get the name of an
RMQ client on page 964
RMQ Message
rmqmessage - RAPID Message Queue
message on page 1173
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 381
|
1 Instructions
1.139. RMQGetMsgData - Get the data part from an RMQ message
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
378
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of how to use the instruction RMQGetMsgData are illustrated below.
Example 1
RECORD mydatatype
int x;
int y;
ENDRECORD
VAR intnum msgreceive;
VAR mydatatype mydata;
PROC main()
! Setup interrupt
CONNECT msgreceive WITH msghandler;
! Order cyclic interrupt to occur for data type mydatatype
IRMQMessage mydata, msgreceive;
WHILE TRUE DO
! Performing cycle
...
ENDWHILE
ENDPROC
TRAP msghandler
VAR rmgmessage message;
VAR rmqheader header;
! Get the RMQ message
RMQGetMessage message;
! Copy RMQ header information
RMQGetMsgHeader message \Header:=header;
IF header.datatype = "mydatatype" AND header.ndim = 0 THEN
! Copy the data from the message
RMQGetMsgData message, mydata;
ELSE
TPWrite "Received a type not handled or with wrong dimension";
ENDIF
ENDTRAP
When a new message is received, the TRAP routine msghandler is executed and the new
message is copied to the variable message (instruction RMQGetMessage ). Then the RMQ
header data is copied (instruction RMQGetMsgHeader ). If the message is of the expected data
type and has the right dimension, the data is copied to the variable mydata (instruction
RMQGetMsgData ).
Continued
Continues on next page
1 Instructions
1.139. RMQGetMsgData - Get the data part from an RMQ message
FlexPendant Interface, PC Interface, or Multitasking
379
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Error handling
The following recoverable errors can be generated. The errors can be handled in an ERROR
handler. The system variable ERRNO will be set to:
Syntax
RMQGetMsgData
[ Message ‘:=’ ] < variable ( VAR ) of rmqmessage > ’,’
[ Data ‘:=’ ] < reference ( VAR ) of anytype >‘;‘
Related information
ERR_RMQ_VALUE
The received message and the data type used in argument
Data does not have the same data type.
ERR_RMQ_DIM
The data types are equal, but the dimensions differ between the
data in the message and the variable used in argument Data .
ERR_RMQ_MSGSIZE
The size of the received data is bigger than the maximum
configured size for the RMQ for the receiving task.
ERR_RMQ_INVMSG
This error will be thrown if the message is invalid. This may for
instance happen if a PC application sends a corrupt message.
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
Order and enable interrupts for a specific data
type
IRMQMessage - Orders RMQ interrupts for a
data type on page 167
Get the slot name from a specified slot
identity
RMQGetSlotName - Get the name of an
RMQ client on page 964
RMQ Message
rmqmessage - RAPID Message Queue
message on page 1173
Continued
1 Instructions
1.140. RMQGetMsgHeader - Get header information from an RMQ message
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
380
© Copyright 2004-2010 ABB. All rights reserved.
1.140. RMQGetMsgHeader - Get header information from an RMQ message
Usage
RMQGetMsgHeader ( RAPID Message Queue Get Message Header ) get the header
information within the received RMQ message and store it in variables of type rmqheader ,
rmqslot or num .
Basic examples
Basic examples of the instruction RMQGetMsgHeader are illustrated below.
See also More examples on page 381 .
Example 1
VAR rmqmessage myrmqmsg;
VAR rmqheader myrmqheader;
...
RMQGetMsgHeader myrmqmsg, \Header:=myrmqheader;
In this example the variable myrmqheader is filled with data copied from the rmqheader
part of the variable myrmqmsg .
Example 2
VAR rmqmessage rmqmessage1;
VAR rmqheader rmqheader1;
VAR rmqslot rmqslot1;
VAR num userdef := 0;
...
RRMQGetMsgHeader rmqmessage1 \Header:=rmqheader1
\SenderId:=rmqslot1 \UserDef:=userdef;
In this example the variables rmqheader1 , rmqslot1 and userdef are filled with data
copied from the variable rmqmessage1 .
Arguments
RMQGetMsgHeader Message [\Header] [\SenderId] [\UserDef]
Message
Data type: rmqmessage
Variable containing the received RMQ message from which the information about the
message should be copied.
[\Header ]
Data type: rmqheader
Variable for storage of the RMQ header information that is copied from the variable specified
as the parameter Message .
[\SenderId]
Data type: rmqslot
Variable for storage of the sender identity information that is copied from the variable
specified as the parameter Message .
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 382
|
1 Instructions
1.139. RMQGetMsgData - Get the data part from an RMQ message
FlexPendant Interface, PC Interface, or Multitasking
379
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Error handling
The following recoverable errors can be generated. The errors can be handled in an ERROR
handler. The system variable ERRNO will be set to:
Syntax
RMQGetMsgData
[ Message ‘:=’ ] < variable ( VAR ) of rmqmessage > ’,’
[ Data ‘:=’ ] < reference ( VAR ) of anytype >‘;‘
Related information
ERR_RMQ_VALUE
The received message and the data type used in argument
Data does not have the same data type.
ERR_RMQ_DIM
The data types are equal, but the dimensions differ between the
data in the message and the variable used in argument Data .
ERR_RMQ_MSGSIZE
The size of the received data is bigger than the maximum
configured size for the RMQ for the receiving task.
ERR_RMQ_INVMSG
This error will be thrown if the message is invalid. This may for
instance happen if a PC application sends a corrupt message.
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
Order and enable interrupts for a specific data
type
IRMQMessage - Orders RMQ interrupts for a
data type on page 167
Get the slot name from a specified slot
identity
RMQGetSlotName - Get the name of an
RMQ client on page 964
RMQ Message
rmqmessage - RAPID Message Queue
message on page 1173
Continued
1 Instructions
1.140. RMQGetMsgHeader - Get header information from an RMQ message
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
380
© Copyright 2004-2010 ABB. All rights reserved.
1.140. RMQGetMsgHeader - Get header information from an RMQ message
Usage
RMQGetMsgHeader ( RAPID Message Queue Get Message Header ) get the header
information within the received RMQ message and store it in variables of type rmqheader ,
rmqslot or num .
Basic examples
Basic examples of the instruction RMQGetMsgHeader are illustrated below.
See also More examples on page 381 .
Example 1
VAR rmqmessage myrmqmsg;
VAR rmqheader myrmqheader;
...
RMQGetMsgHeader myrmqmsg, \Header:=myrmqheader;
In this example the variable myrmqheader is filled with data copied from the rmqheader
part of the variable myrmqmsg .
Example 2
VAR rmqmessage rmqmessage1;
VAR rmqheader rmqheader1;
VAR rmqslot rmqslot1;
VAR num userdef := 0;
...
RRMQGetMsgHeader rmqmessage1 \Header:=rmqheader1
\SenderId:=rmqslot1 \UserDef:=userdef;
In this example the variables rmqheader1 , rmqslot1 and userdef are filled with data
copied from the variable rmqmessage1 .
Arguments
RMQGetMsgHeader Message [\Header] [\SenderId] [\UserDef]
Message
Data type: rmqmessage
Variable containing the received RMQ message from which the information about the
message should be copied.
[\Header ]
Data type: rmqheader
Variable for storage of the RMQ header information that is copied from the variable specified
as the parameter Message .
[\SenderId]
Data type: rmqslot
Variable for storage of the sender identity information that is copied from the variable
specified as the parameter Message .
Continues on next page
1 Instructions
1.140. RMQGetMsgHeader - Get header information from an RMQ message
FlexPendant Interface, PC Interface, or Multitasking
381
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
[\UserDef ]
User Defined data
Data type: num
Variable for storage of user-defined data that is copied from the variable specified as the
parameter Message . To get any valid data in this variable, the sender needs to specify that
this should be included when sending an RMQ message. If it is not used, the value will be set
to -1.
Program execution
The instruction RMQGetMsgHeader gets the header information within the received RMQ
message and copies it to to variables of type rmqheader , rmqslot or num depending on
what arguments are used.
More examples
More examples of how to use the instruction RMQGetMsgHeader are illustrated below.
Example 1
RECORD mydatatype
int x;
int y;
ENDRECORD
VAR intnum msgreceive;
VAR mydatatype mydata;
PROC main()
! Setup interrupt
CONNECT msgreceive WITH msghandler;
! Order cyclic interrupt to occur for data type mydatatype
IRMQMessage mydata, msgreceive;
WHILE TRUE DO
! Performing cycle
...
ENDWHILE
ENDPROC
TRAP msghandler
VAR rmgmessage message;
VAR rmqheader header;
! Get the RMQ message
RMQGetMessage message;
! Copy RMQ header information
RMQGetMsgHeader message \Header:=header;
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
| 383
|
1 Instructions
1.140. RMQGetMsgHeader - Get header information from an RMQ message
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
380
© Copyright 2004-2010 ABB. All rights reserved.
1.140. RMQGetMsgHeader - Get header information from an RMQ message
Usage
RMQGetMsgHeader ( RAPID Message Queue Get Message Header ) get the header
information within the received RMQ message and store it in variables of type rmqheader ,
rmqslot or num .
Basic examples
Basic examples of the instruction RMQGetMsgHeader are illustrated below.
See also More examples on page 381 .
Example 1
VAR rmqmessage myrmqmsg;
VAR rmqheader myrmqheader;
...
RMQGetMsgHeader myrmqmsg, \Header:=myrmqheader;
In this example the variable myrmqheader is filled with data copied from the rmqheader
part of the variable myrmqmsg .
Example 2
VAR rmqmessage rmqmessage1;
VAR rmqheader rmqheader1;
VAR rmqslot rmqslot1;
VAR num userdef := 0;
...
RRMQGetMsgHeader rmqmessage1 \Header:=rmqheader1
\SenderId:=rmqslot1 \UserDef:=userdef;
In this example the variables rmqheader1 , rmqslot1 and userdef are filled with data
copied from the variable rmqmessage1 .
Arguments
RMQGetMsgHeader Message [\Header] [\SenderId] [\UserDef]
Message
Data type: rmqmessage
Variable containing the received RMQ message from which the information about the
message should be copied.
[\Header ]
Data type: rmqheader
Variable for storage of the RMQ header information that is copied from the variable specified
as the parameter Message .
[\SenderId]
Data type: rmqslot
Variable for storage of the sender identity information that is copied from the variable
specified as the parameter Message .
Continues on next page
1 Instructions
1.140. RMQGetMsgHeader - Get header information from an RMQ message
FlexPendant Interface, PC Interface, or Multitasking
381
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
[\UserDef ]
User Defined data
Data type: num
Variable for storage of user-defined data that is copied from the variable specified as the
parameter Message . To get any valid data in this variable, the sender needs to specify that
this should be included when sending an RMQ message. If it is not used, the value will be set
to -1.
Program execution
The instruction RMQGetMsgHeader gets the header information within the received RMQ
message and copies it to to variables of type rmqheader , rmqslot or num depending on
what arguments are used.
More examples
More examples of how to use the instruction RMQGetMsgHeader are illustrated below.
Example 1
RECORD mydatatype
int x;
int y;
ENDRECORD
VAR intnum msgreceive;
VAR mydatatype mydata;
PROC main()
! Setup interrupt
CONNECT msgreceive WITH msghandler;
! Order cyclic interrupt to occur for data type mydatatype
IRMQMessage mydata, msgreceive;
WHILE TRUE DO
! Performing cycle
...
ENDWHILE
ENDPROC
TRAP msghandler
VAR rmgmessage message;
VAR rmqheader header;
! Get the RMQ message
RMQGetMessage message;
! Copy RMQ header information
RMQGetMsgHeader message \Header:=header;
Continued
Continues on next page
1 Instructions
1.140. RMQGetMsgHeader - Get header information from an RMQ message
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
382
© Copyright 2004-2010 ABB. All rights reserved.
IF header.datatype = "mydatatype" AND header.ndim = 0 THEN
! Copy the data from the message
RMQGetMsgData message, mydata;
ELSE
TPWrite "Received a type not handled or with wrong dimension";
ENDIF
ENDTRAP
When a new message is received, the TRAP routine msghandler is executed and the new
message is copied to the variable message (instruction RMQGetMessage ). Then the RMQ
header data is copied (instruction RMQGetMsgHeader ). If the message is of the expected data
type and has the right dimension, the data is copied to the variable mydata (instruction
RMQGetMsgData ).
Syntax
RMQGetMsgHeader
[ Message ‘:=’ ] < variable ( VAR ) of rmqmessage > ’,’
[ ‘\’ Header‘ :=’ < variable ( VAR ) of rmqheader >
[ ‘\’ SenderId‘ :=’ < variable ( VAR ) of rmqslot >
[ ‘\’ UserDef‘ :=’ < variable ( VAR ) of num >‘;‘
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 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
Get the slot name from a specified slot
identity
RMQGetSlotName - Get the name of an
RMQ client on page 964
RMQ Slot
rmqslot - Identity number of an RMQ client on
page 1174
RMQ Header
rmqmessage - RAPID Message Queue
message on page 1173
RMQ Message
rmqheader - RAPID Message Queue
Message header on page 1171
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 384
|
1 Instructions
1.140. RMQGetMsgHeader - Get header information from an RMQ message
FlexPendant Interface, PC Interface, or Multitasking
381
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
[\UserDef ]
User Defined data
Data type: num
Variable for storage of user-defined data that is copied from the variable specified as the
parameter Message . To get any valid data in this variable, the sender needs to specify that
this should be included when sending an RMQ message. If it is not used, the value will be set
to -1.
Program execution
The instruction RMQGetMsgHeader gets the header information within the received RMQ
message and copies it to to variables of type rmqheader , rmqslot or num depending on
what arguments are used.
More examples
More examples of how to use the instruction RMQGetMsgHeader are illustrated below.
Example 1
RECORD mydatatype
int x;
int y;
ENDRECORD
VAR intnum msgreceive;
VAR mydatatype mydata;
PROC main()
! Setup interrupt
CONNECT msgreceive WITH msghandler;
! Order cyclic interrupt to occur for data type mydatatype
IRMQMessage mydata, msgreceive;
WHILE TRUE DO
! Performing cycle
...
ENDWHILE
ENDPROC
TRAP msghandler
VAR rmgmessage message;
VAR rmqheader header;
! Get the RMQ message
RMQGetMessage message;
! Copy RMQ header information
RMQGetMsgHeader message \Header:=header;
Continued
Continues on next page
1 Instructions
1.140. RMQGetMsgHeader - Get header information from an RMQ message
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
382
© Copyright 2004-2010 ABB. All rights reserved.
IF header.datatype = "mydatatype" AND header.ndim = 0 THEN
! Copy the data from the message
RMQGetMsgData message, mydata;
ELSE
TPWrite "Received a type not handled or with wrong dimension";
ENDIF
ENDTRAP
When a new message is received, the TRAP routine msghandler is executed and the new
message is copied to the variable message (instruction RMQGetMessage ). Then the RMQ
header data is copied (instruction RMQGetMsgHeader ). If the message is of the expected data
type and has the right dimension, the data is copied to the variable mydata (instruction
RMQGetMsgData ).
Syntax
RMQGetMsgHeader
[ Message ‘:=’ ] < variable ( VAR ) of rmqmessage > ’,’
[ ‘\’ Header‘ :=’ < variable ( VAR ) of rmqheader >
[ ‘\’ SenderId‘ :=’ < variable ( VAR ) of rmqslot >
[ ‘\’ UserDef‘ :=’ < variable ( VAR ) of num >‘;‘
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 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
Get the slot name from a specified slot
identity
RMQGetSlotName - Get the name of an
RMQ client on page 964
RMQ Slot
rmqslot - Identity number of an RMQ client on
page 1174
RMQ Header
rmqmessage - RAPID Message Queue
message on page 1173
RMQ Message
rmqheader - RAPID Message Queue
Message header on page 1171
Continued
1 Instructions
1.141. RMQReadWait - Returns message from RMQ
RobotWare - OS
383
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.141. RMQReadWait - Returns message from RMQ
Usage
RMQReadWait is used in synchronous mode to receive any type of message.
Basic examples
A basic example of the instruction RMQReadWait is illustrated below.
See also More examples on page 383 .
Example
VAR rmqmessage myrmqmsg;
RMQReadWait myrmqmsg;
The first message in the queue is received in the variable myrmqmsg .
Arguments
RMQReadWait Message [\TimeOut]
Message
Data type: rmqmessage
The variable in which the received message is placed.
[\Timeout]
Data type: num
The maximum amount of time [s] that program execution waits for a message. If this time
runs out before the condition is met, the error handler will be called, if there is one, with the
error code ERR_RMQ_TIMEOUT . If there is no error handler, the execution will be stopped. It
is possible to set the timeout to 0 (zero) seconds, so that there is no wait at all.
If the parameter \Timeout is not used, the waiting time is 60 sec. To wait forever, use the
predefined constant WAIT_MAX .
Program execution
All incoming messages are queued and RMQReadWait handles the messages in FIFO order,
one message at a time. It is the users responsibility to avoid a full queue and to be prepared
to handle any type of message supported by RAPID Message Queue.
More examples
More examples of how to use the instruction RMQReadWait are illustrated below.
Example 1
VAR rmqmessage myrmqmsg;
RMQReadWait myrmqmsg \TimeOut:=30;
The first message in the queue is received in the variable myrmqmsg . If no message is
received within 30 seconds the program execution is stopped.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 385
|
1 Instructions
1.140. RMQGetMsgHeader - Get header information from an RMQ message
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
382
© Copyright 2004-2010 ABB. All rights reserved.
IF header.datatype = "mydatatype" AND header.ndim = 0 THEN
! Copy the data from the message
RMQGetMsgData message, mydata;
ELSE
TPWrite "Received a type not handled or with wrong dimension";
ENDIF
ENDTRAP
When a new message is received, the TRAP routine msghandler is executed and the new
message is copied to the variable message (instruction RMQGetMessage ). Then the RMQ
header data is copied (instruction RMQGetMsgHeader ). If the message is of the expected data
type and has the right dimension, the data is copied to the variable mydata (instruction
RMQGetMsgData ).
Syntax
RMQGetMsgHeader
[ Message ‘:=’ ] < variable ( VAR ) of rmqmessage > ’,’
[ ‘\’ Header‘ :=’ < variable ( VAR ) of rmqheader >
[ ‘\’ SenderId‘ :=’ < variable ( VAR ) of rmqslot >
[ ‘\’ UserDef‘ :=’ < variable ( VAR ) of num >‘;‘
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 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
Get the slot name from a specified slot
identity
RMQGetSlotName - Get the name of an
RMQ client on page 964
RMQ Slot
rmqslot - Identity number of an RMQ client on
page 1174
RMQ Header
rmqmessage - RAPID Message Queue
message on page 1173
RMQ Message
rmqheader - RAPID Message Queue
Message header on page 1171
Continued
1 Instructions
1.141. RMQReadWait - Returns message from RMQ
RobotWare - OS
383
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.141. RMQReadWait - Returns message from RMQ
Usage
RMQReadWait is used in synchronous mode to receive any type of message.
Basic examples
A basic example of the instruction RMQReadWait is illustrated below.
See also More examples on page 383 .
Example
VAR rmqmessage myrmqmsg;
RMQReadWait myrmqmsg;
The first message in the queue is received in the variable myrmqmsg .
Arguments
RMQReadWait Message [\TimeOut]
Message
Data type: rmqmessage
The variable in which the received message is placed.
[\Timeout]
Data type: num
The maximum amount of time [s] that program execution waits for a message. If this time
runs out before the condition is met, the error handler will be called, if there is one, with the
error code ERR_RMQ_TIMEOUT . If there is no error handler, the execution will be stopped. It
is possible to set the timeout to 0 (zero) seconds, so that there is no wait at all.
If the parameter \Timeout is not used, the waiting time is 60 sec. To wait forever, use the
predefined constant WAIT_MAX .
Program execution
All incoming messages are queued and RMQReadWait handles the messages in FIFO order,
one message at a time. It is the users responsibility to avoid a full queue and to be prepared
to handle any type of message supported by RAPID Message Queue.
More examples
More examples of how to use the instruction RMQReadWait are illustrated below.
Example 1
VAR rmqmessage myrmqmsg;
RMQReadWait myrmqmsg \TimeOut:=30;
The first message in the queue is received in the variable myrmqmsg . If no message is
received within 30 seconds the program execution is stopped.
Continues on next page
1 Instructions
1.141. RMQReadWait - Returns message from RMQ
RobotWare - OS
3HAC 16581-1 Revision: J
384
© Copyright 2004-2010 ABB. All rights reserved.
Example 2
PROC main()
VAR rmqmessage myrmqmsg;
FOR i FROM 1 TO 25 DO
RMQReadWait myrmqmsg \TimeOut:=30;
...
ENDFOR
ERROR
IF ERRNO = ERR_RMQ_TIMEOUT THEN
TPWrite "ERR_RMQ_TIMEOUT error reported";
...
ENDIF
ENDPROC
Messages are received from the queue and stored in the variable myrmqmsg . If receiving a
message takes longer than 30 seconds, the error handler is called.
Error handling
The following recoverable errors can be generated. The errors can be handled in an ERROR
handler. The system variable ERRNO will be set to:
Limitations
RMQReadWait is only supported in synchronous mode. Executing this instruction in interrupt
based mode will cause a fatal runtime error.
RMQReadWait is not supported in trap execution level or user execution level. Executing this
instruction in either of these levels will cause a fatal runtime error.
Syntax
RMQReadWait
[ Message ':=' ] < variable ( VAR ) of rmqmessage>
[ '\' TimeOut':=' < expression ( IN ) of num > ] ';'
Related information
Error code
Description
ERR_RMQ_TIMEOUT
No answer has been received within the time-out time
ERR_RMQ_INVMSG
This error will be thrown if the message is invalid. This can for
example happen if a PC application sends a corrupt message
For information about
See
Description of the RAPID Message Queue
functionality
Application manual - Robot communication
and I/O control, section RAPID Message
Queue .
Description of task execution modes
Technical reference manual - System
parameters, section Topic Controller, Type
Task .
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
| 386
|
1 Instructions
1.141. RMQReadWait - Returns message from RMQ
RobotWare - OS
383
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.141. RMQReadWait - Returns message from RMQ
Usage
RMQReadWait is used in synchronous mode to receive any type of message.
Basic examples
A basic example of the instruction RMQReadWait is illustrated below.
See also More examples on page 383 .
Example
VAR rmqmessage myrmqmsg;
RMQReadWait myrmqmsg;
The first message in the queue is received in the variable myrmqmsg .
Arguments
RMQReadWait Message [\TimeOut]
Message
Data type: rmqmessage
The variable in which the received message is placed.
[\Timeout]
Data type: num
The maximum amount of time [s] that program execution waits for a message. If this time
runs out before the condition is met, the error handler will be called, if there is one, with the
error code ERR_RMQ_TIMEOUT . If there is no error handler, the execution will be stopped. It
is possible to set the timeout to 0 (zero) seconds, so that there is no wait at all.
If the parameter \Timeout is not used, the waiting time is 60 sec. To wait forever, use the
predefined constant WAIT_MAX .
Program execution
All incoming messages are queued and RMQReadWait handles the messages in FIFO order,
one message at a time. It is the users responsibility to avoid a full queue and to be prepared
to handle any type of message supported by RAPID Message Queue.
More examples
More examples of how to use the instruction RMQReadWait are illustrated below.
Example 1
VAR rmqmessage myrmqmsg;
RMQReadWait myrmqmsg \TimeOut:=30;
The first message in the queue is received in the variable myrmqmsg . If no message is
received within 30 seconds the program execution is stopped.
Continues on next page
1 Instructions
1.141. RMQReadWait - Returns message from RMQ
RobotWare - OS
3HAC 16581-1 Revision: J
384
© Copyright 2004-2010 ABB. All rights reserved.
Example 2
PROC main()
VAR rmqmessage myrmqmsg;
FOR i FROM 1 TO 25 DO
RMQReadWait myrmqmsg \TimeOut:=30;
...
ENDFOR
ERROR
IF ERRNO = ERR_RMQ_TIMEOUT THEN
TPWrite "ERR_RMQ_TIMEOUT error reported";
...
ENDIF
ENDPROC
Messages are received from the queue and stored in the variable myrmqmsg . If receiving a
message takes longer than 30 seconds, the error handler is called.
Error handling
The following recoverable errors can be generated. The errors can be handled in an ERROR
handler. The system variable ERRNO will be set to:
Limitations
RMQReadWait is only supported in synchronous mode. Executing this instruction in interrupt
based mode will cause a fatal runtime error.
RMQReadWait is not supported in trap execution level or user execution level. Executing this
instruction in either of these levels will cause a fatal runtime error.
Syntax
RMQReadWait
[ Message ':=' ] < variable ( VAR ) of rmqmessage>
[ '\' TimeOut':=' < expression ( IN ) of num > ] ';'
Related information
Error code
Description
ERR_RMQ_TIMEOUT
No answer has been received within the time-out time
ERR_RMQ_INVMSG
This error will be thrown if the message is invalid. This can for
example happen if a PC application sends a corrupt message
For information about
See
Description of the RAPID Message Queue
functionality
Application manual - Robot communication
and I/O control, section RAPID Message
Queue .
Description of task execution modes
Technical reference manual - System
parameters, section Topic Controller, Type
Task .
Continued
Continues on next page
1 Instructions
1.141. RMQReadWait - Returns message from RMQ
RobotWare - OS
385
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
rmqmessage data type
rmqmessage - RAPID Message Queue
message on page 1173 .
Send data to the queue of a RAPID task or
Robot Application Builder client
RMQSendMessage - Send an RMQ data
message on page 386 .
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 .
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 .
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 .
Get the slot name from a specified slot
identity
RMQGetSlotName - Get the name of an
RMQ client on page 964 .
Empty RAPID Message Queue
RMQEmptyQueue - Empty RAPID Message
Queue on page 369
rmqmessage - RAPID Message Queue
message on page 1173
Get the first message from a RAPID Message
Queue
RMQGetMessage - Get an RMQ message on
page 373 .
For information about
See
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 387
|
1 Instructions
1.141. RMQReadWait - Returns message from RMQ
RobotWare - OS
3HAC 16581-1 Revision: J
384
© Copyright 2004-2010 ABB. All rights reserved.
Example 2
PROC main()
VAR rmqmessage myrmqmsg;
FOR i FROM 1 TO 25 DO
RMQReadWait myrmqmsg \TimeOut:=30;
...
ENDFOR
ERROR
IF ERRNO = ERR_RMQ_TIMEOUT THEN
TPWrite "ERR_RMQ_TIMEOUT error reported";
...
ENDIF
ENDPROC
Messages are received from the queue and stored in the variable myrmqmsg . If receiving a
message takes longer than 30 seconds, the error handler is called.
Error handling
The following recoverable errors can be generated. The errors can be handled in an ERROR
handler. The system variable ERRNO will be set to:
Limitations
RMQReadWait is only supported in synchronous mode. Executing this instruction in interrupt
based mode will cause a fatal runtime error.
RMQReadWait is not supported in trap execution level or user execution level. Executing this
instruction in either of these levels will cause a fatal runtime error.
Syntax
RMQReadWait
[ Message ':=' ] < variable ( VAR ) of rmqmessage>
[ '\' TimeOut':=' < expression ( IN ) of num > ] ';'
Related information
Error code
Description
ERR_RMQ_TIMEOUT
No answer has been received within the time-out time
ERR_RMQ_INVMSG
This error will be thrown if the message is invalid. This can for
example happen if a PC application sends a corrupt message
For information about
See
Description of the RAPID Message Queue
functionality
Application manual - Robot communication
and I/O control, section RAPID Message
Queue .
Description of task execution modes
Technical reference manual - System
parameters, section Topic Controller, Type
Task .
Continued
Continues on next page
1 Instructions
1.141. RMQReadWait - Returns message from RMQ
RobotWare - OS
385
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
rmqmessage data type
rmqmessage - RAPID Message Queue
message on page 1173 .
Send data to the queue of a RAPID task or
Robot Application Builder client
RMQSendMessage - Send an RMQ data
message on page 386 .
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 .
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 .
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 .
Get the slot name from a specified slot
identity
RMQGetSlotName - Get the name of an
RMQ client on page 964 .
Empty RAPID Message Queue
RMQEmptyQueue - Empty RAPID Message
Queue on page 369
rmqmessage - RAPID Message Queue
message on page 1173
Get the first message from a RAPID Message
Queue
RMQGetMessage - Get an RMQ message on
page 373 .
For information about
See
Continued
1 Instructions
1.142. RMQSendMessage - Send an RMQ data message
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
386
© Copyright 2004-2010 ABB. All rights reserved.
1.142. RMQSendMessage - Send an RMQ data message
Usage
RMQSendMessage ( RAPID Message Queue Send Message ) is used to send data to an RMQ
configured for a RAPID task, or to a Robot Application Builder client.
Basic examples
Basic examples of the instruction RMQSendMessage are illustrated below.
See also More examples on page 387 .
Example 1
VAR rmqslot destination_slot;
VAR string data:="Hello world";
..
RMQFindSlot destination_slot,"RMQ_Task2";
RMQSendMessage destination_slot,data;
The example shows how to send the value in the variable data to the RAPID task "Task2"
with the configured RMQ " RMQ_Task2 ".
Example 2
VAR rmqslot destination_slot;
CONST robtarget p5:=[ [600, 500, 225.3], [1, 0, 0, 0], [1, 1, 0,
0], [ 11, 12.3, 9E9, 9E9, 9E9, 9E9] ];
VAR num my_id:=1;
..
RMQFindSlot destination_slot,"RMQ_Task2";
RMQSendMessage destination_slot, p5 \UserDef:=my_id;
my_id:=my_id + 1;
The example shows how to send the value in the constant p5 to the RAPID task "Task2"
with the configured RMQ "RMQ_Task2". A user-defined number is also sent. This number
can be used by the receiver as an identifier.
Arguments
RMQSendMessage Slot SendData [\UserDef]
Slot
Data type: rmqslot
The identity slot number of the client that should receive the message.
SendData
Data type: anytype
Reference to a variable, persistent or constant containing the data to be sent to the client with
identity as in argument Slot .
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 388
|
1 Instructions
1.141. RMQReadWait - Returns message from RMQ
RobotWare - OS
385
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
rmqmessage data type
rmqmessage - RAPID Message Queue
message on page 1173 .
Send data to the queue of a RAPID task or
Robot Application Builder client
RMQSendMessage - Send an RMQ data
message on page 386 .
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 .
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 .
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 .
Get the slot name from a specified slot
identity
RMQGetSlotName - Get the name of an
RMQ client on page 964 .
Empty RAPID Message Queue
RMQEmptyQueue - Empty RAPID Message
Queue on page 369
rmqmessage - RAPID Message Queue
message on page 1173
Get the first message from a RAPID Message
Queue
RMQGetMessage - Get an RMQ message on
page 373 .
For information about
See
Continued
1 Instructions
1.142. RMQSendMessage - Send an RMQ data message
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
386
© Copyright 2004-2010 ABB. All rights reserved.
1.142. RMQSendMessage - Send an RMQ data message
Usage
RMQSendMessage ( RAPID Message Queue Send Message ) is used to send data to an RMQ
configured for a RAPID task, or to a Robot Application Builder client.
Basic examples
Basic examples of the instruction RMQSendMessage are illustrated below.
See also More examples on page 387 .
Example 1
VAR rmqslot destination_slot;
VAR string data:="Hello world";
..
RMQFindSlot destination_slot,"RMQ_Task2";
RMQSendMessage destination_slot,data;
The example shows how to send the value in the variable data to the RAPID task "Task2"
with the configured RMQ " RMQ_Task2 ".
Example 2
VAR rmqslot destination_slot;
CONST robtarget p5:=[ [600, 500, 225.3], [1, 0, 0, 0], [1, 1, 0,
0], [ 11, 12.3, 9E9, 9E9, 9E9, 9E9] ];
VAR num my_id:=1;
..
RMQFindSlot destination_slot,"RMQ_Task2";
RMQSendMessage destination_slot, p5 \UserDef:=my_id;
my_id:=my_id + 1;
The example shows how to send the value in the constant p5 to the RAPID task "Task2"
with the configured RMQ "RMQ_Task2". A user-defined number is also sent. This number
can be used by the receiver as an identifier.
Arguments
RMQSendMessage Slot SendData [\UserDef]
Slot
Data type: rmqslot
The identity slot number of the client that should receive the message.
SendData
Data type: anytype
Reference to a variable, persistent or constant containing the data to be sent to the client with
identity as in argument Slot .
Continues on next page
1 Instructions
1.142. RMQSendMessage - Send an RMQ data message
FlexPendant Interface, PC Interface, or Multitasking
387
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
[\UserDef ]
User Defined data
Data type: num
Data specifying user-defined information to the receiver of the SendData , i.e the client with
identity number as in variable Slot . The value must be an integer between 0 and 32767.
Program execution
The instruction RMQSendMessage is used to send data to a specified client. The instruction
packs the indata in a storage container and sends it.
If the receiving client is not interested in receiving messages, i.e has not setup any interrupt
to occur for the data type specified in the RMQSendMessage instruction or is not waiting in
an RMQSendWait instruction, the message will be discarded, and a warning will be generated.
Not all data types can be sent with the instruction (see limitations).
More examples
More examples of how to use the instruction RMQSendMessage are illustrated below.
Example 1
MODULE SenderMod
RECORD msgrec
num x;
num y;
ENDRECORD
PROC main()
VAR rmqslot destinationSlot;
VAR msgrec msg :=[0, 0, 0];
! Connect to a Robot Application Builder client
RMQFindSlot destinationSlot ”My_RAB_client”;
! Perform cycle
WHILE TRUE DO
! Update msg with valid data
...
! Send message
RMQSendMessage destinationSlot, msg;
...
ENDWHILE
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
| 389
|
1 Instructions
1.142. RMQSendMessage - Send an RMQ data message
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
386
© Copyright 2004-2010 ABB. All rights reserved.
1.142. RMQSendMessage - Send an RMQ data message
Usage
RMQSendMessage ( RAPID Message Queue Send Message ) is used to send data to an RMQ
configured for a RAPID task, or to a Robot Application Builder client.
Basic examples
Basic examples of the instruction RMQSendMessage are illustrated below.
See also More examples on page 387 .
Example 1
VAR rmqslot destination_slot;
VAR string data:="Hello world";
..
RMQFindSlot destination_slot,"RMQ_Task2";
RMQSendMessage destination_slot,data;
The example shows how to send the value in the variable data to the RAPID task "Task2"
with the configured RMQ " RMQ_Task2 ".
Example 2
VAR rmqslot destination_slot;
CONST robtarget p5:=[ [600, 500, 225.3], [1, 0, 0, 0], [1, 1, 0,
0], [ 11, 12.3, 9E9, 9E9, 9E9, 9E9] ];
VAR num my_id:=1;
..
RMQFindSlot destination_slot,"RMQ_Task2";
RMQSendMessage destination_slot, p5 \UserDef:=my_id;
my_id:=my_id + 1;
The example shows how to send the value in the constant p5 to the RAPID task "Task2"
with the configured RMQ "RMQ_Task2". A user-defined number is also sent. This number
can be used by the receiver as an identifier.
Arguments
RMQSendMessage Slot SendData [\UserDef]
Slot
Data type: rmqslot
The identity slot number of the client that should receive the message.
SendData
Data type: anytype
Reference to a variable, persistent or constant containing the data to be sent to the client with
identity as in argument Slot .
Continues on next page
1 Instructions
1.142. RMQSendMessage - Send an RMQ data message
FlexPendant Interface, PC Interface, or Multitasking
387
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
[\UserDef ]
User Defined data
Data type: num
Data specifying user-defined information to the receiver of the SendData , i.e the client with
identity number as in variable Slot . The value must be an integer between 0 and 32767.
Program execution
The instruction RMQSendMessage is used to send data to a specified client. The instruction
packs the indata in a storage container and sends it.
If the receiving client is not interested in receiving messages, i.e has not setup any interrupt
to occur for the data type specified in the RMQSendMessage instruction or is not waiting in
an RMQSendWait instruction, the message will be discarded, and a warning will be generated.
Not all data types can be sent with the instruction (see limitations).
More examples
More examples of how to use the instruction RMQSendMessage are illustrated below.
Example 1
MODULE SenderMod
RECORD msgrec
num x;
num y;
ENDRECORD
PROC main()
VAR rmqslot destinationSlot;
VAR msgrec msg :=[0, 0, 0];
! Connect to a Robot Application Builder client
RMQFindSlot destinationSlot ”My_RAB_client”;
! Perform cycle
WHILE TRUE DO
! Update msg with valid data
...
! Send message
RMQSendMessage destinationSlot, msg;
...
ENDWHILE
Continued
Continues on next page
1 Instructions
1.142. RMQSendMessage - Send an RMQ data message
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
388
© Copyright 2004-2010 ABB. All rights reserved.
ERROR
IF ERRNO = ERR_RMQ_INVALID THEN
! Handle destination client lost
WaitTime 1;
! Reconnect to Robot Application Builder client
RMQFindSlot destinationSlot ”My_RAB_client”;
! Avoid execution stop due to retry count exceed
ResetRetryCount;
RETRY;
ELSIF ERRNO = ERR_RMQ_FULL THEN
! Handle destination queue full
WaitTime 1;
! Avoid execution stop due to retry count exceed
ResetRetryCount;
RETRY;
ENDIF
ENDPROC
ENDMODULE
The example shows how to use instruction RMQSendMessage with errorhandling of occuring
run-time errors. The program sends user-defined data of the type msgrec to a Robot
Application Builder client called " My_RAB_client ".
Error handling
The following recoverable errors can be generated. The errors can be handled in an ERROR
handler. The system variable ERRNO will be set to:
Limitations
It is not possible to set up interrupts, or send or receive data instances of data types that are
of non-value, semi-value types or data type motsetdata .
The maximum size of data that can be sent to a Robot Application Builder client is about 5000
bytes. The maximum size of data that can be received by a RMQ and stored in a rmqmessage
data type is about 3000 bytes. The size of the data that can be received by an RMQ can be
configured (default size 400, max size 3000).
Syntax
RMQSendMessage
[ Slot ‘:=’ ] < variable ( VAR ) of rmqslot > ’,’
[ SendData‘ :=’ ] < reference ( REF ) of anytype >
[ ‘\’ UserDef‘ :=’ < expression ( IN ) of num > ] ‘;‘
ERR_RMQ_MSGSIZE
The size of message is too big. Either the data exceeds the
maximum allowed message size, or the receiving client is not
configured to receive the size of the data that is sent.
ERR_RMQ_FULL
The destination message queue is full
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 disconnected from the controller.
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
| 390
|
1 Instructions
1.142. RMQSendMessage - Send an RMQ data message
FlexPendant Interface, PC Interface, or Multitasking
387
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
[\UserDef ]
User Defined data
Data type: num
Data specifying user-defined information to the receiver of the SendData , i.e the client with
identity number as in variable Slot . The value must be an integer between 0 and 32767.
Program execution
The instruction RMQSendMessage is used to send data to a specified client. The instruction
packs the indata in a storage container and sends it.
If the receiving client is not interested in receiving messages, i.e has not setup any interrupt
to occur for the data type specified in the RMQSendMessage instruction or is not waiting in
an RMQSendWait instruction, the message will be discarded, and a warning will be generated.
Not all data types can be sent with the instruction (see limitations).
More examples
More examples of how to use the instruction RMQSendMessage are illustrated below.
Example 1
MODULE SenderMod
RECORD msgrec
num x;
num y;
ENDRECORD
PROC main()
VAR rmqslot destinationSlot;
VAR msgrec msg :=[0, 0, 0];
! Connect to a Robot Application Builder client
RMQFindSlot destinationSlot ”My_RAB_client”;
! Perform cycle
WHILE TRUE DO
! Update msg with valid data
...
! Send message
RMQSendMessage destinationSlot, msg;
...
ENDWHILE
Continued
Continues on next page
1 Instructions
1.142. RMQSendMessage - Send an RMQ data message
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
388
© Copyright 2004-2010 ABB. All rights reserved.
ERROR
IF ERRNO = ERR_RMQ_INVALID THEN
! Handle destination client lost
WaitTime 1;
! Reconnect to Robot Application Builder client
RMQFindSlot destinationSlot ”My_RAB_client”;
! Avoid execution stop due to retry count exceed
ResetRetryCount;
RETRY;
ELSIF ERRNO = ERR_RMQ_FULL THEN
! Handle destination queue full
WaitTime 1;
! Avoid execution stop due to retry count exceed
ResetRetryCount;
RETRY;
ENDIF
ENDPROC
ENDMODULE
The example shows how to use instruction RMQSendMessage with errorhandling of occuring
run-time errors. The program sends user-defined data of the type msgrec to a Robot
Application Builder client called " My_RAB_client ".
Error handling
The following recoverable errors can be generated. The errors can be handled in an ERROR
handler. The system variable ERRNO will be set to:
Limitations
It is not possible to set up interrupts, or send or receive data instances of data types that are
of non-value, semi-value types or data type motsetdata .
The maximum size of data that can be sent to a Robot Application Builder client is about 5000
bytes. The maximum size of data that can be received by a RMQ and stored in a rmqmessage
data type is about 3000 bytes. The size of the data that can be received by an RMQ can be
configured (default size 400, max size 3000).
Syntax
RMQSendMessage
[ Slot ‘:=’ ] < variable ( VAR ) of rmqslot > ’,’
[ SendData‘ :=’ ] < reference ( REF ) of anytype >
[ ‘\’ UserDef‘ :=’ < expression ( IN ) of num > ] ‘;‘
ERR_RMQ_MSGSIZE
The size of message is too big. Either the data exceeds the
maximum allowed message size, or the receiving client is not
configured to receive the size of the data that is sent.
ERR_RMQ_FULL
The destination message queue is full
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 disconnected from the controller.
Continued
Continues on next page
1 Instructions
1.142. RMQSendMessage - Send an RMQ data message
FlexPendant Interface, PC Interface, or Multitasking
389
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
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
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
Get the slot name from a specified slot
identity
RMQGetSlotName - Get the name of an
RMQ client on page 964
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
| 391
|
1 Instructions
1.142. RMQSendMessage - Send an RMQ data message
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
388
© Copyright 2004-2010 ABB. All rights reserved.
ERROR
IF ERRNO = ERR_RMQ_INVALID THEN
! Handle destination client lost
WaitTime 1;
! Reconnect to Robot Application Builder client
RMQFindSlot destinationSlot ”My_RAB_client”;
! Avoid execution stop due to retry count exceed
ResetRetryCount;
RETRY;
ELSIF ERRNO = ERR_RMQ_FULL THEN
! Handle destination queue full
WaitTime 1;
! Avoid execution stop due to retry count exceed
ResetRetryCount;
RETRY;
ENDIF
ENDPROC
ENDMODULE
The example shows how to use instruction RMQSendMessage with errorhandling of occuring
run-time errors. The program sends user-defined data of the type msgrec to a Robot
Application Builder client called " My_RAB_client ".
Error handling
The following recoverable errors can be generated. The errors can be handled in an ERROR
handler. The system variable ERRNO will be set to:
Limitations
It is not possible to set up interrupts, or send or receive data instances of data types that are
of non-value, semi-value types or data type motsetdata .
The maximum size of data that can be sent to a Robot Application Builder client is about 5000
bytes. The maximum size of data that can be received by a RMQ and stored in a rmqmessage
data type is about 3000 bytes. The size of the data that can be received by an RMQ can be
configured (default size 400, max size 3000).
Syntax
RMQSendMessage
[ Slot ‘:=’ ] < variable ( VAR ) of rmqslot > ’,’
[ SendData‘ :=’ ] < reference ( REF ) of anytype >
[ ‘\’ UserDef‘ :=’ < expression ( IN ) of num > ] ‘;‘
ERR_RMQ_MSGSIZE
The size of message is too big. Either the data exceeds the
maximum allowed message size, or the receiving client is not
configured to receive the size of the data that is sent.
ERR_RMQ_FULL
The destination message queue is full
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 disconnected from the controller.
Continued
Continues on next page
1 Instructions
1.142. RMQSendMessage - Send an RMQ data message
FlexPendant Interface, PC Interface, or Multitasking
389
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
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
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
Get the slot name from a specified slot
identity
RMQGetSlotName - Get the name of an
RMQ client on page 964
RMQ Slot
rmqslot - Identity number of an RMQ client on
page 1174
Continued
1 Instructions
1.143. RMQSendWait - Send an RMQ data message and wait for a response
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
390
© Copyright 2004-2010 ABB. All rights reserved.
1.143. RMQSendWait - Send an RMQ data message and wait for a response
Usage
With the RMQSendWait ( RAPID Message Queue Send Wait ) instruction it is possible to send
data to an RMQ or to a Robot Application Builder client, and wait for an answer from the
specified client. If using this instruction, the user needs to know what kind of data type will
be sent in the answer from the client.
Basic examples
Basic examples of the instruction RMQSendWait are illustrated below.
See also More examples on page 393 .
Example 1
VAR rmqslot destination_slot;
VAR string sendstr:="This string is from T_ROB1";
VAR rmqmessage receivemsg;
VAR num mynum;
..
RMQFindSlot destination_slot, "RMQ_T_ROB2";
RMQSendWait destination_slot, sendstr, receivemsg, mynum;
RMQGetMsgData receivemsg, mynum;
The example shows how to send the data in the variable sendstr to the RAPID task
" T_ROB2 " with the configured RMQ " RMQ_T_ROB2 ". Now the instruction RMQSendWait
waits for a reply from the task "T_ROB2". The instruction in "T_ROB2" needs to send data
that is stored in a num data type to terminate the waiting instruction RMQSendWait . When the
message has been received, the data is copied to the variable mynum from the variable
receivemsg with the instruction RMQGetMsgData .
Example 2
VAR rmqslot rmqslot1;
VAR string mysendstr;
VAR rmqmessage rmqmessage1;
VAR string receivestr;
VAR num mysendid:=1;
..
mysendstr:="Message from Task1";
RMQFindSlot rmqslot1, "RMQ_Task2";
RMQSendWait rmqslot1, mysendstr \UserDef:=mysendid, rmqmessage1,
receivestr \TimeOut:=20;
RMQGetMsgData rmqmessage1, receivestr;
mysendid:=mysendid + 1;
The example shows how to send the data in the variable mysendstr to the RAPID task
" Task2 " with the configured RMQ "RMQ_Task2" . A user-defined number is also sent. This
number can be used by the receiver as an identifier and must be bounced back to the sender
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 392
|
1 Instructions
1.142. RMQSendMessage - Send an RMQ data message
FlexPendant Interface, PC Interface, or Multitasking
389
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
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
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
Get the slot name from a specified slot
identity
RMQGetSlotName - Get the name of an
RMQ client on page 964
RMQ Slot
rmqslot - Identity number of an RMQ client on
page 1174
Continued
1 Instructions
1.143. RMQSendWait - Send an RMQ data message and wait for a response
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
390
© Copyright 2004-2010 ABB. All rights reserved.
1.143. RMQSendWait - Send an RMQ data message and wait for a response
Usage
With the RMQSendWait ( RAPID Message Queue Send Wait ) instruction it is possible to send
data to an RMQ or to a Robot Application Builder client, and wait for an answer from the
specified client. If using this instruction, the user needs to know what kind of data type will
be sent in the answer from the client.
Basic examples
Basic examples of the instruction RMQSendWait are illustrated below.
See also More examples on page 393 .
Example 1
VAR rmqslot destination_slot;
VAR string sendstr:="This string is from T_ROB1";
VAR rmqmessage receivemsg;
VAR num mynum;
..
RMQFindSlot destination_slot, "RMQ_T_ROB2";
RMQSendWait destination_slot, sendstr, receivemsg, mynum;
RMQGetMsgData receivemsg, mynum;
The example shows how to send the data in the variable sendstr to the RAPID task
" T_ROB2 " with the configured RMQ " RMQ_T_ROB2 ". Now the instruction RMQSendWait
waits for a reply from the task "T_ROB2". The instruction in "T_ROB2" needs to send data
that is stored in a num data type to terminate the waiting instruction RMQSendWait . When the
message has been received, the data is copied to the variable mynum from the variable
receivemsg with the instruction RMQGetMsgData .
Example 2
VAR rmqslot rmqslot1;
VAR string mysendstr;
VAR rmqmessage rmqmessage1;
VAR string receivestr;
VAR num mysendid:=1;
..
mysendstr:="Message from Task1";
RMQFindSlot rmqslot1, "RMQ_Task2";
RMQSendWait rmqslot1, mysendstr \UserDef:=mysendid, rmqmessage1,
receivestr \TimeOut:=20;
RMQGetMsgData rmqmessage1, receivestr;
mysendid:=mysendid + 1;
The example shows how to send the data in the variable mysendstr to the RAPID task
" Task2 " with the configured RMQ "RMQ_Task2" . A user-defined number is also sent. This
number can be used by the receiver as an identifier and must be bounced back to the sender
Continues on next page
1 Instructions
1.143. RMQSendWait - Send an RMQ data message and wait for a response
FlexPendant Interface, PC Interface, or Multitasking
391
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
to terminate the waiting RMQSendWait instruction. Another demand to terminate the waiting
instruction is that the right data type is sent from the client. That data type is specified by the
variable receivestr in the RMQSendWait instruction. After the message has been received,
the actual data is copied to the variable receivestr with the instruction RMQGetMsgData .
Arguments
RMQSendWait Slot SendData [\UserDef] Message ReceiveDataType
[\TimeOut]
Slot
Data type: rmqslot
The identity number of the client that should receive the message.
SendData
Data type: anytype
Reference to a variable, persistent or constant containing the data to be sent to the client with
identity number as in the variable Slot .
[\UserDef ]
User Defined data
Data type: num
Data specifying user-defined information to the receiver of the SendData , that is, the client
with the identity number as in the variable Slot . If using this optional argument, the
RMQSendWait instruction will only terminate if the ReceiveDataType and the specified
UserDef is as specified in the message answer. The value must be an integer between 0 and
32767.
Message
Data type: rmqmessage
The variable in which the received message is placed.
ReceiveDataType
Data type: anytype
A reference to a persistent, variable or constant of the data type that the instruction is waiting
for. The actual data is not copied to this variable when the RMQSendWait is executed. This
argument is only used to specify the actual data type the RMQSendWait instruction is waiting
for.
[\Timeout]
Data type: num
The maximum amount of time [s] that program execution waits for an answer. If this time
runs out before the condition is met, the error handler will be called, if there is one, with the
error code ERR_RMQ_TIMEOUT . If there is no error handler, the execution will be stopped.
If the parameter \Timeout is not used, the waiting time is 60 s. To wait forever, use the
predefined constant WAIT_MAX .
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
| 393
|
1 Instructions
1.143. RMQSendWait - Send an RMQ data message and wait for a response
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
390
© Copyright 2004-2010 ABB. All rights reserved.
1.143. RMQSendWait - Send an RMQ data message and wait for a response
Usage
With the RMQSendWait ( RAPID Message Queue Send Wait ) instruction it is possible to send
data to an RMQ or to a Robot Application Builder client, and wait for an answer from the
specified client. If using this instruction, the user needs to know what kind of data type will
be sent in the answer from the client.
Basic examples
Basic examples of the instruction RMQSendWait are illustrated below.
See also More examples on page 393 .
Example 1
VAR rmqslot destination_slot;
VAR string sendstr:="This string is from T_ROB1";
VAR rmqmessage receivemsg;
VAR num mynum;
..
RMQFindSlot destination_slot, "RMQ_T_ROB2";
RMQSendWait destination_slot, sendstr, receivemsg, mynum;
RMQGetMsgData receivemsg, mynum;
The example shows how to send the data in the variable sendstr to the RAPID task
" T_ROB2 " with the configured RMQ " RMQ_T_ROB2 ". Now the instruction RMQSendWait
waits for a reply from the task "T_ROB2". The instruction in "T_ROB2" needs to send data
that is stored in a num data type to terminate the waiting instruction RMQSendWait . When the
message has been received, the data is copied to the variable mynum from the variable
receivemsg with the instruction RMQGetMsgData .
Example 2
VAR rmqslot rmqslot1;
VAR string mysendstr;
VAR rmqmessage rmqmessage1;
VAR string receivestr;
VAR num mysendid:=1;
..
mysendstr:="Message from Task1";
RMQFindSlot rmqslot1, "RMQ_Task2";
RMQSendWait rmqslot1, mysendstr \UserDef:=mysendid, rmqmessage1,
receivestr \TimeOut:=20;
RMQGetMsgData rmqmessage1, receivestr;
mysendid:=mysendid + 1;
The example shows how to send the data in the variable mysendstr to the RAPID task
" Task2 " with the configured RMQ "RMQ_Task2" . A user-defined number is also sent. This
number can be used by the receiver as an identifier and must be bounced back to the sender
Continues on next page
1 Instructions
1.143. RMQSendWait - Send an RMQ data message and wait for a response
FlexPendant Interface, PC Interface, or Multitasking
391
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
to terminate the waiting RMQSendWait instruction. Another demand to terminate the waiting
instruction is that the right data type is sent from the client. That data type is specified by the
variable receivestr in the RMQSendWait instruction. After the message has been received,
the actual data is copied to the variable receivestr with the instruction RMQGetMsgData .
Arguments
RMQSendWait Slot SendData [\UserDef] Message ReceiveDataType
[\TimeOut]
Slot
Data type: rmqslot
The identity number of the client that should receive the message.
SendData
Data type: anytype
Reference to a variable, persistent or constant containing the data to be sent to the client with
identity number as in the variable Slot .
[\UserDef ]
User Defined data
Data type: num
Data specifying user-defined information to the receiver of the SendData , that is, the client
with the identity number as in the variable Slot . If using this optional argument, the
RMQSendWait instruction will only terminate if the ReceiveDataType and the specified
UserDef is as specified in the message answer. The value must be an integer between 0 and
32767.
Message
Data type: rmqmessage
The variable in which the received message is placed.
ReceiveDataType
Data type: anytype
A reference to a persistent, variable or constant of the data type that the instruction is waiting
for. The actual data is not copied to this variable when the RMQSendWait is executed. This
argument is only used to specify the actual data type the RMQSendWait instruction is waiting
for.
[\Timeout]
Data type: num
The maximum amount of time [s] that program execution waits for an answer. If this time
runs out before the condition is met, the error handler will be called, if there is one, with the
error code ERR_RMQ_TIMEOUT . If there is no error handler, the execution will be stopped.
If the parameter \Timeout is not used, the waiting time is 60 s. To wait forever, use the
predefined constant WAIT_MAX .
Continued
Continues on next page
1 Instructions
1.143. RMQSendWait - Send an RMQ data message and wait for a response
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
392
© Copyright 2004-2010 ABB. All rights reserved.
Program execution
The instruction RMQSendWait sends data and waits for an answer from the client with the
specified slot identity. The answer must be an rmqmessage from the client that got the
message and the answer must be of the same data type that is specified in the argument
ReceiveDataType . The message will be sent in the same way as when using
RMQSendMessage , i.e.the receiver will get a normal RAPID Message Queue message. It is
the responsibility of the sender that the receiver knows that a reply is needed. If the optional
argument UserDef is used in the RMQSendWait , the demand is that the receiving client uses
the same UserDef in the answer.
If the receiving client is not interested in receiving messages, that is, has not set up any
interrupt to occur for the data type specified in the RMQSendWait instruction, the message
will be discarded, and a warning will be generated. The instruction returns an error after the
time used in the argument TimeOut , or the default time-out time 60 s. This error can be dealt
with in an error handler.
The RMQSendWait instruction has the highest priority if a message is received and it fits the
description for both the expected answer and a message connected to a TRAP routine (see
instruction IRMQMessage ).
If a power failure occurs when waiting for an answer from the client, the variable used in the
argument Slot is set to 0 and the instruction is executed again. The instruction will then fail
due to an invalid slot identity and the error handler will be called, if there is one, with the error
code ERR_RMQ_INVALID . The slot identity can be reinitialized there.
Not all data types can be sent with the instruction (see limitations).
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
| 394
|
1 Instructions
1.143. RMQSendWait - Send an RMQ data message and wait for a response
FlexPendant Interface, PC Interface, or Multitasking
391
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
to terminate the waiting RMQSendWait instruction. Another demand to terminate the waiting
instruction is that the right data type is sent from the client. That data type is specified by the
variable receivestr in the RMQSendWait instruction. After the message has been received,
the actual data is copied to the variable receivestr with the instruction RMQGetMsgData .
Arguments
RMQSendWait Slot SendData [\UserDef] Message ReceiveDataType
[\TimeOut]
Slot
Data type: rmqslot
The identity number of the client that should receive the message.
SendData
Data type: anytype
Reference to a variable, persistent or constant containing the data to be sent to the client with
identity number as in the variable Slot .
[\UserDef ]
User Defined data
Data type: num
Data specifying user-defined information to the receiver of the SendData , that is, the client
with the identity number as in the variable Slot . If using this optional argument, the
RMQSendWait instruction will only terminate if the ReceiveDataType and the specified
UserDef is as specified in the message answer. The value must be an integer between 0 and
32767.
Message
Data type: rmqmessage
The variable in which the received message is placed.
ReceiveDataType
Data type: anytype
A reference to a persistent, variable or constant of the data type that the instruction is waiting
for. The actual data is not copied to this variable when the RMQSendWait is executed. This
argument is only used to specify the actual data type the RMQSendWait instruction is waiting
for.
[\Timeout]
Data type: num
The maximum amount of time [s] that program execution waits for an answer. If this time
runs out before the condition is met, the error handler will be called, if there is one, with the
error code ERR_RMQ_TIMEOUT . If there is no error handler, the execution will be stopped.
If the parameter \Timeout is not used, the waiting time is 60 s. To wait forever, use the
predefined constant WAIT_MAX .
Continued
Continues on next page
1 Instructions
1.143. RMQSendWait - Send an RMQ data message and wait for a response
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
392
© Copyright 2004-2010 ABB. All rights reserved.
Program execution
The instruction RMQSendWait sends data and waits for an answer from the client with the
specified slot identity. The answer must be an rmqmessage from the client that got the
message and the answer must be of the same data type that is specified in the argument
ReceiveDataType . The message will be sent in the same way as when using
RMQSendMessage , i.e.the receiver will get a normal RAPID Message Queue message. It is
the responsibility of the sender that the receiver knows that a reply is needed. If the optional
argument UserDef is used in the RMQSendWait , the demand is that the receiving client uses
the same UserDef in the answer.
If the receiving client is not interested in receiving messages, that is, has not set up any
interrupt to occur for the data type specified in the RMQSendWait instruction, the message
will be discarded, and a warning will be generated. The instruction returns an error after the
time used in the argument TimeOut , or the default time-out time 60 s. This error can be dealt
with in an error handler.
The RMQSendWait instruction has the highest priority if a message is received and it fits the
description for both the expected answer and a message connected to a TRAP routine (see
instruction IRMQMessage ).
If a power failure occurs when waiting for an answer from the client, the variable used in the
argument Slot is set to 0 and the instruction is executed again. The instruction will then fail
due to an invalid slot identity and the error handler will be called, if there is one, with the error
code ERR_RMQ_INVALID . The slot identity can be reinitialized there.
Not all data types can be sent with the instruction (see limitations).
Continued
Continues on next page
1 Instructions
1.143. RMQSendWait - Send an RMQ data message and wait for a response
FlexPendant Interface, PC Interface, or Multitasking
393
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of how to use the instruction RMQSendWait are illustrated below.
Example 1
MODULE RMQ_Task1_mod
PROC main()
VAR rmqslot destination_slot;
VAR string mysendstr:="String sent from RMQ_Task1_mod";
VAR string myrecstr;
VAR rmqmessage recmsg;
VAR rmqheader header;
!Get slot identity to client called RMQ_Task2
RMQFindSlot destination_slot, "RMQ_Task2";
WHILE TRUE DO
! Do something
...
!Send data in mysendstr, wait for an answer of type string
RMQSendWait destination_slot, mysendstr, recmsg, myrecstr;
!Get information about the received message
RMQGetMsgHeader recmsg \Header:=header;
IF header.datatype = "string" AND header.ndim = 0 THEN
! Copy the data in recmsg
RMQGetMsgData recmsg, myrecstr;
TPWrite "Received string: " + myrecstr;
ELSE
TPWrite "Not a string that was received";
ENDIF
ENDWHILE
ENDPROC
ENDMODULE
The data in the variable mysendstr is sent to the RAPID task " Task2 " with the configured
RAPID Message Queue " RMQ_Task2 " with the instruction RMQSendWait . The answer from
the RAPID task " Task2 " should be a string (specified of the data type of the variable
myrecstr ). The RMQ message received as an answer is received in the variable recmsg .
The use of the variable myrecstr in the call to RMQSendWait is just specification of the data
type the sender is expecting as an answer. No valid data is placed in the variable in the
RMQSendWait call.
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
| 395
|
1 Instructions
1.143. RMQSendWait - Send an RMQ data message and wait for a response
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
392
© Copyright 2004-2010 ABB. All rights reserved.
Program execution
The instruction RMQSendWait sends data and waits for an answer from the client with the
specified slot identity. The answer must be an rmqmessage from the client that got the
message and the answer must be of the same data type that is specified in the argument
ReceiveDataType . The message will be sent in the same way as when using
RMQSendMessage , i.e.the receiver will get a normal RAPID Message Queue message. It is
the responsibility of the sender that the receiver knows that a reply is needed. If the optional
argument UserDef is used in the RMQSendWait , the demand is that the receiving client uses
the same UserDef in the answer.
If the receiving client is not interested in receiving messages, that is, has not set up any
interrupt to occur for the data type specified in the RMQSendWait instruction, the message
will be discarded, and a warning will be generated. The instruction returns an error after the
time used in the argument TimeOut , or the default time-out time 60 s. This error can be dealt
with in an error handler.
The RMQSendWait instruction has the highest priority if a message is received and it fits the
description for both the expected answer and a message connected to a TRAP routine (see
instruction IRMQMessage ).
If a power failure occurs when waiting for an answer from the client, the variable used in the
argument Slot is set to 0 and the instruction is executed again. The instruction will then fail
due to an invalid slot identity and the error handler will be called, if there is one, with the error
code ERR_RMQ_INVALID . The slot identity can be reinitialized there.
Not all data types can be sent with the instruction (see limitations).
Continued
Continues on next page
1 Instructions
1.143. RMQSendWait - Send an RMQ data message and wait for a response
FlexPendant Interface, PC Interface, or Multitasking
393
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of how to use the instruction RMQSendWait are illustrated below.
Example 1
MODULE RMQ_Task1_mod
PROC main()
VAR rmqslot destination_slot;
VAR string mysendstr:="String sent from RMQ_Task1_mod";
VAR string myrecstr;
VAR rmqmessage recmsg;
VAR rmqheader header;
!Get slot identity to client called RMQ_Task2
RMQFindSlot destination_slot, "RMQ_Task2";
WHILE TRUE DO
! Do something
...
!Send data in mysendstr, wait for an answer of type string
RMQSendWait destination_slot, mysendstr, recmsg, myrecstr;
!Get information about the received message
RMQGetMsgHeader recmsg \Header:=header;
IF header.datatype = "string" AND header.ndim = 0 THEN
! Copy the data in recmsg
RMQGetMsgData recmsg, myrecstr;
TPWrite "Received string: " + myrecstr;
ELSE
TPWrite "Not a string that was received";
ENDIF
ENDWHILE
ENDPROC
ENDMODULE
The data in the variable mysendstr is sent to the RAPID task " Task2 " with the configured
RAPID Message Queue " RMQ_Task2 " with the instruction RMQSendWait . The answer from
the RAPID task " Task2 " should be a string (specified of the data type of the variable
myrecstr ). The RMQ message received as an answer is received in the variable recmsg .
The use of the variable myrecstr in the call to RMQSendWait is just specification of the data
type the sender is expecting as an answer. No valid data is placed in the variable in the
RMQSendWait call.
Continued
Continues on next page
1 Instructions
1.143. RMQSendWait - Send an RMQ data message and wait for a response
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
394
© Copyright 2004-2010 ABB. All rights reserved.
Error handling
The following recoverable errors can be generated. The errors can be handled in an ERROR
handler. The system variable ERRNO will be set to:
Limitations
It is not allowed to execute RMQSendWait in synchronous mode. That will cause a fatal
runtime error.
It is not possible to set up interrupts, or send or receive data instances of data types that are
of non-value, semi-value types or data type motsetdata .
The maximum size of data that can be sent to a Robot Application Builder client is about 5000
bytes. The maximum size of data that can be received by an RMQ and stored in an
rmqmessage data type is about 3000 bytes. The size of the data that can be received by an
RMQ can be configured (default size 400, max size 3000).
Syntax
RMQSendWait
[ Slot ‘:=’ ] < variable ( VAR ) of rmqslot > ’,’
[ SendData‘ :=’ ] < reference ( REF ) of anytype >
[ ‘\’ UserDef‘ :=’ < expression ( IN ) of num > ] ’,’
[ Message‘ :=’ ] < variable ( VAR ) of rmqmessage > ’,’
[ ReceiveDataType‘ :=’ ] < reference ( REF ) of anytype > ’,’
[ ‘\’ Timeout‘ :=’ < expression ( IN ) of num > ] ‘;‘
Related information
ERR_RMQ_MSGSIZE
The size of message is too big. Either the data exceeds the
maximum allowed message size, or the receiving client is not
configured to receive the size of the data that is sent.
ERR_RMQ_FULL
The destination message queue is full.
ERR_RMQ_INVALID
The rmqslot has not been initialized, or the destination slot is
no longer available. This can happen if the destination slot is a
remote client and the remote client has disconnected from the
controller. RMQSendWait was interrupted by a power failure,
and at restart the rmqslot is set to 0.
ERR_RMQ_TIMEOUT
No answer has been received within the time-out time.
ERR_RMQ_INVMSG
This error will be thrown if the message is invalid. This may for
instance happen if a PC application sends a corrupt message.
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
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
| 396
|
1 Instructions
1.143. RMQSendWait - Send an RMQ data message and wait for a response
FlexPendant Interface, PC Interface, or Multitasking
393
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of how to use the instruction RMQSendWait are illustrated below.
Example 1
MODULE RMQ_Task1_mod
PROC main()
VAR rmqslot destination_slot;
VAR string mysendstr:="String sent from RMQ_Task1_mod";
VAR string myrecstr;
VAR rmqmessage recmsg;
VAR rmqheader header;
!Get slot identity to client called RMQ_Task2
RMQFindSlot destination_slot, "RMQ_Task2";
WHILE TRUE DO
! Do something
...
!Send data in mysendstr, wait for an answer of type string
RMQSendWait destination_slot, mysendstr, recmsg, myrecstr;
!Get information about the received message
RMQGetMsgHeader recmsg \Header:=header;
IF header.datatype = "string" AND header.ndim = 0 THEN
! Copy the data in recmsg
RMQGetMsgData recmsg, myrecstr;
TPWrite "Received string: " + myrecstr;
ELSE
TPWrite "Not a string that was received";
ENDIF
ENDWHILE
ENDPROC
ENDMODULE
The data in the variable mysendstr is sent to the RAPID task " Task2 " with the configured
RAPID Message Queue " RMQ_Task2 " with the instruction RMQSendWait . The answer from
the RAPID task " Task2 " should be a string (specified of the data type of the variable
myrecstr ). The RMQ message received as an answer is received in the variable recmsg .
The use of the variable myrecstr in the call to RMQSendWait is just specification of the data
type the sender is expecting as an answer. No valid data is placed in the variable in the
RMQSendWait call.
Continued
Continues on next page
1 Instructions
1.143. RMQSendWait - Send an RMQ data message and wait for a response
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
394
© Copyright 2004-2010 ABB. All rights reserved.
Error handling
The following recoverable errors can be generated. The errors can be handled in an ERROR
handler. The system variable ERRNO will be set to:
Limitations
It is not allowed to execute RMQSendWait in synchronous mode. That will cause a fatal
runtime error.
It is not possible to set up interrupts, or send or receive data instances of data types that are
of non-value, semi-value types or data type motsetdata .
The maximum size of data that can be sent to a Robot Application Builder client is about 5000
bytes. The maximum size of data that can be received by an RMQ and stored in an
rmqmessage data type is about 3000 bytes. The size of the data that can be received by an
RMQ can be configured (default size 400, max size 3000).
Syntax
RMQSendWait
[ Slot ‘:=’ ] < variable ( VAR ) of rmqslot > ’,’
[ SendData‘ :=’ ] < reference ( REF ) of anytype >
[ ‘\’ UserDef‘ :=’ < expression ( IN ) of num > ] ’,’
[ Message‘ :=’ ] < variable ( VAR ) of rmqmessage > ’,’
[ ReceiveDataType‘ :=’ ] < reference ( REF ) of anytype > ’,’
[ ‘\’ Timeout‘ :=’ < expression ( IN ) of num > ] ‘;‘
Related information
ERR_RMQ_MSGSIZE
The size of message is too big. Either the data exceeds the
maximum allowed message size, or the receiving client is not
configured to receive the size of the data that is sent.
ERR_RMQ_FULL
The destination message queue is full.
ERR_RMQ_INVALID
The rmqslot has not been initialized, or the destination slot is
no longer available. This can happen if the destination slot is a
remote client and the remote client has disconnected from the
controller. RMQSendWait was interrupted by a power failure,
and at restart the rmqslot is set to 0.
ERR_RMQ_TIMEOUT
No answer has been received within the time-out time.
ERR_RMQ_INVMSG
This error will be thrown if the message is invalid. This may for
instance happen if a PC application sends a corrupt message.
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
Continued
Continues on next page
1 Instructions
1.143. RMQSendWait - Send an RMQ data message and wait for a response
FlexPendant Interface, PC Interface, or Multitasking
395
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
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
Get the slot name from a specified slot
identity
RMQGetSlotName - Get the name of an
RMQ client on page 964
RMQ Slot
rmqslot - Identity number of an RMQ client on
page 1174
RMQ Message
rmqmessage - RAPID Message Queue
message on page 1173
For information about
See
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 397
|
1 Instructions
1.143. RMQSendWait - Send an RMQ data message and wait for a response
FlexPendant Interface, PC Interface, or Multitasking
3HAC 16581-1 Revision: J
394
© Copyright 2004-2010 ABB. All rights reserved.
Error handling
The following recoverable errors can be generated. The errors can be handled in an ERROR
handler. The system variable ERRNO will be set to:
Limitations
It is not allowed to execute RMQSendWait in synchronous mode. That will cause a fatal
runtime error.
It is not possible to set up interrupts, or send or receive data instances of data types that are
of non-value, semi-value types or data type motsetdata .
The maximum size of data that can be sent to a Robot Application Builder client is about 5000
bytes. The maximum size of data that can be received by an RMQ and stored in an
rmqmessage data type is about 3000 bytes. The size of the data that can be received by an
RMQ can be configured (default size 400, max size 3000).
Syntax
RMQSendWait
[ Slot ‘:=’ ] < variable ( VAR ) of rmqslot > ’,’
[ SendData‘ :=’ ] < reference ( REF ) of anytype >
[ ‘\’ UserDef‘ :=’ < expression ( IN ) of num > ] ’,’
[ Message‘ :=’ ] < variable ( VAR ) of rmqmessage > ’,’
[ ReceiveDataType‘ :=’ ] < reference ( REF ) of anytype > ’,’
[ ‘\’ Timeout‘ :=’ < expression ( IN ) of num > ] ‘;‘
Related information
ERR_RMQ_MSGSIZE
The size of message is too big. Either the data exceeds the
maximum allowed message size, or the receiving client is not
configured to receive the size of the data that is sent.
ERR_RMQ_FULL
The destination message queue is full.
ERR_RMQ_INVALID
The rmqslot has not been initialized, or the destination slot is
no longer available. This can happen if the destination slot is a
remote client and the remote client has disconnected from the
controller. RMQSendWait was interrupted by a power failure,
and at restart the rmqslot is set to 0.
ERR_RMQ_TIMEOUT
No answer has been received within the time-out time.
ERR_RMQ_INVMSG
This error will be thrown if the message is invalid. This may for
instance happen if a PC application sends a corrupt message.
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
Continued
Continues on next page
1 Instructions
1.143. RMQSendWait - Send an RMQ data message and wait for a response
FlexPendant Interface, PC Interface, or Multitasking
395
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
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
Get the slot name from a specified slot
identity
RMQGetSlotName - Get the name of an
RMQ client on page 964
RMQ Slot
rmqslot - Identity number of an RMQ client on
page 1174
RMQ Message
rmqmessage - RAPID Message Queue
message on page 1173
For information about
See
Continued
1 Instructions
1.144. Save - Save a program module
RobotWare - OS
3HAC 16581-1 Revision: J
396
© Copyright 2004-2010 ABB. All rights reserved.
1.144. Save - Save a program module
Usage
Save is used to save a program module.
The specified program module in the program memory will be saved with the original
(specified in Load or StartLoad ) or specified file path.
It is also possible to save a system module at the specified file path.
Basic examples
Basic examples of the instruction Save are illustrated below.
See also More examples on page 397 .
Example 1
Load "HOME:/PART_B.MOD";
...
Save "PART_B";
Load the program module with the file name PART_B.MOD from HOME: into the program
memory.
Save the program module PART_B with the original file path HOME: and with the original file
name PART_B.MOD .
Arguments
Save [\TaskRef]|[\TaskName] ModuleName [\FilePath] [\File]
[\TaskRef]
Task Reference
Data type: taskid
The program task identity in which the program module should be saved.
For all program tasks in the system the predefined variables of the data type taskid will be
available. The variable identity will be "taskname"+"Id", e.g. for the T_ROB1 task the variable
identity will be T_ROB1Id .
[\TaskName]
Data type: string
The program task name in which the program module should be saved.
If none of the arguments \TaskRef or \TaskName is specified then the specified program
module in the current (executing) program task will be saved.
ModuleName
Data type: string
The program module to save.
[\FilePath]
Data type: string
The file path and the file name to the place where the program module is to be saved. The file
name shall be excluded when the argument \File is used.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 398
|
1 Instructions
1.143. RMQSendWait - Send an RMQ data message and wait for a response
FlexPendant Interface, PC Interface, or Multitasking
395
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
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
Get the slot name from a specified slot
identity
RMQGetSlotName - Get the name of an
RMQ client on page 964
RMQ Slot
rmqslot - Identity number of an RMQ client on
page 1174
RMQ Message
rmqmessage - RAPID Message Queue
message on page 1173
For information about
See
Continued
1 Instructions
1.144. Save - Save a program module
RobotWare - OS
3HAC 16581-1 Revision: J
396
© Copyright 2004-2010 ABB. All rights reserved.
1.144. Save - Save a program module
Usage
Save is used to save a program module.
The specified program module in the program memory will be saved with the original
(specified in Load or StartLoad ) or specified file path.
It is also possible to save a system module at the specified file path.
Basic examples
Basic examples of the instruction Save are illustrated below.
See also More examples on page 397 .
Example 1
Load "HOME:/PART_B.MOD";
...
Save "PART_B";
Load the program module with the file name PART_B.MOD from HOME: into the program
memory.
Save the program module PART_B with the original file path HOME: and with the original file
name PART_B.MOD .
Arguments
Save [\TaskRef]|[\TaskName] ModuleName [\FilePath] [\File]
[\TaskRef]
Task Reference
Data type: taskid
The program task identity in which the program module should be saved.
For all program tasks in the system the predefined variables of the data type taskid will be
available. The variable identity will be "taskname"+"Id", e.g. for the T_ROB1 task the variable
identity will be T_ROB1Id .
[\TaskName]
Data type: string
The program task name in which the program module should be saved.
If none of the arguments \TaskRef or \TaskName is specified then the specified program
module in the current (executing) program task will be saved.
ModuleName
Data type: string
The program module to save.
[\FilePath]
Data type: string
The file path and the file name to the place where the program module is to be saved. The file
name shall be excluded when the argument \File is used.
Continues on next page
1 Instructions
1.144. Save - Save a program module
RobotWare - OS
397
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
[\File]
Data type: string
When the file name is excluded in the argument \FilePath it must be specified with this
argument.
The argument \FilePath \File can only be omitted for program modules loaded with
Load or StartLoad-WaitLoad and the program module will be stored at the same
destination as specified in these instructions. To store the program module at another
destination it is also possible to use the argument \ FilePath \File .
The argument \FilePath \File must be used to be able to save a program module that
previously was loaded from the FlexPendant, external computer, or system configuration.
Program execution
Program execution waits for the program module to finish saving before proceeding with the
next instruction.
More examples
More examples of how to use the instruction Save are illustrated below.
Example 1
Save "PART_A" \FilePath:="HOME:/DOORDIR/PART_A.MOD";
Save the program module PART_A to HOME: in the file PART_A.MOD and in the directory
DOORDIR .
Example 2
Save "PART_A" \FilePath:="HOME:" \File:="DOORDIR/PART_A.MOD";
Same as in the above example 1 but another syntax.
Example 3
Save \TaskRef:=TSK1Id, "PART_A" \FilePath:="HOME:/DOORDIR/
PART_A.MOD";
Save program module PART_A in program task TSK1 to the specified destination. This is an
example where the instruction Save is executing in one program task and the saving is done
in another program task.
Example 4
Save \TaskName:="TSK1", "PART_A" \FilePath:="HOME:/DOORDIR/
PART_A.MOD";
Save program module PART_A in program task TSK1 to the specified destination. This is
another example of where the instruction Save is executing in one program task and the
saving is done in another program task.
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
| 399
|
1 Instructions
1.144. Save - Save a program module
RobotWare - OS
3HAC 16581-1 Revision: J
396
© Copyright 2004-2010 ABB. All rights reserved.
1.144. Save - Save a program module
Usage
Save is used to save a program module.
The specified program module in the program memory will be saved with the original
(specified in Load or StartLoad ) or specified file path.
It is also possible to save a system module at the specified file path.
Basic examples
Basic examples of the instruction Save are illustrated below.
See also More examples on page 397 .
Example 1
Load "HOME:/PART_B.MOD";
...
Save "PART_B";
Load the program module with the file name PART_B.MOD from HOME: into the program
memory.
Save the program module PART_B with the original file path HOME: and with the original file
name PART_B.MOD .
Arguments
Save [\TaskRef]|[\TaskName] ModuleName [\FilePath] [\File]
[\TaskRef]
Task Reference
Data type: taskid
The program task identity in which the program module should be saved.
For all program tasks in the system the predefined variables of the data type taskid will be
available. The variable identity will be "taskname"+"Id", e.g. for the T_ROB1 task the variable
identity will be T_ROB1Id .
[\TaskName]
Data type: string
The program task name in which the program module should be saved.
If none of the arguments \TaskRef or \TaskName is specified then the specified program
module in the current (executing) program task will be saved.
ModuleName
Data type: string
The program module to save.
[\FilePath]
Data type: string
The file path and the file name to the place where the program module is to be saved. The file
name shall be excluded when the argument \File is used.
Continues on next page
1 Instructions
1.144. Save - Save a program module
RobotWare - OS
397
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
[\File]
Data type: string
When the file name is excluded in the argument \FilePath it must be specified with this
argument.
The argument \FilePath \File can only be omitted for program modules loaded with
Load or StartLoad-WaitLoad and the program module will be stored at the same
destination as specified in these instructions. To store the program module at another
destination it is also possible to use the argument \ FilePath \File .
The argument \FilePath \File must be used to be able to save a program module that
previously was loaded from the FlexPendant, external computer, or system configuration.
Program execution
Program execution waits for the program module to finish saving before proceeding with the
next instruction.
More examples
More examples of how to use the instruction Save are illustrated below.
Example 1
Save "PART_A" \FilePath:="HOME:/DOORDIR/PART_A.MOD";
Save the program module PART_A to HOME: in the file PART_A.MOD and in the directory
DOORDIR .
Example 2
Save "PART_A" \FilePath:="HOME:" \File:="DOORDIR/PART_A.MOD";
Same as in the above example 1 but another syntax.
Example 3
Save \TaskRef:=TSK1Id, "PART_A" \FilePath:="HOME:/DOORDIR/
PART_A.MOD";
Save program module PART_A in program task TSK1 to the specified destination. This is an
example where the instruction Save is executing in one program task and the saving is done
in another program task.
Example 4
Save \TaskName:="TSK1", "PART_A" \FilePath:="HOME:/DOORDIR/
PART_A.MOD";
Save program module PART_A in program task TSK1 to the specified destination. This is
another example of where the instruction Save is executing in one program task and the
saving is done in another program task.
Continued
Continues on next page
1 Instructions
1.144. Save - Save a program module
RobotWare - OS
3HAC 16581-1 Revision: J
398
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
TRAP routines, system I/O events, and other program tasks cannot execute during the saving
operation. Therefore, any such operations will be delayed.
The save operation can interrupt update of PERS data done step by step from other program
tasks. This will result in inconsistent whole PERS data.
A program stop during execution of the Save instruction can result in a guard stop with
motors off. The error message "20025 Stop order timeout" will be displayed on the
FlexPendant.
Avoid ongoing robot movements during the saving.
Error handling
If the program task name in argument \TaskName cannot be found in the system, the system
variable ERRNO is set to ERR_TASKNAME.
If the program module cannot be saved because there is no module name, unknown, or
ambiguous module name then the system variable ERRNO is set to ERR_MODULE.
If the save file cannot be opened because of denied permission, no such directory, or no space
left on device then the system variable ERRNO is set to ERR_IOERROR.
If argument \FilePath is not specified for program modules loaded from the FlexPendant,
System Parameters, or an external computer then the system variable ERRNO is set to
ERR_PATH.
The errors above can be handled in the error handler.
Syntax
Save
[[ ’\’ TaskRef ’:=’ <variable ( VAR ) of taskid>]
|[ ’\’ TaskName’ :=’ <expression ( IN ) of string>] ’,’]
[ ModuleName’ :=’ ] <expression ( IN ) of string>
[ ’\’ FilePath’ :=’<expression ( IN ) of string> ]
[ ’\’ File’ :=’ <expression ( IN ) of string>] ’;’
Related information
For information about
See
Program tasks
taskid - Task identification on page 1203
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 400
|
1 Instructions
1.144. Save - Save a program module
RobotWare - OS
397
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
[\File]
Data type: string
When the file name is excluded in the argument \FilePath it must be specified with this
argument.
The argument \FilePath \File can only be omitted for program modules loaded with
Load or StartLoad-WaitLoad and the program module will be stored at the same
destination as specified in these instructions. To store the program module at another
destination it is also possible to use the argument \ FilePath \File .
The argument \FilePath \File must be used to be able to save a program module that
previously was loaded from the FlexPendant, external computer, or system configuration.
Program execution
Program execution waits for the program module to finish saving before proceeding with the
next instruction.
More examples
More examples of how to use the instruction Save are illustrated below.
Example 1
Save "PART_A" \FilePath:="HOME:/DOORDIR/PART_A.MOD";
Save the program module PART_A to HOME: in the file PART_A.MOD and in the directory
DOORDIR .
Example 2
Save "PART_A" \FilePath:="HOME:" \File:="DOORDIR/PART_A.MOD";
Same as in the above example 1 but another syntax.
Example 3
Save \TaskRef:=TSK1Id, "PART_A" \FilePath:="HOME:/DOORDIR/
PART_A.MOD";
Save program module PART_A in program task TSK1 to the specified destination. This is an
example where the instruction Save is executing in one program task and the saving is done
in another program task.
Example 4
Save \TaskName:="TSK1", "PART_A" \FilePath:="HOME:/DOORDIR/
PART_A.MOD";
Save program module PART_A in program task TSK1 to the specified destination. This is
another example of where the instruction Save is executing in one program task and the
saving is done in another program task.
Continued
Continues on next page
1 Instructions
1.144. Save - Save a program module
RobotWare - OS
3HAC 16581-1 Revision: J
398
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
TRAP routines, system I/O events, and other program tasks cannot execute during the saving
operation. Therefore, any such operations will be delayed.
The save operation can interrupt update of PERS data done step by step from other program
tasks. This will result in inconsistent whole PERS data.
A program stop during execution of the Save instruction can result in a guard stop with
motors off. The error message "20025 Stop order timeout" will be displayed on the
FlexPendant.
Avoid ongoing robot movements during the saving.
Error handling
If the program task name in argument \TaskName cannot be found in the system, the system
variable ERRNO is set to ERR_TASKNAME.
If the program module cannot be saved because there is no module name, unknown, or
ambiguous module name then the system variable ERRNO is set to ERR_MODULE.
If the save file cannot be opened because of denied permission, no such directory, or no space
left on device then the system variable ERRNO is set to ERR_IOERROR.
If argument \FilePath is not specified for program modules loaded from the FlexPendant,
System Parameters, or an external computer then the system variable ERRNO is set to
ERR_PATH.
The errors above can be handled in the error handler.
Syntax
Save
[[ ’\’ TaskRef ’:=’ <variable ( VAR ) of taskid>]
|[ ’\’ TaskName’ :=’ <expression ( IN ) of string>] ’,’]
[ ModuleName’ :=’ ] <expression ( IN ) of string>
[ ’\’ FilePath’ :=’<expression ( IN ) of string> ]
[ ’\’ File’ :=’ <expression ( IN ) of string>] ’;’
Related information
For information about
See
Program tasks
taskid - Task identification on page 1203
Continued
1 Instructions
1.145. SCWrite - Send variable data to a client application
PC interface/backup
399
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.145. SCWrite - Send variable data to a client application
Usage
SCWrite ( Superior Computer Write ) is used to send the name, type, dimension, and value of
a persistent variable to a client application. It is possible to send both single variables and
arrays of variables.
Basic examples
Basic examples of the instruction instruction name are illustrated below.
Example 1
PERS num cycle_done;
PERS num numarr{2}:=[1,2];
SCWrite cycle_done;
The name, type, and value of the persistent variable cycle_done is sent to all client
applications.
Example 2
SCWrite \ToNode := "138.221.228.4", cycle_done;
The name, type, and value of the persistent variable cycle_done is sent to all client
applications. The argument \ToNode will be ignored.
Example 3
SCWrite numarr;
The name, type, dim, and value of the persistent variable numarr is sent to all client
applications.
Example 4
SCWrite \ToNode := "138.221.228.4", numarr;
The name, type, dim, and value of the persistent variable numarr is sent to all client
applications. The argument \ToNode will be ignored.
Arguments
SCWrite [ \ToNode ] Variable
[\ToNode]
Data type: datatype
The argument will be ignored.
Variable
Data type: anytype
The name of a persistent variable.
Program execution
The name, type, dim, and value of the persistent variable is sent to all client applications.
‘dim’ is the dimension of the variable and is only sent if the variable is an array.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 401
|
1 Instructions
1.144. Save - Save a program module
RobotWare - OS
3HAC 16581-1 Revision: J
398
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
TRAP routines, system I/O events, and other program tasks cannot execute during the saving
operation. Therefore, any such operations will be delayed.
The save operation can interrupt update of PERS data done step by step from other program
tasks. This will result in inconsistent whole PERS data.
A program stop during execution of the Save instruction can result in a guard stop with
motors off. The error message "20025 Stop order timeout" will be displayed on the
FlexPendant.
Avoid ongoing robot movements during the saving.
Error handling
If the program task name in argument \TaskName cannot be found in the system, the system
variable ERRNO is set to ERR_TASKNAME.
If the program module cannot be saved because there is no module name, unknown, or
ambiguous module name then the system variable ERRNO is set to ERR_MODULE.
If the save file cannot be opened because of denied permission, no such directory, or no space
left on device then the system variable ERRNO is set to ERR_IOERROR.
If argument \FilePath is not specified for program modules loaded from the FlexPendant,
System Parameters, or an external computer then the system variable ERRNO is set to
ERR_PATH.
The errors above can be handled in the error handler.
Syntax
Save
[[ ’\’ TaskRef ’:=’ <variable ( VAR ) of taskid>]
|[ ’\’ TaskName’ :=’ <expression ( IN ) of string>] ’,’]
[ ModuleName’ :=’ ] <expression ( IN ) of string>
[ ’\’ FilePath’ :=’<expression ( IN ) of string> ]
[ ’\’ File’ :=’ <expression ( IN ) of string>] ’;’
Related information
For information about
See
Program tasks
taskid - Task identification on page 1203
Continued
1 Instructions
1.145. SCWrite - Send variable data to a client application
PC interface/backup
399
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.145. SCWrite - Send variable data to a client application
Usage
SCWrite ( Superior Computer Write ) is used to send the name, type, dimension, and value of
a persistent variable to a client application. It is possible to send both single variables and
arrays of variables.
Basic examples
Basic examples of the instruction instruction name are illustrated below.
Example 1
PERS num cycle_done;
PERS num numarr{2}:=[1,2];
SCWrite cycle_done;
The name, type, and value of the persistent variable cycle_done is sent to all client
applications.
Example 2
SCWrite \ToNode := "138.221.228.4", cycle_done;
The name, type, and value of the persistent variable cycle_done is sent to all client
applications. The argument \ToNode will be ignored.
Example 3
SCWrite numarr;
The name, type, dim, and value of the persistent variable numarr is sent to all client
applications.
Example 4
SCWrite \ToNode := "138.221.228.4", numarr;
The name, type, dim, and value of the persistent variable numarr is sent to all client
applications. The argument \ToNode will be ignored.
Arguments
SCWrite [ \ToNode ] Variable
[\ToNode]
Data type: datatype
The argument will be ignored.
Variable
Data type: anytype
The name of a persistent variable.
Program execution
The name, type, dim, and value of the persistent variable is sent to all client applications.
‘dim’ is the dimension of the variable and is only sent if the variable is an array.
Continues on next page
1 Instructions
1.145. SCWrite - Send variable data to a client application
PC interface/backup
3HAC 16581-1 Revision: J
400
© Copyright 2004-2010 ABB. All rights reserved.
Error handling
The SCWrite instruction will return an error in the following cases:
The variable could not be sent to the client. This can have the following cause:
•
The SCWrite messages comes so close so that they cannot be sent to the client.
Solution: Put in a WaitTime instruction between the SCWrite instructions.
•
The variable value is too large decreasing the size of the ARRAY or RECORD.
•
The error message will be:
41473 System access error
Failed to send YYYYYY
Where YYYY is the name of the variable.
When an error occurs the program halts and must be restarted. The ERRNO system variable
will contain the value ERR_SC_WRITE .
The SCWrite instruction will not return an error if the client application may, for example,
be closed down or the communication is down. The program will continue executing.
SCWrite error recovery
To avoid stopping the program when a error occurs in a SCWrite instruction it has to be
handled by an error handler . The error will only be reported to the log, and the program will
continue running.
Remember that the error handling will make it more difficult to find errors in the client
communication since the error is never reported to the display on the FlexPendant (but it can
be found in the log).
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
| 402
|
1 Instructions
1.145. SCWrite - Send variable data to a client application
PC interface/backup
399
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.145. SCWrite - Send variable data to a client application
Usage
SCWrite ( Superior Computer Write ) is used to send the name, type, dimension, and value of
a persistent variable to a client application. It is possible to send both single variables and
arrays of variables.
Basic examples
Basic examples of the instruction instruction name are illustrated below.
Example 1
PERS num cycle_done;
PERS num numarr{2}:=[1,2];
SCWrite cycle_done;
The name, type, and value of the persistent variable cycle_done is sent to all client
applications.
Example 2
SCWrite \ToNode := "138.221.228.4", cycle_done;
The name, type, and value of the persistent variable cycle_done is sent to all client
applications. The argument \ToNode will be ignored.
Example 3
SCWrite numarr;
The name, type, dim, and value of the persistent variable numarr is sent to all client
applications.
Example 4
SCWrite \ToNode := "138.221.228.4", numarr;
The name, type, dim, and value of the persistent variable numarr is sent to all client
applications. The argument \ToNode will be ignored.
Arguments
SCWrite [ \ToNode ] Variable
[\ToNode]
Data type: datatype
The argument will be ignored.
Variable
Data type: anytype
The name of a persistent variable.
Program execution
The name, type, dim, and value of the persistent variable is sent to all client applications.
‘dim’ is the dimension of the variable and is only sent if the variable is an array.
Continues on next page
1 Instructions
1.145. SCWrite - Send variable data to a client application
PC interface/backup
3HAC 16581-1 Revision: J
400
© Copyright 2004-2010 ABB. All rights reserved.
Error handling
The SCWrite instruction will return an error in the following cases:
The variable could not be sent to the client. This can have the following cause:
•
The SCWrite messages comes so close so that they cannot be sent to the client.
Solution: Put in a WaitTime instruction between the SCWrite instructions.
•
The variable value is too large decreasing the size of the ARRAY or RECORD.
•
The error message will be:
41473 System access error
Failed to send YYYYYY
Where YYYY is the name of the variable.
When an error occurs the program halts and must be restarted. The ERRNO system variable
will contain the value ERR_SC_WRITE .
The SCWrite instruction will not return an error if the client application may, for example,
be closed down or the communication is down. The program will continue executing.
SCWrite error recovery
To avoid stopping the program when a error occurs in a SCWrite instruction it has to be
handled by an error handler . The error will only be reported to the log, and the program will
continue running.
Remember that the error handling will make it more difficult to find errors in the client
communication since the error is never reported to the display on the FlexPendant (but it can
be found in the log).
Continued
Continues on next page
1 Instructions
1.145. SCWrite - Send variable data to a client application
PC interface/backup
401
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Using RobotWare 5.0 or later
The RAPID program looks as follows:
xx0500002139
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 403
|
1 Instructions
1.145. SCWrite - Send variable data to a client application
PC interface/backup
3HAC 16581-1 Revision: J
400
© Copyright 2004-2010 ABB. All rights reserved.
Error handling
The SCWrite instruction will return an error in the following cases:
The variable could not be sent to the client. This can have the following cause:
•
The SCWrite messages comes so close so that they cannot be sent to the client.
Solution: Put in a WaitTime instruction between the SCWrite instructions.
•
The variable value is too large decreasing the size of the ARRAY or RECORD.
•
The error message will be:
41473 System access error
Failed to send YYYYYY
Where YYYY is the name of the variable.
When an error occurs the program halts and must be restarted. The ERRNO system variable
will contain the value ERR_SC_WRITE .
The SCWrite instruction will not return an error if the client application may, for example,
be closed down or the communication is down. The program will continue executing.
SCWrite error recovery
To avoid stopping the program when a error occurs in a SCWrite instruction it has to be
handled by an error handler . The error will only be reported to the log, and the program will
continue running.
Remember that the error handling will make it more difficult to find errors in the client
communication since the error is never reported to the display on the FlexPendant (but it can
be found in the log).
Continued
Continues on next page
1 Instructions
1.145. SCWrite - Send variable data to a client application
PC interface/backup
401
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Using RobotWare 5.0 or later
The RAPID program looks as follows:
xx0500002139
Continued
1 Instructions
1.146. SearchC - Searches circularly using the robot
RobotWare - OS
3HAC 16581-1 Revision: J
402
© Copyright 2004-2010 ABB. All rights reserved.
1.146. SearchC - Searches circularly using the robot
Usage
SearchC ( Search Circular ) is used to search for a position when moving the tool center point
(TCP) circularly.
During the movement the robot supervises a digital input signal. When the value of the signal
changes to the requested one the robot immediately reads the current position.
This instruction can typically be used when the tool held by the robot is a probe for surface
detection. The outline coordinates of a work object can be obtained using the SearchC
instruction.
This instruction can only be used in the main task T_ROB1 or, if in a MultiMove system, in
Motion tasks.
When using search instructions it is important to configure the I/O system to have a very short
time from setting the physical signal to the system to get information about the setting (use I/
O unit with interrupt control, not poll control). How to do this can differ between fieldbuses.
If using DeviceNet then the ABB units DSQC 651 (AD Combi I/O) and DSQC 652 (Digital
I/O) will give short times since they are using connection type Change of State. If using other
fieldbuses make sure to configure the network in a proper way to get the right conditions.
Basic examples
Basic examples of the instruction SearchC are illustrated below.
See also More examples on page 406 .
Example 1
SearchC di1, sp, cirpoint, p10, v100, probe;
The TCP of the probe is moved circularly towards the position p10 at a speed of v100 .
When the value of the signal di1 changes to active the position is stored in sp .
Example 1
SearchC \Stop, di2, sp, cirpoint, p10, v100, probe;
The TCP of the probe is moved circularly towards the position p10 . When the value of the
signal di2 changes to active the position is stored in sp and the robot stops immediately.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 404
|
1 Instructions
1.145. SCWrite - Send variable data to a client application
PC interface/backup
401
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Using RobotWare 5.0 or later
The RAPID program looks as follows:
xx0500002139
Continued
1 Instructions
1.146. SearchC - Searches circularly using the robot
RobotWare - OS
3HAC 16581-1 Revision: J
402
© Copyright 2004-2010 ABB. All rights reserved.
1.146. SearchC - Searches circularly using the robot
Usage
SearchC ( Search Circular ) is used to search for a position when moving the tool center point
(TCP) circularly.
During the movement the robot supervises a digital input signal. When the value of the signal
changes to the requested one the robot immediately reads the current position.
This instruction can typically be used when the tool held by the robot is a probe for surface
detection. The outline coordinates of a work object can be obtained using the SearchC
instruction.
This instruction can only be used in the main task T_ROB1 or, if in a MultiMove system, in
Motion tasks.
When using search instructions it is important to configure the I/O system to have a very short
time from setting the physical signal to the system to get information about the setting (use I/
O unit with interrupt control, not poll control). How to do this can differ between fieldbuses.
If using DeviceNet then the ABB units DSQC 651 (AD Combi I/O) and DSQC 652 (Digital
I/O) will give short times since they are using connection type Change of State. If using other
fieldbuses make sure to configure the network in a proper way to get the right conditions.
Basic examples
Basic examples of the instruction SearchC are illustrated below.
See also More examples on page 406 .
Example 1
SearchC di1, sp, cirpoint, p10, v100, probe;
The TCP of the probe is moved circularly towards the position p10 at a speed of v100 .
When the value of the signal di1 changes to active the position is stored in sp .
Example 1
SearchC \Stop, di2, sp, cirpoint, p10, v100, probe;
The TCP of the probe is moved circularly towards the position p10 . When the value of the
signal di2 changes to active the position is stored in sp and the robot stops immediately.
Continues on next page
1 Instructions
1.146. SearchC - Searches circularly using the robot
RobotWare - OS
403
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
SearchC [\Stop] | [\PStop] | [\SStop] | [\Sup] Signal [\Flanks]
SearchPoint CirPoint ToPoint [\ID] Speed [\V] | [\T] Tool
[\WObj] [\Corr]
[ \Stop ]
Stiff Stop
Data type: switch
The robot movement is stopped as quickly as possible without keeping the TCP on the path
(hard stop) when the value of the search signal changes to active. However, the robot is
moved a small distance before it stops and is not moved back to the searched position, i.e. to
the position where the signal changed.
-
WARNING!
To stop the searching with stiff stop (switch \Stop ) is only allowed if the TCP-speed is lower
than 100 mm/s. At a stiff stop with higher speeds some axes can move in unpredictable
direction.
[ \PStop ]
Path Stop
Data type: switch
The robot movement is stopped as quickly as possible while keeping the TCP on the path (soft
stop), when the value of the search signal changes to active. However, the robot is moved a
distance before it stops and is not moved back to the searched position, i.e. to the position
where the signal changed.
[ \SStop ]
Soft Stop
Data type: switch
The robot movement is stopped as quickly as possible while keeping the TCP close to or on
the path (soft stop) when the value of the search signal changes to active. However, the robot
is moved only a small distance before it stops and is not moved back to the searched position,
i.e. to the position where the signal changed. SStop is faster then PStop . But when the robot
is running faster than 100 mm/s it stops in the direction of the tangent of the movement which
causes it to marginally slide of the path.
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
| 405
|
1 Instructions
1.146. SearchC - Searches circularly using the robot
RobotWare - OS
3HAC 16581-1 Revision: J
402
© Copyright 2004-2010 ABB. All rights reserved.
1.146. SearchC - Searches circularly using the robot
Usage
SearchC ( Search Circular ) is used to search for a position when moving the tool center point
(TCP) circularly.
During the movement the robot supervises a digital input signal. When the value of the signal
changes to the requested one the robot immediately reads the current position.
This instruction can typically be used when the tool held by the robot is a probe for surface
detection. The outline coordinates of a work object can be obtained using the SearchC
instruction.
This instruction can only be used in the main task T_ROB1 or, if in a MultiMove system, in
Motion tasks.
When using search instructions it is important to configure the I/O system to have a very short
time from setting the physical signal to the system to get information about the setting (use I/
O unit with interrupt control, not poll control). How to do this can differ between fieldbuses.
If using DeviceNet then the ABB units DSQC 651 (AD Combi I/O) and DSQC 652 (Digital
I/O) will give short times since they are using connection type Change of State. If using other
fieldbuses make sure to configure the network in a proper way to get the right conditions.
Basic examples
Basic examples of the instruction SearchC are illustrated below.
See also More examples on page 406 .
Example 1
SearchC di1, sp, cirpoint, p10, v100, probe;
The TCP of the probe is moved circularly towards the position p10 at a speed of v100 .
When the value of the signal di1 changes to active the position is stored in sp .
Example 1
SearchC \Stop, di2, sp, cirpoint, p10, v100, probe;
The TCP of the probe is moved circularly towards the position p10 . When the value of the
signal di2 changes to active the position is stored in sp and the robot stops immediately.
Continues on next page
1 Instructions
1.146. SearchC - Searches circularly using the robot
RobotWare - OS
403
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
SearchC [\Stop] | [\PStop] | [\SStop] | [\Sup] Signal [\Flanks]
SearchPoint CirPoint ToPoint [\ID] Speed [\V] | [\T] Tool
[\WObj] [\Corr]
[ \Stop ]
Stiff Stop
Data type: switch
The robot movement is stopped as quickly as possible without keeping the TCP on the path
(hard stop) when the value of the search signal changes to active. However, the robot is
moved a small distance before it stops and is not moved back to the searched position, i.e. to
the position where the signal changed.
-
WARNING!
To stop the searching with stiff stop (switch \Stop ) is only allowed if the TCP-speed is lower
than 100 mm/s. At a stiff stop with higher speeds some axes can move in unpredictable
direction.
[ \PStop ]
Path Stop
Data type: switch
The robot movement is stopped as quickly as possible while keeping the TCP on the path (soft
stop), when the value of the search signal changes to active. However, the robot is moved a
distance before it stops and is not moved back to the searched position, i.e. to the position
where the signal changed.
[ \SStop ]
Soft Stop
Data type: switch
The robot movement is stopped as quickly as possible while keeping the TCP close to or on
the path (soft stop) when the value of the search signal changes to active. However, the robot
is moved only a small distance before it stops and is not moved back to the searched position,
i.e. to the position where the signal changed. SStop is faster then PStop . But when the robot
is running faster than 100 mm/s it stops in the direction of the tangent of the movement which
causes it to marginally slide of the path.
Continued
Continues on next page
1 Instructions
1.146. SearchC - Searches circularly using the robot
RobotWare - OS
3HAC 16581-1 Revision: J
404
© Copyright 2004-2010 ABB. All rights reserved.
[ \Sup ]
Supervision
Data type: switch
The search instruction is sensitive to signal activation during the complete movement (flying
search), i.e. even after the first signal change has been reported. If more than one match
occurs during a search then a recoverable error is generated with the robot in the ToPoint .
If the argument \Stop , \PStop , \SStop , or \Sup is omitted (no switch used at all):
•
the movement continues (flying search) to the position specified in the ToPoint
argument (same as with argument \Sup )
•
error is reported for none search hit but is not reported for more than one search hit
(first search hit is returned as the SearchPoint )
Signal
Data type: signaldi
The name of the signal to supervise.
[ \Flanks ]
Data type: switch
The positive and the negative edge of the signal is valid for a search hit.
If the argument \Flanks is omitted then only the positive edge of the signal is valid for a
search hit, and a signal supervision will be activated at the beginning of a search process. This
means that if the signal has a positive value already at the beginning of the search process or
the communication with the signal is lost, then the robot movement is stopped as quickly as
possible, while keeping the TCP on the path (soft stop). However, the robot is moved a small
distance before it stops and is not moved back to the start position. A user recovery error
(ERR_SIGSUPSEARCH) will be generated and can be dealt with by the error handler.
SearchPoint
Data type: robtarget
The position of the TCP and external axes when the search signal has been triggered. The
position is specified in the outermost coordinate system taking the specified tool, work object,
and active ProgDisp/ExtOffs coordinate system into consideration.
CirPoint
Data type: robtarget
The circle point of the robot. See the instruction MoveC for a more detailed description of
circular movement. The circle point is defined as a named position or stored directly in the
instruction (marked with an * in the instruction).
ToPoint
Data type: robtarget
The destination point of the robot and external axes. It is defined as a named position or stored
directly in the instruction (marked with an * in the instruction). SearchC always uses a stop
point as zone data for the destination.
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
| 406
|
1 Instructions
1.146. SearchC - Searches circularly using the robot
RobotWare - OS
403
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
SearchC [\Stop] | [\PStop] | [\SStop] | [\Sup] Signal [\Flanks]
SearchPoint CirPoint ToPoint [\ID] Speed [\V] | [\T] Tool
[\WObj] [\Corr]
[ \Stop ]
Stiff Stop
Data type: switch
The robot movement is stopped as quickly as possible without keeping the TCP on the path
(hard stop) when the value of the search signal changes to active. However, the robot is
moved a small distance before it stops and is not moved back to the searched position, i.e. to
the position where the signal changed.
-
WARNING!
To stop the searching with stiff stop (switch \Stop ) is only allowed if the TCP-speed is lower
than 100 mm/s. At a stiff stop with higher speeds some axes can move in unpredictable
direction.
[ \PStop ]
Path Stop
Data type: switch
The robot movement is stopped as quickly as possible while keeping the TCP on the path (soft
stop), when the value of the search signal changes to active. However, the robot is moved a
distance before it stops and is not moved back to the searched position, i.e. to the position
where the signal changed.
[ \SStop ]
Soft Stop
Data type: switch
The robot movement is stopped as quickly as possible while keeping the TCP close to or on
the path (soft stop) when the value of the search signal changes to active. However, the robot
is moved only a small distance before it stops and is not moved back to the searched position,
i.e. to the position where the signal changed. SStop is faster then PStop . But when the robot
is running faster than 100 mm/s it stops in the direction of the tangent of the movement which
causes it to marginally slide of the path.
Continued
Continues on next page
1 Instructions
1.146. SearchC - Searches circularly using the robot
RobotWare - OS
3HAC 16581-1 Revision: J
404
© Copyright 2004-2010 ABB. All rights reserved.
[ \Sup ]
Supervision
Data type: switch
The search instruction is sensitive to signal activation during the complete movement (flying
search), i.e. even after the first signal change has been reported. If more than one match
occurs during a search then a recoverable error is generated with the robot in the ToPoint .
If the argument \Stop , \PStop , \SStop , or \Sup is omitted (no switch used at all):
•
the movement continues (flying search) to the position specified in the ToPoint
argument (same as with argument \Sup )
•
error is reported for none search hit but is not reported for more than one search hit
(first search hit is returned as the SearchPoint )
Signal
Data type: signaldi
The name of the signal to supervise.
[ \Flanks ]
Data type: switch
The positive and the negative edge of the signal is valid for a search hit.
If the argument \Flanks is omitted then only the positive edge of the signal is valid for a
search hit, and a signal supervision will be activated at the beginning of a search process. This
means that if the signal has a positive value already at the beginning of the search process or
the communication with the signal is lost, then the robot movement is stopped as quickly as
possible, while keeping the TCP on the path (soft stop). However, the robot is moved a small
distance before it stops and is not moved back to the start position. A user recovery error
(ERR_SIGSUPSEARCH) will be generated and can be dealt with by the error handler.
SearchPoint
Data type: robtarget
The position of the TCP and external axes when the search signal has been triggered. The
position is specified in the outermost coordinate system taking the specified tool, work object,
and active ProgDisp/ExtOffs coordinate system into consideration.
CirPoint
Data type: robtarget
The circle point of the robot. See the instruction MoveC for a more detailed description of
circular movement. The circle point is defined as a named position or stored directly in the
instruction (marked with an * in the instruction).
ToPoint
Data type: robtarget
The destination point of the robot and external axes. It is defined as a named position or stored
directly in the instruction (marked with an * in the instruction). SearchC always uses a stop
point as zone data for the destination.
Continued
Continues on next page
1 Instructions
1.146. SearchC - Searches circularly using the robot
RobotWare - OS
405
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
[ \ID ]
Synchronization id
Data type: identno
This argument must be used in a MultiMove System if it is a coordinated synchronized
movement, and is not allowed in any other cases.
The specified ID number must be the same in all cooperating program tasks. The ID number
gives a guarantee that the movements are not mixed up at runtime.
Speed
Data type: speeddata
The speed data that applies to movements. Speed data defines the velocity of the tool center
point, the external axes and the tool reorientation.
[ \V ]
Velocity
Data type: num
This argument is used to specify the velocity of the TCP in mm/s directly in the instruction.
It is then substituted for the corresponding velocity specified in the speed data.
[ \T ]
Time
Data type: num
This argument is used to specify the total time in seconds during which the robot moves. It is
then substituted for the corresponding speed data.
Tool
Data type: tooldata
The tool in use when the robot moves. The tool center point is the point that is moved to the
specified destination position.
[ \WObj ]
Work Object
Data type: wobjdata
The work object (coordinate system) to which the robot positions in the instruction are
related.
This argument can be omitted and if so then the position is related to the world coordinate
system. If, on the other hand, a stationary TCP or coordinated external axes are used then this
argument must be specified for a linear movement relative to the work object to be performed.
[ \Corr ]
Correction
Data type: switch
When this argument is present the correction data written to a corrections entry by the
instruction CorrWrite will be added to the path and destination position.
Continued
Continues on next page
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.