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
| 707
|
1 Instructions
1.239. WarmStart - Restart the controller
RobotWare - OS
3HAC 16581-1 Revision: J
704
© Copyright 2004-2010 ABB. All rights reserved.
1.239. WarmStart - Restart the controller
Usage
WarmStart is used to restart the controller.
The system parameters can be changed from RAPID with the instruction WriteCfgData .
You must restart the controller in order for a change to have effect on some of the system
parameters. The restart can be done with this instruction WarmStart .
Basic examples
Basic examples of the instruction WarmStart are illustrated below.
Example 1
WriteCfgData "/MOC/MOTOR_CALIB/rob1_1","cal_offset",offset1;
WarmStart;
Writes the value of the num variable offset1 as calibration offset for axis 1 on rob1 and
generates a restart of the controller.
Program execution
Warmstart takes effect at once and the program pointer is set to the next instruction.
Syntax
WarmStart ´;´
Related information
For information about
See
Write attribute of a system parameter
WriteCfgData - Writes attribute of a system
parameter on page 721
Configuration
Technical reference manual - System parameters
1 Instructions
1.240. WHILE - Repeats as long as ...
RobotWare - OS
705
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.240. WHILE - Repeats as long as ...
Usage
WHILE is used when a number of instructions are to be repeated as long as a given condition
expression evaluates to a TRUE value.
Basic examples
Basic examples of the instruction WHILE are illustrated below.
Example 1
WHILE reg1 < reg2 DO
...
reg1 := reg1 + 1;
ENDWHILE
Repeats the instructions in the WHILE -block as long as reg1 < reg2 .
Arguments
WHILE Condition DO ... ENDWHILE
Condition
Data type: bool
The condition that must be evaluated to a TRUE value for the instructions in the WHILE -block
to be executed.
Program execution
1. The condition expression is evaluated. If the expression evaluates to a TRUE value then
the instructions in the WHILE -block are executed.
2. The condition expression is then evaluated again, and if the result of this evaluation is
TRUE then the instructions in the WHILE -block are executed again.
3. This process continues until the result of the expression evaluation becomes FALSE .
The iteration is then terminated and the program execution continues from the instruction
after the WHILE -block.
If the result of the expression evaluation is FALSE at the very outset then the instructions in
the WHILE -block are not executed at all, and the program control transfers immediately to the
instruction that follows after the WHILE -block.
Remarks
If it is possible to determine the number of repetitions then the FOR instruction can be used.
Syntax
(EBNF)
WHILE <conditional expression> DO
<instruction list>
ENDWHILE
Continues on next page
1 Instructions
1.240. WHILE - Repeats as long as ...
RobotWare - OS
3HAC 16581-1 Revision: J
706
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Expressions
Technical reference manual - RAPID overview ,
section Basic characteristics - Expressions
Repeats a given number of times
FOR - Repeats a given number of times on page
108
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 708
|
1 Instructions
1.240. WHILE - Repeats as long as ...
RobotWare - OS
705
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.240. WHILE - Repeats as long as ...
Usage
WHILE is used when a number of instructions are to be repeated as long as a given condition
expression evaluates to a TRUE value.
Basic examples
Basic examples of the instruction WHILE are illustrated below.
Example 1
WHILE reg1 < reg2 DO
...
reg1 := reg1 + 1;
ENDWHILE
Repeats the instructions in the WHILE -block as long as reg1 < reg2 .
Arguments
WHILE Condition DO ... ENDWHILE
Condition
Data type: bool
The condition that must be evaluated to a TRUE value for the instructions in the WHILE -block
to be executed.
Program execution
1. The condition expression is evaluated. If the expression evaluates to a TRUE value then
the instructions in the WHILE -block are executed.
2. The condition expression is then evaluated again, and if the result of this evaluation is
TRUE then the instructions in the WHILE -block are executed again.
3. This process continues until the result of the expression evaluation becomes FALSE .
The iteration is then terminated and the program execution continues from the instruction
after the WHILE -block.
If the result of the expression evaluation is FALSE at the very outset then the instructions in
the WHILE -block are not executed at all, and the program control transfers immediately to the
instruction that follows after the WHILE -block.
Remarks
If it is possible to determine the number of repetitions then the FOR instruction can be used.
Syntax
(EBNF)
WHILE <conditional expression> DO
<instruction list>
ENDWHILE
Continues on next page
1 Instructions
1.240. WHILE - Repeats as long as ...
RobotWare - OS
3HAC 16581-1 Revision: J
706
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Expressions
Technical reference manual - RAPID overview ,
section Basic characteristics - Expressions
Repeats a given number of times
FOR - Repeats a given number of times on page
108
Continued
1 Instructions
1.241. WorldAccLim - Control acceleration in world coordinate system
RobotWare - OS
707
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.241. WorldAccLim - Control acceleration in world coordinate system
Usage
WorldAccLim ( World Acceleration Limitation ) is used to limit the acceleration/deceleration
of the tool (and payload) in the world coordinate system.
Only implemented for robot type IRB5400-04, IRB6600, and IRB7600 with track motion.
The limitation will be achieved all together in the gravity center point of the actual tool, actual
payload (if present), and the mounting flange of the robot.
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 WorldAccLim are illustrated below.
Example 1
WorldAccLim \On := 3.5;
Acceleration is limited to 3.5 m/s 2 .
Example 2
WorldAccLim \Off;
The acceleration is reset to maximum (default).
Arguments
WorldAccLim [\On]|[\Off]
[ \On ]
Data type: num
The absolute value of the acceleration limitation in m/s 2 .
[ \Off ]
Data type: switch
Maximum acceleration (default).
Program execution
The acceleration limitations applies for the next executed robot segment and is valid until a
new WorldAccLim instruction is executed.
The maximum acceleration ( WorldAccLim \Off ) is automatically set
•
at a cold start-up.
•
when a new program is loaded.
•
when starting program execution from the beginning.
It is recommended to use just one type of limitation of the acceleration. If a combination of
instructions WorldAccLim , AccSet , and PathAccLim are done then the system reduces the
acceleration/deceleration in the following order:
•
according WorldAccLim
•
according AccSet
•
according PathAccLim
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 709
|
1 Instructions
1.240. WHILE - Repeats as long as ...
RobotWare - OS
3HAC 16581-1 Revision: J
706
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Expressions
Technical reference manual - RAPID overview ,
section Basic characteristics - Expressions
Repeats a given number of times
FOR - Repeats a given number of times on page
108
Continued
1 Instructions
1.241. WorldAccLim - Control acceleration in world coordinate system
RobotWare - OS
707
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.241. WorldAccLim - Control acceleration in world coordinate system
Usage
WorldAccLim ( World Acceleration Limitation ) is used to limit the acceleration/deceleration
of the tool (and payload) in the world coordinate system.
Only implemented for robot type IRB5400-04, IRB6600, and IRB7600 with track motion.
The limitation will be achieved all together in the gravity center point of the actual tool, actual
payload (if present), and the mounting flange of the robot.
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 WorldAccLim are illustrated below.
Example 1
WorldAccLim \On := 3.5;
Acceleration is limited to 3.5 m/s 2 .
Example 2
WorldAccLim \Off;
The acceleration is reset to maximum (default).
Arguments
WorldAccLim [\On]|[\Off]
[ \On ]
Data type: num
The absolute value of the acceleration limitation in m/s 2 .
[ \Off ]
Data type: switch
Maximum acceleration (default).
Program execution
The acceleration limitations applies for the next executed robot segment and is valid until a
new WorldAccLim instruction is executed.
The maximum acceleration ( WorldAccLim \Off ) is automatically set
•
at a cold start-up.
•
when a new program is loaded.
•
when starting program execution from the beginning.
It is recommended to use just one type of limitation of the acceleration. If a combination of
instructions WorldAccLim , AccSet , and PathAccLim are done then the system reduces the
acceleration/deceleration in the following order:
•
according WorldAccLim
•
according AccSet
•
according PathAccLim
Continues on next page
1 Instructions
1.241. WorldAccLim - Control acceleration in world coordinate system
RobotWare - OS
3HAC 16581-1 Revision: J
708
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
The minimum acceleration allowed is 1 m/s 2 .
Error handling
If the argument On is set to a value that is too low then the system variable ERRNO is set to
ERR_ACC_TOO_LOW. This error can then be handled in the error handler.
Syntax
WorldAccLim
[´\’On ’:=’ <expression ( IN ) of num>] | [´\’Off ]’;’
Related information
For information about
See
Positioning instructions
Technical reference manual - RAPID overview ,
section RAPID summary - Motion
Motion settings data
motsetdata - Motion settings data on page 1141
Reduction of acceleration
AccSet - Reduces the acceleration on page 15
Limitation of acceleration along the path
PathAccLim - Reduce TCP acceleration along
the path on page 295
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 710
|
1 Instructions
1.241. WorldAccLim - Control acceleration in world coordinate system
RobotWare - OS
707
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.241. WorldAccLim - Control acceleration in world coordinate system
Usage
WorldAccLim ( World Acceleration Limitation ) is used to limit the acceleration/deceleration
of the tool (and payload) in the world coordinate system.
Only implemented for robot type IRB5400-04, IRB6600, and IRB7600 with track motion.
The limitation will be achieved all together in the gravity center point of the actual tool, actual
payload (if present), and the mounting flange of the robot.
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 WorldAccLim are illustrated below.
Example 1
WorldAccLim \On := 3.5;
Acceleration is limited to 3.5 m/s 2 .
Example 2
WorldAccLim \Off;
The acceleration is reset to maximum (default).
Arguments
WorldAccLim [\On]|[\Off]
[ \On ]
Data type: num
The absolute value of the acceleration limitation in m/s 2 .
[ \Off ]
Data type: switch
Maximum acceleration (default).
Program execution
The acceleration limitations applies for the next executed robot segment and is valid until a
new WorldAccLim instruction is executed.
The maximum acceleration ( WorldAccLim \Off ) is automatically set
•
at a cold start-up.
•
when a new program is loaded.
•
when starting program execution from the beginning.
It is recommended to use just one type of limitation of the acceleration. If a combination of
instructions WorldAccLim , AccSet , and PathAccLim are done then the system reduces the
acceleration/deceleration in the following order:
•
according WorldAccLim
•
according AccSet
•
according PathAccLim
Continues on next page
1 Instructions
1.241. WorldAccLim - Control acceleration in world coordinate system
RobotWare - OS
3HAC 16581-1 Revision: J
708
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
The minimum acceleration allowed is 1 m/s 2 .
Error handling
If the argument On is set to a value that is too low then the system variable ERRNO is set to
ERR_ACC_TOO_LOW. This error can then be handled in the error handler.
Syntax
WorldAccLim
[´\’On ’:=’ <expression ( IN ) of num>] | [´\’Off ]’;’
Related information
For information about
See
Positioning instructions
Technical reference manual - RAPID overview ,
section RAPID summary - Motion
Motion settings data
motsetdata - Motion settings data on page 1141
Reduction of acceleration
AccSet - Reduces the acceleration on page 15
Limitation of acceleration along the path
PathAccLim - Reduce TCP acceleration along
the path on page 295
Continued
1 Instructions
1.242. Write - Writes to a character-based file or serial channel
RobotWare - OS
709
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.242. Write - Writes to a character-based file or serial channel
Usage
Write is used to write to a character-based file or serial channel. The value of certain data
can be written as well as text.
Basic examples
Basic examples of the instruction Write are illustrated below.
See also More examples on page 711 .
Example 1
Write logfile, "Execution started";
The text Execution started is written to the file with reference name logfile .
Example 2
VAR num reg1:=5;
...
Write logfile, "No of produced parts="\Num:=reg1;
The text No of produced parts=5 , is written to the file with the reference name
logfile .
Arguments
Write IODevice String [\Num] | [\Bool] | [\Pos] | [\Orient] |
[\Dnum] [\NoNewLine]
IODevice
Data type: iodev
The name (reference) of the current file or serial channel.
String
Data type: string
The text to be written.
[\Num]
Numeric
Data type: num
The data whose numeric values are to be written after the text string.
[\Bool]
Boolean
Data type: bool
The data whose logical values are to be written after the text string.
[\Pos]
Position
Data type: pos
The data whose position is to be written after the text 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
| 711
|
1 Instructions
1.241. WorldAccLim - Control acceleration in world coordinate system
RobotWare - OS
3HAC 16581-1 Revision: J
708
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
The minimum acceleration allowed is 1 m/s 2 .
Error handling
If the argument On is set to a value that is too low then the system variable ERRNO is set to
ERR_ACC_TOO_LOW. This error can then be handled in the error handler.
Syntax
WorldAccLim
[´\’On ’:=’ <expression ( IN ) of num>] | [´\’Off ]’;’
Related information
For information about
See
Positioning instructions
Technical reference manual - RAPID overview ,
section RAPID summary - Motion
Motion settings data
motsetdata - Motion settings data on page 1141
Reduction of acceleration
AccSet - Reduces the acceleration on page 15
Limitation of acceleration along the path
PathAccLim - Reduce TCP acceleration along
the path on page 295
Continued
1 Instructions
1.242. Write - Writes to a character-based file or serial channel
RobotWare - OS
709
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.242. Write - Writes to a character-based file or serial channel
Usage
Write is used to write to a character-based file or serial channel. The value of certain data
can be written as well as text.
Basic examples
Basic examples of the instruction Write are illustrated below.
See also More examples on page 711 .
Example 1
Write logfile, "Execution started";
The text Execution started is written to the file with reference name logfile .
Example 2
VAR num reg1:=5;
...
Write logfile, "No of produced parts="\Num:=reg1;
The text No of produced parts=5 , is written to the file with the reference name
logfile .
Arguments
Write IODevice String [\Num] | [\Bool] | [\Pos] | [\Orient] |
[\Dnum] [\NoNewLine]
IODevice
Data type: iodev
The name (reference) of the current file or serial channel.
String
Data type: string
The text to be written.
[\Num]
Numeric
Data type: num
The data whose numeric values are to be written after the text string.
[\Bool]
Boolean
Data type: bool
The data whose logical values are to be written after the text string.
[\Pos]
Position
Data type: pos
The data whose position is to be written after the text string.
Continues on next page
1 Instructions
1.242. Write - Writes to a character-based file or serial channel
RobotWare - OS
3HAC 16581-1 Revision: J
710
© Copyright 2004-2010 ABB. All rights reserved.
[\Orient]
Orientation
Data type: orient
The data whose orientation is to be written after the text string.
[\Dnum]
Numeric
Data type: dnum
The data whose numeric values are to be written after the text string.
[\NoNewLine]
Data type: switch
Omits the line-feed character that normally indicates the end of the text, i.e. next write
instruction will continue on the same line.
Program execution
The text string is written to a specified file or serial channel. A line-feed character (LF) is also
written, but can be omitted if the argument \NoNewLine is used.
If one of the arguments \Num , \Bool , \Pos , or \Orient is used then its value is first
converted to a text string before being added to the first string. The conversion from value to
text string takes place as follows:
The value is converted to a string with standard RAPID format. This means in principle 6
significant digits. If the decimal part is less than 0.000005 or greater than 0.999995, the
number is rounded to an integer.
Argument
Value
Text string
\Num
23
“23”
\Num
1.141367
“1.14137”
\Bool
TRUE
“TRUE”
\Pos
[1817.3,905.17,879.11]
"[1817.3,905.17,879.11]"
\Orient
[0.96593,0,0.25882,0]
“[0.96593,0,0.25882,0]"
\Dnum
4294967295
"4294967295"
Continued
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 712
|
1 Instructions
1.242. Write - Writes to a character-based file or serial channel
RobotWare - OS
709
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.242. Write - Writes to a character-based file or serial channel
Usage
Write is used to write to a character-based file or serial channel. The value of certain data
can be written as well as text.
Basic examples
Basic examples of the instruction Write are illustrated below.
See also More examples on page 711 .
Example 1
Write logfile, "Execution started";
The text Execution started is written to the file with reference name logfile .
Example 2
VAR num reg1:=5;
...
Write logfile, "No of produced parts="\Num:=reg1;
The text No of produced parts=5 , is written to the file with the reference name
logfile .
Arguments
Write IODevice String [\Num] | [\Bool] | [\Pos] | [\Orient] |
[\Dnum] [\NoNewLine]
IODevice
Data type: iodev
The name (reference) of the current file or serial channel.
String
Data type: string
The text to be written.
[\Num]
Numeric
Data type: num
The data whose numeric values are to be written after the text string.
[\Bool]
Boolean
Data type: bool
The data whose logical values are to be written after the text string.
[\Pos]
Position
Data type: pos
The data whose position is to be written after the text string.
Continues on next page
1 Instructions
1.242. Write - Writes to a character-based file or serial channel
RobotWare - OS
3HAC 16581-1 Revision: J
710
© Copyright 2004-2010 ABB. All rights reserved.
[\Orient]
Orientation
Data type: orient
The data whose orientation is to be written after the text string.
[\Dnum]
Numeric
Data type: dnum
The data whose numeric values are to be written after the text string.
[\NoNewLine]
Data type: switch
Omits the line-feed character that normally indicates the end of the text, i.e. next write
instruction will continue on the same line.
Program execution
The text string is written to a specified file or serial channel. A line-feed character (LF) is also
written, but can be omitted if the argument \NoNewLine is used.
If one of the arguments \Num , \Bool , \Pos , or \Orient is used then its value is first
converted to a text string before being added to the first string. The conversion from value to
text string takes place as follows:
The value is converted to a string with standard RAPID format. This means in principle 6
significant digits. If the decimal part is less than 0.000005 or greater than 0.999995, the
number is rounded to an integer.
Argument
Value
Text string
\Num
23
“23”
\Num
1.141367
“1.14137”
\Bool
TRUE
“TRUE”
\Pos
[1817.3,905.17,879.11]
"[1817.3,905.17,879.11]"
\Orient
[0.96593,0,0.25882,0]
“[0.96593,0,0.25882,0]"
\Dnum
4294967295
"4294967295"
Continued
Continues on next page
1 Instructions
1.242. Write - Writes to a character-based file or serial channel
RobotWare - OS
711
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of the instruction Write are illustrated below.
Example 1
VAR iodev printer;
VAR num reg1:=0
VAR num stopprod_value:=0
...
Open "com2:", printer\Write;
stopprod_value:=stopprod;
WHILE stopprod_value = 0 DO
produce_part;
reg1:=reg1+1;
Write printer, "Produced part="\Num:=reg1\NoNewLine;
Write printer, " "\NoNewLine;
Write printer, CTime();
stopprod_value:=stopprod;
ENDWHILE
Close printer;
A line, including the number of the produced part and the time, is outputed to a printer each
cycle. The printer is connected to serial channel com2 :. The printed message could look like
this:
Limitations
The arguments \Num , \Dnum, \Bool , \Pos , and \Orient are mutually exclusive and thus
cannot be used simultaneously in the same instruction.
This instruction can only be used for files or serial channels that have been opened for writing.
Error handling
If an error occurs during writing then the system variable ERRNO is set to ERR_FILEACC . This
error can then be handled in the error handler.
Syntax
Write
[IODevice’:=’] <variable ( VAR ) of iodev>’,’
[String’:=’] <expression ( IN ) of string>
[’\’Num’:=’ <expression ( IN ) of num> ]
| [’\’Bool’:=’ <expression ( IN ) of bool> ]
| [’\’Pos’:=’ <expression ( IN ) of pos> ]
| [’\’Orient’:=’ <expression ( IN ) of orient> ]
| [’\’Dnum’:=’ <expression ( IN ) of dnum> ]
[’\’NoNewLine]’;’
Produced part=473
09:47:15
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
| 713
|
1 Instructions
1.242. Write - Writes to a character-based file or serial channel
RobotWare - OS
3HAC 16581-1 Revision: J
710
© Copyright 2004-2010 ABB. All rights reserved.
[\Orient]
Orientation
Data type: orient
The data whose orientation is to be written after the text string.
[\Dnum]
Numeric
Data type: dnum
The data whose numeric values are to be written after the text string.
[\NoNewLine]
Data type: switch
Omits the line-feed character that normally indicates the end of the text, i.e. next write
instruction will continue on the same line.
Program execution
The text string is written to a specified file or serial channel. A line-feed character (LF) is also
written, but can be omitted if the argument \NoNewLine is used.
If one of the arguments \Num , \Bool , \Pos , or \Orient is used then its value is first
converted to a text string before being added to the first string. The conversion from value to
text string takes place as follows:
The value is converted to a string with standard RAPID format. This means in principle 6
significant digits. If the decimal part is less than 0.000005 or greater than 0.999995, the
number is rounded to an integer.
Argument
Value
Text string
\Num
23
“23”
\Num
1.141367
“1.14137”
\Bool
TRUE
“TRUE”
\Pos
[1817.3,905.17,879.11]
"[1817.3,905.17,879.11]"
\Orient
[0.96593,0,0.25882,0]
“[0.96593,0,0.25882,0]"
\Dnum
4294967295
"4294967295"
Continued
Continues on next page
1 Instructions
1.242. Write - Writes to a character-based file or serial channel
RobotWare - OS
711
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of the instruction Write are illustrated below.
Example 1
VAR iodev printer;
VAR num reg1:=0
VAR num stopprod_value:=0
...
Open "com2:", printer\Write;
stopprod_value:=stopprod;
WHILE stopprod_value = 0 DO
produce_part;
reg1:=reg1+1;
Write printer, "Produced part="\Num:=reg1\NoNewLine;
Write printer, " "\NoNewLine;
Write printer, CTime();
stopprod_value:=stopprod;
ENDWHILE
Close printer;
A line, including the number of the produced part and the time, is outputed to a printer each
cycle. The printer is connected to serial channel com2 :. The printed message could look like
this:
Limitations
The arguments \Num , \Dnum, \Bool , \Pos , and \Orient are mutually exclusive and thus
cannot be used simultaneously in the same instruction.
This instruction can only be used for files or serial channels that have been opened for writing.
Error handling
If an error occurs during writing then the system variable ERRNO is set to ERR_FILEACC . This
error can then be handled in the error handler.
Syntax
Write
[IODevice’:=’] <variable ( VAR ) of iodev>’,’
[String’:=’] <expression ( IN ) of string>
[’\’Num’:=’ <expression ( IN ) of num> ]
| [’\’Bool’:=’ <expression ( IN ) of bool> ]
| [’\’Pos’:=’ <expression ( IN ) of pos> ]
| [’\’Orient’:=’ <expression ( IN ) of orient> ]
| [’\’Dnum’:=’ <expression ( IN ) of dnum> ]
[’\’NoNewLine]’;’
Produced part=473
09:47:15
Continued
Continues on next page
1 Instructions
1.242. Write - Writes to a character-based file or serial channel
RobotWare - OS
3HAC 16581-1 Revision: J
712
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Opening a file or serial channel
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
| 714
|
1 Instructions
1.242. Write - Writes to a character-based file or serial channel
RobotWare - OS
711
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of the instruction Write are illustrated below.
Example 1
VAR iodev printer;
VAR num reg1:=0
VAR num stopprod_value:=0
...
Open "com2:", printer\Write;
stopprod_value:=stopprod;
WHILE stopprod_value = 0 DO
produce_part;
reg1:=reg1+1;
Write printer, "Produced part="\Num:=reg1\NoNewLine;
Write printer, " "\NoNewLine;
Write printer, CTime();
stopprod_value:=stopprod;
ENDWHILE
Close printer;
A line, including the number of the produced part and the time, is outputed to a printer each
cycle. The printer is connected to serial channel com2 :. The printed message could look like
this:
Limitations
The arguments \Num , \Dnum, \Bool , \Pos , and \Orient are mutually exclusive and thus
cannot be used simultaneously in the same instruction.
This instruction can only be used for files or serial channels that have been opened for writing.
Error handling
If an error occurs during writing then the system variable ERRNO is set to ERR_FILEACC . This
error can then be handled in the error handler.
Syntax
Write
[IODevice’:=’] <variable ( VAR ) of iodev>’,’
[String’:=’] <expression ( IN ) of string>
[’\’Num’:=’ <expression ( IN ) of num> ]
| [’\’Bool’:=’ <expression ( IN ) of bool> ]
| [’\’Pos’:=’ <expression ( IN ) of pos> ]
| [’\’Orient’:=’ <expression ( IN ) of orient> ]
| [’\’Dnum’:=’ <expression ( IN ) of dnum> ]
[’\’NoNewLine]’;’
Produced part=473
09:47:15
Continued
Continues on next page
1 Instructions
1.242. Write - Writes to a character-based file or serial channel
RobotWare - OS
3HAC 16581-1 Revision: J
712
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Opening a file or serial channel
Technical reference manual - RAPID overview ,
section RAPID summary - Communication
Continued
1 Instructions
1.243. WriteAnyBin - Writes data to a binary serial channel or file
RobotWare - OS
713
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.243. WriteAnyBin - Writes data to a binary serial channel or file
Usage
WriteAnyBin ( Write Any Binary ) is used to write any type of data to a binary serial channel
or file.
Basic examples
Basic examples of the instruction WriteAnyBin are illustrated below.
See also More examples on page 714 .
Example 1
VAR iodev channel2;
VAR orient quat1 := [1, 0, 0, 0];
...
Open "com2:", channel2 \Bin;
WriteAnyBin channel2, quat1;
The orient data quat1 is written to the channel referred to by channel2 .
Arguments
WriteAnyBin IODevice Data
IODevice
Data type: iodev
The name (reference) of the binary serial channel or file for the writing operation.
Data
Data type: ANYTYPE
Data to be written.
Program execution
As many bytes as required for the specified data are written to the specified binary serial
channel or file.
Limitations
This instruction can only be used for serial channels or files that have been opened for binary
writing.
The data to be written by this instruction WriteAnyBin must be 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.
Error handling
If an error occurs during writing then the system variable ERRNO is set to ERR_FILEACC . This
error can then be handled in the error handler.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 715
|
1 Instructions
1.242. Write - Writes to a character-based file or serial channel
RobotWare - OS
3HAC 16581-1 Revision: J
712
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Opening a file or serial channel
Technical reference manual - RAPID overview ,
section RAPID summary - Communication
Continued
1 Instructions
1.243. WriteAnyBin - Writes data to a binary serial channel or file
RobotWare - OS
713
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.243. WriteAnyBin - Writes data to a binary serial channel or file
Usage
WriteAnyBin ( Write Any Binary ) is used to write any type of data to a binary serial channel
or file.
Basic examples
Basic examples of the instruction WriteAnyBin are illustrated below.
See also More examples on page 714 .
Example 1
VAR iodev channel2;
VAR orient quat1 := [1, 0, 0, 0];
...
Open "com2:", channel2 \Bin;
WriteAnyBin channel2, quat1;
The orient data quat1 is written to the channel referred to by channel2 .
Arguments
WriteAnyBin IODevice Data
IODevice
Data type: iodev
The name (reference) of the binary serial channel or file for the writing operation.
Data
Data type: ANYTYPE
Data to be written.
Program execution
As many bytes as required for the specified data are written to the specified binary serial
channel or file.
Limitations
This instruction can only be used for serial channels or files that have been opened for binary
writing.
The data to be written by this instruction WriteAnyBin must be 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.
Error handling
If an error occurs during writing then the system variable ERRNO is set to ERR_FILEACC . This
error can then be handled in the error handler.
Continues on next page
1 Instructions
1.243. WriteAnyBin - Writes data to a binary serial channel or file
RobotWare - OS
3HAC 16581-1 Revision: J
714
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of the instruction WriteAnyBin are illustrated below.
Example 1
VAR iodev channel;
VAR num input;
VAR robtarget cur_robt;
Open "com2:", channel\Bin;
! Send the control character enq
WriteStrBin channel, "\05";
! Wait for the control character ack
input := ReadBin (channel \Time:= 0.1);
IF input = 6 THEN
! Send current robot position
cur_robt := CRobT(\Tool:= tool1\WObj:= wobj1);
WriteAnyBin channel, cur_robt;
ENDIF
Close channel;
The current position of the robot is written to a binary serial channel.
Limitations
Because WriteAnyBin-ReadAnyBin is designed to only send internal controller data
between IRC5 control systems, no data protocol is released and the data cannot be interpreted
on any PC .
Control software development can break the compatibility, and therefore 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
WriteAnyBin
[IODevice’:=’] <variable ( VAR ) of iodev>’,’
[Data’:=’] <expression ( IN ) of ANYTYPE>’;’
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
| 716
|
1 Instructions
1.243. WriteAnyBin - Writes data to a binary serial channel or file
RobotWare - OS
713
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.243. WriteAnyBin - Writes data to a binary serial channel or file
Usage
WriteAnyBin ( Write Any Binary ) is used to write any type of data to a binary serial channel
or file.
Basic examples
Basic examples of the instruction WriteAnyBin are illustrated below.
See also More examples on page 714 .
Example 1
VAR iodev channel2;
VAR orient quat1 := [1, 0, 0, 0];
...
Open "com2:", channel2 \Bin;
WriteAnyBin channel2, quat1;
The orient data quat1 is written to the channel referred to by channel2 .
Arguments
WriteAnyBin IODevice Data
IODevice
Data type: iodev
The name (reference) of the binary serial channel or file for the writing operation.
Data
Data type: ANYTYPE
Data to be written.
Program execution
As many bytes as required for the specified data are written to the specified binary serial
channel or file.
Limitations
This instruction can only be used for serial channels or files that have been opened for binary
writing.
The data to be written by this instruction WriteAnyBin must be 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.
Error handling
If an error occurs during writing then the system variable ERRNO is set to ERR_FILEACC . This
error can then be handled in the error handler.
Continues on next page
1 Instructions
1.243. WriteAnyBin - Writes data to a binary serial channel or file
RobotWare - OS
3HAC 16581-1 Revision: J
714
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of the instruction WriteAnyBin are illustrated below.
Example 1
VAR iodev channel;
VAR num input;
VAR robtarget cur_robt;
Open "com2:", channel\Bin;
! Send the control character enq
WriteStrBin channel, "\05";
! Wait for the control character ack
input := ReadBin (channel \Time:= 0.1);
IF input = 6 THEN
! Send current robot position
cur_robt := CRobT(\Tool:= tool1\WObj:= wobj1);
WriteAnyBin channel, cur_robt;
ENDIF
Close channel;
The current position of the robot is written to a binary serial channel.
Limitations
Because WriteAnyBin-ReadAnyBin is designed to only send internal controller data
between IRC5 control systems, no data protocol is released and the data cannot be interpreted
on any PC .
Control software development can break the compatibility, and therefore 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
WriteAnyBin
[IODevice’:=’] <variable ( VAR ) of iodev>’,’
[Data’:=’] <expression ( IN ) of ANYTYPE>’;’
Continued
Continues on next page
1 Instructions
1.243. WriteAnyBin - Writes data to a binary serial channel or file
RobotWare - OS
715
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Opening, etc. of serial channels or files
Technical reference manual - RAPID
overview , section RAPID summary - Com-
munication
Read data from a binary serial channel or file
ReadAnyBin - Read data from a binary serial
channel or file on page 340
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 717
|
1 Instructions
1.243. WriteAnyBin - Writes data to a binary serial channel or file
RobotWare - OS
3HAC 16581-1 Revision: J
714
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of the instruction WriteAnyBin are illustrated below.
Example 1
VAR iodev channel;
VAR num input;
VAR robtarget cur_robt;
Open "com2:", channel\Bin;
! Send the control character enq
WriteStrBin channel, "\05";
! Wait for the control character ack
input := ReadBin (channel \Time:= 0.1);
IF input = 6 THEN
! Send current robot position
cur_robt := CRobT(\Tool:= tool1\WObj:= wobj1);
WriteAnyBin channel, cur_robt;
ENDIF
Close channel;
The current position of the robot is written to a binary serial channel.
Limitations
Because WriteAnyBin-ReadAnyBin is designed to only send internal controller data
between IRC5 control systems, no data protocol is released and the data cannot be interpreted
on any PC .
Control software development can break the compatibility, and therefore 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
WriteAnyBin
[IODevice’:=’] <variable ( VAR ) of iodev>’,’
[Data’:=’] <expression ( IN ) of ANYTYPE>’;’
Continued
Continues on next page
1 Instructions
1.243. WriteAnyBin - Writes data to a binary serial channel or file
RobotWare - OS
715
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Opening, etc. of serial channels or files
Technical reference manual - RAPID
overview , section RAPID summary - Com-
munication
Read data from a binary serial channel or file
ReadAnyBin - Read data from a binary serial
channel or file on page 340
Continued
1 Instructions
1.244. WriteBin - Writes to a binary serial channel
RobotWare - OS
3HAC 16581-1 Revision: J
716
© Copyright 2004-2010 ABB. All rights reserved.
1.244. WriteBin - Writes to a binary serial channel
Usage
WriteBin is used to write a number of bytes to a binary serial channel.
Basic examples
Basic examples of the instruction WriteBin are illustrated below.
See also More examples on page 717 .
Example 1
WriteBin channel2, text_buffer, 10;
10 characters from the text_buffer list are written to the channel referred to by channel2 .
Arguments
WriteBin IODevice Buffer NChar
IODevice
Data type: iodev
Name (reference) of the current serial channel.
Buffer
Data type: array of num
The list (array) containing the numbers (characters) to be written.
NChar
Number of Characters
Data type: num
The number of characters to be written from the Buffer .
Program execution
The specified number of numbers (characters) in the list is written to the serial channel.
Limitations
This instruction can only be used for serial channels that have been opened for binary writing.
Error handling
If an error occurs during writing then the system variable ERRNO is set to ERR_FILEACC . This
error can then be handled in the error handler.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 718
|
1 Instructions
1.243. WriteAnyBin - Writes data to a binary serial channel or file
RobotWare - OS
715
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Opening, etc. of serial channels or files
Technical reference manual - RAPID
overview , section RAPID summary - Com-
munication
Read data from a binary serial channel or file
ReadAnyBin - Read data from a binary serial
channel or file on page 340
Continued
1 Instructions
1.244. WriteBin - Writes to a binary serial channel
RobotWare - OS
3HAC 16581-1 Revision: J
716
© Copyright 2004-2010 ABB. All rights reserved.
1.244. WriteBin - Writes to a binary serial channel
Usage
WriteBin is used to write a number of bytes to a binary serial channel.
Basic examples
Basic examples of the instruction WriteBin are illustrated below.
See also More examples on page 717 .
Example 1
WriteBin channel2, text_buffer, 10;
10 characters from the text_buffer list are written to the channel referred to by channel2 .
Arguments
WriteBin IODevice Buffer NChar
IODevice
Data type: iodev
Name (reference) of the current serial channel.
Buffer
Data type: array of num
The list (array) containing the numbers (characters) to be written.
NChar
Number of Characters
Data type: num
The number of characters to be written from the Buffer .
Program execution
The specified number of numbers (characters) in the list is written to the serial channel.
Limitations
This instruction can only be used for serial channels that have been opened for binary writing.
Error handling
If an error occurs during writing then the system variable ERRNO is set to ERR_FILEACC . This
error can then be handled in the error handler.
Continues on next page
1 Instructions
1.244. WriteBin - Writes to a binary serial channel
RobotWare - OS
717
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of how to use the instruction WriteBin are illustrated below.
Example 1
VAR iodev channel;
VAR num out_buffer{20};
VAR num input;
VAR num nchar;
Open "com2:", channel\Bin;
out_buffer{1} := 5;!( enq )
WriteBin channel, out_buffer, 1;
input := ReadBin (channel \Time:= 0.1);
IF input = 6 THEN !( ack )
out_buffer{1} := 2;!( stx )
out_buffer{2} := 72;!( ’H’ )
out_buffer{3} := 101;!( ’e’ )
out_buffer{4} := 108;!( ’l’ )
out_buffer{5} := 108;!( ’l’ )
out_buffer{6} := 111;!( ’o’ )
out_buffer{7} := 32;!( ’ ’ )
out_buffer{8} := StrToByte("w"\Char);!( ’w’ )
out_buffer{9} := StrToByte("o"\Char);!( ’o’ )
out_buffer{10} := StrToByte("r"\Char);!( ’r’ )
out_buffer{11} := StrToByte("l"\Char);!( ’l’ )
out_buffer{12} := StrToByte("d"\Char);!( ’d’ )
out_buffer{13} := 3;!( etx )
WriteBin channel, out_buffer, 13;
ENDIF
After a handshake ( enq,ack ) the text string Hello world (with associated control
characters) is written to a serial channel. The function StrToByte is used in the same cases
to convert a string into a byte ( num ) data.
Syntax
WriteBin
[IODevice’:=’] <variable ( VAR ) of iodev>’,’
[Buffer’:=’] <array {*} ( IN ) of num>’,’
[NChar’:=’] <expression ( IN ) of num>’;’
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
| 719
|
1 Instructions
1.244. WriteBin - Writes to a binary serial channel
RobotWare - OS
3HAC 16581-1 Revision: J
716
© Copyright 2004-2010 ABB. All rights reserved.
1.244. WriteBin - Writes to a binary serial channel
Usage
WriteBin is used to write a number of bytes to a binary serial channel.
Basic examples
Basic examples of the instruction WriteBin are illustrated below.
See also More examples on page 717 .
Example 1
WriteBin channel2, text_buffer, 10;
10 characters from the text_buffer list are written to the channel referred to by channel2 .
Arguments
WriteBin IODevice Buffer NChar
IODevice
Data type: iodev
Name (reference) of the current serial channel.
Buffer
Data type: array of num
The list (array) containing the numbers (characters) to be written.
NChar
Number of Characters
Data type: num
The number of characters to be written from the Buffer .
Program execution
The specified number of numbers (characters) in the list is written to the serial channel.
Limitations
This instruction can only be used for serial channels that have been opened for binary writing.
Error handling
If an error occurs during writing then the system variable ERRNO is set to ERR_FILEACC . This
error can then be handled in the error handler.
Continues on next page
1 Instructions
1.244. WriteBin - Writes to a binary serial channel
RobotWare - OS
717
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of how to use the instruction WriteBin are illustrated below.
Example 1
VAR iodev channel;
VAR num out_buffer{20};
VAR num input;
VAR num nchar;
Open "com2:", channel\Bin;
out_buffer{1} := 5;!( enq )
WriteBin channel, out_buffer, 1;
input := ReadBin (channel \Time:= 0.1);
IF input = 6 THEN !( ack )
out_buffer{1} := 2;!( stx )
out_buffer{2} := 72;!( ’H’ )
out_buffer{3} := 101;!( ’e’ )
out_buffer{4} := 108;!( ’l’ )
out_buffer{5} := 108;!( ’l’ )
out_buffer{6} := 111;!( ’o’ )
out_buffer{7} := 32;!( ’ ’ )
out_buffer{8} := StrToByte("w"\Char);!( ’w’ )
out_buffer{9} := StrToByte("o"\Char);!( ’o’ )
out_buffer{10} := StrToByte("r"\Char);!( ’r’ )
out_buffer{11} := StrToByte("l"\Char);!( ’l’ )
out_buffer{12} := StrToByte("d"\Char);!( ’d’ )
out_buffer{13} := 3;!( etx )
WriteBin channel, out_buffer, 13;
ENDIF
After a handshake ( enq,ack ) the text string Hello world (with associated control
characters) is written to a serial channel. The function StrToByte is used in the same cases
to convert a string into a byte ( num ) data.
Syntax
WriteBin
[IODevice’:=’] <variable ( VAR ) of iodev>’,’
[Buffer’:=’] <array {*} ( IN ) of num>’,’
[NChar’:=’] <expression ( IN ) of num>’;’
Continued
Continues on next page
1 Instructions
1.244. WriteBin - Writes to a binary serial channel
RobotWare - OS
3HAC 16581-1 Revision: J
718
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Opening, etc. of serial channels
Technical reference manual - RAPID overview ,
section RAPID summary - Communication
Convert a string to a byte data
StrToByte - Converts a string to a byte data on
page 1007
Byte data
byte - Integer values 0 - 255 on page 1091
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 720
|
1 Instructions
1.244. WriteBin - Writes to a binary serial channel
RobotWare - OS
717
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of how to use the instruction WriteBin are illustrated below.
Example 1
VAR iodev channel;
VAR num out_buffer{20};
VAR num input;
VAR num nchar;
Open "com2:", channel\Bin;
out_buffer{1} := 5;!( enq )
WriteBin channel, out_buffer, 1;
input := ReadBin (channel \Time:= 0.1);
IF input = 6 THEN !( ack )
out_buffer{1} := 2;!( stx )
out_buffer{2} := 72;!( ’H’ )
out_buffer{3} := 101;!( ’e’ )
out_buffer{4} := 108;!( ’l’ )
out_buffer{5} := 108;!( ’l’ )
out_buffer{6} := 111;!( ’o’ )
out_buffer{7} := 32;!( ’ ’ )
out_buffer{8} := StrToByte("w"\Char);!( ’w’ )
out_buffer{9} := StrToByte("o"\Char);!( ’o’ )
out_buffer{10} := StrToByte("r"\Char);!( ’r’ )
out_buffer{11} := StrToByte("l"\Char);!( ’l’ )
out_buffer{12} := StrToByte("d"\Char);!( ’d’ )
out_buffer{13} := 3;!( etx )
WriteBin channel, out_buffer, 13;
ENDIF
After a handshake ( enq,ack ) the text string Hello world (with associated control
characters) is written to a serial channel. The function StrToByte is used in the same cases
to convert a string into a byte ( num ) data.
Syntax
WriteBin
[IODevice’:=’] <variable ( VAR ) of iodev>’,’
[Buffer’:=’] <array {*} ( IN ) of num>’,’
[NChar’:=’] <expression ( IN ) of num>’;’
Continued
Continues on next page
1 Instructions
1.244. WriteBin - Writes to a binary serial channel
RobotWare - OS
3HAC 16581-1 Revision: J
718
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Opening, etc. of serial channels
Technical reference manual - RAPID overview ,
section RAPID summary - Communication
Convert a string to a byte data
StrToByte - Converts a string to a byte data on
page 1007
Byte data
byte - Integer values 0 - 255 on page 1091
Continued
1 Instructions
1.245. WriteBlock - write block of data to device
Sensor Interface
719
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.245. WriteBlock - write block of data to device
Usage
WriteBlock is used to write a block of data to a device connected to the serial sensor
interface. The data is fetched from a file.
The sensor interface communicates with sensors over serial channels using the RTP1
transport protocol.
This is an example of a sensor channel configuration.
COM_PHY_CHANNEL:
•
Name “COM1:”
•
Connector “COM1”
•
Baudrate 19200
COM_TRP:
•
Name “sen1:”
•
Type “RTP1”
•
PhyChannel “COM1”
Basic examples
Basic example of the instruction WriteBlock 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:";
! Write sensor parameters from flp1:senpar.cfg
! to sensor datablock 1.
WriteBlock "sen1:", ParBlock, SensorPar;
Arguments
WriteBlock 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 block to be written.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 721
|
1 Instructions
1.244. WriteBin - Writes to a binary serial channel
RobotWare - OS
3HAC 16581-1 Revision: J
718
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Opening, etc. of serial channels
Technical reference manual - RAPID overview ,
section RAPID summary - Communication
Convert a string to a byte data
StrToByte - Converts a string to a byte data on
page 1007
Byte data
byte - Integer values 0 - 255 on page 1091
Continued
1 Instructions
1.245. WriteBlock - write block of data to device
Sensor Interface
719
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.245. WriteBlock - write block of data to device
Usage
WriteBlock is used to write a block of data to a device connected to the serial sensor
interface. The data is fetched from a file.
The sensor interface communicates with sensors over serial channels using the RTP1
transport protocol.
This is an example of a sensor channel configuration.
COM_PHY_CHANNEL:
•
Name “COM1:”
•
Connector “COM1”
•
Baudrate 19200
COM_TRP:
•
Name “sen1:”
•
Type “RTP1”
•
PhyChannel “COM1”
Basic examples
Basic example of the instruction WriteBlock 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:";
! Write sensor parameters from flp1:senpar.cfg
! to sensor datablock 1.
WriteBlock "sen1:", ParBlock, SensorPar;
Arguments
WriteBlock 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 block to be written.
Continues on next page
1 Instructions
1.245. WriteBlock - write block of data to device
Sensor Interface
3HAC 16581-1 Revision: J
720
© Copyright 2004-2010 ABB. All rights reserved.
FileName
Data type: string
The argument FileName is used to select a file from which data is written to 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
WriteBlock
[ 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 bus
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 data block
ReadBlock - read a block of data from device on page 343
Configuration of sensor commu-
nication
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
| 722
|
1 Instructions
1.245. WriteBlock - write block of data to device
Sensor Interface
719
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.245. WriteBlock - write block of data to device
Usage
WriteBlock is used to write a block of data to a device connected to the serial sensor
interface. The data is fetched from a file.
The sensor interface communicates with sensors over serial channels using the RTP1
transport protocol.
This is an example of a sensor channel configuration.
COM_PHY_CHANNEL:
•
Name “COM1:”
•
Connector “COM1”
•
Baudrate 19200
COM_TRP:
•
Name “sen1:”
•
Type “RTP1”
•
PhyChannel “COM1”
Basic examples
Basic example of the instruction WriteBlock 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:";
! Write sensor parameters from flp1:senpar.cfg
! to sensor datablock 1.
WriteBlock "sen1:", ParBlock, SensorPar;
Arguments
WriteBlock 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 block to be written.
Continues on next page
1 Instructions
1.245. WriteBlock - write block of data to device
Sensor Interface
3HAC 16581-1 Revision: J
720
© Copyright 2004-2010 ABB. All rights reserved.
FileName
Data type: string
The argument FileName is used to select a file from which data is written to 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
WriteBlock
[ 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 bus
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 data block
ReadBlock - read a block of data from device on page 343
Configuration of sensor commu-
nication
Technical reference manual - System parameters , section
Communication
Continued
1 Instructions
1.246. WriteCfgData - Writes attribute of a system parameter
RobotWare - OS
721
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.246. WriteCfgData - Writes attribute of a system parameter
Usage
WriteCfgData is used to write one attribute of a system parameter (configuration data).
Besides writing named parameters, it is also possible to search and update unnamed
parameters
Basic examples
Basic examples of the instruction WriteCfgData are illustrated below. Both of these
examples show how to write named parameter data.
Example 1
VAR num offset1 := 1.2;
...
WriteCfgData "/MOC/MOTOR_CALIB/rob1_1","cal_offset",offset1;
Written in the num variable offset1 , the calibration offset for axis 1 on rob_1.
Example 2
VAR string io_unit := "my_unit";
...
WriteCfgData "/EIO/EIO_SIGNAL/process_error","Unit",io_unit;
Written in the string variable io_unit, the name of the I/O unit where the signal
process_error is defined.
Arguments
WriteCfgData InstancePath Attribute CfgData [\ListNo]
InstancePath
Data type: string
Specifies the 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 written.
CfgData
Data type: anytype
The data object from which the new data to store is read. Depending on the attribute type,
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
| 723
|
1 Instructions
1.245. WriteBlock - write block of data to device
Sensor Interface
3HAC 16581-1 Revision: J
720
© Copyright 2004-2010 ABB. All rights reserved.
FileName
Data type: string
The argument FileName is used to select a file from which data is written to 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
WriteBlock
[ 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 bus
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 data block
ReadBlock - read a block of data from device on page 343
Configuration of sensor commu-
nication
Technical reference manual - System parameters , section
Communication
Continued
1 Instructions
1.246. WriteCfgData - Writes attribute of a system parameter
RobotWare - OS
721
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.246. WriteCfgData - Writes attribute of a system parameter
Usage
WriteCfgData is used to write one attribute of a system parameter (configuration data).
Besides writing named parameters, it is also possible to search and update unnamed
parameters
Basic examples
Basic examples of the instruction WriteCfgData are illustrated below. Both of these
examples show how to write named parameter data.
Example 1
VAR num offset1 := 1.2;
...
WriteCfgData "/MOC/MOTOR_CALIB/rob1_1","cal_offset",offset1;
Written in the num variable offset1 , the calibration offset for axis 1 on rob_1.
Example 2
VAR string io_unit := "my_unit";
...
WriteCfgData "/EIO/EIO_SIGNAL/process_error","Unit",io_unit;
Written in the string variable io_unit, the name of the I/O unit where the signal
process_error is defined.
Arguments
WriteCfgData InstancePath Attribute CfgData [\ListNo]
InstancePath
Data type: string
Specifies the 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 written.
CfgData
Data type: anytype
The data object from which the new data to store is read. Depending on the attribute type,
valid types are bool, num , or string .
Continues on next page
1 Instructions
1.246. WriteCfgData - Writes attribute of a system parameter
RobotWare - OS
3HAC 16581-1 Revision: J
722
© Copyright 2004-2010 ABB. All rights reserved.
[\ListNo]
Data type: num
Variable holding the instance number of the Attribute + AttributeValue to be found
and updated.
First occurrence of the Attribute + AttributeValue has instance number 0. If there are
more instances to search for then the returned value in \ListNo will be incremented with 1.
Otherwise if there are no more instance then the returned value will be -1. The predefined
constant END_OF_LIST can be used for check if there are more instances to search for.
Program execution
The value of the attribute specified by the Attribute argument is set according to the value
of the data object specified by the CfgData argument.
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 .
For unnamed parameters, use the optional parameter \ListNo to specify which instance to
write the attribute value to. It is updated after each successful write to the next available
instance to write to.
More examples
More examples of the instruction WriteCfgdata are illustrated below. Both of these
examples show how to write to unnamed parameters.
Example 1
VAR num read_index;
VAR num write_index;
VAR string read_str;
...
read_index:=0;
write_index:=0;
ReadCfgData "/EIO/EIO_CROSS/Act1/do_13", "Res", read_str,
\ListNo:=read_index;
WriteCfgData "/EIO/EIO_CROSS/Act1/do_13", "Res", "my"+read_str,
\ListNo:=write_index;
Reads the resultant signal for the unnamed digital actor signal do_13 and places the name in
the string variable read_str . Then update the name to di_13 with prefix " my ".
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
| 724
|
1 Instructions
1.246. WriteCfgData - Writes attribute of a system parameter
RobotWare - OS
721
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.246. WriteCfgData - Writes attribute of a system parameter
Usage
WriteCfgData is used to write one attribute of a system parameter (configuration data).
Besides writing named parameters, it is also possible to search and update unnamed
parameters
Basic examples
Basic examples of the instruction WriteCfgData are illustrated below. Both of these
examples show how to write named parameter data.
Example 1
VAR num offset1 := 1.2;
...
WriteCfgData "/MOC/MOTOR_CALIB/rob1_1","cal_offset",offset1;
Written in the num variable offset1 , the calibration offset for axis 1 on rob_1.
Example 2
VAR string io_unit := "my_unit";
...
WriteCfgData "/EIO/EIO_SIGNAL/process_error","Unit",io_unit;
Written in the string variable io_unit, the name of the I/O unit where the signal
process_error is defined.
Arguments
WriteCfgData InstancePath Attribute CfgData [\ListNo]
InstancePath
Data type: string
Specifies the 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 written.
CfgData
Data type: anytype
The data object from which the new data to store is read. Depending on the attribute type,
valid types are bool, num , or string .
Continues on next page
1 Instructions
1.246. WriteCfgData - Writes attribute of a system parameter
RobotWare - OS
3HAC 16581-1 Revision: J
722
© Copyright 2004-2010 ABB. All rights reserved.
[\ListNo]
Data type: num
Variable holding the instance number of the Attribute + AttributeValue to be found
and updated.
First occurrence of the Attribute + AttributeValue has instance number 0. If there are
more instances to search for then the returned value in \ListNo will be incremented with 1.
Otherwise if there are no more instance then the returned value will be -1. The predefined
constant END_OF_LIST can be used for check if there are more instances to search for.
Program execution
The value of the attribute specified by the Attribute argument is set according to the value
of the data object specified by the CfgData argument.
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 .
For unnamed parameters, use the optional parameter \ListNo to specify which instance to
write the attribute value to. It is updated after each successful write to the next available
instance to write to.
More examples
More examples of the instruction WriteCfgdata are illustrated below. Both of these
examples show how to write to unnamed parameters.
Example 1
VAR num read_index;
VAR num write_index;
VAR string read_str;
...
read_index:=0;
write_index:=0;
ReadCfgData "/EIO/EIO_CROSS/Act1/do_13", "Res", read_str,
\ListNo:=read_index;
WriteCfgData "/EIO/EIO_CROSS/Act1/do_13", "Res", "my"+read_str,
\ListNo:=write_index;
Reads the resultant signal for the unnamed digital actor signal do_13 and places the name in
the string variable read_str . Then update the name to di_13 with prefix " my ".
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.246. WriteCfgData - Writes attribute of a system parameter
RobotWare - OS
723
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Example 2
VAR num read_index;
VAR num write_index;
VAR string read_str;
...
read_index:=0;
write_index:=0;
WHILE read_index <> END_OF_LIST DO
ReadCfgData "/EIO/EIO_SIGNAL/Unit/USERIO", "Name", read_str,
\ListNo:=read_index;
IF read_index <> END_OF_LIST THEN
WriteCfgData "/EIO/EIO_SIGNAL/Unit/USERIO", "Name",
"my"+read_str, \ListNo:=write_index;
ENDIF
ENDWHILE
Read the names of all signals defined for the I/O unit USERIO . Change the names on the
signals to the read name with the prefix " my ".
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 the data for parameter CfgData is outside limits (max./min. value) then the system variable
ERRNO is set to ERR_CFG_LIMIT.
If trying to write internally written protected 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.
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
| 725
|
1 Instructions
1.246. WriteCfgData - Writes attribute of a system parameter
RobotWare - OS
3HAC 16581-1 Revision: J
722
© Copyright 2004-2010 ABB. All rights reserved.
[\ListNo]
Data type: num
Variable holding the instance number of the Attribute + AttributeValue to be found
and updated.
First occurrence of the Attribute + AttributeValue has instance number 0. If there are
more instances to search for then the returned value in \ListNo will be incremented with 1.
Otherwise if there are no more instance then the returned value will be -1. The predefined
constant END_OF_LIST can be used for check if there are more instances to search for.
Program execution
The value of the attribute specified by the Attribute argument is set according to the value
of the data object specified by the CfgData argument.
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 .
For unnamed parameters, use the optional parameter \ListNo to specify which instance to
write the attribute value to. It is updated after each successful write to the next available
instance to write to.
More examples
More examples of the instruction WriteCfgdata are illustrated below. Both of these
examples show how to write to unnamed parameters.
Example 1
VAR num read_index;
VAR num write_index;
VAR string read_str;
...
read_index:=0;
write_index:=0;
ReadCfgData "/EIO/EIO_CROSS/Act1/do_13", "Res", read_str,
\ListNo:=read_index;
WriteCfgData "/EIO/EIO_CROSS/Act1/do_13", "Res", "my"+read_str,
\ListNo:=write_index;
Reads the resultant signal for the unnamed digital actor signal do_13 and places the name in
the string variable read_str . Then update the name to di_13 with prefix " my ".
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.246. WriteCfgData - Writes attribute of a system parameter
RobotWare - OS
723
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Example 2
VAR num read_index;
VAR num write_index;
VAR string read_str;
...
read_index:=0;
write_index:=0;
WHILE read_index <> END_OF_LIST DO
ReadCfgData "/EIO/EIO_SIGNAL/Unit/USERIO", "Name", read_str,
\ListNo:=read_index;
IF read_index <> END_OF_LIST THEN
WriteCfgData "/EIO/EIO_SIGNAL/Unit/USERIO", "Name",
"my"+read_str, \ListNo:=write_index;
ENDIF
ENDWHILE
Read the names of all signals defined for the I/O unit USERIO . Change the names on the
signals to the read name with the prefix " my ".
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 the data for parameter CfgData is outside limits (max./min. value) then the system variable
ERRNO is set to ERR_CFG_LIMIT.
If trying to write internally written protected 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.
Continued
Continues on next page
1 Instructions
1.246. WriteCfgData - Writes attribute of a system parameter
RobotWare - OS
3HAC 16581-1 Revision: J
724
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
The conversion from RAPID program units (mm, degree, second etc.) to system parameter
units (m, radian, second etc.) for CfgData of data type num must be done by the user in the
RAPID program.
You must manually restart the controller or execute the instruction WarmStart in order for
the change to have effect.
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 of InstancePath, Attribute , or CfgData .
Predefined data
The predefined constant END_OF_LIST with value -1 can be used to stop writing when no
more instances can be found.
Syntax
WriteCfgData
[ InstancePath’ :=’ ] < expression ( IN ) of string >’,’
[ Attribute’ :=’ ] < expression ( IN ) of string >’,’
[ CfgData’ :=’ ] < expression ( IN ) of anytype >
[’\’ListNo’:=’ < variable ( VAR ) of num >]’;’
Related information
For information about
See
Definition of string
string - Strings on page 1195
Read attribute of a system parameter
ReadCfgData - Reads attribute of a system
parameter on page 345
Get robot name in current task
RobName - Get the TCP robot name on page 966
Configuration
Technical reference manual - System parameters
Warm start of the system
WarmStart - Restart the controller on page 704
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 726
|
1 Instructions
1.246. WriteCfgData - Writes attribute of a system parameter
RobotWare - OS
723
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Example 2
VAR num read_index;
VAR num write_index;
VAR string read_str;
...
read_index:=0;
write_index:=0;
WHILE read_index <> END_OF_LIST DO
ReadCfgData "/EIO/EIO_SIGNAL/Unit/USERIO", "Name", read_str,
\ListNo:=read_index;
IF read_index <> END_OF_LIST THEN
WriteCfgData "/EIO/EIO_SIGNAL/Unit/USERIO", "Name",
"my"+read_str, \ListNo:=write_index;
ENDIF
ENDWHILE
Read the names of all signals defined for the I/O unit USERIO . Change the names on the
signals to the read name with the prefix " my ".
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 the data for parameter CfgData is outside limits (max./min. value) then the system variable
ERRNO is set to ERR_CFG_LIMIT.
If trying to write internally written protected 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.
Continued
Continues on next page
1 Instructions
1.246. WriteCfgData - Writes attribute of a system parameter
RobotWare - OS
3HAC 16581-1 Revision: J
724
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
The conversion from RAPID program units (mm, degree, second etc.) to system parameter
units (m, radian, second etc.) for CfgData of data type num must be done by the user in the
RAPID program.
You must manually restart the controller or execute the instruction WarmStart in order for
the change to have effect.
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 of InstancePath, Attribute , or CfgData .
Predefined data
The predefined constant END_OF_LIST with value -1 can be used to stop writing when no
more instances can be found.
Syntax
WriteCfgData
[ InstancePath’ :=’ ] < expression ( IN ) of string >’,’
[ Attribute’ :=’ ] < expression ( IN ) of string >’,’
[ CfgData’ :=’ ] < expression ( IN ) of anytype >
[’\’ListNo’:=’ < variable ( VAR ) of num >]’;’
Related information
For information about
See
Definition of string
string - Strings on page 1195
Read attribute of a system parameter
ReadCfgData - Reads attribute of a system
parameter on page 345
Get robot name in current task
RobName - Get the TCP robot name on page 966
Configuration
Technical reference manual - System parameters
Warm start of the system
WarmStart - Restart the controller on page 704
Continued
1 Instructions
1.247. WriteRawBytes - Write rawbytes data
RobotWare - OS
725
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.247. WriteRawBytes - Write rawbytes data
Usage
WriteRawBytes is used to write data of type rawbytes to a device opened with Open\Bin .
Basic examples
Basic examples of the instruction WriteRawBytes 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 "/FCI1:/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, "/FCI1/: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 “ /FCI1/:dsqc328_1 ”, then the read data is unpacked as a
string of 10 characters and stored in answer.
Arguments
WriteRawBytes IODevice RawData [\NoOfBytes]
IODevice
Data type: iodev
IODevice is the identifier of the device to which RawData shall be written.
RawData
Data type: rawbytes
RawData is the data container to be written to IODevice .
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 727
|
1 Instructions
1.246. WriteCfgData - Writes attribute of a system parameter
RobotWare - OS
3HAC 16581-1 Revision: J
724
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
The conversion from RAPID program units (mm, degree, second etc.) to system parameter
units (m, radian, second etc.) for CfgData of data type num must be done by the user in the
RAPID program.
You must manually restart the controller or execute the instruction WarmStart in order for
the change to have effect.
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 of InstancePath, Attribute , or CfgData .
Predefined data
The predefined constant END_OF_LIST with value -1 can be used to stop writing when no
more instances can be found.
Syntax
WriteCfgData
[ InstancePath’ :=’ ] < expression ( IN ) of string >’,’
[ Attribute’ :=’ ] < expression ( IN ) of string >’,’
[ CfgData’ :=’ ] < expression ( IN ) of anytype >
[’\’ListNo’:=’ < variable ( VAR ) of num >]’;’
Related information
For information about
See
Definition of string
string - Strings on page 1195
Read attribute of a system parameter
ReadCfgData - Reads attribute of a system
parameter on page 345
Get robot name in current task
RobName - Get the TCP robot name on page 966
Configuration
Technical reference manual - System parameters
Warm start of the system
WarmStart - Restart the controller on page 704
Continued
1 Instructions
1.247. WriteRawBytes - Write rawbytes data
RobotWare - OS
725
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.247. WriteRawBytes - Write rawbytes data
Usage
WriteRawBytes is used to write data of type rawbytes to a device opened with Open\Bin .
Basic examples
Basic examples of the instruction WriteRawBytes 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 "/FCI1:/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, "/FCI1/: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 “ /FCI1/:dsqc328_1 ”, then the read data is unpacked as a
string of 10 characters and stored in answer.
Arguments
WriteRawBytes IODevice RawData [\NoOfBytes]
IODevice
Data type: iodev
IODevice is the identifier of the device to which RawData shall be written.
RawData
Data type: rawbytes
RawData is the data container to be written to IODevice .
Continues on next page
1 Instructions
1.247. WriteRawBytes - Write rawbytes data
RobotWare - OS
3HAC 16581-1 Revision: J
726
© Copyright 2004-2010 ABB. All rights reserved.
[\NoOfBytes]
Data type: num
\NoOfBytes tells how many bytes of RawData should be written to IODevice , starting at
index 1.
If \NoOfBytes is not present then the current length of valid bytes in the variable RawData
is written to device IODevice.
Program execution
During program execution, data is written to 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 handle in RAPID with the ReadRawBytes
instruction.
The current length of valid bytes in the RawData variable is not changed.
Error handling
If an error occurs during writing then the system variable ERRNO is set to ERR_FILEACC .
This error can then be dealt with by the error handler.
Syntax
WriteRawBytes
[IODevice ’:=’ ] < variable ( VAR ) of iodev> ´,’
[RawData ’:=’ ] < variable ( VAR ) of rawbytes>
[´\’NoOfBytes’ :=’ < 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
Read rawbytes data
ReadRawBytes - Read rawbytes data on page
352
Unpack data from rawbytes data
UnpackRawBytes - Unpack data from rawbytes
data on page 658
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 728
|
1 Instructions
1.247. WriteRawBytes - Write rawbytes data
RobotWare - OS
725
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.247. WriteRawBytes - Write rawbytes data
Usage
WriteRawBytes is used to write data of type rawbytes to a device opened with Open\Bin .
Basic examples
Basic examples of the instruction WriteRawBytes 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 "/FCI1:/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, "/FCI1/: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 “ /FCI1/:dsqc328_1 ”, then the read data is unpacked as a
string of 10 characters and stored in answer.
Arguments
WriteRawBytes IODevice RawData [\NoOfBytes]
IODevice
Data type: iodev
IODevice is the identifier of the device to which RawData shall be written.
RawData
Data type: rawbytes
RawData is the data container to be written to IODevice .
Continues on next page
1 Instructions
1.247. WriteRawBytes - Write rawbytes data
RobotWare - OS
3HAC 16581-1 Revision: J
726
© Copyright 2004-2010 ABB. All rights reserved.
[\NoOfBytes]
Data type: num
\NoOfBytes tells how many bytes of RawData should be written to IODevice , starting at
index 1.
If \NoOfBytes is not present then the current length of valid bytes in the variable RawData
is written to device IODevice.
Program execution
During program execution, data is written to 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 handle in RAPID with the ReadRawBytes
instruction.
The current length of valid bytes in the RawData variable is not changed.
Error handling
If an error occurs during writing then the system variable ERRNO is set to ERR_FILEACC .
This error can then be dealt with by the error handler.
Syntax
WriteRawBytes
[IODevice ’:=’ ] < variable ( VAR ) of iodev> ´,’
[RawData ’:=’ ] < variable ( VAR ) of rawbytes>
[´\’NoOfBytes’ :=’ < 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
Read rawbytes data
ReadRawBytes - Read rawbytes data on page
352
Unpack data from rawbytes data
UnpackRawBytes - Unpack data from rawbytes
data on page 658
Continued
1 Instructions
1.248. WriteStrBin - Writes a string to a binary serial channel
RobotWare - OS
727
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.248. WriteStrBin - Writes a string to a binary serial channel
Usage
WriteStrBin ( Write String Binary ) is used to write a string to a binary serial channel or
binary file.
Basic examples
Basic examples of the instruction WriteStrBin are illustrated below.
See also More examples on page 728 .
Example 1
WriteStrBin channel2, "Hello World\0A";
The string "Hello World\0A" is written to the channel referred to by channel2 . The string
is in this case ended with new line \ 0A . All characters and hexadecimal values written with
WriteStrBin will be unchanged by the system.
Arguments
WriteStrBin IODevice Str
IODevice
Data type: iodev
Name (reference) of the current serial channel.
Str
String
Data type: string
The text to be written.
Program execution
The text string is written to the specified serial channel or file.
Limitations
This instruction can only be used for serial channels or files that have been opened for binary
reading and writing.
Error handling
If an error occurs during writing then the system variable ERRNO is set to ERR_FILEACC . This
error can then be handled in the error handler.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 729
|
1 Instructions
1.247. WriteRawBytes - Write rawbytes data
RobotWare - OS
3HAC 16581-1 Revision: J
726
© Copyright 2004-2010 ABB. All rights reserved.
[\NoOfBytes]
Data type: num
\NoOfBytes tells how many bytes of RawData should be written to IODevice , starting at
index 1.
If \NoOfBytes is not present then the current length of valid bytes in the variable RawData
is written to device IODevice.
Program execution
During program execution, data is written to 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 handle in RAPID with the ReadRawBytes
instruction.
The current length of valid bytes in the RawData variable is not changed.
Error handling
If an error occurs during writing then the system variable ERRNO is set to ERR_FILEACC .
This error can then be dealt with by the error handler.
Syntax
WriteRawBytes
[IODevice ’:=’ ] < variable ( VAR ) of iodev> ´,’
[RawData ’:=’ ] < variable ( VAR ) of rawbytes>
[´\’NoOfBytes’ :=’ < 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
Read rawbytes data
ReadRawBytes - Read rawbytes data on page
352
Unpack data from rawbytes data
UnpackRawBytes - Unpack data from rawbytes
data on page 658
Continued
1 Instructions
1.248. WriteStrBin - Writes a string to a binary serial channel
RobotWare - OS
727
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.248. WriteStrBin - Writes a string to a binary serial channel
Usage
WriteStrBin ( Write String Binary ) is used to write a string to a binary serial channel or
binary file.
Basic examples
Basic examples of the instruction WriteStrBin are illustrated below.
See also More examples on page 728 .
Example 1
WriteStrBin channel2, "Hello World\0A";
The string "Hello World\0A" is written to the channel referred to by channel2 . The string
is in this case ended with new line \ 0A . All characters and hexadecimal values written with
WriteStrBin will be unchanged by the system.
Arguments
WriteStrBin IODevice Str
IODevice
Data type: iodev
Name (reference) of the current serial channel.
Str
String
Data type: string
The text to be written.
Program execution
The text string is written to the specified serial channel or file.
Limitations
This instruction can only be used for serial channels or files that have been opened for binary
reading and writing.
Error handling
If an error occurs during writing then the system variable ERRNO is set to ERR_FILEACC . This
error can then be handled in the error handler.
Continues on next page
1 Instructions
1.248. WriteStrBin - Writes a string to a binary serial channel
RobotWare - OS
3HAC 16581-1 Revision: J
728
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of how to use the instruction WriteStrBin are illustrated below.
Example 1
VAR iodev channel;
VAR num input;
Open "com2:", channel\Bin;
! Send the control character enq
WriteStrBin channel, "\05";
! Wait for the control character ack
input := ReadBin (channel \Time:= 0.1);
IF input = 6 THEN
! Send a text starting with control character stx and ending with
etx
WriteStrBin channel, "\02Hello world\03";
ENDIF
Close channel;
After a handshake the text string Hello world (with associated control characters in
hexadecimal) is written to a binary serial channel.
Syntax
WriteStrBin
[IODevice’:=’] <variable ( VAR ) of iodev>’,’
[Str’:=’] <expression ( IN ) of string>’;’
Related information
For information about
See
Opening, etc. of serial channels
Technical reference manual - RAPID
overview , section RAPID summary - Commu-
nication
Read binary sting
ReadStrBin - Reads a string from a binary
serial channel or file on page 956
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 730
|
1 Instructions
1.248. WriteStrBin - Writes a string to a binary serial channel
RobotWare - OS
727
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.248. WriteStrBin - Writes a string to a binary serial channel
Usage
WriteStrBin ( Write String Binary ) is used to write a string to a binary serial channel or
binary file.
Basic examples
Basic examples of the instruction WriteStrBin are illustrated below.
See also More examples on page 728 .
Example 1
WriteStrBin channel2, "Hello World\0A";
The string "Hello World\0A" is written to the channel referred to by channel2 . The string
is in this case ended with new line \ 0A . All characters and hexadecimal values written with
WriteStrBin will be unchanged by the system.
Arguments
WriteStrBin IODevice Str
IODevice
Data type: iodev
Name (reference) of the current serial channel.
Str
String
Data type: string
The text to be written.
Program execution
The text string is written to the specified serial channel or file.
Limitations
This instruction can only be used for serial channels or files that have been opened for binary
reading and writing.
Error handling
If an error occurs during writing then the system variable ERRNO is set to ERR_FILEACC . This
error can then be handled in the error handler.
Continues on next page
1 Instructions
1.248. WriteStrBin - Writes a string to a binary serial channel
RobotWare - OS
3HAC 16581-1 Revision: J
728
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of how to use the instruction WriteStrBin are illustrated below.
Example 1
VAR iodev channel;
VAR num input;
Open "com2:", channel\Bin;
! Send the control character enq
WriteStrBin channel, "\05";
! Wait for the control character ack
input := ReadBin (channel \Time:= 0.1);
IF input = 6 THEN
! Send a text starting with control character stx and ending with
etx
WriteStrBin channel, "\02Hello world\03";
ENDIF
Close channel;
After a handshake the text string Hello world (with associated control characters in
hexadecimal) is written to a binary serial channel.
Syntax
WriteStrBin
[IODevice’:=’] <variable ( VAR ) of iodev>’,’
[Str’:=’] <expression ( IN ) of string>’;’
Related information
For information about
See
Opening, etc. of serial channels
Technical reference manual - RAPID
overview , section RAPID summary - Commu-
nication
Read binary sting
ReadStrBin - Reads a string from a binary
serial channel or file on page 956
Continued
1 Instructions
1.249. WriteVar - write variable
Sensor Interface
729
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.249. WriteVar - write variable
Usage
WriteVar is used to write a variable to a device connected to the serial sensor interface .
The sensor interface communicates with sensors over serial channels using the RTP1
transport protocol.
This is an example of a sensor channel configuration.
COM_PHY_CHANNEL:
•
Name “COM1:”
•
Connector “COM1”
•
Baudrate 19200
COM_TRP:
•
Name “sen1:”
•
Type “RTP1”
•
PhyChannel “COM1”
Basic examples
Basic examples of the instruction WriteVar are illustrated below.
Example 1
! Define variable numbers
CONST num SensorOn := 6;
CONST num XCoord := 8;
CONST num YCoord := 9;
CONST num ZCoord := 10;
VAR pos SensorPos;
! Connect to the sensor device“ sen1:” (defined in sio.cfg).
SenDevice "sen1:";
! Request start of sensor meassurements
WriteVar "sen1:", SensorOn, 1;
! Read a cartesian position from the sensor.
SensorPos.x := ReadVar "sen1:", XCoord;
SensorPos.y := ReadVar "sen1:", YCoord;
SensorPos.z := ReadVar "sen1:", ZCoord;
! Stop sensor
WriteVar "sen1:", SensorOn, 0;
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 731
|
1 Instructions
1.248. WriteStrBin - Writes a string to a binary serial channel
RobotWare - OS
3HAC 16581-1 Revision: J
728
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of how to use the instruction WriteStrBin are illustrated below.
Example 1
VAR iodev channel;
VAR num input;
Open "com2:", channel\Bin;
! Send the control character enq
WriteStrBin channel, "\05";
! Wait for the control character ack
input := ReadBin (channel \Time:= 0.1);
IF input = 6 THEN
! Send a text starting with control character stx and ending with
etx
WriteStrBin channel, "\02Hello world\03";
ENDIF
Close channel;
After a handshake the text string Hello world (with associated control characters in
hexadecimal) is written to a binary serial channel.
Syntax
WriteStrBin
[IODevice’:=’] <variable ( VAR ) of iodev>’,’
[Str’:=’] <expression ( IN ) of string>’;’
Related information
For information about
See
Opening, etc. of serial channels
Technical reference manual - RAPID
overview , section RAPID summary - Commu-
nication
Read binary sting
ReadStrBin - Reads a string from a binary
serial channel or file on page 956
Continued
1 Instructions
1.249. WriteVar - write variable
Sensor Interface
729
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.249. WriteVar - write variable
Usage
WriteVar is used to write a variable to a device connected to the serial sensor interface .
The sensor interface communicates with sensors over serial channels using the RTP1
transport protocol.
This is an example of a sensor channel configuration.
COM_PHY_CHANNEL:
•
Name “COM1:”
•
Connector “COM1”
•
Baudrate 19200
COM_TRP:
•
Name “sen1:”
•
Type “RTP1”
•
PhyChannel “COM1”
Basic examples
Basic examples of the instruction WriteVar are illustrated below.
Example 1
! Define variable numbers
CONST num SensorOn := 6;
CONST num XCoord := 8;
CONST num YCoord := 9;
CONST num ZCoord := 10;
VAR pos SensorPos;
! Connect to the sensor device“ sen1:” (defined in sio.cfg).
SenDevice "sen1:";
! Request start of sensor meassurements
WriteVar "sen1:", SensorOn, 1;
! Read a cartesian position from the sensor.
SensorPos.x := ReadVar "sen1:", XCoord;
SensorPos.y := ReadVar "sen1:", YCoord;
SensorPos.z := ReadVar "sen1:", ZCoord;
! Stop sensor
WriteVar "sen1:", SensorOn, 0;
Continues on next page
1 Instructions
1.249. WriteVar - write variable
Sensor Interface
3HAC 16581-1 Revision: J
730
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
WriteVar device VarNo VarData [ \TaskName ]
device
Data type: string
The I/O device name configured in sio.cfg for the sensor used.
VarNo
Data type: num
The argument VarNo is used to select the sensor variable.
VarData
Data type: num
The argument VarData defines the data which is to be written to the variable selected by the
VarNo argument.
[ \TaskName ]
Data type: string
The argument TaskName makes it possible to access devices in other RAPID tasks.
Fault management
Syntax
WriteVar
[ device ‘:=’ ] < expression ( IN ) of string> ’,’
[ VarNo ’:=’ ] < expression ( IN ) of num > ‘,’
[ VarData’ :=’ ] < expression ( IN ) of num > ’,’
[ ’\’ TaskName’ :=’ < expression ( IN ) of string > ] ‘;’
Error constant ( ERRNO ) value
Description
SEN_NO_MEAS
Measurement failure
SEN_NOREADY
Sensor unable to handle command
SEN_GENERRO
General sensor error
SEN_BUSY
Sensor busy
SEN_UNKNOWN
Unknown sensor
SEN_EXALARM
External sensor error
SEN_CAALARM
Internal sensor error
SEN_TEMP
Sensor temperature error
SEN_VALUE
Illegal communication value
SEN_CAMCHECK
Sensor check failure
SEN_TIMEOUT
Communication error
Continued
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 732
|
1 Instructions
1.249. WriteVar - write variable
Sensor Interface
729
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.249. WriteVar - write variable
Usage
WriteVar is used to write a variable to a device connected to the serial sensor interface .
The sensor interface communicates with sensors over serial channels using the RTP1
transport protocol.
This is an example of a sensor channel configuration.
COM_PHY_CHANNEL:
•
Name “COM1:”
•
Connector “COM1”
•
Baudrate 19200
COM_TRP:
•
Name “sen1:”
•
Type “RTP1”
•
PhyChannel “COM1”
Basic examples
Basic examples of the instruction WriteVar are illustrated below.
Example 1
! Define variable numbers
CONST num SensorOn := 6;
CONST num XCoord := 8;
CONST num YCoord := 9;
CONST num ZCoord := 10;
VAR pos SensorPos;
! Connect to the sensor device“ sen1:” (defined in sio.cfg).
SenDevice "sen1:";
! Request start of sensor meassurements
WriteVar "sen1:", SensorOn, 1;
! Read a cartesian position from the sensor.
SensorPos.x := ReadVar "sen1:", XCoord;
SensorPos.y := ReadVar "sen1:", YCoord;
SensorPos.z := ReadVar "sen1:", ZCoord;
! Stop sensor
WriteVar "sen1:", SensorOn, 0;
Continues on next page
1 Instructions
1.249. WriteVar - write variable
Sensor Interface
3HAC 16581-1 Revision: J
730
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
WriteVar device VarNo VarData [ \TaskName ]
device
Data type: string
The I/O device name configured in sio.cfg for the sensor used.
VarNo
Data type: num
The argument VarNo is used to select the sensor variable.
VarData
Data type: num
The argument VarData defines the data which is to be written to the variable selected by the
VarNo argument.
[ \TaskName ]
Data type: string
The argument TaskName makes it possible to access devices in other RAPID tasks.
Fault management
Syntax
WriteVar
[ device ‘:=’ ] < expression ( IN ) of string> ’,’
[ VarNo ’:=’ ] < expression ( IN ) of num > ‘,’
[ VarData’ :=’ ] < expression ( IN ) of num > ’,’
[ ’\’ TaskName’ :=’ < expression ( IN ) of string > ] ‘;’
Error constant ( ERRNO ) value
Description
SEN_NO_MEAS
Measurement failure
SEN_NOREADY
Sensor unable to handle command
SEN_GENERRO
General sensor error
SEN_BUSY
Sensor busy
SEN_UNKNOWN
Unknown sensor
SEN_EXALARM
External sensor error
SEN_CAALARM
Internal sensor error
SEN_TEMP
Sensor temperature error
SEN_VALUE
Illegal communication value
SEN_CAMCHECK
Sensor check failure
SEN_TIMEOUT
Communication error
Continued
Continues on next page
1 Instructions
1.249. WriteVar - write variable
Sensor Interface
731
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Connect to a sensor device
SenDevice - connect to a sensor device on page 425
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
Read a sensor data block
ReadBlock - read a block of data from device on page
343
Configuration of sensor communi-
cation
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
| 733
|
1 Instructions
1.249. WriteVar - write variable
Sensor Interface
3HAC 16581-1 Revision: J
730
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
WriteVar device VarNo VarData [ \TaskName ]
device
Data type: string
The I/O device name configured in sio.cfg for the sensor used.
VarNo
Data type: num
The argument VarNo is used to select the sensor variable.
VarData
Data type: num
The argument VarData defines the data which is to be written to the variable selected by the
VarNo argument.
[ \TaskName ]
Data type: string
The argument TaskName makes it possible to access devices in other RAPID tasks.
Fault management
Syntax
WriteVar
[ device ‘:=’ ] < expression ( IN ) of string> ’,’
[ VarNo ’:=’ ] < expression ( IN ) of num > ‘,’
[ VarData’ :=’ ] < expression ( IN ) of num > ’,’
[ ’\’ TaskName’ :=’ < expression ( IN ) of string > ] ‘;’
Error constant ( ERRNO ) value
Description
SEN_NO_MEAS
Measurement failure
SEN_NOREADY
Sensor unable to handle command
SEN_GENERRO
General sensor error
SEN_BUSY
Sensor busy
SEN_UNKNOWN
Unknown sensor
SEN_EXALARM
External sensor error
SEN_CAALARM
Internal sensor error
SEN_TEMP
Sensor temperature error
SEN_VALUE
Illegal communication value
SEN_CAMCHECK
Sensor check failure
SEN_TIMEOUT
Communication error
Continued
Continues on next page
1 Instructions
1.249. WriteVar - write variable
Sensor Interface
731
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Connect to a sensor device
SenDevice - connect to a sensor device on page 425
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
Read a sensor data block
ReadBlock - read a block of data from device on page
343
Configuration of sensor communi-
cation
Technical reference manual - System parameters ,
section Communication
Continued
1 Instructions
1.250. WZBoxDef - Define a box-shaped world zone
World Zones
3HAC 16581-1 Revision: J
732
© Copyright 2004-2010 ABB. All rights reserved.
1.250. WZBoxDef - Define a box-shaped world zone
Usage
WZBoxDef ( World Zone Box Definition ) is used to define a world zone that has the shape of
a straight box with all its sides parallel to the axes of the World Coordinate System.
Basic examples
Basic examples of the instruction WZBoxDef are illustrated below.
Example 1
xx0500002205
VAR shapedata volume;
CONST pos corner1:=[200,100,100];
CONST pos corner2:=[600,400,400];
...
WZBoxDef \Inside, volume, corner1, corner2;
Define a straight box with coordinates parallel to the axes of the world coordinate system and
defined by the opposite corners corner1 and corner2 .
Arguments
WZBoxDef [\Inside] | [\Outside] Shape LowPoint HighPoint
[\Inside]
Data type: switch
Define the volume inside the box.
[\Outside]
Data type: switch
Define the volume outside the box (inverse volume).
One of the arguments \Inside or \Outside must be specified.
Shape
Data type: shapedata
Variable for storage of the defined volume (private data for the system).
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 734
|
1 Instructions
1.249. WriteVar - write variable
Sensor Interface
731
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Connect to a sensor device
SenDevice - connect to a sensor device on page 425
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
Read a sensor data block
ReadBlock - read a block of data from device on page
343
Configuration of sensor communi-
cation
Technical reference manual - System parameters ,
section Communication
Continued
1 Instructions
1.250. WZBoxDef - Define a box-shaped world zone
World Zones
3HAC 16581-1 Revision: J
732
© Copyright 2004-2010 ABB. All rights reserved.
1.250. WZBoxDef - Define a box-shaped world zone
Usage
WZBoxDef ( World Zone Box Definition ) is used to define a world zone that has the shape of
a straight box with all its sides parallel to the axes of the World Coordinate System.
Basic examples
Basic examples of the instruction WZBoxDef are illustrated below.
Example 1
xx0500002205
VAR shapedata volume;
CONST pos corner1:=[200,100,100];
CONST pos corner2:=[600,400,400];
...
WZBoxDef \Inside, volume, corner1, corner2;
Define a straight box with coordinates parallel to the axes of the world coordinate system and
defined by the opposite corners corner1 and corner2 .
Arguments
WZBoxDef [\Inside] | [\Outside] Shape LowPoint HighPoint
[\Inside]
Data type: switch
Define the volume inside the box.
[\Outside]
Data type: switch
Define the volume outside the box (inverse volume).
One of the arguments \Inside or \Outside must be specified.
Shape
Data type: shapedata
Variable for storage of the defined volume (private data for the system).
Continues on next page
1 Instructions
1.250. WZBoxDef - Define a box-shaped world zone
World Zones
733
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
LowPoint
Data type: pos
Position (x,y,z) in mm defining one lower corner of the box.
HighPoint
Data type: pos
Position (x,y,z) in mm defining the corner diagonally opposite to the previous one.
Program execution
The definition of the box is stored in the variable of type shapedata (argument Shape ), for
future use in WZLimSup or WZDOSet instructions.
Limitations
The LowPoint and HighPoint positions must be valid for opposite corners (with different
x, y, and z coordinate values).
If the robot is used to point out the LowPoint or HighPoint then work object wobj0 must
be active (use of component trans in robtarget e.g. p1.trans as argument).
Syntax
WZBoxDef
[[’\’Inside] | [’\’Outside]’,’]
[LowPoint’:=’]<expression ( IN ) of pos>’,’
[Shape’:=’]<variable ( VAR ) of shapedata>’,’
[HighPoint’:=’]<expression ( IN ) of pos>’;’
Related information
For information about
See
World Zones
Technical reference manual - RAPID overview ,
section Motion and I/O principles - World zones
World zone shape
shapedata - World zone shape data on page 1179
Define sphere-shaped world zone
WZSphDef - Define a sphere-shaped world zone on
page 756
Define cylinder-shaped world zone
WZCylDef - Define a cylinder-shaped world zone on
page 734
Define a world zone for home joints
WZHomeJointDef - Define a world zone for home
joints on page 746
Define a world zone for limit joints
WZLimJointDef - Define a world zone for limitation
in joints on page 749
Activate world zone limit supervision
WZLimSup - Activate world zone limit supervision
on page 753
Activate world zone digital output set
WZDOSet - Activate world zone to set digital output
on page 738
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 735
|
1 Instructions
1.250. WZBoxDef - Define a box-shaped world zone
World Zones
3HAC 16581-1 Revision: J
732
© Copyright 2004-2010 ABB. All rights reserved.
1.250. WZBoxDef - Define a box-shaped world zone
Usage
WZBoxDef ( World Zone Box Definition ) is used to define a world zone that has the shape of
a straight box with all its sides parallel to the axes of the World Coordinate System.
Basic examples
Basic examples of the instruction WZBoxDef are illustrated below.
Example 1
xx0500002205
VAR shapedata volume;
CONST pos corner1:=[200,100,100];
CONST pos corner2:=[600,400,400];
...
WZBoxDef \Inside, volume, corner1, corner2;
Define a straight box with coordinates parallel to the axes of the world coordinate system and
defined by the opposite corners corner1 and corner2 .
Arguments
WZBoxDef [\Inside] | [\Outside] Shape LowPoint HighPoint
[\Inside]
Data type: switch
Define the volume inside the box.
[\Outside]
Data type: switch
Define the volume outside the box (inverse volume).
One of the arguments \Inside or \Outside must be specified.
Shape
Data type: shapedata
Variable for storage of the defined volume (private data for the system).
Continues on next page
1 Instructions
1.250. WZBoxDef - Define a box-shaped world zone
World Zones
733
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
LowPoint
Data type: pos
Position (x,y,z) in mm defining one lower corner of the box.
HighPoint
Data type: pos
Position (x,y,z) in mm defining the corner diagonally opposite to the previous one.
Program execution
The definition of the box is stored in the variable of type shapedata (argument Shape ), for
future use in WZLimSup or WZDOSet instructions.
Limitations
The LowPoint and HighPoint positions must be valid for opposite corners (with different
x, y, and z coordinate values).
If the robot is used to point out the LowPoint or HighPoint then work object wobj0 must
be active (use of component trans in robtarget e.g. p1.trans as argument).
Syntax
WZBoxDef
[[’\’Inside] | [’\’Outside]’,’]
[LowPoint’:=’]<expression ( IN ) of pos>’,’
[Shape’:=’]<variable ( VAR ) of shapedata>’,’
[HighPoint’:=’]<expression ( IN ) of pos>’;’
Related information
For information about
See
World Zones
Technical reference manual - RAPID overview ,
section Motion and I/O principles - World zones
World zone shape
shapedata - World zone shape data on page 1179
Define sphere-shaped world zone
WZSphDef - Define a sphere-shaped world zone on
page 756
Define cylinder-shaped world zone
WZCylDef - Define a cylinder-shaped world zone on
page 734
Define a world zone for home joints
WZHomeJointDef - Define a world zone for home
joints on page 746
Define a world zone for limit joints
WZLimJointDef - Define a world zone for limitation
in joints on page 749
Activate world zone limit supervision
WZLimSup - Activate world zone limit supervision
on page 753
Activate world zone digital output set
WZDOSet - Activate world zone to set digital output
on page 738
Continued
1 Instructions
1.251. WZCylDef - Define a cylinder-shaped world zone
World Zones
3HAC 16581-1 Revision: J
734
© Copyright 2004-2010 ABB. All rights reserved.
1.251. WZCylDef - Define a cylinder-shaped world zone
Usage
WZCylDef ( World Zone Cylinder Definition ) is used to define a world zone that has the shape
of a cylinder with the cylinder axis parallel to the z-axis of the World Coordinate System.
Basic examples
Basic examples of the instruction WZCylDef are illustrated below.
Example 1
xx0500002206
VAR shapedata volume;
CONST pos C2:=[300,200,200];
CONST num R2:=100;
CONST num H2:=200;
...
WZCylDef \Inside, volume, C2, R2, H2;
Define a cylinder with the center of the bottom circle in C2 , radius R2 , and height H2 .
Arguments
WZCylDef [\Inside] | [\Outside] Shape CentrePoint Radius Height
[\Inside]
Data type: switch
Define the volume inside the cylinder.
[\Outside]
Data type: switch
Define the volume outside the cylinder (inverse volume).
One of the arguments \Inside or \Outside must be specified.
Shape
Data type: shapedata
Variable for storage of the defined volume (private data for the system).
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 736
|
1 Instructions
1.250. WZBoxDef - Define a box-shaped world zone
World Zones
733
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
LowPoint
Data type: pos
Position (x,y,z) in mm defining one lower corner of the box.
HighPoint
Data type: pos
Position (x,y,z) in mm defining the corner diagonally opposite to the previous one.
Program execution
The definition of the box is stored in the variable of type shapedata (argument Shape ), for
future use in WZLimSup or WZDOSet instructions.
Limitations
The LowPoint and HighPoint positions must be valid for opposite corners (with different
x, y, and z coordinate values).
If the robot is used to point out the LowPoint or HighPoint then work object wobj0 must
be active (use of component trans in robtarget e.g. p1.trans as argument).
Syntax
WZBoxDef
[[’\’Inside] | [’\’Outside]’,’]
[LowPoint’:=’]<expression ( IN ) of pos>’,’
[Shape’:=’]<variable ( VAR ) of shapedata>’,’
[HighPoint’:=’]<expression ( IN ) of pos>’;’
Related information
For information about
See
World Zones
Technical reference manual - RAPID overview ,
section Motion and I/O principles - World zones
World zone shape
shapedata - World zone shape data on page 1179
Define sphere-shaped world zone
WZSphDef - Define a sphere-shaped world zone on
page 756
Define cylinder-shaped world zone
WZCylDef - Define a cylinder-shaped world zone on
page 734
Define a world zone for home joints
WZHomeJointDef - Define a world zone for home
joints on page 746
Define a world zone for limit joints
WZLimJointDef - Define a world zone for limitation
in joints on page 749
Activate world zone limit supervision
WZLimSup - Activate world zone limit supervision
on page 753
Activate world zone digital output set
WZDOSet - Activate world zone to set digital output
on page 738
Continued
1 Instructions
1.251. WZCylDef - Define a cylinder-shaped world zone
World Zones
3HAC 16581-1 Revision: J
734
© Copyright 2004-2010 ABB. All rights reserved.
1.251. WZCylDef - Define a cylinder-shaped world zone
Usage
WZCylDef ( World Zone Cylinder Definition ) is used to define a world zone that has the shape
of a cylinder with the cylinder axis parallel to the z-axis of the World Coordinate System.
Basic examples
Basic examples of the instruction WZCylDef are illustrated below.
Example 1
xx0500002206
VAR shapedata volume;
CONST pos C2:=[300,200,200];
CONST num R2:=100;
CONST num H2:=200;
...
WZCylDef \Inside, volume, C2, R2, H2;
Define a cylinder with the center of the bottom circle in C2 , radius R2 , and height H2 .
Arguments
WZCylDef [\Inside] | [\Outside] Shape CentrePoint Radius Height
[\Inside]
Data type: switch
Define the volume inside the cylinder.
[\Outside]
Data type: switch
Define the volume outside the cylinder (inverse volume).
One of the arguments \Inside or \Outside must be specified.
Shape
Data type: shapedata
Variable for storage of the defined volume (private data for the system).
Continues on next page
1 Instructions
1.251. WZCylDef - Define a cylinder-shaped world zone
World Zones
735
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
CentrePoint
Data type: pos
Position (x,y,z) in mm defining the center of one circular end of the cylinder.
Radius
Data type: num
The radius of the cylinder in mm.
Height
Data type: num
The height of the cylinder in mm. If it is positive (+z direction), the CentrePoint argument
is the center of the lower end of the cylinder (as in the above example). If it is negative (-z
direction) then the CentrePoint argument is the center of the upper end of the cylinder.
Program execution
The definition of the cylinder is stored in the variable of type shapedata (argument Shape )
for future use in WZLimSup or WZDOSet instructions.
Limitations
If the robot is used to point out the CentrePoint then the work object wobj0 must be active
(use of component trans in robtarget e.g. p1.trans as argument).
Syntax
WZCylDef
[’\’Inside] | [’\’Outside]’,’
[Shape’:=’]<variable ( VAR ) of shapedata>’,’
[centerPoint’:=’]<expression ( IN ) of pos>’,’
[Radius’:=’]<expression ( IN ) of num>’,’
[Height’:=’]<expression ( IN ) of num>’;’
Related information
For information about
See
World Zones
Technical reference manual - RAPID overview ,
section Motion and I/O principles - World zones
World zone shape
shapedata - World zone shape data on page 1179
Define box-shaped world zone
WZBoxDef - Define a box-shaped world zone on
page 732
Define sphere-shaped world zone
WZSphDef - Define a sphere-shaped world zone
on page 756
Define a world zone for home joints
WZHomeJointDef - Define a world zone for home
joints on page 746
Define a world zone for limit joints
WZLimJointDef - Define a world zone for limitation
in joints on page 749
Activate world zone limit supervision
WZLimSup - Activate world zone limit supervision
on page 753
Activate world zone digital output set
WZDOSet - Activate world zone to set digital output
on page 738
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 737
|
1 Instructions
1.251. WZCylDef - Define a cylinder-shaped world zone
World Zones
3HAC 16581-1 Revision: J
734
© Copyright 2004-2010 ABB. All rights reserved.
1.251. WZCylDef - Define a cylinder-shaped world zone
Usage
WZCylDef ( World Zone Cylinder Definition ) is used to define a world zone that has the shape
of a cylinder with the cylinder axis parallel to the z-axis of the World Coordinate System.
Basic examples
Basic examples of the instruction WZCylDef are illustrated below.
Example 1
xx0500002206
VAR shapedata volume;
CONST pos C2:=[300,200,200];
CONST num R2:=100;
CONST num H2:=200;
...
WZCylDef \Inside, volume, C2, R2, H2;
Define a cylinder with the center of the bottom circle in C2 , radius R2 , and height H2 .
Arguments
WZCylDef [\Inside] | [\Outside] Shape CentrePoint Radius Height
[\Inside]
Data type: switch
Define the volume inside the cylinder.
[\Outside]
Data type: switch
Define the volume outside the cylinder (inverse volume).
One of the arguments \Inside or \Outside must be specified.
Shape
Data type: shapedata
Variable for storage of the defined volume (private data for the system).
Continues on next page
1 Instructions
1.251. WZCylDef - Define a cylinder-shaped world zone
World Zones
735
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
CentrePoint
Data type: pos
Position (x,y,z) in mm defining the center of one circular end of the cylinder.
Radius
Data type: num
The radius of the cylinder in mm.
Height
Data type: num
The height of the cylinder in mm. If it is positive (+z direction), the CentrePoint argument
is the center of the lower end of the cylinder (as in the above example). If it is negative (-z
direction) then the CentrePoint argument is the center of the upper end of the cylinder.
Program execution
The definition of the cylinder is stored in the variable of type shapedata (argument Shape )
for future use in WZLimSup or WZDOSet instructions.
Limitations
If the robot is used to point out the CentrePoint then the work object wobj0 must be active
(use of component trans in robtarget e.g. p1.trans as argument).
Syntax
WZCylDef
[’\’Inside] | [’\’Outside]’,’
[Shape’:=’]<variable ( VAR ) of shapedata>’,’
[centerPoint’:=’]<expression ( IN ) of pos>’,’
[Radius’:=’]<expression ( IN ) of num>’,’
[Height’:=’]<expression ( IN ) of num>’;’
Related information
For information about
See
World Zones
Technical reference manual - RAPID overview ,
section Motion and I/O principles - World zones
World zone shape
shapedata - World zone shape data on page 1179
Define box-shaped world zone
WZBoxDef - Define a box-shaped world zone on
page 732
Define sphere-shaped world zone
WZSphDef - Define a sphere-shaped world zone
on page 756
Define a world zone for home joints
WZHomeJointDef - Define a world zone for home
joints on page 746
Define a world zone for limit joints
WZLimJointDef - Define a world zone for limitation
in joints on page 749
Activate world zone limit supervision
WZLimSup - Activate world zone limit supervision
on page 753
Activate world zone digital output set
WZDOSet - Activate world zone to set digital output
on page 738
Continued
1 Instructions
1.252. WZDisable - Deactivate temporary world zone supervision
World Zones
3HAC 16581-1 Revision: J
736
© Copyright 2004-2010 ABB. All rights reserved.
1.252. WZDisable - Deactivate temporary world zone supervision
Usage
WZDisable ( World Zone Disable ) is used to deactivate the supervision of a temporary world
zone previously defined either to stop the movement or to set an output.
Basic examples
Basic examples of the instruction WZDisable are illustrated below.
Example 1
VAR wztemporary wzone;
...
PROC...
WZLimSup \Temp, wzone, volume;
MoveL p_pick, v500, z40, tool1;
WZDisable wzone;
MoveL p_place, v200, z30, tool1;
ENDPROC
When moving to p_pick , the position of the robot’s TCP is checked so that it will not go
inside the specified volume wzone . This supervision is not performed when going to
p_place .
Arguments
WZDisable WorldZone
WorldZone
Data type: wztemporary
Variable or persistent variable of type wztemporary , which contains the identity of the world
zone to be deactivated.
Program execution
The temporary world zone is deactivated. This means that the supervision of the robot’s TCP,
relative to the corresponding volume, is temporarily stopped. It can be re-activated via the
WZEnable instruction.
Limitations
Only a temporary world zone can be deactivated. A stationary world zone is always active.
Syntax
WZDisable
[WorldZone’:=’]<variable or persistent ( INOUT ) of
wztemporary>’;’
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 738
|
1 Instructions
1.251. WZCylDef - Define a cylinder-shaped world zone
World Zones
735
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
CentrePoint
Data type: pos
Position (x,y,z) in mm defining the center of one circular end of the cylinder.
Radius
Data type: num
The radius of the cylinder in mm.
Height
Data type: num
The height of the cylinder in mm. If it is positive (+z direction), the CentrePoint argument
is the center of the lower end of the cylinder (as in the above example). If it is negative (-z
direction) then the CentrePoint argument is the center of the upper end of the cylinder.
Program execution
The definition of the cylinder is stored in the variable of type shapedata (argument Shape )
for future use in WZLimSup or WZDOSet instructions.
Limitations
If the robot is used to point out the CentrePoint then the work object wobj0 must be active
(use of component trans in robtarget e.g. p1.trans as argument).
Syntax
WZCylDef
[’\’Inside] | [’\’Outside]’,’
[Shape’:=’]<variable ( VAR ) of shapedata>’,’
[centerPoint’:=’]<expression ( IN ) of pos>’,’
[Radius’:=’]<expression ( IN ) of num>’,’
[Height’:=’]<expression ( IN ) of num>’;’
Related information
For information about
See
World Zones
Technical reference manual - RAPID overview ,
section Motion and I/O principles - World zones
World zone shape
shapedata - World zone shape data on page 1179
Define box-shaped world zone
WZBoxDef - Define a box-shaped world zone on
page 732
Define sphere-shaped world zone
WZSphDef - Define a sphere-shaped world zone
on page 756
Define a world zone for home joints
WZHomeJointDef - Define a world zone for home
joints on page 746
Define a world zone for limit joints
WZLimJointDef - Define a world zone for limitation
in joints on page 749
Activate world zone limit supervision
WZLimSup - Activate world zone limit supervision
on page 753
Activate world zone digital output set
WZDOSet - Activate world zone to set digital output
on page 738
Continued
1 Instructions
1.252. WZDisable - Deactivate temporary world zone supervision
World Zones
3HAC 16581-1 Revision: J
736
© Copyright 2004-2010 ABB. All rights reserved.
1.252. WZDisable - Deactivate temporary world zone supervision
Usage
WZDisable ( World Zone Disable ) is used to deactivate the supervision of a temporary world
zone previously defined either to stop the movement or to set an output.
Basic examples
Basic examples of the instruction WZDisable are illustrated below.
Example 1
VAR wztemporary wzone;
...
PROC...
WZLimSup \Temp, wzone, volume;
MoveL p_pick, v500, z40, tool1;
WZDisable wzone;
MoveL p_place, v200, z30, tool1;
ENDPROC
When moving to p_pick , the position of the robot’s TCP is checked so that it will not go
inside the specified volume wzone . This supervision is not performed when going to
p_place .
Arguments
WZDisable WorldZone
WorldZone
Data type: wztemporary
Variable or persistent variable of type wztemporary , which contains the identity of the world
zone to be deactivated.
Program execution
The temporary world zone is deactivated. This means that the supervision of the robot’s TCP,
relative to the corresponding volume, is temporarily stopped. It can be re-activated via the
WZEnable instruction.
Limitations
Only a temporary world zone can be deactivated. A stationary world zone is always active.
Syntax
WZDisable
[WorldZone’:=’]<variable or persistent ( INOUT ) of
wztemporary>’;’
Continues on next page
1 Instructions
1.252. WZDisable - Deactivate temporary world zone supervision
World Zones
737
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
World Zones
Technical reference manual - RAPID overview ,
section Motion and I/O principles - World zones
World zone shape
shapedata - World zone shape data on page 1179
Temporary world zone data
wztemporary - Temporary world zone data on page
1230
Activate world zone limit supervision
WZLimSup - Activate world zone limit supervision on
page 753
Activate world zone set digital output
WZDOSet - Activate world zone to set digital output
on page 738
Activate world zone
WZEnable - Activate temporary world zone
supervision on page 742
Erase world zone
WZFree - Erase temporary world zone supervision
on page 744
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 739
|
1 Instructions
1.252. WZDisable - Deactivate temporary world zone supervision
World Zones
3HAC 16581-1 Revision: J
736
© Copyright 2004-2010 ABB. All rights reserved.
1.252. WZDisable - Deactivate temporary world zone supervision
Usage
WZDisable ( World Zone Disable ) is used to deactivate the supervision of a temporary world
zone previously defined either to stop the movement or to set an output.
Basic examples
Basic examples of the instruction WZDisable are illustrated below.
Example 1
VAR wztemporary wzone;
...
PROC...
WZLimSup \Temp, wzone, volume;
MoveL p_pick, v500, z40, tool1;
WZDisable wzone;
MoveL p_place, v200, z30, tool1;
ENDPROC
When moving to p_pick , the position of the robot’s TCP is checked so that it will not go
inside the specified volume wzone . This supervision is not performed when going to
p_place .
Arguments
WZDisable WorldZone
WorldZone
Data type: wztemporary
Variable or persistent variable of type wztemporary , which contains the identity of the world
zone to be deactivated.
Program execution
The temporary world zone is deactivated. This means that the supervision of the robot’s TCP,
relative to the corresponding volume, is temporarily stopped. It can be re-activated via the
WZEnable instruction.
Limitations
Only a temporary world zone can be deactivated. A stationary world zone is always active.
Syntax
WZDisable
[WorldZone’:=’]<variable or persistent ( INOUT ) of
wztemporary>’;’
Continues on next page
1 Instructions
1.252. WZDisable - Deactivate temporary world zone supervision
World Zones
737
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
World Zones
Technical reference manual - RAPID overview ,
section Motion and I/O principles - World zones
World zone shape
shapedata - World zone shape data on page 1179
Temporary world zone data
wztemporary - Temporary world zone data on page
1230
Activate world zone limit supervision
WZLimSup - Activate world zone limit supervision on
page 753
Activate world zone set digital output
WZDOSet - Activate world zone to set digital output
on page 738
Activate world zone
WZEnable - Activate temporary world zone
supervision on page 742
Erase world zone
WZFree - Erase temporary world zone supervision
on page 744
Continued
1 Instructions
1.253. WZDOSet - Activate world zone to set digital output
World Zones
3HAC 16581-1 Revision: J
738
© Copyright 2004-2010 ABB. All rights reserved.
1.253. WZDOSet - Activate world zone to set digital output
Usage
WZDOSet ( World Zone Digital Output Set ) is used to define the action and to activate a world
zone for supervision of the robot movements.
After this instruction is executed, when the robot’s TCP or the robot/external axes (zone in
joints) is inside the defined world zone or is approaching close to it, a digital output signal is
set to the specified value.
Basic examples
Basic examples of the instruction WZDOSet are illustrated below.
See also More examples on page 740 .
Example 1
VAR wztemporary service;
PROC zone_output()
VAR shapedata volume;
CONST pos p_service:=[500,500,700];
...
WZSphDef \Inside, volume, p_service, 50;
WZDOSet \Temp, service \Inside, volume, do_service, 1;
ENDPROC
Definition of temporary world zone service in the application program that sets the signal
do_service when the robot’s TCP is inside the defined sphere during program execution or
when jogging.
Arguments
WZDOSet [\Temp] | [\Stat] WorldZone [\Inside] | [\Before] Shape
Signal SetValue
[\Temp]
Temporary
Data type: switch
The world zone to define is a temporary world zone.
[\Stat]
Stationary
Data type: switch
The world zone to define is a stationary world zone.
One of the arguments \Temp or \Stat must 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
| 740
|
1 Instructions
1.252. WZDisable - Deactivate temporary world zone supervision
World Zones
737
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
World Zones
Technical reference manual - RAPID overview ,
section Motion and I/O principles - World zones
World zone shape
shapedata - World zone shape data on page 1179
Temporary world zone data
wztemporary - Temporary world zone data on page
1230
Activate world zone limit supervision
WZLimSup - Activate world zone limit supervision on
page 753
Activate world zone set digital output
WZDOSet - Activate world zone to set digital output
on page 738
Activate world zone
WZEnable - Activate temporary world zone
supervision on page 742
Erase world zone
WZFree - Erase temporary world zone supervision
on page 744
Continued
1 Instructions
1.253. WZDOSet - Activate world zone to set digital output
World Zones
3HAC 16581-1 Revision: J
738
© Copyright 2004-2010 ABB. All rights reserved.
1.253. WZDOSet - Activate world zone to set digital output
Usage
WZDOSet ( World Zone Digital Output Set ) is used to define the action and to activate a world
zone for supervision of the robot movements.
After this instruction is executed, when the robot’s TCP or the robot/external axes (zone in
joints) is inside the defined world zone or is approaching close to it, a digital output signal is
set to the specified value.
Basic examples
Basic examples of the instruction WZDOSet are illustrated below.
See also More examples on page 740 .
Example 1
VAR wztemporary service;
PROC zone_output()
VAR shapedata volume;
CONST pos p_service:=[500,500,700];
...
WZSphDef \Inside, volume, p_service, 50;
WZDOSet \Temp, service \Inside, volume, do_service, 1;
ENDPROC
Definition of temporary world zone service in the application program that sets the signal
do_service when the robot’s TCP is inside the defined sphere during program execution or
when jogging.
Arguments
WZDOSet [\Temp] | [\Stat] WorldZone [\Inside] | [\Before] Shape
Signal SetValue
[\Temp]
Temporary
Data type: switch
The world zone to define is a temporary world zone.
[\Stat]
Stationary
Data type: switch
The world zone to define is a stationary world zone.
One of the arguments \Temp or \Stat must be specified.
Continues on next page
1 Instructions
1.253. WZDOSet - Activate world zone to set digital output
World Zones
739
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
WorldZone
Data type: wztemporary or wzstationary
Variable or persistent variable, that will be updated with the identity (numeric value) of the
world zone.
If using the switch \Temp , the data type must be wztemporary . If using the switch \Stat ,
the data type must be wzstationary .
[\Inside]
Data type: switch
The digital output signal will be set when the robot’s TCP or specified axes are inside the
defined volume.
[\Before]
Data type: switch
The digital output signal will be set before the robot’s TCP or specified axes reaches the
defined volume (as soon as possible before the volume).
One of the arguments \Inside or \Before must be specified.
Shape
Data type: shapedata
The variable that defines the volume of the world zone.
Signal
Data type: signaldo
The name of the digital output signal that will be changed.
If a stationary worldzone is used then the signal must be written as protected for access from
the user (RAPID, FP). Set Access Level for the signal in System Parameters or specified axes.
SetValue
Data type: dionum
Desired value of the signal (0 or 1) when the robot’s TCP is inside the volume or just before
it enters the volume.
When outside or just outside the volume then the signal is set to the opposite value.
Program execution
The defined world zone is activated. From this moment the robot’s TCP position (or robot/
external joint position) is supervised, and the output will be set when the robot’s TCP position
(or robot/external joint position) is inside the volume ( \Inside ) or comes close to the border
of the volume ( \Before ).
If using WZHomeJointDef or WZLimJointDef together with WZDOSet then the digital
output signal is set only if all active axes with joint space supervision are before or inside the
joint space.
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
| 741
|
1 Instructions
1.253. WZDOSet - Activate world zone to set digital output
World Zones
3HAC 16581-1 Revision: J
738
© Copyright 2004-2010 ABB. All rights reserved.
1.253. WZDOSet - Activate world zone to set digital output
Usage
WZDOSet ( World Zone Digital Output Set ) is used to define the action and to activate a world
zone for supervision of the robot movements.
After this instruction is executed, when the robot’s TCP or the robot/external axes (zone in
joints) is inside the defined world zone or is approaching close to it, a digital output signal is
set to the specified value.
Basic examples
Basic examples of the instruction WZDOSet are illustrated below.
See also More examples on page 740 .
Example 1
VAR wztemporary service;
PROC zone_output()
VAR shapedata volume;
CONST pos p_service:=[500,500,700];
...
WZSphDef \Inside, volume, p_service, 50;
WZDOSet \Temp, service \Inside, volume, do_service, 1;
ENDPROC
Definition of temporary world zone service in the application program that sets the signal
do_service when the robot’s TCP is inside the defined sphere during program execution or
when jogging.
Arguments
WZDOSet [\Temp] | [\Stat] WorldZone [\Inside] | [\Before] Shape
Signal SetValue
[\Temp]
Temporary
Data type: switch
The world zone to define is a temporary world zone.
[\Stat]
Stationary
Data type: switch
The world zone to define is a stationary world zone.
One of the arguments \Temp or \Stat must be specified.
Continues on next page
1 Instructions
1.253. WZDOSet - Activate world zone to set digital output
World Zones
739
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
WorldZone
Data type: wztemporary or wzstationary
Variable or persistent variable, that will be updated with the identity (numeric value) of the
world zone.
If using the switch \Temp , the data type must be wztemporary . If using the switch \Stat ,
the data type must be wzstationary .
[\Inside]
Data type: switch
The digital output signal will be set when the robot’s TCP or specified axes are inside the
defined volume.
[\Before]
Data type: switch
The digital output signal will be set before the robot’s TCP or specified axes reaches the
defined volume (as soon as possible before the volume).
One of the arguments \Inside or \Before must be specified.
Shape
Data type: shapedata
The variable that defines the volume of the world zone.
Signal
Data type: signaldo
The name of the digital output signal that will be changed.
If a stationary worldzone is used then the signal must be written as protected for access from
the user (RAPID, FP). Set Access Level for the signal in System Parameters or specified axes.
SetValue
Data type: dionum
Desired value of the signal (0 or 1) when the robot’s TCP is inside the volume or just before
it enters the volume.
When outside or just outside the volume then the signal is set to the opposite value.
Program execution
The defined world zone is activated. From this moment the robot’s TCP position (or robot/
external joint position) is supervised, and the output will be set when the robot’s TCP position
(or robot/external joint position) is inside the volume ( \Inside ) or comes close to the border
of the volume ( \Before ).
If using WZHomeJointDef or WZLimJointDef together with WZDOSet then the digital
output signal is set only if all active axes with joint space supervision are before or inside the
joint space.
Continued
Continues on next page
1 Instructions
1.253. WZDOSet - Activate world zone to set digital output
World Zones
3HAC 16581-1 Revision: J
740
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of how to use the instruction WZDOSet are illustrated below.
Example 1
VAR wztemporary home;
VAR wztemporary service;
PERS wztemporary equip1:=[0];
PROC main()
...
! Definition of all temporary world zones
zone_output;
...
! equip1 in robot work area
WZEnable equip1;
...
! equip1 out of robot work area
WZDisable equip1;
...
! No use for equip1 any more
WZFree equip1;
...
ENDPROC
PROC zone_output()
VAR shapedata volume;
CONST pos p_home:=[800,0,800];
CONST pos p_service:=[800,800,800];
CONST pos p_equip1:=[-800,-800,0];
...
WZSphDef \Inside, volume, p_home, 50;
WZDOSet \Temp, home \Inside, volume, do_home, 1;
WZSphDef \Inside, volume, p_service, 50;
WZDOSet \Temp, service \Inside, volume, do_service, 1;
WZCylDef \Inside, volume, p_equip1, 300, 1000;
WZLimSup \Temp, equip1, volume;
! equip1 not in robot work area
WZDisable equip1;
ENDPROC
Definition of temporary world zones home and service in the application program, that sets
the signals do_home and do_service , when the robot is inside the sphere home or service
respectively during program execution or when jogging.
Also, definition of a temporary world zone equip1 , which is active only in the part of the
robot program when equip1 is inside the working area for the robot. At that time the robot
stops before entering the equip1 volume, both during program execution and manual
jogging. equip1 can be disabled or enabled from other program tasks by using the persistent
variable equip1 value.
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
| 742
|
1 Instructions
1.253. WZDOSet - Activate world zone to set digital output
World Zones
739
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
WorldZone
Data type: wztemporary or wzstationary
Variable or persistent variable, that will be updated with the identity (numeric value) of the
world zone.
If using the switch \Temp , the data type must be wztemporary . If using the switch \Stat ,
the data type must be wzstationary .
[\Inside]
Data type: switch
The digital output signal will be set when the robot’s TCP or specified axes are inside the
defined volume.
[\Before]
Data type: switch
The digital output signal will be set before the robot’s TCP or specified axes reaches the
defined volume (as soon as possible before the volume).
One of the arguments \Inside or \Before must be specified.
Shape
Data type: shapedata
The variable that defines the volume of the world zone.
Signal
Data type: signaldo
The name of the digital output signal that will be changed.
If a stationary worldzone is used then the signal must be written as protected for access from
the user (RAPID, FP). Set Access Level for the signal in System Parameters or specified axes.
SetValue
Data type: dionum
Desired value of the signal (0 or 1) when the robot’s TCP is inside the volume or just before
it enters the volume.
When outside or just outside the volume then the signal is set to the opposite value.
Program execution
The defined world zone is activated. From this moment the robot’s TCP position (or robot/
external joint position) is supervised, and the output will be set when the robot’s TCP position
(or robot/external joint position) is inside the volume ( \Inside ) or comes close to the border
of the volume ( \Before ).
If using WZHomeJointDef or WZLimJointDef together with WZDOSet then the digital
output signal is set only if all active axes with joint space supervision are before or inside the
joint space.
Continued
Continues on next page
1 Instructions
1.253. WZDOSet - Activate world zone to set digital output
World Zones
3HAC 16581-1 Revision: J
740
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of how to use the instruction WZDOSet are illustrated below.
Example 1
VAR wztemporary home;
VAR wztemporary service;
PERS wztemporary equip1:=[0];
PROC main()
...
! Definition of all temporary world zones
zone_output;
...
! equip1 in robot work area
WZEnable equip1;
...
! equip1 out of robot work area
WZDisable equip1;
...
! No use for equip1 any more
WZFree equip1;
...
ENDPROC
PROC zone_output()
VAR shapedata volume;
CONST pos p_home:=[800,0,800];
CONST pos p_service:=[800,800,800];
CONST pos p_equip1:=[-800,-800,0];
...
WZSphDef \Inside, volume, p_home, 50;
WZDOSet \Temp, home \Inside, volume, do_home, 1;
WZSphDef \Inside, volume, p_service, 50;
WZDOSet \Temp, service \Inside, volume, do_service, 1;
WZCylDef \Inside, volume, p_equip1, 300, 1000;
WZLimSup \Temp, equip1, volume;
! equip1 not in robot work area
WZDisable equip1;
ENDPROC
Definition of temporary world zones home and service in the application program, that sets
the signals do_home and do_service , when the robot is inside the sphere home or service
respectively during program execution or when jogging.
Also, definition of a temporary world zone equip1 , which is active only in the part of the
robot program when equip1 is inside the working area for the robot. At that time the robot
stops before entering the equip1 volume, both during program execution and manual
jogging. equip1 can be disabled or enabled from other program tasks by using the persistent
variable equip1 value.
Continued
Continues on next page
1 Instructions
1.253. WZDOSet - Activate world zone to set digital output
World Zones
741
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
A world zone cannot be redefined by using the same variable in the argument WorldZone .
A stationary world zone cannot be deactivated, activated again, or erased in the RAPID
program.
A temporary world zone can be deactivated ( WZDisable ), activated again ( WZEnable ), or
erased ( WZFree) in the RAPID program.
Syntax
WZDOSet
[[’\’Temp] | [’\’Stat]’,’]
[WorldZone’:=’]<variable or persistent ( INOUT ) of wztemporary>
[’\’Inside] | [’\’Before] ’,’
[Shape’:=’]<variable ( VAR ) of shapedata>’,’
[Signal’:=’]<variable ( VAR ) of signaldo>’,’
[SetValue’:=’]<expression ( IN ) of dionum>’;’
Related information
For information about
See
World Zones
Technical reference manual - RAPID overview ,
section Motion and I/O principles - World zones
World zone shape
shapedata - World zone shape data on page 1179
Temporary world zone
wztemporary - Temporary world zone data on
page 1230
Stationary world zone
wzstationary - Stationary world zone data on page
1228
Define straight box-shaped world zone
WZBoxDef - Define a box-shaped world zone on
page 732
Define sphere-shaped world zone
WZSphDef - Define a sphere-shaped world zone
on page 756
Define cylinder-shaped world zone
WZCylDef - Define a cylinder-shaped world zone
on page 734
Define a world zone for home joints
WZHomeJointDef - Define a world zone for home
joints on page 746
Activate world zone limit supervision
WZLimSup - Activate world zone limit supervision
on page 753
Signal access level
Technical reference manual - System parameters ,
section I/O - Signal - Access Level
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 743
|
1 Instructions
1.253. WZDOSet - Activate world zone to set digital output
World Zones
3HAC 16581-1 Revision: J
740
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of how to use the instruction WZDOSet are illustrated below.
Example 1
VAR wztemporary home;
VAR wztemporary service;
PERS wztemporary equip1:=[0];
PROC main()
...
! Definition of all temporary world zones
zone_output;
...
! equip1 in robot work area
WZEnable equip1;
...
! equip1 out of robot work area
WZDisable equip1;
...
! No use for equip1 any more
WZFree equip1;
...
ENDPROC
PROC zone_output()
VAR shapedata volume;
CONST pos p_home:=[800,0,800];
CONST pos p_service:=[800,800,800];
CONST pos p_equip1:=[-800,-800,0];
...
WZSphDef \Inside, volume, p_home, 50;
WZDOSet \Temp, home \Inside, volume, do_home, 1;
WZSphDef \Inside, volume, p_service, 50;
WZDOSet \Temp, service \Inside, volume, do_service, 1;
WZCylDef \Inside, volume, p_equip1, 300, 1000;
WZLimSup \Temp, equip1, volume;
! equip1 not in robot work area
WZDisable equip1;
ENDPROC
Definition of temporary world zones home and service in the application program, that sets
the signals do_home and do_service , when the robot is inside the sphere home or service
respectively during program execution or when jogging.
Also, definition of a temporary world zone equip1 , which is active only in the part of the
robot program when equip1 is inside the working area for the robot. At that time the robot
stops before entering the equip1 volume, both during program execution and manual
jogging. equip1 can be disabled or enabled from other program tasks by using the persistent
variable equip1 value.
Continued
Continues on next page
1 Instructions
1.253. WZDOSet - Activate world zone to set digital output
World Zones
741
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
A world zone cannot be redefined by using the same variable in the argument WorldZone .
A stationary world zone cannot be deactivated, activated again, or erased in the RAPID
program.
A temporary world zone can be deactivated ( WZDisable ), activated again ( WZEnable ), or
erased ( WZFree) in the RAPID program.
Syntax
WZDOSet
[[’\’Temp] | [’\’Stat]’,’]
[WorldZone’:=’]<variable or persistent ( INOUT ) of wztemporary>
[’\’Inside] | [’\’Before] ’,’
[Shape’:=’]<variable ( VAR ) of shapedata>’,’
[Signal’:=’]<variable ( VAR ) of signaldo>’,’
[SetValue’:=’]<expression ( IN ) of dionum>’;’
Related information
For information about
See
World Zones
Technical reference manual - RAPID overview ,
section Motion and I/O principles - World zones
World zone shape
shapedata - World zone shape data on page 1179
Temporary world zone
wztemporary - Temporary world zone data on
page 1230
Stationary world zone
wzstationary - Stationary world zone data on page
1228
Define straight box-shaped world zone
WZBoxDef - Define a box-shaped world zone on
page 732
Define sphere-shaped world zone
WZSphDef - Define a sphere-shaped world zone
on page 756
Define cylinder-shaped world zone
WZCylDef - Define a cylinder-shaped world zone
on page 734
Define a world zone for home joints
WZHomeJointDef - Define a world zone for home
joints on page 746
Activate world zone limit supervision
WZLimSup - Activate world zone limit supervision
on page 753
Signal access level
Technical reference manual - System parameters ,
section I/O - Signal - Access Level
Continued
1 Instructions
1.254. WZEnable - Activate temporary world zone supervision
World Zones
3HAC 16581-1 Revision: J
742
© Copyright 2004-2010 ABB. All rights reserved.
1.254. WZEnable - Activate temporary world zone supervision
Usage
WZEnable ( World Zone Enable ) is used to re-activate the supervision of a temporary world
zone, previously defined either to stop the movement or to set an output.
Basic examples
Basic examples of the instruction WZEnable are illustrated.
Example 1
VAR wztemporary wzone;
...
PROC ...
WZLimSup \Temp, wzone, volume;
MoveL p_pick, v500, z40, tool1;
WZDisable wzone;
MoveL p_place, v200, z30, tool1;
WZEnable wzone;
MoveL p_home, v200, z30, tool1;
ENDPROC
When moving to p_pick , the position of the robot’s TCP is checked so that it will not go
inside the specified volume wzone . This supervision is not performed when going to
p_place but is reactivated before going to p_home .
Arguments
WZEnable WorldZone
WorldZone
Data type: wztemporary
Variable or persistent variable of the type wztemporary , which contains the identity of the
world zone to be activated.
Program execution
The temporary world zone is re-activated. Please note that a world zone is automatically
activated when it is created. It need only be re-activated when it has previously been
deactivated by WZDisable .
Limitations
Only a temporary world zone can be deactivated and reactivated. A stationary world zone is
always active.
Syntax
WZEnable
[WorldZone’:=’]<variable or persistent ( INOUT ) of
wztemporary>’;’
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 744
|
1 Instructions
1.253. WZDOSet - Activate world zone to set digital output
World Zones
741
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
A world zone cannot be redefined by using the same variable in the argument WorldZone .
A stationary world zone cannot be deactivated, activated again, or erased in the RAPID
program.
A temporary world zone can be deactivated ( WZDisable ), activated again ( WZEnable ), or
erased ( WZFree) in the RAPID program.
Syntax
WZDOSet
[[’\’Temp] | [’\’Stat]’,’]
[WorldZone’:=’]<variable or persistent ( INOUT ) of wztemporary>
[’\’Inside] | [’\’Before] ’,’
[Shape’:=’]<variable ( VAR ) of shapedata>’,’
[Signal’:=’]<variable ( VAR ) of signaldo>’,’
[SetValue’:=’]<expression ( IN ) of dionum>’;’
Related information
For information about
See
World Zones
Technical reference manual - RAPID overview ,
section Motion and I/O principles - World zones
World zone shape
shapedata - World zone shape data on page 1179
Temporary world zone
wztemporary - Temporary world zone data on
page 1230
Stationary world zone
wzstationary - Stationary world zone data on page
1228
Define straight box-shaped world zone
WZBoxDef - Define a box-shaped world zone on
page 732
Define sphere-shaped world zone
WZSphDef - Define a sphere-shaped world zone
on page 756
Define cylinder-shaped world zone
WZCylDef - Define a cylinder-shaped world zone
on page 734
Define a world zone for home joints
WZHomeJointDef - Define a world zone for home
joints on page 746
Activate world zone limit supervision
WZLimSup - Activate world zone limit supervision
on page 753
Signal access level
Technical reference manual - System parameters ,
section I/O - Signal - Access Level
Continued
1 Instructions
1.254. WZEnable - Activate temporary world zone supervision
World Zones
3HAC 16581-1 Revision: J
742
© Copyright 2004-2010 ABB. All rights reserved.
1.254. WZEnable - Activate temporary world zone supervision
Usage
WZEnable ( World Zone Enable ) is used to re-activate the supervision of a temporary world
zone, previously defined either to stop the movement or to set an output.
Basic examples
Basic examples of the instruction WZEnable are illustrated.
Example 1
VAR wztemporary wzone;
...
PROC ...
WZLimSup \Temp, wzone, volume;
MoveL p_pick, v500, z40, tool1;
WZDisable wzone;
MoveL p_place, v200, z30, tool1;
WZEnable wzone;
MoveL p_home, v200, z30, tool1;
ENDPROC
When moving to p_pick , the position of the robot’s TCP is checked so that it will not go
inside the specified volume wzone . This supervision is not performed when going to
p_place but is reactivated before going to p_home .
Arguments
WZEnable WorldZone
WorldZone
Data type: wztemporary
Variable or persistent variable of the type wztemporary , which contains the identity of the
world zone to be activated.
Program execution
The temporary world zone is re-activated. Please note that a world zone is automatically
activated when it is created. It need only be re-activated when it has previously been
deactivated by WZDisable .
Limitations
Only a temporary world zone can be deactivated and reactivated. A stationary world zone is
always active.
Syntax
WZEnable
[WorldZone’:=’]<variable or persistent ( INOUT ) of
wztemporary>’;’
Continues on next page
1 Instructions
1.254. WZEnable - Activate temporary world zone supervision
World Zones
743
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
World Zones
Technical reference manual - RAPID overview ,
section Motion and I/O principles - World zones
World zone shape
shapedata - World zone shape data on page 1179
Temporary world zone data
wztemporary - Temporary world zone data on page
1230
Activate world zone limit supervision
WZLimSup - Activate world zone limit supervision
on page 753
Activate world zone set digital output
WZDOSet - Activate world zone to set digital output
on page 738
Deactivate world zone
WZDisable - Deactivate temporary world zone
supervision on page 736
Erase world zone
WZFree - Erase temporary world zone supervision
on page 744
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 745
|
1 Instructions
1.254. WZEnable - Activate temporary world zone supervision
World Zones
3HAC 16581-1 Revision: J
742
© Copyright 2004-2010 ABB. All rights reserved.
1.254. WZEnable - Activate temporary world zone supervision
Usage
WZEnable ( World Zone Enable ) is used to re-activate the supervision of a temporary world
zone, previously defined either to stop the movement or to set an output.
Basic examples
Basic examples of the instruction WZEnable are illustrated.
Example 1
VAR wztemporary wzone;
...
PROC ...
WZLimSup \Temp, wzone, volume;
MoveL p_pick, v500, z40, tool1;
WZDisable wzone;
MoveL p_place, v200, z30, tool1;
WZEnable wzone;
MoveL p_home, v200, z30, tool1;
ENDPROC
When moving to p_pick , the position of the robot’s TCP is checked so that it will not go
inside the specified volume wzone . This supervision is not performed when going to
p_place but is reactivated before going to p_home .
Arguments
WZEnable WorldZone
WorldZone
Data type: wztemporary
Variable or persistent variable of the type wztemporary , which contains the identity of the
world zone to be activated.
Program execution
The temporary world zone is re-activated. Please note that a world zone is automatically
activated when it is created. It need only be re-activated when it has previously been
deactivated by WZDisable .
Limitations
Only a temporary world zone can be deactivated and reactivated. A stationary world zone is
always active.
Syntax
WZEnable
[WorldZone’:=’]<variable or persistent ( INOUT ) of
wztemporary>’;’
Continues on next page
1 Instructions
1.254. WZEnable - Activate temporary world zone supervision
World Zones
743
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
World Zones
Technical reference manual - RAPID overview ,
section Motion and I/O principles - World zones
World zone shape
shapedata - World zone shape data on page 1179
Temporary world zone data
wztemporary - Temporary world zone data on page
1230
Activate world zone limit supervision
WZLimSup - Activate world zone limit supervision
on page 753
Activate world zone set digital output
WZDOSet - Activate world zone to set digital output
on page 738
Deactivate world zone
WZDisable - Deactivate temporary world zone
supervision on page 736
Erase world zone
WZFree - Erase temporary world zone supervision
on page 744
Continued
1 Instructions
1.255. WZFree - Erase temporary world zone supervision
World Zones
3HAC 16581-1 Revision: J
744
© Copyright 2004-2010 ABB. All rights reserved.
1.255. WZFree - Erase temporary world zone supervision
Usage
WZFree ( World Zone Free ) is used to erase the definition of a temporary world zone,
previously defined either to stop the movement or to set an output.
Basic examples
Basic examples of the instruction WZFree are illustrated below.
Example 1
VAR wztemporary wzone;
...
PROC ...
WZLimSup \Temp, wzone, volume;
MoveL p_pick, v500, z40, tool1;
WZDisable wzone;
MoveL p_place, v200, z30, tool1;
WZEnable wzone;
MoveL p_home, v200, z30, tool1;
WZFree wzone;
ENDPROC
When moving to p_pick , the position of the robot’s TCP is checked so that it will not go
inside a specified volume wzone . This supervision is not performed when going to p_place
but is reactivated before going to p_home . When this position is reached then the world zone
definition is erased.
Arguments
WZFree WorldZone
WorldZone
Data type: wztemporary
Variable or persistent variable of the type wztemporary , which contains the identity of the
world zone to be erased.
Program execution
The temporary world zone is first deactivated and then its definition is erased.
Once erased, a temporary world zone cannot be re-activated or deactivated.
Limitations
Only a temporary world zone can be deactivated, reactivated, or erased. A stationary world
zone is always active.
Syntax
WZFree
[WorldZone’:=’]<variable or persistent ( INOUT ) of
wztemporary>’;’
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 746
|
1 Instructions
1.254. WZEnable - Activate temporary world zone supervision
World Zones
743
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
World Zones
Technical reference manual - RAPID overview ,
section Motion and I/O principles - World zones
World zone shape
shapedata - World zone shape data on page 1179
Temporary world zone data
wztemporary - Temporary world zone data on page
1230
Activate world zone limit supervision
WZLimSup - Activate world zone limit supervision
on page 753
Activate world zone set digital output
WZDOSet - Activate world zone to set digital output
on page 738
Deactivate world zone
WZDisable - Deactivate temporary world zone
supervision on page 736
Erase world zone
WZFree - Erase temporary world zone supervision
on page 744
Continued
1 Instructions
1.255. WZFree - Erase temporary world zone supervision
World Zones
3HAC 16581-1 Revision: J
744
© Copyright 2004-2010 ABB. All rights reserved.
1.255. WZFree - Erase temporary world zone supervision
Usage
WZFree ( World Zone Free ) is used to erase the definition of a temporary world zone,
previously defined either to stop the movement or to set an output.
Basic examples
Basic examples of the instruction WZFree are illustrated below.
Example 1
VAR wztemporary wzone;
...
PROC ...
WZLimSup \Temp, wzone, volume;
MoveL p_pick, v500, z40, tool1;
WZDisable wzone;
MoveL p_place, v200, z30, tool1;
WZEnable wzone;
MoveL p_home, v200, z30, tool1;
WZFree wzone;
ENDPROC
When moving to p_pick , the position of the robot’s TCP is checked so that it will not go
inside a specified volume wzone . This supervision is not performed when going to p_place
but is reactivated before going to p_home . When this position is reached then the world zone
definition is erased.
Arguments
WZFree WorldZone
WorldZone
Data type: wztemporary
Variable or persistent variable of the type wztemporary , which contains the identity of the
world zone to be erased.
Program execution
The temporary world zone is first deactivated and then its definition is erased.
Once erased, a temporary world zone cannot be re-activated or deactivated.
Limitations
Only a temporary world zone can be deactivated, reactivated, or erased. A stationary world
zone is always active.
Syntax
WZFree
[WorldZone’:=’]<variable or persistent ( INOUT ) of
wztemporary>’;’
Continues on next page
1 Instructions
1.255. WZFree - Erase temporary world zone supervision
World Zones
745
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
World Zones
Technical reference manual - RAPID overview ,
section Motion and I/O principles - World zones
World zone shape
shapedata - World zone shape data on page 1179
Temporary world zone data
wztemporary - Temporary world zone data on page
1230
Activate world zone limit supervision
WZLimSup - Activate world zone limit supervision
on page 753
Activate world zone set digital output
WZDOSet - Activate world zone to set digital output
on page 738
Deactivate world zone
WZDisable - Deactivate temporary world zone
supervision on page 736
Activate world zone
WZEnable - Activate temporary world zone
supervision on page 742
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 747
|
1 Instructions
1.255. WZFree - Erase temporary world zone supervision
World Zones
3HAC 16581-1 Revision: J
744
© Copyright 2004-2010 ABB. All rights reserved.
1.255. WZFree - Erase temporary world zone supervision
Usage
WZFree ( World Zone Free ) is used to erase the definition of a temporary world zone,
previously defined either to stop the movement or to set an output.
Basic examples
Basic examples of the instruction WZFree are illustrated below.
Example 1
VAR wztemporary wzone;
...
PROC ...
WZLimSup \Temp, wzone, volume;
MoveL p_pick, v500, z40, tool1;
WZDisable wzone;
MoveL p_place, v200, z30, tool1;
WZEnable wzone;
MoveL p_home, v200, z30, tool1;
WZFree wzone;
ENDPROC
When moving to p_pick , the position of the robot’s TCP is checked so that it will not go
inside a specified volume wzone . This supervision is not performed when going to p_place
but is reactivated before going to p_home . When this position is reached then the world zone
definition is erased.
Arguments
WZFree WorldZone
WorldZone
Data type: wztemporary
Variable or persistent variable of the type wztemporary , which contains the identity of the
world zone to be erased.
Program execution
The temporary world zone is first deactivated and then its definition is erased.
Once erased, a temporary world zone cannot be re-activated or deactivated.
Limitations
Only a temporary world zone can be deactivated, reactivated, or erased. A stationary world
zone is always active.
Syntax
WZFree
[WorldZone’:=’]<variable or persistent ( INOUT ) of
wztemporary>’;’
Continues on next page
1 Instructions
1.255. WZFree - Erase temporary world zone supervision
World Zones
745
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
World Zones
Technical reference manual - RAPID overview ,
section Motion and I/O principles - World zones
World zone shape
shapedata - World zone shape data on page 1179
Temporary world zone data
wztemporary - Temporary world zone data on page
1230
Activate world zone limit supervision
WZLimSup - Activate world zone limit supervision
on page 753
Activate world zone set digital output
WZDOSet - Activate world zone to set digital output
on page 738
Deactivate world zone
WZDisable - Deactivate temporary world zone
supervision on page 736
Activate world zone
WZEnable - Activate temporary world zone
supervision on page 742
Continued
1 Instructions
1.256. WZHomeJointDef - Define a world zone for home joints
World Zones
3HAC 16581-1 Revision: J
746
© Copyright 2004-2010 ABB. All rights reserved.
1.256. WZHomeJointDef - Define a world zone for home joints
Usage
WZHomeJointDef ( World Zone Home Joint Definition ) is used to define a world zone in
joints coordinates for both the robot and external axes to be used as a HOME or SERVICE
position.
Basic examples
Basic examples of the instruction WZHomeJointDef are illustrated below.
Example 1
VAR wzstationary home;
...
PROC power_on()
VAR shapedata joint_space;
CONST jointtarget home_pos := [ [ 0, 0, 0, 0, 0, -45], [ 0, 9E9,
9E9, 9E9, 9E9, 9E9] ];
CONST jointtarget delta_pos := [ [ 2, 2, 2, 2, 2, 2], [ 5, 9E9,
9E9, 9E9, 9E9, 9E9] ];
...
WZHomeJointDef \Inside, joint_space, home_pos, delta_pos;
WZDOSet \Stat, home \Inside, joint_space, do_home, 1;
ENDPROC
Definition and activation of stationary world zone home , that sets the signal do_home to 1,
when all robot axes and the external axis extax.eax_a are at the joint position home_pos
(within +/- delta_pos for each axis) during program execution and jogging. The variable
joint_space of data type shapedata are used to transfer data from the instruction
WZHomeJointDef to the instruction WZDOSet .
Arguments
WZHomeJointDef [\Inside] | [\Outside] Shape MiddleJointVal
DeltaJointVal
[\Inside]
Data type: switch
Define the joint space inside the MiddleJointVal +/- DeltaJointVal .
[\Outside]
Data type: switch
Define the joint space outside the MiddleJointVal +/- DeltaJointVal (inverse joint
space).
Shape
Data type: shapedata
Variable for storage of the defined joint space (private data for the system).
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 748
|
1 Instructions
1.255. WZFree - Erase temporary world zone supervision
World Zones
745
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
World Zones
Technical reference manual - RAPID overview ,
section Motion and I/O principles - World zones
World zone shape
shapedata - World zone shape data on page 1179
Temporary world zone data
wztemporary - Temporary world zone data on page
1230
Activate world zone limit supervision
WZLimSup - Activate world zone limit supervision
on page 753
Activate world zone set digital output
WZDOSet - Activate world zone to set digital output
on page 738
Deactivate world zone
WZDisable - Deactivate temporary world zone
supervision on page 736
Activate world zone
WZEnable - Activate temporary world zone
supervision on page 742
Continued
1 Instructions
1.256. WZHomeJointDef - Define a world zone for home joints
World Zones
3HAC 16581-1 Revision: J
746
© Copyright 2004-2010 ABB. All rights reserved.
1.256. WZHomeJointDef - Define a world zone for home joints
Usage
WZHomeJointDef ( World Zone Home Joint Definition ) is used to define a world zone in
joints coordinates for both the robot and external axes to be used as a HOME or SERVICE
position.
Basic examples
Basic examples of the instruction WZHomeJointDef are illustrated below.
Example 1
VAR wzstationary home;
...
PROC power_on()
VAR shapedata joint_space;
CONST jointtarget home_pos := [ [ 0, 0, 0, 0, 0, -45], [ 0, 9E9,
9E9, 9E9, 9E9, 9E9] ];
CONST jointtarget delta_pos := [ [ 2, 2, 2, 2, 2, 2], [ 5, 9E9,
9E9, 9E9, 9E9, 9E9] ];
...
WZHomeJointDef \Inside, joint_space, home_pos, delta_pos;
WZDOSet \Stat, home \Inside, joint_space, do_home, 1;
ENDPROC
Definition and activation of stationary world zone home , that sets the signal do_home to 1,
when all robot axes and the external axis extax.eax_a are at the joint position home_pos
(within +/- delta_pos for each axis) during program execution and jogging. The variable
joint_space of data type shapedata are used to transfer data from the instruction
WZHomeJointDef to the instruction WZDOSet .
Arguments
WZHomeJointDef [\Inside] | [\Outside] Shape MiddleJointVal
DeltaJointVal
[\Inside]
Data type: switch
Define the joint space inside the MiddleJointVal +/- DeltaJointVal .
[\Outside]
Data type: switch
Define the joint space outside the MiddleJointVal +/- DeltaJointVal (inverse joint
space).
Shape
Data type: shapedata
Variable for storage of the defined joint space (private data for the system).
Continues on next page
1 Instructions
1.256. WZHomeJointDef - Define a world zone for home joints
World Zones
747
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
MiddleJointVal
Data type: jointtarget
The position in joint coordinates for the center of the joint space to define. Specifies for each
robot axis and external axis (degrees for rotational axes and mm for linear axes). Specifies in
absolute joints (not in offset coordinate system EOffsSet-EOffsOn for external axes).
Value 9E9 for some axis means that the axis should not be supervised. Non-active
external axis also gives 9E9 at programming time.
DeltaJointVal
Data type: jointtarget
The +/- delta position in joint coordinates from the center of the joint space. The value must
be greater than 0 for all axes to supervise.
The following figure shows the definition of joint space for rotational axis.
xx0500002208
The following figure shows the definition of joint space for linear axis.
xx0500002209
Program execution
The definition of the joint space is stored in the variable of type shapedata (argument
Shape ) for future use in WZLimSup or WZDOSet instructions.
If use of WZHomeJointDef together with WZDOSet then the digital output signal is set but
only if all active axes with joint space supervision are before or inside the joint space.
If use of WZHomeJointDef with outside joint space (argument \Outside ) together with
WZLimSup then the robot is stopped as soon as one active axes with joint space supervision
reach the joint space.
If use of WZHomeJointDef with inside joint space (argument \Inside ) together with
WZLimSup then the robot is stopped as soon as the last active axes with joint space
supervision reach the joint space. That means that one or several axes, but not all active and
supervised axes, can be inside the joint space at the same time.
At execution of the instruction ActUnit or DeactUnit for activation or deactivation of
mechanical units, the supervision status for HOME position or work area limitation will be
updated.
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
| 749
|
1 Instructions
1.256. WZHomeJointDef - Define a world zone for home joints
World Zones
3HAC 16581-1 Revision: J
746
© Copyright 2004-2010 ABB. All rights reserved.
1.256. WZHomeJointDef - Define a world zone for home joints
Usage
WZHomeJointDef ( World Zone Home Joint Definition ) is used to define a world zone in
joints coordinates for both the robot and external axes to be used as a HOME or SERVICE
position.
Basic examples
Basic examples of the instruction WZHomeJointDef are illustrated below.
Example 1
VAR wzstationary home;
...
PROC power_on()
VAR shapedata joint_space;
CONST jointtarget home_pos := [ [ 0, 0, 0, 0, 0, -45], [ 0, 9E9,
9E9, 9E9, 9E9, 9E9] ];
CONST jointtarget delta_pos := [ [ 2, 2, 2, 2, 2, 2], [ 5, 9E9,
9E9, 9E9, 9E9, 9E9] ];
...
WZHomeJointDef \Inside, joint_space, home_pos, delta_pos;
WZDOSet \Stat, home \Inside, joint_space, do_home, 1;
ENDPROC
Definition and activation of stationary world zone home , that sets the signal do_home to 1,
when all robot axes and the external axis extax.eax_a are at the joint position home_pos
(within +/- delta_pos for each axis) during program execution and jogging. The variable
joint_space of data type shapedata are used to transfer data from the instruction
WZHomeJointDef to the instruction WZDOSet .
Arguments
WZHomeJointDef [\Inside] | [\Outside] Shape MiddleJointVal
DeltaJointVal
[\Inside]
Data type: switch
Define the joint space inside the MiddleJointVal +/- DeltaJointVal .
[\Outside]
Data type: switch
Define the joint space outside the MiddleJointVal +/- DeltaJointVal (inverse joint
space).
Shape
Data type: shapedata
Variable for storage of the defined joint space (private data for the system).
Continues on next page
1 Instructions
1.256. WZHomeJointDef - Define a world zone for home joints
World Zones
747
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
MiddleJointVal
Data type: jointtarget
The position in joint coordinates for the center of the joint space to define. Specifies for each
robot axis and external axis (degrees for rotational axes and mm for linear axes). Specifies in
absolute joints (not in offset coordinate system EOffsSet-EOffsOn for external axes).
Value 9E9 for some axis means that the axis should not be supervised. Non-active
external axis also gives 9E9 at programming time.
DeltaJointVal
Data type: jointtarget
The +/- delta position in joint coordinates from the center of the joint space. The value must
be greater than 0 for all axes to supervise.
The following figure shows the definition of joint space for rotational axis.
xx0500002208
The following figure shows the definition of joint space for linear axis.
xx0500002209
Program execution
The definition of the joint space is stored in the variable of type shapedata (argument
Shape ) for future use in WZLimSup or WZDOSet instructions.
If use of WZHomeJointDef together with WZDOSet then the digital output signal is set but
only if all active axes with joint space supervision are before or inside the joint space.
If use of WZHomeJointDef with outside joint space (argument \Outside ) together with
WZLimSup then the robot is stopped as soon as one active axes with joint space supervision
reach the joint space.
If use of WZHomeJointDef with inside joint space (argument \Inside ) together with
WZLimSup then the robot is stopped as soon as the last active axes with joint space
supervision reach the joint space. That means that one or several axes, but not all active and
supervised axes, can be inside the joint space at the same time.
At execution of the instruction ActUnit or DeactUnit for activation or deactivation of
mechanical units, the supervision status for HOME position or work area limitation will be
updated.
Continued
Continues on next page
1 Instructions
1.256. WZHomeJointDef - Define a world zone for home joints
World Zones
3HAC 16581-1 Revision: J
748
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
-
Only active mechanical units and their active axes at activation time of the world zone (with
instruction WZDOSet respectively WZLimSup ), are included in the supervision of the HOME
position respectively to the limitation of the working area. Besides that, the mechanical unit
and its axes must still be active at the program movement or jogging to be supervised.
For example, if one axis with supervision is outside its HOME joint position but is
deactivated then it does not prevent the digital output signal for the HOME joint position to
be set if all other active axes with joint space supervision are inside the HOME joint position.
At activation of that axis again it will be included in the supervision and the robot system will
then be outside the HOME joint position and the digital output will be reset.
Syntax
WZHomeJointDef
[[’\’Inside] | [’\’Outside]’,’]
[Shape’:=’]<variable ( VAR ) of shapedata>’,’
[MiddleJointVal’ :=’]<expression ( IN ) of jointtarget>’,’
[DeltaJointVal’ :=’]<expression ( IN ) of jointtarget>’;’
Related information
For information about
See
World Zones
Technical reference manual - RAPID overview ,
section Motion and I/O principles - World zones
World zone shape
shapedata - World zone shape data on page
1179
Define box-shaped world zone
WZBoxDef - Define a box-shaped world zone
on page 732
Define cylinder-shaped world zone
WZCylDef - Define a cylinder-shaped world
zone on page 734
Define sphere-shaped world zone
WZSphDef - Define a sphere-shaped world
zone on page 756
Define a world zone for limit joints
WZLimJointDef - Define a world zone for
limitation in joints on page 749
Activate world zone limit supervision
WZLimSup - Activate world zone limit
supervision on page 753
Activate world zone digital output set
WZDOSet - Activate world zone to set digital
output on page 738
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 750
|
1 Instructions
1.256. WZHomeJointDef - Define a world zone for home joints
World Zones
747
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
MiddleJointVal
Data type: jointtarget
The position in joint coordinates for the center of the joint space to define. Specifies for each
robot axis and external axis (degrees for rotational axes and mm for linear axes). Specifies in
absolute joints (not in offset coordinate system EOffsSet-EOffsOn for external axes).
Value 9E9 for some axis means that the axis should not be supervised. Non-active
external axis also gives 9E9 at programming time.
DeltaJointVal
Data type: jointtarget
The +/- delta position in joint coordinates from the center of the joint space. The value must
be greater than 0 for all axes to supervise.
The following figure shows the definition of joint space for rotational axis.
xx0500002208
The following figure shows the definition of joint space for linear axis.
xx0500002209
Program execution
The definition of the joint space is stored in the variable of type shapedata (argument
Shape ) for future use in WZLimSup or WZDOSet instructions.
If use of WZHomeJointDef together with WZDOSet then the digital output signal is set but
only if all active axes with joint space supervision are before or inside the joint space.
If use of WZHomeJointDef with outside joint space (argument \Outside ) together with
WZLimSup then the robot is stopped as soon as one active axes with joint space supervision
reach the joint space.
If use of WZHomeJointDef with inside joint space (argument \Inside ) together with
WZLimSup then the robot is stopped as soon as the last active axes with joint space
supervision reach the joint space. That means that one or several axes, but not all active and
supervised axes, can be inside the joint space at the same time.
At execution of the instruction ActUnit or DeactUnit for activation or deactivation of
mechanical units, the supervision status for HOME position or work area limitation will be
updated.
Continued
Continues on next page
1 Instructions
1.256. WZHomeJointDef - Define a world zone for home joints
World Zones
3HAC 16581-1 Revision: J
748
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
-
Only active mechanical units and their active axes at activation time of the world zone (with
instruction WZDOSet respectively WZLimSup ), are included in the supervision of the HOME
position respectively to the limitation of the working area. Besides that, the mechanical unit
and its axes must still be active at the program movement or jogging to be supervised.
For example, if one axis with supervision is outside its HOME joint position but is
deactivated then it does not prevent the digital output signal for the HOME joint position to
be set if all other active axes with joint space supervision are inside the HOME joint position.
At activation of that axis again it will be included in the supervision and the robot system will
then be outside the HOME joint position and the digital output will be reset.
Syntax
WZHomeJointDef
[[’\’Inside] | [’\’Outside]’,’]
[Shape’:=’]<variable ( VAR ) of shapedata>’,’
[MiddleJointVal’ :=’]<expression ( IN ) of jointtarget>’,’
[DeltaJointVal’ :=’]<expression ( IN ) of jointtarget>’;’
Related information
For information about
See
World Zones
Technical reference manual - RAPID overview ,
section Motion and I/O principles - World zones
World zone shape
shapedata - World zone shape data on page
1179
Define box-shaped world zone
WZBoxDef - Define a box-shaped world zone
on page 732
Define cylinder-shaped world zone
WZCylDef - Define a cylinder-shaped world
zone on page 734
Define sphere-shaped world zone
WZSphDef - Define a sphere-shaped world
zone on page 756
Define a world zone for limit joints
WZLimJointDef - Define a world zone for
limitation in joints on page 749
Activate world zone limit supervision
WZLimSup - Activate world zone limit
supervision on page 753
Activate world zone digital output set
WZDOSet - Activate world zone to set digital
output on page 738
Continued
1 Instructions
1.257. WZLimJointDef - Define a world zone for limitation in joints
World Zones
749
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.257. WZLimJointDef - Define a world zone for limitation in joints
Usage
WZLimJointDef ( World Zone Limit Joint Definition ) is used to define a world zone in joints
coordinates for both the robot and external axes, to be used for limitation of the working area.
With WZLimJointDef it is possible to limit the working area for each robot and external axes
in the RAPID program, besides the limitation that can be done with system parameters
Motion - Arm - robx_y - Upper Joint Bound ... Lower Joint Bound .
Basic examples
Basic examples of the instruction WZLimJointDef are illustrated below.
Example 1
VAR wzstationary work_limit;
...
PROC power_on()
VAR shapedata joint_space;
CONST jointtarget low_pos:= [ [ -90, 9E9, 9E9, 9E9, 9E9, 9E9],
[ -1000, 9E9, 9E9, 9E9, 9E9, 9E9]];
CONST jointtarget high_pos := [ [ 90, 9E9, 9E9, 9E9,9E9, 9E9],
[ 9E9, 9E9, 9E9, 9E9, 9E9, 9E9] ];
...
WZLimJointDef \Outside, joint_space, low_pos, high_pos;
WZLimSup \Stat, work_limit, joint_space;
ENDPROC
Definition and activation of stationary world zone work_limit , that limit the working area
for robot axis 1 to -90 and +90 degrees and the external axis extax.eax_a to -1000 mm
during program execution and jogging. The variable joint_space of data type shapedata
are used to transfer data from the instruction WZLimJointDef to the instruction WZLimSup .
Arguments
WZLimJointDef [\Inside] | [\Outside] Shape LowJointVal
HighJointVal
[\Inside]
Data type: switch
Define the joint space inside the LowJointVal ... HighJointVal .
[\Outside]
Data type: switch
Define the joint space outside the LowJointVal ... HighJointVal (inverse joint space).
Shape
Data type: shapedata
Variable for storage of the defined joint space (private data for the system).
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 751
|
1 Instructions
1.256. WZHomeJointDef - Define a world zone for home joints
World Zones
3HAC 16581-1 Revision: J
748
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
-
Only active mechanical units and their active axes at activation time of the world zone (with
instruction WZDOSet respectively WZLimSup ), are included in the supervision of the HOME
position respectively to the limitation of the working area. Besides that, the mechanical unit
and its axes must still be active at the program movement or jogging to be supervised.
For example, if one axis with supervision is outside its HOME joint position but is
deactivated then it does not prevent the digital output signal for the HOME joint position to
be set if all other active axes with joint space supervision are inside the HOME joint position.
At activation of that axis again it will be included in the supervision and the robot system will
then be outside the HOME joint position and the digital output will be reset.
Syntax
WZHomeJointDef
[[’\’Inside] | [’\’Outside]’,’]
[Shape’:=’]<variable ( VAR ) of shapedata>’,’
[MiddleJointVal’ :=’]<expression ( IN ) of jointtarget>’,’
[DeltaJointVal’ :=’]<expression ( IN ) of jointtarget>’;’
Related information
For information about
See
World Zones
Technical reference manual - RAPID overview ,
section Motion and I/O principles - World zones
World zone shape
shapedata - World zone shape data on page
1179
Define box-shaped world zone
WZBoxDef - Define a box-shaped world zone
on page 732
Define cylinder-shaped world zone
WZCylDef - Define a cylinder-shaped world
zone on page 734
Define sphere-shaped world zone
WZSphDef - Define a sphere-shaped world
zone on page 756
Define a world zone for limit joints
WZLimJointDef - Define a world zone for
limitation in joints on page 749
Activate world zone limit supervision
WZLimSup - Activate world zone limit
supervision on page 753
Activate world zone digital output set
WZDOSet - Activate world zone to set digital
output on page 738
Continued
1 Instructions
1.257. WZLimJointDef - Define a world zone for limitation in joints
World Zones
749
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.257. WZLimJointDef - Define a world zone for limitation in joints
Usage
WZLimJointDef ( World Zone Limit Joint Definition ) is used to define a world zone in joints
coordinates for both the robot and external axes, to be used for limitation of the working area.
With WZLimJointDef it is possible to limit the working area for each robot and external axes
in the RAPID program, besides the limitation that can be done with system parameters
Motion - Arm - robx_y - Upper Joint Bound ... Lower Joint Bound .
Basic examples
Basic examples of the instruction WZLimJointDef are illustrated below.
Example 1
VAR wzstationary work_limit;
...
PROC power_on()
VAR shapedata joint_space;
CONST jointtarget low_pos:= [ [ -90, 9E9, 9E9, 9E9, 9E9, 9E9],
[ -1000, 9E9, 9E9, 9E9, 9E9, 9E9]];
CONST jointtarget high_pos := [ [ 90, 9E9, 9E9, 9E9,9E9, 9E9],
[ 9E9, 9E9, 9E9, 9E9, 9E9, 9E9] ];
...
WZLimJointDef \Outside, joint_space, low_pos, high_pos;
WZLimSup \Stat, work_limit, joint_space;
ENDPROC
Definition and activation of stationary world zone work_limit , that limit the working area
for robot axis 1 to -90 and +90 degrees and the external axis extax.eax_a to -1000 mm
during program execution and jogging. The variable joint_space of data type shapedata
are used to transfer data from the instruction WZLimJointDef to the instruction WZLimSup .
Arguments
WZLimJointDef [\Inside] | [\Outside] Shape LowJointVal
HighJointVal
[\Inside]
Data type: switch
Define the joint space inside the LowJointVal ... HighJointVal .
[\Outside]
Data type: switch
Define the joint space outside the LowJointVal ... HighJointVal (inverse joint space).
Shape
Data type: shapedata
Variable for storage of the defined joint space (private data for the system).
Continues on next page
1 Instructions
1.257. WZLimJointDef - Define a world zone for limitation in joints
World Zones
3HAC 16581-1 Revision: J
750
© Copyright 2004-2010 ABB. All rights reserved.
LowJointVal
Data type: jointtarget
The position in joint coordinates for the low limit of the joint space to define. Specifies for
each robot axes and external axes (degrees for rotational axes and mm for linear axes).
Specifies in absolute joints (not in offset coordinate system EOffsSet or EOffsOn for
external axes). Value 9E9 for some axis means that the axis should not be supervised for low
limit. Non-active external axis also gives 9E9 at programming time.
HighJointVal
Data type: jointtarget
The position in joint coordinates for the high limit of the joint space to define. Specifies for
each robot axes and external axes (degrees for rotational axes and mm for linear axes).
Specifies in absolute joints (not in offset coordinate system EOffsSet or EOffsOn for
external axes). Value 9E9 for an axis means that the axis should not be supervised for high
limit. Non-active external axis also gives 9E9 at programming time.
HighJointVal minus LowJointVal for each axis must be greater than 0 for all axes to
supervise.
The figure below shows definition of joint space for rotating axis.
xx0500002281
The figure below shows definition of joint space for linear axis.
xx0500002282
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
| 752
|
1 Instructions
1.257. WZLimJointDef - Define a world zone for limitation in joints
World Zones
749
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.257. WZLimJointDef - Define a world zone for limitation in joints
Usage
WZLimJointDef ( World Zone Limit Joint Definition ) is used to define a world zone in joints
coordinates for both the robot and external axes, to be used for limitation of the working area.
With WZLimJointDef it is possible to limit the working area for each robot and external axes
in the RAPID program, besides the limitation that can be done with system parameters
Motion - Arm - robx_y - Upper Joint Bound ... Lower Joint Bound .
Basic examples
Basic examples of the instruction WZLimJointDef are illustrated below.
Example 1
VAR wzstationary work_limit;
...
PROC power_on()
VAR shapedata joint_space;
CONST jointtarget low_pos:= [ [ -90, 9E9, 9E9, 9E9, 9E9, 9E9],
[ -1000, 9E9, 9E9, 9E9, 9E9, 9E9]];
CONST jointtarget high_pos := [ [ 90, 9E9, 9E9, 9E9,9E9, 9E9],
[ 9E9, 9E9, 9E9, 9E9, 9E9, 9E9] ];
...
WZLimJointDef \Outside, joint_space, low_pos, high_pos;
WZLimSup \Stat, work_limit, joint_space;
ENDPROC
Definition and activation of stationary world zone work_limit , that limit the working area
for robot axis 1 to -90 and +90 degrees and the external axis extax.eax_a to -1000 mm
during program execution and jogging. The variable joint_space of data type shapedata
are used to transfer data from the instruction WZLimJointDef to the instruction WZLimSup .
Arguments
WZLimJointDef [\Inside] | [\Outside] Shape LowJointVal
HighJointVal
[\Inside]
Data type: switch
Define the joint space inside the LowJointVal ... HighJointVal .
[\Outside]
Data type: switch
Define the joint space outside the LowJointVal ... HighJointVal (inverse joint space).
Shape
Data type: shapedata
Variable for storage of the defined joint space (private data for the system).
Continues on next page
1 Instructions
1.257. WZLimJointDef - Define a world zone for limitation in joints
World Zones
3HAC 16581-1 Revision: J
750
© Copyright 2004-2010 ABB. All rights reserved.
LowJointVal
Data type: jointtarget
The position in joint coordinates for the low limit of the joint space to define. Specifies for
each robot axes and external axes (degrees for rotational axes and mm for linear axes).
Specifies in absolute joints (not in offset coordinate system EOffsSet or EOffsOn for
external axes). Value 9E9 for some axis means that the axis should not be supervised for low
limit. Non-active external axis also gives 9E9 at programming time.
HighJointVal
Data type: jointtarget
The position in joint coordinates for the high limit of the joint space to define. Specifies for
each robot axes and external axes (degrees for rotational axes and mm for linear axes).
Specifies in absolute joints (not in offset coordinate system EOffsSet or EOffsOn for
external axes). Value 9E9 for an axis means that the axis should not be supervised for high
limit. Non-active external axis also gives 9E9 at programming time.
HighJointVal minus LowJointVal for each axis must be greater than 0 for all axes to
supervise.
The figure below shows definition of joint space for rotating axis.
xx0500002281
The figure below shows definition of joint space for linear axis.
xx0500002282
Continued
Continues on next page
1 Instructions
1.257. WZLimJointDef - Define a world zone for limitation in joints
World Zones
751
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Program execution
The definition of the joint space is stored in the variable of type shapedata (argument
Shape ) for future use in WZLimSup or WZDOSet instructions.
If using WZLimJointDef together with WZDOSet then the digital output signal is set, only if
all active axes with joint space supervision are before or inside the joint space.
If using WZLimJointDef with outside joint space (argument \Outside ) together with
WZLimSup then the robot is stopped as soon as one active axes with joint space supervision
reaches the joint space.
If using WZLimJointDef with inside joint space (argument \Inside ) together with
WZLimSup then the robot is stopped as soon as the last active axes with joint space
supervision reaches the joint space. That means that one or several axes but not all active and
supervised axes can be inside the joint space at the same time.
At execution of the instruction ActUnit or DeactUnit the supervision status will be
updated.
Limitations
-
WARNING!
Only active mechanical units and its active axes at activation time of the world zone (with
instruction WZDOSet respective to WZLimSup ), are included in the supervision of the HOME
position respectively the limitation of the working area. Besides that, the mechanical unit and
its axes must still be active at the program movement or jogging to be supervised.
For example, if one axis with supervision is outside its HOME joint position but is
deactivated then it does not prevent the digital output signal for the HOME joint position to
be set if all other active axes with joint space supervision are inside the HOME joint position.
At activation of that axis again, it will be included in the supervision and the robot system
will the be outside the HOME joint position and the digital output will be reset.
Syntax
WZLimJointDef
[[’\’Inside] | [’\’Outside]’,’]
[Shape’:=’]<variable ( VAR ) of shapedata>’,’
[LowJointVal’:=’]<expression ( IN ) of jointtarget>’,’
[HighJointVal’:=’]<expression ( IN ) of jointtarget>’;’
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
| 753
|
1 Instructions
1.257. WZLimJointDef - Define a world zone for limitation in joints
World Zones
3HAC 16581-1 Revision: J
750
© Copyright 2004-2010 ABB. All rights reserved.
LowJointVal
Data type: jointtarget
The position in joint coordinates for the low limit of the joint space to define. Specifies for
each robot axes and external axes (degrees for rotational axes and mm for linear axes).
Specifies in absolute joints (not in offset coordinate system EOffsSet or EOffsOn for
external axes). Value 9E9 for some axis means that the axis should not be supervised for low
limit. Non-active external axis also gives 9E9 at programming time.
HighJointVal
Data type: jointtarget
The position in joint coordinates for the high limit of the joint space to define. Specifies for
each robot axes and external axes (degrees for rotational axes and mm for linear axes).
Specifies in absolute joints (not in offset coordinate system EOffsSet or EOffsOn for
external axes). Value 9E9 for an axis means that the axis should not be supervised for high
limit. Non-active external axis also gives 9E9 at programming time.
HighJointVal minus LowJointVal for each axis must be greater than 0 for all axes to
supervise.
The figure below shows definition of joint space for rotating axis.
xx0500002281
The figure below shows definition of joint space for linear axis.
xx0500002282
Continued
Continues on next page
1 Instructions
1.257. WZLimJointDef - Define a world zone for limitation in joints
World Zones
751
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Program execution
The definition of the joint space is stored in the variable of type shapedata (argument
Shape ) for future use in WZLimSup or WZDOSet instructions.
If using WZLimJointDef together with WZDOSet then the digital output signal is set, only if
all active axes with joint space supervision are before or inside the joint space.
If using WZLimJointDef with outside joint space (argument \Outside ) together with
WZLimSup then the robot is stopped as soon as one active axes with joint space supervision
reaches the joint space.
If using WZLimJointDef with inside joint space (argument \Inside ) together with
WZLimSup then the robot is stopped as soon as the last active axes with joint space
supervision reaches the joint space. That means that one or several axes but not all active and
supervised axes can be inside the joint space at the same time.
At execution of the instruction ActUnit or DeactUnit the supervision status will be
updated.
Limitations
-
WARNING!
Only active mechanical units and its active axes at activation time of the world zone (with
instruction WZDOSet respective to WZLimSup ), are included in the supervision of the HOME
position respectively the limitation of the working area. Besides that, the mechanical unit and
its axes must still be active at the program movement or jogging to be supervised.
For example, if one axis with supervision is outside its HOME joint position but is
deactivated then it does not prevent the digital output signal for the HOME joint position to
be set if all other active axes with joint space supervision are inside the HOME joint position.
At activation of that axis again, it will be included in the supervision and the robot system
will the be outside the HOME joint position and the digital output will be reset.
Syntax
WZLimJointDef
[[’\’Inside] | [’\’Outside]’,’]
[Shape’:=’]<variable ( VAR ) of shapedata>’,’
[LowJointVal’:=’]<expression ( IN ) of jointtarget>’,’
[HighJointVal’:=’]<expression ( IN ) of jointtarget>’;’
Continued
Continues on next page
1 Instructions
1.257. WZLimJointDef - Define a world zone for limitation in joints
World Zones
3HAC 16581-1 Revision: J
752
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
World Zones
Technical reference manual - RAPID overview ,
section Motion and I/O principles - World zones
World zone shape
shapedata - World zone shape data on page 1179
Define box-shaped world zone
WZBoxDef - Define a box-shaped world zone on
page 732
Define cylinder-shaped world zone
WZCylDef - Define a cylinder-shaped world zone
on page 734
Define sphere-shaped world zone
WZSphDef - Define a sphere-shaped world zone
on page 756
Define a world zone for home joints
WZHomeJointDef - Define a world zone for home
joints on page 746
Activate world zone limit supervision
WZLimSup - Activate world zone limit supervision
on page 753
Activate world zone digital output set
WZDOSet - Activate world zone to set digital
output on page 738
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 754
|
1 Instructions
1.257. WZLimJointDef - Define a world zone for limitation in joints
World Zones
751
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Program execution
The definition of the joint space is stored in the variable of type shapedata (argument
Shape ) for future use in WZLimSup or WZDOSet instructions.
If using WZLimJointDef together with WZDOSet then the digital output signal is set, only if
all active axes with joint space supervision are before or inside the joint space.
If using WZLimJointDef with outside joint space (argument \Outside ) together with
WZLimSup then the robot is stopped as soon as one active axes with joint space supervision
reaches the joint space.
If using WZLimJointDef with inside joint space (argument \Inside ) together with
WZLimSup then the robot is stopped as soon as the last active axes with joint space
supervision reaches the joint space. That means that one or several axes but not all active and
supervised axes can be inside the joint space at the same time.
At execution of the instruction ActUnit or DeactUnit the supervision status will be
updated.
Limitations
-
WARNING!
Only active mechanical units and its active axes at activation time of the world zone (with
instruction WZDOSet respective to WZLimSup ), are included in the supervision of the HOME
position respectively the limitation of the working area. Besides that, the mechanical unit and
its axes must still be active at the program movement or jogging to be supervised.
For example, if one axis with supervision is outside its HOME joint position but is
deactivated then it does not prevent the digital output signal for the HOME joint position to
be set if all other active axes with joint space supervision are inside the HOME joint position.
At activation of that axis again, it will be included in the supervision and the robot system
will the be outside the HOME joint position and the digital output will be reset.
Syntax
WZLimJointDef
[[’\’Inside] | [’\’Outside]’,’]
[Shape’:=’]<variable ( VAR ) of shapedata>’,’
[LowJointVal’:=’]<expression ( IN ) of jointtarget>’,’
[HighJointVal’:=’]<expression ( IN ) of jointtarget>’;’
Continued
Continues on next page
1 Instructions
1.257. WZLimJointDef - Define a world zone for limitation in joints
World Zones
3HAC 16581-1 Revision: J
752
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
World Zones
Technical reference manual - RAPID overview ,
section Motion and I/O principles - World zones
World zone shape
shapedata - World zone shape data on page 1179
Define box-shaped world zone
WZBoxDef - Define a box-shaped world zone on
page 732
Define cylinder-shaped world zone
WZCylDef - Define a cylinder-shaped world zone
on page 734
Define sphere-shaped world zone
WZSphDef - Define a sphere-shaped world zone
on page 756
Define a world zone for home joints
WZHomeJointDef - Define a world zone for home
joints on page 746
Activate world zone limit supervision
WZLimSup - Activate world zone limit supervision
on page 753
Activate world zone digital output set
WZDOSet - Activate world zone to set digital
output on page 738
Continued
1 Instructions
1.258. WZLimSup - Activate world zone limit supervision
World Zones
753
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.258. WZLimSup - Activate world zone limit supervision
Usage
WZLimSup ( World Zone Limit Supervision ) is used to define the action and to activate a world
zone for supervision of the working area of the robot or external axes.
After this instruction is executed, when the robot’s TCP reaches the defined world zone or
when the robot/external axes reaches the defined world zone in joints, then the movement is
stopped both during program execution and when jogging.
Basic examples
Basic examples of the instruction WZLimSup are illustrated below.
See also More examples on page 754 .
Example 1
VAR wzstationary max_workarea;
...
PROC POWER_ON()
VAR shapedata volume;
...
WZBoxDef \Outside, volume, corner1, corner2;
WZLimSup \Stat, max_workarea, volume;
ENDPROC
Definition and activation of stationary world zone max_workarea , with the shape of the area
outside a box (temporarily stored in volume ) and the action work-area supervision. The robot
stops with an error message before entering the area outside the box.
Arguments
WZLimSup [\Temp] | [\Stat] WorldZone Shape
[\Temp]
Temporary
Data type: switch
The world zone to define is a temporary world zone.
[\Stat]
Stationary
Data type: switch
The world zone to define is a stationary world zone.
One of the arguments \Temp or \Stat must be specified.
WorldZone
Data type: wztemporary or wzstationary
Variable or persistent variable that will be updated with the identity (numeric value) of the
world zone.
If using switch \Temp , the data type must be wztemporary . If using switch \Stat , the data
type must be wzstationary .
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 755
|
1 Instructions
1.257. WZLimJointDef - Define a world zone for limitation in joints
World Zones
3HAC 16581-1 Revision: J
752
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
World Zones
Technical reference manual - RAPID overview ,
section Motion and I/O principles - World zones
World zone shape
shapedata - World zone shape data on page 1179
Define box-shaped world zone
WZBoxDef - Define a box-shaped world zone on
page 732
Define cylinder-shaped world zone
WZCylDef - Define a cylinder-shaped world zone
on page 734
Define sphere-shaped world zone
WZSphDef - Define a sphere-shaped world zone
on page 756
Define a world zone for home joints
WZHomeJointDef - Define a world zone for home
joints on page 746
Activate world zone limit supervision
WZLimSup - Activate world zone limit supervision
on page 753
Activate world zone digital output set
WZDOSet - Activate world zone to set digital
output on page 738
Continued
1 Instructions
1.258. WZLimSup - Activate world zone limit supervision
World Zones
753
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.258. WZLimSup - Activate world zone limit supervision
Usage
WZLimSup ( World Zone Limit Supervision ) is used to define the action and to activate a world
zone for supervision of the working area of the robot or external axes.
After this instruction is executed, when the robot’s TCP reaches the defined world zone or
when the robot/external axes reaches the defined world zone in joints, then the movement is
stopped both during program execution and when jogging.
Basic examples
Basic examples of the instruction WZLimSup are illustrated below.
See also More examples on page 754 .
Example 1
VAR wzstationary max_workarea;
...
PROC POWER_ON()
VAR shapedata volume;
...
WZBoxDef \Outside, volume, corner1, corner2;
WZLimSup \Stat, max_workarea, volume;
ENDPROC
Definition and activation of stationary world zone max_workarea , with the shape of the area
outside a box (temporarily stored in volume ) and the action work-area supervision. The robot
stops with an error message before entering the area outside the box.
Arguments
WZLimSup [\Temp] | [\Stat] WorldZone Shape
[\Temp]
Temporary
Data type: switch
The world zone to define is a temporary world zone.
[\Stat]
Stationary
Data type: switch
The world zone to define is a stationary world zone.
One of the arguments \Temp or \Stat must be specified.
WorldZone
Data type: wztemporary or wzstationary
Variable or persistent variable that will be updated with the identity (numeric value) of the
world zone.
If using switch \Temp , the data type must be wztemporary . If using switch \Stat , the data
type must be wzstationary .
Continues on next page
1 Instructions
1.258. WZLimSup - Activate world zone limit supervision
World Zones
3HAC 16581-1 Revision: J
754
© Copyright 2004-2010 ABB. All rights reserved.
Shape
Data type: shapedata
The variable that defines the volume of the world zone.
Program execution
The defined world zone is activated. From this moment the robot’s TCP position or the robot/
external axes joint position are supervised. If it reaches the defined area then the movement
is stopped.
If using WZLimJointDef or WZHomeJointDef with outside joint space (argument
\Outside ) together with WZLimSup then the robot is stopped as soon as one active axes with
joint space supervision reaches the joint space.
If using WZLimJointDef or WZHomeJointDef with inside joint space (argument \Inside )
together with WZLimSup then the robot is stopped as soon as the last active axes with joint
space supervision reaches the joint space. That means that one or several axes but not all
active and supervised axes can be inside the joint space at the same time.
At execution of the instruction ActUnit or DeactUnit the supervision status will be
updated.
More examples
More examples of how to use the instruction WZLimSup are illustrated below.
Example 1
VAR wzstationary box1_invers;
VAR wzstationary box2;
PROC wzone_power_on()
VAR shapedata volume;
CONST pos box1_c1:=[500,-500,0];
CONST pos box1_c2:=[-500,500,500];
CONST pos box2_c1:=[500,-500,0];
CONST pos box2_c2:=[200,-200,300];
...
WZBoxDef \Outside, volume, box1_c1, box1_c2;
WZLimSup \Stat, box1_invers, volume;
WZBoxDef \Inside, volume, box2_c1, box2_c2;
WZLimSup \Stat, box2, volume;
ENDPROC
Limitation of work area for the robot with the following stationary world zones:
•
Outside working area when outside box1_invers
•
Outside working area when inside box2
If this routine is connected to the system event POWER ON then these world zones will
always be active in the system, both for program movements and manual jogging.
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
| 756
|
1 Instructions
1.258. WZLimSup - Activate world zone limit supervision
World Zones
753
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
1.258. WZLimSup - Activate world zone limit supervision
Usage
WZLimSup ( World Zone Limit Supervision ) is used to define the action and to activate a world
zone for supervision of the working area of the robot or external axes.
After this instruction is executed, when the robot’s TCP reaches the defined world zone or
when the robot/external axes reaches the defined world zone in joints, then the movement is
stopped both during program execution and when jogging.
Basic examples
Basic examples of the instruction WZLimSup are illustrated below.
See also More examples on page 754 .
Example 1
VAR wzstationary max_workarea;
...
PROC POWER_ON()
VAR shapedata volume;
...
WZBoxDef \Outside, volume, corner1, corner2;
WZLimSup \Stat, max_workarea, volume;
ENDPROC
Definition and activation of stationary world zone max_workarea , with the shape of the area
outside a box (temporarily stored in volume ) and the action work-area supervision. The robot
stops with an error message before entering the area outside the box.
Arguments
WZLimSup [\Temp] | [\Stat] WorldZone Shape
[\Temp]
Temporary
Data type: switch
The world zone to define is a temporary world zone.
[\Stat]
Stationary
Data type: switch
The world zone to define is a stationary world zone.
One of the arguments \Temp or \Stat must be specified.
WorldZone
Data type: wztemporary or wzstationary
Variable or persistent variable that will be updated with the identity (numeric value) of the
world zone.
If using switch \Temp , the data type must be wztemporary . If using switch \Stat , the data
type must be wzstationary .
Continues on next page
1 Instructions
1.258. WZLimSup - Activate world zone limit supervision
World Zones
3HAC 16581-1 Revision: J
754
© Copyright 2004-2010 ABB. All rights reserved.
Shape
Data type: shapedata
The variable that defines the volume of the world zone.
Program execution
The defined world zone is activated. From this moment the robot’s TCP position or the robot/
external axes joint position are supervised. If it reaches the defined area then the movement
is stopped.
If using WZLimJointDef or WZHomeJointDef with outside joint space (argument
\Outside ) together with WZLimSup then the robot is stopped as soon as one active axes with
joint space supervision reaches the joint space.
If using WZLimJointDef or WZHomeJointDef with inside joint space (argument \Inside )
together with WZLimSup then the robot is stopped as soon as the last active axes with joint
space supervision reaches the joint space. That means that one or several axes but not all
active and supervised axes can be inside the joint space at the same time.
At execution of the instruction ActUnit or DeactUnit the supervision status will be
updated.
More examples
More examples of how to use the instruction WZLimSup are illustrated below.
Example 1
VAR wzstationary box1_invers;
VAR wzstationary box2;
PROC wzone_power_on()
VAR shapedata volume;
CONST pos box1_c1:=[500,-500,0];
CONST pos box1_c2:=[-500,500,500];
CONST pos box2_c1:=[500,-500,0];
CONST pos box2_c2:=[200,-200,300];
...
WZBoxDef \Outside, volume, box1_c1, box1_c2;
WZLimSup \Stat, box1_invers, volume;
WZBoxDef \Inside, volume, box2_c1, box2_c2;
WZLimSup \Stat, box2, volume;
ENDPROC
Limitation of work area for the robot with the following stationary world zones:
•
Outside working area when outside box1_invers
•
Outside working area when inside box2
If this routine is connected to the system event POWER ON then these world zones will
always be active in the system, both for program movements and manual jogging.
Continued
Continues on next page
1 Instructions
1.258. WZLimSup - Activate world zone limit supervision
World Zones
755
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
A world zone cannot be redefined using the same variable in argument WorldZone .
A stationary world zone cannot be deactivated, activated again, or erased in the RAPID
program.
A temporary world zone can be deactivated ( WZDisable ), activated again ( WZEnable ), or
erased ( WZFree) in the RAPID program.
Syntax
WZLimSup
[[’\’Temp] | [’\Stat]’,’]
[WorldZone´:=´]<variable or persistent ( INOUT ) of
wztemporary>´,´
[Shape´:=´]<variable ( VAR ) of shapedata>´;´
Related information
For information about
See
World Zones
Technical reference manual - RAPID overview ,
section Motion and I/O principles - World zones
World zone shape
shapedata - World zone shape data on page 1179
Temporary world zone
wztemporary - Temporary world zone data on
page 1230
Stationary world zone
wzstationary - Stationary world zone data on page
1228
Define straight box-shaped world zone
WZBoxDef - Define a box-shaped world zone on
page 732
Define sphere-shaped world zone
WZSphDef - Define a sphere-shaped world zone
on page 756
Define cylinder-shaped world zone
WZCylDef - Define a cylinder-shaped world zone
on page 734
Define a world zone for home joints
WZHomeJointDef - Define a world zone for home
joints on page 746
Define a world zone for limit joints
WZLimJointDef - Define a world zone for limitation
in joints on page 749
Activate world zone digital output set
WZDOSet - Activate world zone to set digital
output on page 738
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 757
|
1 Instructions
1.258. WZLimSup - Activate world zone limit supervision
World Zones
3HAC 16581-1 Revision: J
754
© Copyright 2004-2010 ABB. All rights reserved.
Shape
Data type: shapedata
The variable that defines the volume of the world zone.
Program execution
The defined world zone is activated. From this moment the robot’s TCP position or the robot/
external axes joint position are supervised. If it reaches the defined area then the movement
is stopped.
If using WZLimJointDef or WZHomeJointDef with outside joint space (argument
\Outside ) together with WZLimSup then the robot is stopped as soon as one active axes with
joint space supervision reaches the joint space.
If using WZLimJointDef or WZHomeJointDef with inside joint space (argument \Inside )
together with WZLimSup then the robot is stopped as soon as the last active axes with joint
space supervision reaches the joint space. That means that one or several axes but not all
active and supervised axes can be inside the joint space at the same time.
At execution of the instruction ActUnit or DeactUnit the supervision status will be
updated.
More examples
More examples of how to use the instruction WZLimSup are illustrated below.
Example 1
VAR wzstationary box1_invers;
VAR wzstationary box2;
PROC wzone_power_on()
VAR shapedata volume;
CONST pos box1_c1:=[500,-500,0];
CONST pos box1_c2:=[-500,500,500];
CONST pos box2_c1:=[500,-500,0];
CONST pos box2_c2:=[200,-200,300];
...
WZBoxDef \Outside, volume, box1_c1, box1_c2;
WZLimSup \Stat, box1_invers, volume;
WZBoxDef \Inside, volume, box2_c1, box2_c2;
WZLimSup \Stat, box2, volume;
ENDPROC
Limitation of work area for the robot with the following stationary world zones:
•
Outside working area when outside box1_invers
•
Outside working area when inside box2
If this routine is connected to the system event POWER ON then these world zones will
always be active in the system, both for program movements and manual jogging.
Continued
Continues on next page
1 Instructions
1.258. WZLimSup - Activate world zone limit supervision
World Zones
755
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
A world zone cannot be redefined using the same variable in argument WorldZone .
A stationary world zone cannot be deactivated, activated again, or erased in the RAPID
program.
A temporary world zone can be deactivated ( WZDisable ), activated again ( WZEnable ), or
erased ( WZFree) in the RAPID program.
Syntax
WZLimSup
[[’\’Temp] | [’\Stat]’,’]
[WorldZone´:=´]<variable or persistent ( INOUT ) of
wztemporary>´,´
[Shape´:=´]<variable ( VAR ) of shapedata>´;´
Related information
For information about
See
World Zones
Technical reference manual - RAPID overview ,
section Motion and I/O principles - World zones
World zone shape
shapedata - World zone shape data on page 1179
Temporary world zone
wztemporary - Temporary world zone data on
page 1230
Stationary world zone
wzstationary - Stationary world zone data on page
1228
Define straight box-shaped world zone
WZBoxDef - Define a box-shaped world zone on
page 732
Define sphere-shaped world zone
WZSphDef - Define a sphere-shaped world zone
on page 756
Define cylinder-shaped world zone
WZCylDef - Define a cylinder-shaped world zone
on page 734
Define a world zone for home joints
WZHomeJointDef - Define a world zone for home
joints on page 746
Define a world zone for limit joints
WZLimJointDef - Define a world zone for limitation
in joints on page 749
Activate world zone digital output set
WZDOSet - Activate world zone to set digital
output on page 738
Continued
1 Instructions
1.259. WZSphDef - Define a sphere-shaped world zone
World Zones
3HAC 16581-1 Revision: J
756
© Copyright 2004-2010 ABB. All rights reserved.
1.259. WZSphDef - Define a sphere-shaped world zone
Usage
WZSphDef ( World Zone Sphere Definition ) is used to define a world zone that has the shape
of a sphere.
Basic examples
Basic examples of the instruction WZSphDef are illustrated below.
Example 1
xx0500002207
VAR shapedata volume;
CONST pos C1:=[300,300,200];
CONST num R1:=200;
...
WZSphDef \Inside, volume, C1, R1;
Define a sphere named volume by its center C1 and its radius R1 .
Arguments
WZSphDef [\Inside] | [\Outside] Shape CentrePoint Radius
[\Inside]
Data type: switch
Define the volume inside the sphere.
[\Outside]
Data type: switch
Define the volume outside the sphere (inverse volume).
One of the arguments \Inside or \Outside must be specified.
Shape
Data type: shapedata
Variable for storage of the defined volume (private data for the system).
CentrePoint
Data type: pos
Position (x,y,z) in mm defining the center of the sphere.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 758
|
1 Instructions
1.258. WZLimSup - Activate world zone limit supervision
World Zones
755
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
A world zone cannot be redefined using the same variable in argument WorldZone .
A stationary world zone cannot be deactivated, activated again, or erased in the RAPID
program.
A temporary world zone can be deactivated ( WZDisable ), activated again ( WZEnable ), or
erased ( WZFree) in the RAPID program.
Syntax
WZLimSup
[[’\’Temp] | [’\Stat]’,’]
[WorldZone´:=´]<variable or persistent ( INOUT ) of
wztemporary>´,´
[Shape´:=´]<variable ( VAR ) of shapedata>´;´
Related information
For information about
See
World Zones
Technical reference manual - RAPID overview ,
section Motion and I/O principles - World zones
World zone shape
shapedata - World zone shape data on page 1179
Temporary world zone
wztemporary - Temporary world zone data on
page 1230
Stationary world zone
wzstationary - Stationary world zone data on page
1228
Define straight box-shaped world zone
WZBoxDef - Define a box-shaped world zone on
page 732
Define sphere-shaped world zone
WZSphDef - Define a sphere-shaped world zone
on page 756
Define cylinder-shaped world zone
WZCylDef - Define a cylinder-shaped world zone
on page 734
Define a world zone for home joints
WZHomeJointDef - Define a world zone for home
joints on page 746
Define a world zone for limit joints
WZLimJointDef - Define a world zone for limitation
in joints on page 749
Activate world zone digital output set
WZDOSet - Activate world zone to set digital
output on page 738
Continued
1 Instructions
1.259. WZSphDef - Define a sphere-shaped world zone
World Zones
3HAC 16581-1 Revision: J
756
© Copyright 2004-2010 ABB. All rights reserved.
1.259. WZSphDef - Define a sphere-shaped world zone
Usage
WZSphDef ( World Zone Sphere Definition ) is used to define a world zone that has the shape
of a sphere.
Basic examples
Basic examples of the instruction WZSphDef are illustrated below.
Example 1
xx0500002207
VAR shapedata volume;
CONST pos C1:=[300,300,200];
CONST num R1:=200;
...
WZSphDef \Inside, volume, C1, R1;
Define a sphere named volume by its center C1 and its radius R1 .
Arguments
WZSphDef [\Inside] | [\Outside] Shape CentrePoint Radius
[\Inside]
Data type: switch
Define the volume inside the sphere.
[\Outside]
Data type: switch
Define the volume outside the sphere (inverse volume).
One of the arguments \Inside or \Outside must be specified.
Shape
Data type: shapedata
Variable for storage of the defined volume (private data for the system).
CentrePoint
Data type: pos
Position (x,y,z) in mm defining the center of the sphere.
Continues on next page
1 Instructions
1.259. WZSphDef - Define a sphere-shaped world zone
World Zones
757
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Radius
Data type: num
The radius of the sphere in mm.
Program execution
The definition of the sphere is stored in the variable of type shapedata (argument Shape ),
for future use in WZLimSup or WZDOSet instructions.
Limitations
If the robot is used to point out the CentrePoint then the work object wobj0 must be active
(use of component trans in robtarget e.g. p1.trans as argument).
Syntax
WZSphDef
[[’\’Inside] | [’\’Outside]’,’]
[Shape’:=’]<variable ( VAR ) of shapedata>’,’
[CentrePoint’:=’]<expression ( IN ) of pos>’,’
[Radius’:=’]<expression ( IN ) of num>’;’
Related information
For information about
See
World Zones
Technical reference manual - RAPID overview ,
section Motion and I/O principles - World zones
World zone shape
shapedata - World zone shape data on page 1179
Define box-shaped world zone
WZBoxDef - Define a box-shaped world zone on
page 732
Define cylinder-shaped world zone
WZCylDef - Define a cylinder-shaped world zone on
page 734
Define a world zone for home joints
WZHomeJointDef - Define a world zone for home
joints on page 746
Define a world zone for limit joints
WZLimJointDef - Define a world zone for limitation in
joints on page 749
Activate world zone limit supervision
WZLimSup - Activate world zone limit supervision
on page 753
Activate world zone digital output set
WZDOSet - Activate world zone to set digital output
on page 738
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 759
|
1 Instructions
1.259. WZSphDef - Define a sphere-shaped world zone
World Zones
3HAC 16581-1 Revision: J
756
© Copyright 2004-2010 ABB. All rights reserved.
1.259. WZSphDef - Define a sphere-shaped world zone
Usage
WZSphDef ( World Zone Sphere Definition ) is used to define a world zone that has the shape
of a sphere.
Basic examples
Basic examples of the instruction WZSphDef are illustrated below.
Example 1
xx0500002207
VAR shapedata volume;
CONST pos C1:=[300,300,200];
CONST num R1:=200;
...
WZSphDef \Inside, volume, C1, R1;
Define a sphere named volume by its center C1 and its radius R1 .
Arguments
WZSphDef [\Inside] | [\Outside] Shape CentrePoint Radius
[\Inside]
Data type: switch
Define the volume inside the sphere.
[\Outside]
Data type: switch
Define the volume outside the sphere (inverse volume).
One of the arguments \Inside or \Outside must be specified.
Shape
Data type: shapedata
Variable for storage of the defined volume (private data for the system).
CentrePoint
Data type: pos
Position (x,y,z) in mm defining the center of the sphere.
Continues on next page
1 Instructions
1.259. WZSphDef - Define a sphere-shaped world zone
World Zones
757
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Radius
Data type: num
The radius of the sphere in mm.
Program execution
The definition of the sphere is stored in the variable of type shapedata (argument Shape ),
for future use in WZLimSup or WZDOSet instructions.
Limitations
If the robot is used to point out the CentrePoint then the work object wobj0 must be active
(use of component trans in robtarget e.g. p1.trans as argument).
Syntax
WZSphDef
[[’\’Inside] | [’\’Outside]’,’]
[Shape’:=’]<variable ( VAR ) of shapedata>’,’
[CentrePoint’:=’]<expression ( IN ) of pos>’,’
[Radius’:=’]<expression ( IN ) of num>’;’
Related information
For information about
See
World Zones
Technical reference manual - RAPID overview ,
section Motion and I/O principles - World zones
World zone shape
shapedata - World zone shape data on page 1179
Define box-shaped world zone
WZBoxDef - Define a box-shaped world zone on
page 732
Define cylinder-shaped world zone
WZCylDef - Define a cylinder-shaped world zone on
page 734
Define a world zone for home joints
WZHomeJointDef - Define a world zone for home
joints on page 746
Define a world zone for limit joints
WZLimJointDef - Define a world zone for limitation in
joints on page 749
Activate world zone limit supervision
WZLimSup - Activate world zone limit supervision
on page 753
Activate world zone digital output set
WZDOSet - Activate world zone to set digital output
on page 738
Continued
1 Instructions
1.259. WZSphDef - Define a sphere-shaped world zone
World Zones
3HAC 16581-1 Revision: J
758
© Copyright 2004-2010 ABB. All rights reserved.
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 760
|
1 Instructions
1.259. WZSphDef - Define a sphere-shaped world zone
World Zones
757
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Radius
Data type: num
The radius of the sphere in mm.
Program execution
The definition of the sphere is stored in the variable of type shapedata (argument Shape ),
for future use in WZLimSup or WZDOSet instructions.
Limitations
If the robot is used to point out the CentrePoint then the work object wobj0 must be active
(use of component trans in robtarget e.g. p1.trans as argument).
Syntax
WZSphDef
[[’\’Inside] | [’\’Outside]’,’]
[Shape’:=’]<variable ( VAR ) of shapedata>’,’
[CentrePoint’:=’]<expression ( IN ) of pos>’,’
[Radius’:=’]<expression ( IN ) of num>’;’
Related information
For information about
See
World Zones
Technical reference manual - RAPID overview ,
section Motion and I/O principles - World zones
World zone shape
shapedata - World zone shape data on page 1179
Define box-shaped world zone
WZBoxDef - Define a box-shaped world zone on
page 732
Define cylinder-shaped world zone
WZCylDef - Define a cylinder-shaped world zone on
page 734
Define a world zone for home joints
WZHomeJointDef - Define a world zone for home
joints on page 746
Define a world zone for limit joints
WZLimJointDef - Define a world zone for limitation in
joints on page 749
Activate world zone limit supervision
WZLimSup - Activate world zone limit supervision
on page 753
Activate world zone digital output set
WZDOSet - Activate world zone to set digital output
on page 738
Continued
1 Instructions
1.259. WZSphDef - Define a sphere-shaped world zone
World Zones
3HAC 16581-1 Revision: J
758
© Copyright 2004-2010 ABB. All rights reserved.
2 Functions
2.1. Abs - Gets the absolute value
RobotWare - OS
759
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2 Functions
2.1. Abs - Gets the absolute value
Usage
Abs is used to get the absolute value, i.e. a positive value of numeric data.
Basic examples
Basic examples of the function Abs are illustrated below.
See also More examples on page 759 .
Example 1
reg1 := Abs(reg2);
Reg1 is assigned the absolute value of reg2 .
Return value
Data type: num
The absolute value, i.e. a positive numeric value, e.g.:
Arguments
Abs (Value)
Value
Data type: num
The input value.
More examples
More examples of the function Abs are illustrated below.
Example 1
TPReadNum no_of_parts, "How many parts should be produced? ";
no_of_parts := Abs(no_of_parts);
The operator is asked to input the number of parts to be produced. To ensure that the value is
greater than zero, the value given by the operator is made positive.
Syntax
Abs ’(’
[ Value ’:=’ ] < expression ( IN ) of num >’)’
A function with a return value of the data type num .
Input value
Returned value
3
3
-3
3
-2.53
2.53
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 761
|
1 Instructions
1.259. WZSphDef - Define a sphere-shaped world zone
World Zones
3HAC 16581-1 Revision: J
758
© Copyright 2004-2010 ABB. All rights reserved.
2 Functions
2.1. Abs - Gets the absolute value
RobotWare - OS
759
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2 Functions
2.1. Abs - Gets the absolute value
Usage
Abs is used to get the absolute value, i.e. a positive value of numeric data.
Basic examples
Basic examples of the function Abs are illustrated below.
See also More examples on page 759 .
Example 1
reg1 := Abs(reg2);
Reg1 is assigned the absolute value of reg2 .
Return value
Data type: num
The absolute value, i.e. a positive numeric value, e.g.:
Arguments
Abs (Value)
Value
Data type: num
The input value.
More examples
More examples of the function Abs are illustrated below.
Example 1
TPReadNum no_of_parts, "How many parts should be produced? ";
no_of_parts := Abs(no_of_parts);
The operator is asked to input the number of parts to be produced. To ensure that the value is
greater than zero, the value given by the operator is made positive.
Syntax
Abs ’(’
[ Value ’:=’ ] < expression ( IN ) of num >’)’
A function with a return value of the data type num .
Input value
Returned value
3
3
-3
3
-2.53
2.53
Continues on next page
2 Functions
2.1. Abs - Gets the absolute value
RobotWare - OS
3HAC 16581-1 Revision: J
760
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID overview ,
section RAPID summary - Mathematics
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 762
|
2 Functions
2.1. Abs - Gets the absolute value
RobotWare - OS
759
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2 Functions
2.1. Abs - Gets the absolute value
Usage
Abs is used to get the absolute value, i.e. a positive value of numeric data.
Basic examples
Basic examples of the function Abs are illustrated below.
See also More examples on page 759 .
Example 1
reg1 := Abs(reg2);
Reg1 is assigned the absolute value of reg2 .
Return value
Data type: num
The absolute value, i.e. a positive numeric value, e.g.:
Arguments
Abs (Value)
Value
Data type: num
The input value.
More examples
More examples of the function Abs are illustrated below.
Example 1
TPReadNum no_of_parts, "How many parts should be produced? ";
no_of_parts := Abs(no_of_parts);
The operator is asked to input the number of parts to be produced. To ensure that the value is
greater than zero, the value given by the operator is made positive.
Syntax
Abs ’(’
[ Value ’:=’ ] < expression ( IN ) of num >’)’
A function with a return value of the data type num .
Input value
Returned value
3
3
-3
3
-2.53
2.53
Continues on next page
2 Functions
2.1. Abs - Gets the absolute value
RobotWare - OS
3HAC 16581-1 Revision: J
760
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID overview ,
section RAPID summary - Mathematics
Continued
2 Functions
2.2. ACos - Calculates the arc cosine value
RobotWare - OS
761
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.2. ACos - Calculates the arc cosine value
Usage
ACos ( Arc Cosine ) is used to calculate the arc cosine value.
Basic examples
Basic examples of the function ACos are illustrated below.
Example 1
VAR num angle;
VAR num value;
...
...
angle := ACos(value);
angle will get the arc cosine value of value .
Return value
Data type: num
The arc cosine value, expressed in degrees, range [0, 180].
Arguments
ACos (Value)
Value
Data type: num
The argument value must be in range [-1, 1].
Limitations
The execution of the function Acos(x) will give an error if x is outside the range [-1, 1].
Syntax
Acos’(’
[Value ’:=’] <expression ( IN ) of num>
’)’
A function with a return value of the data type num .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID overview ,
section RAPID Summary - Mathematics
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 763
|
2 Functions
2.1. Abs - Gets the absolute value
RobotWare - OS
3HAC 16581-1 Revision: J
760
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID overview ,
section RAPID summary - Mathematics
Continued
2 Functions
2.2. ACos - Calculates the arc cosine value
RobotWare - OS
761
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.2. ACos - Calculates the arc cosine value
Usage
ACos ( Arc Cosine ) is used to calculate the arc cosine value.
Basic examples
Basic examples of the function ACos are illustrated below.
Example 1
VAR num angle;
VAR num value;
...
...
angle := ACos(value);
angle will get the arc cosine value of value .
Return value
Data type: num
The arc cosine value, expressed in degrees, range [0, 180].
Arguments
ACos (Value)
Value
Data type: num
The argument value must be in range [-1, 1].
Limitations
The execution of the function Acos(x) will give an error if x is outside the range [-1, 1].
Syntax
Acos’(’
[Value ’:=’] <expression ( IN ) of num>
’)’
A function with a return value of the data type num .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID overview ,
section RAPID Summary - Mathematics
2 Functions
2.3. AOutput - Reads the value of an analog output signal
RobotWare - OS
3HAC 16581-1 Revision: J
762
© Copyright 2004-2010 ABB. All rights reserved.
2.3. AOutput - Reads the value of an analog output signal
Usage
AOutput is used to read the current value of an analog output signal.
Basic examples
Basic examples of the function AOutput are illustrated below.
Example 1
IF AOutput(ao4) > 5 THEN ...
If the current value of the signal ao4 is greater than 5, then ...
Return value
Data type: num
The current value of the signal.
The current value is scaled (in accordance with the system parameters) before it is read by the
RAPID program. A diagram of how analog signal values are scaled is shown in the figure
below.
xx0500002408
Arguments
AOutput (Signal)
Signal
Data type: signalao
The name of the analog output to be read.
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.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 764
|
2 Functions
2.2. ACos - Calculates the arc cosine value
RobotWare - OS
761
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.2. ACos - Calculates the arc cosine value
Usage
ACos ( Arc Cosine ) is used to calculate the arc cosine value.
Basic examples
Basic examples of the function ACos are illustrated below.
Example 1
VAR num angle;
VAR num value;
...
...
angle := ACos(value);
angle will get the arc cosine value of value .
Return value
Data type: num
The arc cosine value, expressed in degrees, range [0, 180].
Arguments
ACos (Value)
Value
Data type: num
The argument value must be in range [-1, 1].
Limitations
The execution of the function Acos(x) will give an error if x is outside the range [-1, 1].
Syntax
Acos’(’
[Value ’:=’] <expression ( IN ) of num>
’)’
A function with a return value of the data type num .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID overview ,
section RAPID Summary - Mathematics
2 Functions
2.3. AOutput - Reads the value of an analog output signal
RobotWare - OS
3HAC 16581-1 Revision: J
762
© Copyright 2004-2010 ABB. All rights reserved.
2.3. AOutput - Reads the value of an analog output signal
Usage
AOutput is used to read the current value of an analog output signal.
Basic examples
Basic examples of the function AOutput are illustrated below.
Example 1
IF AOutput(ao4) > 5 THEN ...
If the current value of the signal ao4 is greater than 5, then ...
Return value
Data type: num
The current value of the signal.
The current value is scaled (in accordance with the system parameters) before it is read by the
RAPID program. A diagram of how analog signal values are scaled is shown in the figure
below.
xx0500002408
Arguments
AOutput (Signal)
Signal
Data type: signalao
The name of the analog output to be read.
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.
Continues on next page
2 Functions
2.3. AOutput - Reads the value of an analog output signal
RobotWare - OS
763
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
AOutput ’(’
[ Signal ’:=’ ] < variable ( VAR ) of signalao > ’)’
A function with a return value of data type num .
Related information
For information about
See
Set an analog output signal
SetAO - Changes the value of an analog output signal
on page 431
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
| 765
|
2 Functions
2.3. AOutput - Reads the value of an analog output signal
RobotWare - OS
3HAC 16581-1 Revision: J
762
© Copyright 2004-2010 ABB. All rights reserved.
2.3. AOutput - Reads the value of an analog output signal
Usage
AOutput is used to read the current value of an analog output signal.
Basic examples
Basic examples of the function AOutput are illustrated below.
Example 1
IF AOutput(ao4) > 5 THEN ...
If the current value of the signal ao4 is greater than 5, then ...
Return value
Data type: num
The current value of the signal.
The current value is scaled (in accordance with the system parameters) before it is read by the
RAPID program. A diagram of how analog signal values are scaled is shown in the figure
below.
xx0500002408
Arguments
AOutput (Signal)
Signal
Data type: signalao
The name of the analog output to be read.
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.
Continues on next page
2 Functions
2.3. AOutput - Reads the value of an analog output signal
RobotWare - OS
763
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
AOutput ’(’
[ Signal ’:=’ ] < variable ( VAR ) of signalao > ’)’
A function with a return value of data type num .
Related information
For information about
See
Set an analog output signal
SetAO - Changes the value of an analog output signal
on page 431
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
2 Functions
2.4. ArgName - Gets argument name
RobotWare - OS
3HAC 16581-1 Revision: J
764
© Copyright 2004-2010 ABB. All rights reserved.
2.4. ArgName - Gets argument name
Usage
ArgName ( Argument Name ) is used to get the name of the original data object for the current
argument or the current data.
Basic examples
Basic examples of the function ArgName are illustrated below.
See also More examples on page 765 .
Example 1
VAR num chales :=5;
...
proc1 chales;
PROC proc1 (num par1)
VAR string name;
...
name:=ArgName(par1);
TPWrite "Argument name "+name+" with value "\Num:=par1;
ENDPROC
The variable name is assigned the string value " chales " and on FlexPendant the following
string is written: "Argument name chales with value 5".
Return value
Data type: string
The original data object name.
Arguments
ArgName (Parameter)
Parameter
Data type: anytype
The formal parameter identifier (for the routine in which ArgName is located) or the data
identity.
All types of data with structure atomic, record, record component, array, or array element can
be used.
Program execution
The function returns the original data object name for an entire object of the type constant,
variable, or persistent. The original data object can be global, local in the program module, or
local in a routine (normal RAPID scope rules).
If it is a part of a data object then the name of the whole data object is returned.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 766
|
2 Functions
2.3. AOutput - Reads the value of an analog output signal
RobotWare - OS
763
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
AOutput ’(’
[ Signal ’:=’ ] < variable ( VAR ) of signalao > ’)’
A function with a return value of data type num .
Related information
For information about
See
Set an analog output signal
SetAO - Changes the value of an analog output signal
on page 431
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
2 Functions
2.4. ArgName - Gets argument name
RobotWare - OS
3HAC 16581-1 Revision: J
764
© Copyright 2004-2010 ABB. All rights reserved.
2.4. ArgName - Gets argument name
Usage
ArgName ( Argument Name ) is used to get the name of the original data object for the current
argument or the current data.
Basic examples
Basic examples of the function ArgName are illustrated below.
See also More examples on page 765 .
Example 1
VAR num chales :=5;
...
proc1 chales;
PROC proc1 (num par1)
VAR string name;
...
name:=ArgName(par1);
TPWrite "Argument name "+name+" with value "\Num:=par1;
ENDPROC
The variable name is assigned the string value " chales " and on FlexPendant the following
string is written: "Argument name chales with value 5".
Return value
Data type: string
The original data object name.
Arguments
ArgName (Parameter)
Parameter
Data type: anytype
The formal parameter identifier (for the routine in which ArgName is located) or the data
identity.
All types of data with structure atomic, record, record component, array, or array element can
be used.
Program execution
The function returns the original data object name for an entire object of the type constant,
variable, or persistent. The original data object can be global, local in the program module, or
local in a routine (normal RAPID scope rules).
If it is a part of a data object then the name of the whole data object is returned.
Continues on next page
2 Functions
2.4. ArgName - Gets argument name
RobotWare - OS
765
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of the function ArgName are illustrated below.
Convert from identifier to string
This function can also be used to convert from identifier to string , by specifying the
identifier in the argument Parameter for any data object with global, local in module, or
local in routine scope:
VAR num chales :=5;
...
proc1;
PROC proc1 ()
VAR string name;
...
name:=ArgName(chales);
TPWrite "Global data object "+name+" has value "\Num:=chales;
ENDPROC
The variable name is assigned the string value " chales " and on FlexPendant the following
string is written: "Global data object chales has value 5".
Routine call in several steps
Note that the function returns the original data object name:
VAR num chales :=5;
...
proc1 chales;
...
PROC proc1 (num parameter1)
...
proc2 parameter1;
...
ENDPROC
PROC proc2 (num par1)
VAR string name;
...
name:=ArgName(par1);
TPWrite "Original data object name "+name+" with value"
\Num:=par1;
ENDPROC
The variable name is assigned the string value " chales " and on FlexPendant the following
string is written: "Original data object name chales with value 5".
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
| 767
|
2 Functions
2.4. ArgName - Gets argument name
RobotWare - OS
3HAC 16581-1 Revision: J
764
© Copyright 2004-2010 ABB. All rights reserved.
2.4. ArgName - Gets argument name
Usage
ArgName ( Argument Name ) is used to get the name of the original data object for the current
argument or the current data.
Basic examples
Basic examples of the function ArgName are illustrated below.
See also More examples on page 765 .
Example 1
VAR num chales :=5;
...
proc1 chales;
PROC proc1 (num par1)
VAR string name;
...
name:=ArgName(par1);
TPWrite "Argument name "+name+" with value "\Num:=par1;
ENDPROC
The variable name is assigned the string value " chales " and on FlexPendant the following
string is written: "Argument name chales with value 5".
Return value
Data type: string
The original data object name.
Arguments
ArgName (Parameter)
Parameter
Data type: anytype
The formal parameter identifier (for the routine in which ArgName is located) or the data
identity.
All types of data with structure atomic, record, record component, array, or array element can
be used.
Program execution
The function returns the original data object name for an entire object of the type constant,
variable, or persistent. The original data object can be global, local in the program module, or
local in a routine (normal RAPID scope rules).
If it is a part of a data object then the name of the whole data object is returned.
Continues on next page
2 Functions
2.4. ArgName - Gets argument name
RobotWare - OS
765
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of the function ArgName are illustrated below.
Convert from identifier to string
This function can also be used to convert from identifier to string , by specifying the
identifier in the argument Parameter for any data object with global, local in module, or
local in routine scope:
VAR num chales :=5;
...
proc1;
PROC proc1 ()
VAR string name;
...
name:=ArgName(chales);
TPWrite "Global data object "+name+" has value "\Num:=chales;
ENDPROC
The variable name is assigned the string value " chales " and on FlexPendant the following
string is written: "Global data object chales has value 5".
Routine call in several steps
Note that the function returns the original data object name:
VAR num chales :=5;
...
proc1 chales;
...
PROC proc1 (num parameter1)
...
proc2 parameter1;
...
ENDPROC
PROC proc2 (num par1)
VAR string name;
...
name:=ArgName(par1);
TPWrite "Original data object name "+name+" with value"
\Num:=par1;
ENDPROC
The variable name is assigned the string value " chales " and on FlexPendant the following
string is written: "Original data object name chales with value 5".
Continued
Continues on next page
2 Functions
2.4. ArgName - Gets argument name
RobotWare - OS
3HAC 16581-1 Revision: J
766
© Copyright 2004-2010 ABB. All rights reserved.
Error handling
If one of the following errors occurs then the system variable ERRNO is set to ERR_ARGNAME :
•
Argument is expression value
•
Argument is not present
•
Argument is of type switch
This error can then be handled in the error handler.
Syntax
ArgName ’(’
[ Parameter’:=’ ] < reference ( REF ) of any type> ’)’
A function with a return value of the data type string .
Related information
For information about
See
String functions
Technical reference manual - RAPID overview ,
section RAPID summary - String functions
Definition of string
string - Strings on page 1195
String values
Technical reference manual - RAPID overview ,
section Basic characteristics -Basic elements
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 768
|
2 Functions
2.4. ArgName - Gets argument name
RobotWare - OS
765
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of the function ArgName are illustrated below.
Convert from identifier to string
This function can also be used to convert from identifier to string , by specifying the
identifier in the argument Parameter for any data object with global, local in module, or
local in routine scope:
VAR num chales :=5;
...
proc1;
PROC proc1 ()
VAR string name;
...
name:=ArgName(chales);
TPWrite "Global data object "+name+" has value "\Num:=chales;
ENDPROC
The variable name is assigned the string value " chales " and on FlexPendant the following
string is written: "Global data object chales has value 5".
Routine call in several steps
Note that the function returns the original data object name:
VAR num chales :=5;
...
proc1 chales;
...
PROC proc1 (num parameter1)
...
proc2 parameter1;
...
ENDPROC
PROC proc2 (num par1)
VAR string name;
...
name:=ArgName(par1);
TPWrite "Original data object name "+name+" with value"
\Num:=par1;
ENDPROC
The variable name is assigned the string value " chales " and on FlexPendant the following
string is written: "Original data object name chales with value 5".
Continued
Continues on next page
2 Functions
2.4. ArgName - Gets argument name
RobotWare - OS
3HAC 16581-1 Revision: J
766
© Copyright 2004-2010 ABB. All rights reserved.
Error handling
If one of the following errors occurs then the system variable ERRNO is set to ERR_ARGNAME :
•
Argument is expression value
•
Argument is not present
•
Argument is of type switch
This error can then be handled in the error handler.
Syntax
ArgName ’(’
[ Parameter’:=’ ] < reference ( REF ) of any type> ’)’
A function with a return value of the data type string .
Related information
For information about
See
String functions
Technical reference manual - RAPID overview ,
section RAPID summary - String functions
Definition of string
string - Strings on page 1195
String values
Technical reference manual - RAPID overview ,
section Basic characteristics -Basic elements
Continued
2 Functions
2.5. ASin - Calculates the arc sine value
RobotWare - OS
767
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.5. ASin - Calculates the arc sine value
Usage
ASin ( Arc Sine ) is used to calculate the arc sine value.
Basic examples
Basic examples of the function ASin are illustrated below.
Example 1
VAR num angle;
VAR num value;
...
...
angle := ASin(value);
angle will get the arc sine value of value
Return value
Data type: num
The arc sine value, expressed in degrees, range [-90, 90].
Arguments
ASin (Value)
Value
Data type: num
The argument value must be in range [-1, 1].
Limitations
The execution of the function ASin(x) will give an error if x is outside the range [1, -1].
Syntax
ASin’(’
[Value ’:=’] <expression ( IN ) of num>
’)’
A function with a return value of the data type num .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID
overview , section RAPID Summary -
Mathematics
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 769
|
2 Functions
2.4. ArgName - Gets argument name
RobotWare - OS
3HAC 16581-1 Revision: J
766
© Copyright 2004-2010 ABB. All rights reserved.
Error handling
If one of the following errors occurs then the system variable ERRNO is set to ERR_ARGNAME :
•
Argument is expression value
•
Argument is not present
•
Argument is of type switch
This error can then be handled in the error handler.
Syntax
ArgName ’(’
[ Parameter’:=’ ] < reference ( REF ) of any type> ’)’
A function with a return value of the data type string .
Related information
For information about
See
String functions
Technical reference manual - RAPID overview ,
section RAPID summary - String functions
Definition of string
string - Strings on page 1195
String values
Technical reference manual - RAPID overview ,
section Basic characteristics -Basic elements
Continued
2 Functions
2.5. ASin - Calculates the arc sine value
RobotWare - OS
767
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.5. ASin - Calculates the arc sine value
Usage
ASin ( Arc Sine ) is used to calculate the arc sine value.
Basic examples
Basic examples of the function ASin are illustrated below.
Example 1
VAR num angle;
VAR num value;
...
...
angle := ASin(value);
angle will get the arc sine value of value
Return value
Data type: num
The arc sine value, expressed in degrees, range [-90, 90].
Arguments
ASin (Value)
Value
Data type: num
The argument value must be in range [-1, 1].
Limitations
The execution of the function ASin(x) will give an error if x is outside the range [1, -1].
Syntax
ASin’(’
[Value ’:=’] <expression ( IN ) of num>
’)’
A function with a return value of the data type num .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID
overview , section RAPID Summary -
Mathematics
2 Functions
2.6. ATan - Calculates the arc tangent value
RobotWare - OS
3HAC 16581-1 Revision: J
768
© Copyright 2004-2010 ABB. All rights reserved.
2.6. ATan - Calculates the arc tangent value
Usage
ATan ( Arc Tangent ) is used to calculate the arc tangent value.
Basic examples
Basic examples of the function ATan are illustrated below.
Example 1
VAR num angle;
VAR num value;
...
...
angle := ATan(value);
angle will get the arc tangent value of value .
Return value
Data type: num
The arc tangent value, expressed in degrees, range [-90, 90].
Arguments
ATan (Value)
Value
Data type: num
The argument value.
Syntax
ATan’(’
[Value ’:=’] <expression ( IN ) of num>
’)’
A function with a return value of the data type num .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID overview ,
section RAPID summary - Mathematics
Arc tangent with a return value in the range
[-180, 180]
ATan2 - Calculates the arc tangent2 value on
page 769
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 770
|
2 Functions
2.5. ASin - Calculates the arc sine value
RobotWare - OS
767
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.5. ASin - Calculates the arc sine value
Usage
ASin ( Arc Sine ) is used to calculate the arc sine value.
Basic examples
Basic examples of the function ASin are illustrated below.
Example 1
VAR num angle;
VAR num value;
...
...
angle := ASin(value);
angle will get the arc sine value of value
Return value
Data type: num
The arc sine value, expressed in degrees, range [-90, 90].
Arguments
ASin (Value)
Value
Data type: num
The argument value must be in range [-1, 1].
Limitations
The execution of the function ASin(x) will give an error if x is outside the range [1, -1].
Syntax
ASin’(’
[Value ’:=’] <expression ( IN ) of num>
’)’
A function with a return value of the data type num .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID
overview , section RAPID Summary -
Mathematics
2 Functions
2.6. ATan - Calculates the arc tangent value
RobotWare - OS
3HAC 16581-1 Revision: J
768
© Copyright 2004-2010 ABB. All rights reserved.
2.6. ATan - Calculates the arc tangent value
Usage
ATan ( Arc Tangent ) is used to calculate the arc tangent value.
Basic examples
Basic examples of the function ATan are illustrated below.
Example 1
VAR num angle;
VAR num value;
...
...
angle := ATan(value);
angle will get the arc tangent value of value .
Return value
Data type: num
The arc tangent value, expressed in degrees, range [-90, 90].
Arguments
ATan (Value)
Value
Data type: num
The argument value.
Syntax
ATan’(’
[Value ’:=’] <expression ( IN ) of num>
’)’
A function with a return value of the data type num .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID overview ,
section RAPID summary - Mathematics
Arc tangent with a return value in the range
[-180, 180]
ATan2 - Calculates the arc tangent2 value on
page 769
2 Functions
2.7. ATan2 - Calculates the arc tangent2 value
RobotWare - OS
769
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.7. ATan2 - Calculates the arc tangent2 value
Usage
ATan2 ( Arc Tangent2 ) is used to calculate the arc tangent2 value.
Basic examples
Basic examples of the function ATan2 are illustrated below.
Example 1
VAR num angle;
VAR num x_value;
VAR num y_value;
...
...
angle := ATan2(y_value, x_value);
angle will get the arc tangent value of y_value/x_value .
Return value
Data type: num
The arc tangent value, expressed in degrees, range [-180, 180]. The value will be equal to
ATan(y/x) but in the range of [-180, 180] since the function uses the sign of both arguments
to determine the quadrant of the return value.
Arguments
ATan2 (Y X)
Y
Data type: num
The numerator argument value.
X
Data type: num
The denominator argument value.
Syntax
ATan2’(’
[Y ’:=’] <expression (IN) of num> ’,’
[X ’:=’] <expression (IN) of num>
’)’
A function with a return value of the data type num .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID overview ,
section RAPID Summary - Mathematics
Arc tangent with only one argument
ATan - Calculates the arc tangent value on page
768
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 771
|
2 Functions
2.6. ATan - Calculates the arc tangent value
RobotWare - OS
3HAC 16581-1 Revision: J
768
© Copyright 2004-2010 ABB. All rights reserved.
2.6. ATan - Calculates the arc tangent value
Usage
ATan ( Arc Tangent ) is used to calculate the arc tangent value.
Basic examples
Basic examples of the function ATan are illustrated below.
Example 1
VAR num angle;
VAR num value;
...
...
angle := ATan(value);
angle will get the arc tangent value of value .
Return value
Data type: num
The arc tangent value, expressed in degrees, range [-90, 90].
Arguments
ATan (Value)
Value
Data type: num
The argument value.
Syntax
ATan’(’
[Value ’:=’] <expression ( IN ) of num>
’)’
A function with a return value of the data type num .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID overview ,
section RAPID summary - Mathematics
Arc tangent with a return value in the range
[-180, 180]
ATan2 - Calculates the arc tangent2 value on
page 769
2 Functions
2.7. ATan2 - Calculates the arc tangent2 value
RobotWare - OS
769
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.7. ATan2 - Calculates the arc tangent2 value
Usage
ATan2 ( Arc Tangent2 ) is used to calculate the arc tangent2 value.
Basic examples
Basic examples of the function ATan2 are illustrated below.
Example 1
VAR num angle;
VAR num x_value;
VAR num y_value;
...
...
angle := ATan2(y_value, x_value);
angle will get the arc tangent value of y_value/x_value .
Return value
Data type: num
The arc tangent value, expressed in degrees, range [-180, 180]. The value will be equal to
ATan(y/x) but in the range of [-180, 180] since the function uses the sign of both arguments
to determine the quadrant of the return value.
Arguments
ATan2 (Y X)
Y
Data type: num
The numerator argument value.
X
Data type: num
The denominator argument value.
Syntax
ATan2’(’
[Y ’:=’] <expression (IN) of num> ’,’
[X ’:=’] <expression (IN) of num>
’)’
A function with a return value of the data type num .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID overview ,
section RAPID Summary - Mathematics
Arc tangent with only one argument
ATan - Calculates the arc tangent value on page
768
2 Functions
2.8. BitAnd - Logical bitwise AND - operation on byte data
RobotWare - OS
3HAC 16581-1 Revision: J
770
© Copyright 2004-2010 ABB. All rights reserved.
2.8. BitAnd - Logical bitwise AND - operation on byte data
Usage
BitAnd is used to execute a logical bitwise AND - operation on data types byte.
Basic examples
Basic examples of the function BitAnd are illustrated below.
Example 1
VAR byte data1 := 38;
VAR byte data2 := 34;
VAR byte data3;
data3 := BitAnd(data1, data2);
The logical bitwise AND - operation (see figure below) will be executed on the data1 and
data2 . The result will be returned to data3 (integer representation).
xx0500002454
Return value
Data type: byte
The result of the logical bitwise AND - operation in integer representation.
Arguments
BitAnd (BitData1 BitData2)
BitData1
Data type: byte
The bit data 1, in integer representation.
BitData2
Data type: byte
The bit data 2, in integer representation.
Limitations
The range for a data type byte is 0 - 255.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 772
|
2 Functions
2.7. ATan2 - Calculates the arc tangent2 value
RobotWare - OS
769
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.7. ATan2 - Calculates the arc tangent2 value
Usage
ATan2 ( Arc Tangent2 ) is used to calculate the arc tangent2 value.
Basic examples
Basic examples of the function ATan2 are illustrated below.
Example 1
VAR num angle;
VAR num x_value;
VAR num y_value;
...
...
angle := ATan2(y_value, x_value);
angle will get the arc tangent value of y_value/x_value .
Return value
Data type: num
The arc tangent value, expressed in degrees, range [-180, 180]. The value will be equal to
ATan(y/x) but in the range of [-180, 180] since the function uses the sign of both arguments
to determine the quadrant of the return value.
Arguments
ATan2 (Y X)
Y
Data type: num
The numerator argument value.
X
Data type: num
The denominator argument value.
Syntax
ATan2’(’
[Y ’:=’] <expression (IN) of num> ’,’
[X ’:=’] <expression (IN) of num>
’)’
A function with a return value of the data type num .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID overview ,
section RAPID Summary - Mathematics
Arc tangent with only one argument
ATan - Calculates the arc tangent value on page
768
2 Functions
2.8. BitAnd - Logical bitwise AND - operation on byte data
RobotWare - OS
3HAC 16581-1 Revision: J
770
© Copyright 2004-2010 ABB. All rights reserved.
2.8. BitAnd - Logical bitwise AND - operation on byte data
Usage
BitAnd is used to execute a logical bitwise AND - operation on data types byte.
Basic examples
Basic examples of the function BitAnd are illustrated below.
Example 1
VAR byte data1 := 38;
VAR byte data2 := 34;
VAR byte data3;
data3 := BitAnd(data1, data2);
The logical bitwise AND - operation (see figure below) will be executed on the data1 and
data2 . The result will be returned to data3 (integer representation).
xx0500002454
Return value
Data type: byte
The result of the logical bitwise AND - operation in integer representation.
Arguments
BitAnd (BitData1 BitData2)
BitData1
Data type: byte
The bit data 1, in integer representation.
BitData2
Data type: byte
The bit data 2, in integer representation.
Limitations
The range for a data type byte is 0 - 255.
Continues on next page
2 Functions
2.8. BitAnd - Logical bitwise AND - operation on byte data
RobotWare - OS
771
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
BitAnd’(’
[BitData1 ’:=’] <expression ( IN ) of byte>’ ,’
[BitData2 ’:=’] <expression ( IN ) of byte>
’)’
A function with a return value of the data type byte .
Related information
For information about
See
Logical bitwise OR - operation on byte data
BitOr - Logical bitwise OR - operation on
byte data on page 778
Logical bitwise XOR - operation on byte data
BitXOr - Logical bitwise XOR - operation on
byte data on page 782
Logical bitwise NEGATION - operation on byte
data
BitNeg - Logical bitwise NEGATION -
operation on byte data on page 776
Other bit functions
Technical reference manual - RAPID
overview , section RAPID summary - Bit
Functions
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 773
|
2 Functions
2.8. BitAnd - Logical bitwise AND - operation on byte data
RobotWare - OS
3HAC 16581-1 Revision: J
770
© Copyright 2004-2010 ABB. All rights reserved.
2.8. BitAnd - Logical bitwise AND - operation on byte data
Usage
BitAnd is used to execute a logical bitwise AND - operation on data types byte.
Basic examples
Basic examples of the function BitAnd are illustrated below.
Example 1
VAR byte data1 := 38;
VAR byte data2 := 34;
VAR byte data3;
data3 := BitAnd(data1, data2);
The logical bitwise AND - operation (see figure below) will be executed on the data1 and
data2 . The result will be returned to data3 (integer representation).
xx0500002454
Return value
Data type: byte
The result of the logical bitwise AND - operation in integer representation.
Arguments
BitAnd (BitData1 BitData2)
BitData1
Data type: byte
The bit data 1, in integer representation.
BitData2
Data type: byte
The bit data 2, in integer representation.
Limitations
The range for a data type byte is 0 - 255.
Continues on next page
2 Functions
2.8. BitAnd - Logical bitwise AND - operation on byte data
RobotWare - OS
771
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
BitAnd’(’
[BitData1 ’:=’] <expression ( IN ) of byte>’ ,’
[BitData2 ’:=’] <expression ( IN ) of byte>
’)’
A function with a return value of the data type byte .
Related information
For information about
See
Logical bitwise OR - operation on byte data
BitOr - Logical bitwise OR - operation on
byte data on page 778
Logical bitwise XOR - operation on byte data
BitXOr - Logical bitwise XOR - operation on
byte data on page 782
Logical bitwise NEGATION - operation on byte
data
BitNeg - Logical bitwise NEGATION -
operation on byte data on page 776
Other bit functions
Technical reference manual - RAPID
overview , section RAPID summary - Bit
Functions
Continued
2 Functions
2.9. BitCheck - Check if a specified bit in a byte data is set
RobotWare - OS
3HAC 16581-1 Revision: J
772
© Copyright 2004-2010 ABB. All rights reserved.
2.9. BitCheck - Check if a specified bit in a byte data is set
Usage
BitCheck is used to check if a specified bit in a defined byte data is set to 1.
Basic examples
Basic examples of the function BitCheck are illustrated below.
Example 1
CONST num parity_bit := 8;
VAR byte data1 := 130;
IF BitCheck(data1, parity_bit) = TRUE THEN
...
ELSE
...
ENDIF
Bit number 8 ( parity_bit ) in the variable data1 will be checked, e.g. if the specified bit
is set to 1 in the variable data1 then this function will return to TRUE . Bit check of data type
byte is illustrated in the figure below.
xx0500002442
Return value
Data type: bool
TRUE if the specified bit is set to 1, FALSE if the specified bit is set to 0.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 774
|
2 Functions
2.8. BitAnd - Logical bitwise AND - operation on byte data
RobotWare - OS
771
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
BitAnd’(’
[BitData1 ’:=’] <expression ( IN ) of byte>’ ,’
[BitData2 ’:=’] <expression ( IN ) of byte>
’)’
A function with a return value of the data type byte .
Related information
For information about
See
Logical bitwise OR - operation on byte data
BitOr - Logical bitwise OR - operation on
byte data on page 778
Logical bitwise XOR - operation on byte data
BitXOr - Logical bitwise XOR - operation on
byte data on page 782
Logical bitwise NEGATION - operation on byte
data
BitNeg - Logical bitwise NEGATION -
operation on byte data on page 776
Other bit functions
Technical reference manual - RAPID
overview , section RAPID summary - Bit
Functions
Continued
2 Functions
2.9. BitCheck - Check if a specified bit in a byte data is set
RobotWare - OS
3HAC 16581-1 Revision: J
772
© Copyright 2004-2010 ABB. All rights reserved.
2.9. BitCheck - Check if a specified bit in a byte data is set
Usage
BitCheck is used to check if a specified bit in a defined byte data is set to 1.
Basic examples
Basic examples of the function BitCheck are illustrated below.
Example 1
CONST num parity_bit := 8;
VAR byte data1 := 130;
IF BitCheck(data1, parity_bit) = TRUE THEN
...
ELSE
...
ENDIF
Bit number 8 ( parity_bit ) in the variable data1 will be checked, e.g. if the specified bit
is set to 1 in the variable data1 then this function will return to TRUE . Bit check of data type
byte is illustrated in the figure below.
xx0500002442
Return value
Data type: bool
TRUE if the specified bit is set to 1, FALSE if the specified bit is set to 0.
Continues on next page
2 Functions
2.9. BitCheck - Check if a specified bit in a byte data is set
RobotWare - OS
773
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
BitCheck (BitData BitPos)
BitData
Data type: byte
The bit data, in integer representation, to be checked.
BitPos
Bit Position
Data type: num
The bit position (1-8) in the BitData to be checked.
Limitations
The range for a data type byte is 0 - 255 decimal.
The bit position is valid from 1 - 8.
Syntax
BitCheck’(’
[BitData ’:=’] <expression ( IN ) of byte> ´,’
[BitPos ’:=’] <expression ( IN ) of num>
’)’
A function with a return value of the data type bool .
Related information
For information about
See
Set a specified bit in a byte data
BitSet - Set a specified bit in a byte data on page 28
Clear a specified bit in a byte data
BitClear - Clear a specified bit in a byte data on page
26
Other bit functions
Technical reference manual - RAPID overview ,
section RAPID summary - Bit Functions
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 775
|
2 Functions
2.9. BitCheck - Check if a specified bit in a byte data is set
RobotWare - OS
3HAC 16581-1 Revision: J
772
© Copyright 2004-2010 ABB. All rights reserved.
2.9. BitCheck - Check if a specified bit in a byte data is set
Usage
BitCheck is used to check if a specified bit in a defined byte data is set to 1.
Basic examples
Basic examples of the function BitCheck are illustrated below.
Example 1
CONST num parity_bit := 8;
VAR byte data1 := 130;
IF BitCheck(data1, parity_bit) = TRUE THEN
...
ELSE
...
ENDIF
Bit number 8 ( parity_bit ) in the variable data1 will be checked, e.g. if the specified bit
is set to 1 in the variable data1 then this function will return to TRUE . Bit check of data type
byte is illustrated in the figure below.
xx0500002442
Return value
Data type: bool
TRUE if the specified bit is set to 1, FALSE if the specified bit is set to 0.
Continues on next page
2 Functions
2.9. BitCheck - Check if a specified bit in a byte data is set
RobotWare - OS
773
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
BitCheck (BitData BitPos)
BitData
Data type: byte
The bit data, in integer representation, to be checked.
BitPos
Bit Position
Data type: num
The bit position (1-8) in the BitData to be checked.
Limitations
The range for a data type byte is 0 - 255 decimal.
The bit position is valid from 1 - 8.
Syntax
BitCheck’(’
[BitData ’:=’] <expression ( IN ) of byte> ´,’
[BitPos ’:=’] <expression ( IN ) of num>
’)’
A function with a return value of the data type bool .
Related information
For information about
See
Set a specified bit in a byte data
BitSet - Set a specified bit in a byte data on page 28
Clear a specified bit in a byte data
BitClear - Clear a specified bit in a byte data on page
26
Other bit functions
Technical reference manual - RAPID overview ,
section RAPID summary - Bit Functions
Continued
2 Functions
2.10. BitLSh - Logical bitwise LEFT SHIFT - operation on byte
RobotWare - OS
3HAC 16581-1 Revision: J
774
© Copyright 2004-2010 ABB. All rights reserved.
2.10. BitLSh - Logical bitwise LEFT SHIFT - operation on byte
Usage
BitLSh ( Bit Left Shift ) is used to execute a logical bitwise LEFT SHIFT-operation on data
types byte .
Basic examples
Basic examples of the function BitLSh are illustrated below.
Example 1
VAR num left_shift := 3;
VAR byte data1 := 38;
VAR byte data2;
data2 := BitLSh(data1, left_shift);
The logical bitwise LEFT SHIFT- operation will be executed on the data1 with 3
( left_shift ) steps of left shift, and the result will be returned to data2 (integer
representation).
The following figure shows logical bitwise LEFT SHIFT-operation.
xx0500002457
Return value
Data type: byte
The result of the logical bitwise LEFT SHIFT-operation in integer representation.
The right bit cells will be filled up with 0-bits.
Arguments
BitLSh (BitData ShiftSteps)
BitData
Data type: byte
The bit data, in integer representation, to be shifted.
ShiftSteps
Data type: num
Number of the logical shifts (1 - 8) to be executed.
Limitations
The range for a data type byte is 0 - 255.
The ShiftSteps argument is valid from 1 - 8 according to one byte.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 776
|
2 Functions
2.9. BitCheck - Check if a specified bit in a byte data is set
RobotWare - OS
773
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
BitCheck (BitData BitPos)
BitData
Data type: byte
The bit data, in integer representation, to be checked.
BitPos
Bit Position
Data type: num
The bit position (1-8) in the BitData to be checked.
Limitations
The range for a data type byte is 0 - 255 decimal.
The bit position is valid from 1 - 8.
Syntax
BitCheck’(’
[BitData ’:=’] <expression ( IN ) of byte> ´,’
[BitPos ’:=’] <expression ( IN ) of num>
’)’
A function with a return value of the data type bool .
Related information
For information about
See
Set a specified bit in a byte data
BitSet - Set a specified bit in a byte data on page 28
Clear a specified bit in a byte data
BitClear - Clear a specified bit in a byte data on page
26
Other bit functions
Technical reference manual - RAPID overview ,
section RAPID summary - Bit Functions
Continued
2 Functions
2.10. BitLSh - Logical bitwise LEFT SHIFT - operation on byte
RobotWare - OS
3HAC 16581-1 Revision: J
774
© Copyright 2004-2010 ABB. All rights reserved.
2.10. BitLSh - Logical bitwise LEFT SHIFT - operation on byte
Usage
BitLSh ( Bit Left Shift ) is used to execute a logical bitwise LEFT SHIFT-operation on data
types byte .
Basic examples
Basic examples of the function BitLSh are illustrated below.
Example 1
VAR num left_shift := 3;
VAR byte data1 := 38;
VAR byte data2;
data2 := BitLSh(data1, left_shift);
The logical bitwise LEFT SHIFT- operation will be executed on the data1 with 3
( left_shift ) steps of left shift, and the result will be returned to data2 (integer
representation).
The following figure shows logical bitwise LEFT SHIFT-operation.
xx0500002457
Return value
Data type: byte
The result of the logical bitwise LEFT SHIFT-operation in integer representation.
The right bit cells will be filled up with 0-bits.
Arguments
BitLSh (BitData ShiftSteps)
BitData
Data type: byte
The bit data, in integer representation, to be shifted.
ShiftSteps
Data type: num
Number of the logical shifts (1 - 8) to be executed.
Limitations
The range for a data type byte is 0 - 255.
The ShiftSteps argument is valid from 1 - 8 according to one byte.
Continues on next page
2 Functions
2.10. BitLSh - Logical bitwise LEFT SHIFT - operation on byte
RobotWare - OS
775
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
BitLSh’(’
[BitData ’:=’] <expression ( IN ) of byte>’ ,’
[ShiftSteps’ :=’] <expression ( IN ) of num>
’)’
A function with a return value of the data type byte .
Related information
For information about
See
Logical bitwise RIGHT SHIFT-operation
on byte data
BitRSh - Logical bitwise RIGHT SHIFT -
operation on byte on page 780
Other bit functions
Technical reference manual - RAPID overview ,
section RAPID summary - Mathematics -
Bit functions
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 777
|
2 Functions
2.10. BitLSh - Logical bitwise LEFT SHIFT - operation on byte
RobotWare - OS
3HAC 16581-1 Revision: J
774
© Copyright 2004-2010 ABB. All rights reserved.
2.10. BitLSh - Logical bitwise LEFT SHIFT - operation on byte
Usage
BitLSh ( Bit Left Shift ) is used to execute a logical bitwise LEFT SHIFT-operation on data
types byte .
Basic examples
Basic examples of the function BitLSh are illustrated below.
Example 1
VAR num left_shift := 3;
VAR byte data1 := 38;
VAR byte data2;
data2 := BitLSh(data1, left_shift);
The logical bitwise LEFT SHIFT- operation will be executed on the data1 with 3
( left_shift ) steps of left shift, and the result will be returned to data2 (integer
representation).
The following figure shows logical bitwise LEFT SHIFT-operation.
xx0500002457
Return value
Data type: byte
The result of the logical bitwise LEFT SHIFT-operation in integer representation.
The right bit cells will be filled up with 0-bits.
Arguments
BitLSh (BitData ShiftSteps)
BitData
Data type: byte
The bit data, in integer representation, to be shifted.
ShiftSteps
Data type: num
Number of the logical shifts (1 - 8) to be executed.
Limitations
The range for a data type byte is 0 - 255.
The ShiftSteps argument is valid from 1 - 8 according to one byte.
Continues on next page
2 Functions
2.10. BitLSh - Logical bitwise LEFT SHIFT - operation on byte
RobotWare - OS
775
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
BitLSh’(’
[BitData ’:=’] <expression ( IN ) of byte>’ ,’
[ShiftSteps’ :=’] <expression ( IN ) of num>
’)’
A function with a return value of the data type byte .
Related information
For information about
See
Logical bitwise RIGHT SHIFT-operation
on byte data
BitRSh - Logical bitwise RIGHT SHIFT -
operation on byte on page 780
Other bit functions
Technical reference manual - RAPID overview ,
section RAPID summary - Mathematics -
Bit functions
Continued
2 Functions
2.11. BitNeg - Logical bitwise NEGATION - operation on byte data
RobotWare - OS
3HAC 16581-1 Revision: J
776
© Copyright 2004-2010 ABB. All rights reserved.
2.11. BitNeg - Logical bitwise NEGATION - operation on byte data
Usage
BitNeg ( Bit Negation ) is used to execute a logical bitwise NEGATION - operation
(one’s complement) on data types byte .
Basic examples
Basic examples of the function BitNeg are illustrated below.
Example 1
VAR byte data1 := 38;
VAR byte data2;
data2 := BitNeg(data1);
The logical bitwise NEGATION - operation (see figure below) will be executed on the data1 ,
and the result will be returned to data2 (integer representation).
xx0500002456
Return value
Data type: byte
The result of the logical bitwise NEGATION - operation in integer representation.
Arguments
BitNeg (BitData)
BitData
Data type: byte
The byte data, in integer representation.
Limitations
The range for a data type byte is 0 - 255.
Syntax
BitNeg’(’
[BitData ’:=’] <expression ( IN ) of byte>
’)’
A function with a return value of the data type byte .
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 778
|
2 Functions
2.10. BitLSh - Logical bitwise LEFT SHIFT - operation on byte
RobotWare - OS
775
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
BitLSh’(’
[BitData ’:=’] <expression ( IN ) of byte>’ ,’
[ShiftSteps’ :=’] <expression ( IN ) of num>
’)’
A function with a return value of the data type byte .
Related information
For information about
See
Logical bitwise RIGHT SHIFT-operation
on byte data
BitRSh - Logical bitwise RIGHT SHIFT -
operation on byte on page 780
Other bit functions
Technical reference manual - RAPID overview ,
section RAPID summary - Mathematics -
Bit functions
Continued
2 Functions
2.11. BitNeg - Logical bitwise NEGATION - operation on byte data
RobotWare - OS
3HAC 16581-1 Revision: J
776
© Copyright 2004-2010 ABB. All rights reserved.
2.11. BitNeg - Logical bitwise NEGATION - operation on byte data
Usage
BitNeg ( Bit Negation ) is used to execute a logical bitwise NEGATION - operation
(one’s complement) on data types byte .
Basic examples
Basic examples of the function BitNeg are illustrated below.
Example 1
VAR byte data1 := 38;
VAR byte data2;
data2 := BitNeg(data1);
The logical bitwise NEGATION - operation (see figure below) will be executed on the data1 ,
and the result will be returned to data2 (integer representation).
xx0500002456
Return value
Data type: byte
The result of the logical bitwise NEGATION - operation in integer representation.
Arguments
BitNeg (BitData)
BitData
Data type: byte
The byte data, in integer representation.
Limitations
The range for a data type byte is 0 - 255.
Syntax
BitNeg’(’
[BitData ’:=’] <expression ( IN ) of byte>
’)’
A function with a return value of the data type byte .
Continues on next page
2 Functions
2.11. BitNeg - Logical bitwise NEGATION - operation on byte data
RobotWare - OS
777
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Logical bitwise AND - operation on byte data
BitAnd - Logical bitwise AND - operation on
byte data on page 770
Logical bitwise OR - operation on byte data
BitOr - Logical bitwise OR - operation on byte
data on page 778
Logical bitwise XOR - operation on byte data
BitXOr - Logical bitwise XOR - operation on
byte data on page 782
Other bit functions
Technical reference manual - RAPID
overview , section RAPID summary - Bit
functions
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 779
|
2 Functions
2.11. BitNeg - Logical bitwise NEGATION - operation on byte data
RobotWare - OS
3HAC 16581-1 Revision: J
776
© Copyright 2004-2010 ABB. All rights reserved.
2.11. BitNeg - Logical bitwise NEGATION - operation on byte data
Usage
BitNeg ( Bit Negation ) is used to execute a logical bitwise NEGATION - operation
(one’s complement) on data types byte .
Basic examples
Basic examples of the function BitNeg are illustrated below.
Example 1
VAR byte data1 := 38;
VAR byte data2;
data2 := BitNeg(data1);
The logical bitwise NEGATION - operation (see figure below) will be executed on the data1 ,
and the result will be returned to data2 (integer representation).
xx0500002456
Return value
Data type: byte
The result of the logical bitwise NEGATION - operation in integer representation.
Arguments
BitNeg (BitData)
BitData
Data type: byte
The byte data, in integer representation.
Limitations
The range for a data type byte is 0 - 255.
Syntax
BitNeg’(’
[BitData ’:=’] <expression ( IN ) of byte>
’)’
A function with a return value of the data type byte .
Continues on next page
2 Functions
2.11. BitNeg - Logical bitwise NEGATION - operation on byte data
RobotWare - OS
777
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Logical bitwise AND - operation on byte data
BitAnd - Logical bitwise AND - operation on
byte data on page 770
Logical bitwise OR - operation on byte data
BitOr - Logical bitwise OR - operation on byte
data on page 778
Logical bitwise XOR - operation on byte data
BitXOr - Logical bitwise XOR - operation on
byte data on page 782
Other bit functions
Technical reference manual - RAPID
overview , section RAPID summary - Bit
functions
Continued
2 Functions
2.12. BitOr - Logical bitwise OR - operation on byte data
RobotWare - OS
3HAC 16581-1 Revision: J
778
© Copyright 2004-2010 ABB. All rights reserved.
2.12. BitOr - Logical bitwise OR - operation on byte data
Usage
BitOr ( Bit inclusive Or ) is used to execute a logical bitwise OR -operation on data types byte .
Basic examples
Basic examples of the function BitOr are illustrated below.
Example 1
VAR byte data1 := 39;
VAR byte data2 := 162;
VAR byte data3;
data3 := BitOr(data1, data2);
The logical bitwise OR-operation will be executed on the data1 and data2 , and the result
will be returned to data3 (integer representation).
The following figure shows logical bitwise OR-operation.
xx0500002458
Return value
Data type: byte
The result of the logical bitwise OR-operation in integer representation.
Arguments
BitOr (BitData1 BitData2)
BitData1
Data type: byte
The bit data 1, in integer representation.
BitData2
Data type: byte
The bit data 2, in integer representation.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 780
|
2 Functions
2.11. BitNeg - Logical bitwise NEGATION - operation on byte data
RobotWare - OS
777
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Related information
For information about
See
Logical bitwise AND - operation on byte data
BitAnd - Logical bitwise AND - operation on
byte data on page 770
Logical bitwise OR - operation on byte data
BitOr - Logical bitwise OR - operation on byte
data on page 778
Logical bitwise XOR - operation on byte data
BitXOr - Logical bitwise XOR - operation on
byte data on page 782
Other bit functions
Technical reference manual - RAPID
overview , section RAPID summary - Bit
functions
Continued
2 Functions
2.12. BitOr - Logical bitwise OR - operation on byte data
RobotWare - OS
3HAC 16581-1 Revision: J
778
© Copyright 2004-2010 ABB. All rights reserved.
2.12. BitOr - Logical bitwise OR - operation on byte data
Usage
BitOr ( Bit inclusive Or ) is used to execute a logical bitwise OR -operation on data types byte .
Basic examples
Basic examples of the function BitOr are illustrated below.
Example 1
VAR byte data1 := 39;
VAR byte data2 := 162;
VAR byte data3;
data3 := BitOr(data1, data2);
The logical bitwise OR-operation will be executed on the data1 and data2 , and the result
will be returned to data3 (integer representation).
The following figure shows logical bitwise OR-operation.
xx0500002458
Return value
Data type: byte
The result of the logical bitwise OR-operation in integer representation.
Arguments
BitOr (BitData1 BitData2)
BitData1
Data type: byte
The bit data 1, in integer representation.
BitData2
Data type: byte
The bit data 2, in integer representation.
Continues on next page
2 Functions
2.12. BitOr - Logical bitwise OR - operation on byte data
RobotWare - OS
779
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
The range for a data type byte is 0 - 255.
Syntax
BitOr’(’
[BitData1 ’:=’] <expression ( IN ) of byte>’ ,’
[BitData2 ’:=’] <expression ( IN ) of byte>
’)’
A function with a return value of the data type byte .
Related information
For information about
See
Logical bitwise AND - operation on byte
data
BitAnd - Logical bitwise AND - operation on byte
data on page 770
Logical bitwise XOR - operation on byte
data
BitXOr - Logical bitwise XOR - operation on byte
data on page 782
Logical bitwise NEGATION - operation on
byte data
BitNeg - Logical bitwise NEGATION - operation
on byte data on page 776
Other bit functions
Technical reference manual - RAPID overview ,
section RAPID summary - Mathematics -
Bit functions
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 781
|
2 Functions
2.12. BitOr - Logical bitwise OR - operation on byte data
RobotWare - OS
3HAC 16581-1 Revision: J
778
© Copyright 2004-2010 ABB. All rights reserved.
2.12. BitOr - Logical bitwise OR - operation on byte data
Usage
BitOr ( Bit inclusive Or ) is used to execute a logical bitwise OR -operation on data types byte .
Basic examples
Basic examples of the function BitOr are illustrated below.
Example 1
VAR byte data1 := 39;
VAR byte data2 := 162;
VAR byte data3;
data3 := BitOr(data1, data2);
The logical bitwise OR-operation will be executed on the data1 and data2 , and the result
will be returned to data3 (integer representation).
The following figure shows logical bitwise OR-operation.
xx0500002458
Return value
Data type: byte
The result of the logical bitwise OR-operation in integer representation.
Arguments
BitOr (BitData1 BitData2)
BitData1
Data type: byte
The bit data 1, in integer representation.
BitData2
Data type: byte
The bit data 2, in integer representation.
Continues on next page
2 Functions
2.12. BitOr - Logical bitwise OR - operation on byte data
RobotWare - OS
779
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
The range for a data type byte is 0 - 255.
Syntax
BitOr’(’
[BitData1 ’:=’] <expression ( IN ) of byte>’ ,’
[BitData2 ’:=’] <expression ( IN ) of byte>
’)’
A function with a return value of the data type byte .
Related information
For information about
See
Logical bitwise AND - operation on byte
data
BitAnd - Logical bitwise AND - operation on byte
data on page 770
Logical bitwise XOR - operation on byte
data
BitXOr - Logical bitwise XOR - operation on byte
data on page 782
Logical bitwise NEGATION - operation on
byte data
BitNeg - Logical bitwise NEGATION - operation
on byte data on page 776
Other bit functions
Technical reference manual - RAPID overview ,
section RAPID summary - Mathematics -
Bit functions
Continued
2 Functions
2.13. BitRSh - Logical bitwise RIGHT SHIFT - operation on byte
RobotWare - OS
3HAC 16581-1 Revision: J
780
© Copyright 2004-2010 ABB. All rights reserved.
2.13. BitRSh - Logical bitwise RIGHT SHIFT - operation on byte
Usage
BitRSh ( Bit Right Shift ) is used to execute a logical bitwise RIGHT SHIFT-operation on data
types byte .
Basic examples
Basic example of the function BitRSh are illustrated below.
Example 1
VAR num right_shift := 3;
VAR byte data1 := 38;
VAR byte data2;
data2 := BitRSh(data1, right_shift);
The logical bitwise RIGHT SHIFT-operation will be executed on the data1 with 3
( right_shift ) steps of right shift, and the result will be returned to data2
(integer representation)
The following figure shows logical bitwise RIGHT SHIFT-operation.
xx0500002455
Return value
Data type: byte
The result of the logical bitwise RIGHT SHIFT-operation in integer representation.
The left bit cells will be filled up with 0-bits.
Arguments
BitRSh (BitData ShiftSteps)
BitData
Data type: byte
The bit data, in integer representation, to be shifted.
ShiftSteps
Data type: num
Number of the logical shifts (1 - 8) to be executed.
Limitations
The range for a data type byte is 0 - 255.
The ShiftSteps argument is valid from 1 - 8 according to one byte.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 782
|
2 Functions
2.12. BitOr - Logical bitwise OR - operation on byte data
RobotWare - OS
779
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
The range for a data type byte is 0 - 255.
Syntax
BitOr’(’
[BitData1 ’:=’] <expression ( IN ) of byte>’ ,’
[BitData2 ’:=’] <expression ( IN ) of byte>
’)’
A function with a return value of the data type byte .
Related information
For information about
See
Logical bitwise AND - operation on byte
data
BitAnd - Logical bitwise AND - operation on byte
data on page 770
Logical bitwise XOR - operation on byte
data
BitXOr - Logical bitwise XOR - operation on byte
data on page 782
Logical bitwise NEGATION - operation on
byte data
BitNeg - Logical bitwise NEGATION - operation
on byte data on page 776
Other bit functions
Technical reference manual - RAPID overview ,
section RAPID summary - Mathematics -
Bit functions
Continued
2 Functions
2.13. BitRSh - Logical bitwise RIGHT SHIFT - operation on byte
RobotWare - OS
3HAC 16581-1 Revision: J
780
© Copyright 2004-2010 ABB. All rights reserved.
2.13. BitRSh - Logical bitwise RIGHT SHIFT - operation on byte
Usage
BitRSh ( Bit Right Shift ) is used to execute a logical bitwise RIGHT SHIFT-operation on data
types byte .
Basic examples
Basic example of the function BitRSh are illustrated below.
Example 1
VAR num right_shift := 3;
VAR byte data1 := 38;
VAR byte data2;
data2 := BitRSh(data1, right_shift);
The logical bitwise RIGHT SHIFT-operation will be executed on the data1 with 3
( right_shift ) steps of right shift, and the result will be returned to data2
(integer representation)
The following figure shows logical bitwise RIGHT SHIFT-operation.
xx0500002455
Return value
Data type: byte
The result of the logical bitwise RIGHT SHIFT-operation in integer representation.
The left bit cells will be filled up with 0-bits.
Arguments
BitRSh (BitData ShiftSteps)
BitData
Data type: byte
The bit data, in integer representation, to be shifted.
ShiftSteps
Data type: num
Number of the logical shifts (1 - 8) to be executed.
Limitations
The range for a data type byte is 0 - 255.
The ShiftSteps argument is valid from 1 - 8 according to one byte.
Continues on next page
2 Functions
2.13. BitRSh - Logical bitwise RIGHT SHIFT - operation on byte
RobotWare - OS
781
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
BitRSh’(’
[BitData ’:=’] <expression ( IN ) of byte>’,’
[ShiftSteps’:=’] <expression ( IN ) of num>
’)’
A function with a return value of the data type byte.
Related information
For information about
See
Logical bitwise LEFT SHIFT-operation on
byte data
BitLSh - Logical bitwise LEFT SHIFT - operation
on byte on page 774
Other bit functions
Technical reference manual - RAPID overview ,
section RAPID summary - Mathematics -
Bit functions
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 783
|
2 Functions
2.13. BitRSh - Logical bitwise RIGHT SHIFT - operation on byte
RobotWare - OS
3HAC 16581-1 Revision: J
780
© Copyright 2004-2010 ABB. All rights reserved.
2.13. BitRSh - Logical bitwise RIGHT SHIFT - operation on byte
Usage
BitRSh ( Bit Right Shift ) is used to execute a logical bitwise RIGHT SHIFT-operation on data
types byte .
Basic examples
Basic example of the function BitRSh are illustrated below.
Example 1
VAR num right_shift := 3;
VAR byte data1 := 38;
VAR byte data2;
data2 := BitRSh(data1, right_shift);
The logical bitwise RIGHT SHIFT-operation will be executed on the data1 with 3
( right_shift ) steps of right shift, and the result will be returned to data2
(integer representation)
The following figure shows logical bitwise RIGHT SHIFT-operation.
xx0500002455
Return value
Data type: byte
The result of the logical bitwise RIGHT SHIFT-operation in integer representation.
The left bit cells will be filled up with 0-bits.
Arguments
BitRSh (BitData ShiftSteps)
BitData
Data type: byte
The bit data, in integer representation, to be shifted.
ShiftSteps
Data type: num
Number of the logical shifts (1 - 8) to be executed.
Limitations
The range for a data type byte is 0 - 255.
The ShiftSteps argument is valid from 1 - 8 according to one byte.
Continues on next page
2 Functions
2.13. BitRSh - Logical bitwise RIGHT SHIFT - operation on byte
RobotWare - OS
781
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
BitRSh’(’
[BitData ’:=’] <expression ( IN ) of byte>’,’
[ShiftSteps’:=’] <expression ( IN ) of num>
’)’
A function with a return value of the data type byte.
Related information
For information about
See
Logical bitwise LEFT SHIFT-operation on
byte data
BitLSh - Logical bitwise LEFT SHIFT - operation
on byte on page 774
Other bit functions
Technical reference manual - RAPID overview ,
section RAPID summary - Mathematics -
Bit functions
Continued
2 Functions
2.14. BitXOr - Logical bitwise XOR - operation on byte data
RobotWare - OS
3HAC 16581-1 Revision: J
782
© Copyright 2004-2010 ABB. All rights reserved.
2.14. BitXOr - Logical bitwise XOR - operation on byte data
Usage
BitXOr ( Bit eXclusive Or ) is used to execute a logical bitwise XOR-operation on data types
byte .
Basic examples
Basic examples of the function BitXOr are illustrated below.
Example 1
VAR byte data1 := 39;
VAR byte data2 := 162;
VAR byte data3;
data3 := BitXOr(data1, data2);
The logical bitwise XOR -operation will be executed on the data1 and data2 , and the result
will be returned to data3 (integer representation).
The following figure shows logical bitwise XOR-operation.
xx0500002459
Return value
Data type: byte
The result of the logical bitwise XOR-operation in integer representation.
Arguments
BitXOr (BitData1 BitData2)
BitData1
Data type: byte
The bit data 1, in integer representation.
BitData2
Data type: byte
The bit data 2, in integer representation.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 784
|
2 Functions
2.13. BitRSh - Logical bitwise RIGHT SHIFT - operation on byte
RobotWare - OS
781
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
BitRSh’(’
[BitData ’:=’] <expression ( IN ) of byte>’,’
[ShiftSteps’:=’] <expression ( IN ) of num>
’)’
A function with a return value of the data type byte.
Related information
For information about
See
Logical bitwise LEFT SHIFT-operation on
byte data
BitLSh - Logical bitwise LEFT SHIFT - operation
on byte on page 774
Other bit functions
Technical reference manual - RAPID overview ,
section RAPID summary - Mathematics -
Bit functions
Continued
2 Functions
2.14. BitXOr - Logical bitwise XOR - operation on byte data
RobotWare - OS
3HAC 16581-1 Revision: J
782
© Copyright 2004-2010 ABB. All rights reserved.
2.14. BitXOr - Logical bitwise XOR - operation on byte data
Usage
BitXOr ( Bit eXclusive Or ) is used to execute a logical bitwise XOR-operation on data types
byte .
Basic examples
Basic examples of the function BitXOr are illustrated below.
Example 1
VAR byte data1 := 39;
VAR byte data2 := 162;
VAR byte data3;
data3 := BitXOr(data1, data2);
The logical bitwise XOR -operation will be executed on the data1 and data2 , and the result
will be returned to data3 (integer representation).
The following figure shows logical bitwise XOR-operation.
xx0500002459
Return value
Data type: byte
The result of the logical bitwise XOR-operation in integer representation.
Arguments
BitXOr (BitData1 BitData2)
BitData1
Data type: byte
The bit data 1, in integer representation.
BitData2
Data type: byte
The bit data 2, in integer representation.
Continues on next page
2 Functions
2.14. BitXOr - Logical bitwise XOR - operation on byte data
RobotWare - OS
783
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
The range for a data type byte is 0 - 255.
Syntax
BitXOr’(’
[BitData1 ’:=’] <expression ( IN ) of byte>’ ,’
[BitData2 ’:=’] <expression ( IN ) of byte>
’)’
A function with a return value of the data type byte .
Related information
For information about
See
Logical bitwise AND - operation on byte
data
BitAnd - Logical bitwise AND - operation on byte
data on page 770
Logical bitwise OR - operation on byte
data
BitOr - Logical bitwise OR - operation on byte
data on page 778
Logical bitwise NEGATION - operation on
byte data
BitNeg - Logical bitwise NEGATION - operation
on byte data on page 776
Other bit functions
Technical reference manual - RAPID overview ,
section RAPID summary - Mathematics -
Bit functions
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 785
|
2 Functions
2.14. BitXOr - Logical bitwise XOR - operation on byte data
RobotWare - OS
3HAC 16581-1 Revision: J
782
© Copyright 2004-2010 ABB. All rights reserved.
2.14. BitXOr - Logical bitwise XOR - operation on byte data
Usage
BitXOr ( Bit eXclusive Or ) is used to execute a logical bitwise XOR-operation on data types
byte .
Basic examples
Basic examples of the function BitXOr are illustrated below.
Example 1
VAR byte data1 := 39;
VAR byte data2 := 162;
VAR byte data3;
data3 := BitXOr(data1, data2);
The logical bitwise XOR -operation will be executed on the data1 and data2 , and the result
will be returned to data3 (integer representation).
The following figure shows logical bitwise XOR-operation.
xx0500002459
Return value
Data type: byte
The result of the logical bitwise XOR-operation in integer representation.
Arguments
BitXOr (BitData1 BitData2)
BitData1
Data type: byte
The bit data 1, in integer representation.
BitData2
Data type: byte
The bit data 2, in integer representation.
Continues on next page
2 Functions
2.14. BitXOr - Logical bitwise XOR - operation on byte data
RobotWare - OS
783
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
The range for a data type byte is 0 - 255.
Syntax
BitXOr’(’
[BitData1 ’:=’] <expression ( IN ) of byte>’ ,’
[BitData2 ’:=’] <expression ( IN ) of byte>
’)’
A function with a return value of the data type byte .
Related information
For information about
See
Logical bitwise AND - operation on byte
data
BitAnd - Logical bitwise AND - operation on byte
data on page 770
Logical bitwise OR - operation on byte
data
BitOr - Logical bitwise OR - operation on byte
data on page 778
Logical bitwise NEGATION - operation on
byte data
BitNeg - Logical bitwise NEGATION - operation
on byte data on page 776
Other bit functions
Technical reference manual - RAPID overview ,
section RAPID summary - Mathematics -
Bit functions
Continued
2 Functions
2.15. ByteToStr - Converts a byte to a string data
RobotWare - OS
3HAC 16581-1 Revision: J
784
© Copyright 2004-2010 ABB. All rights reserved.
2.15. ByteToStr - Converts a byte to a string data
Usage
ByteToStr ( Byte To String ) is used to convert a byte into a string data with a defined byte
data format.
Basic examples
Basic examples of the function ByteToStr are illustrated below.
Example 1
VAR string con_data_buffer{5};
VAR byte data1 := 122;
con_data_buffer{1} := ByteToStr(data1);
The content of the array component con_data_buffer{1} will be "122" after the
ByteToStr ... function.
con_data_buffer{2} := ByteToStr(data1\Hex);
The content of the array component con_data_buffer{2} will be "7A" after the
ByteToStr ... function.
con_data_buffer{3} := ByteToStr(data1\Okt);
The content of the array component con_data_buffer{3} will be "172" after the
ByteToStr ... function.
con_data_buffer{4} := ByteToStr(data1\Bin);
The content of the array component con_data_buffer{4} will be "01111010"after the
ByteToStr ... function.
con_data_buffer{5} := ByteToStr(data1\Char);
The content of the array component con_data_buffer{5} will be "z" after the ByteToStr
... function.
Return value
Data type: string
The result of the conversion operation with the following format:
(*) If it is a non-writable ASCII character then the return format will be RAPID character
code format (e.g.“ \07” for BEL control character).
Format
Characters
String length
Range
Dec .....:
’0’ -’ 9’
1-3
"0" - "255"
Hex .....:
’0’ -’ 9’, ’A’ -’F’
2
"00" - "FF"
Okt ......:
’0’ - ’7’
3
"000" - "377"
Bin ......:
’0’ - ’1’
8
"00000000" - "11111111"
Char ....:
Any ASCII char (*)
1
One ASCII char
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 786
|
2 Functions
2.14. BitXOr - Logical bitwise XOR - operation on byte data
RobotWare - OS
783
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Limitations
The range for a data type byte is 0 - 255.
Syntax
BitXOr’(’
[BitData1 ’:=’] <expression ( IN ) of byte>’ ,’
[BitData2 ’:=’] <expression ( IN ) of byte>
’)’
A function with a return value of the data type byte .
Related information
For information about
See
Logical bitwise AND - operation on byte
data
BitAnd - Logical bitwise AND - operation on byte
data on page 770
Logical bitwise OR - operation on byte
data
BitOr - Logical bitwise OR - operation on byte
data on page 778
Logical bitwise NEGATION - operation on
byte data
BitNeg - Logical bitwise NEGATION - operation
on byte data on page 776
Other bit functions
Technical reference manual - RAPID overview ,
section RAPID summary - Mathematics -
Bit functions
Continued
2 Functions
2.15. ByteToStr - Converts a byte to a string data
RobotWare - OS
3HAC 16581-1 Revision: J
784
© Copyright 2004-2010 ABB. All rights reserved.
2.15. ByteToStr - Converts a byte to a string data
Usage
ByteToStr ( Byte To String ) is used to convert a byte into a string data with a defined byte
data format.
Basic examples
Basic examples of the function ByteToStr are illustrated below.
Example 1
VAR string con_data_buffer{5};
VAR byte data1 := 122;
con_data_buffer{1} := ByteToStr(data1);
The content of the array component con_data_buffer{1} will be "122" after the
ByteToStr ... function.
con_data_buffer{2} := ByteToStr(data1\Hex);
The content of the array component con_data_buffer{2} will be "7A" after the
ByteToStr ... function.
con_data_buffer{3} := ByteToStr(data1\Okt);
The content of the array component con_data_buffer{3} will be "172" after the
ByteToStr ... function.
con_data_buffer{4} := ByteToStr(data1\Bin);
The content of the array component con_data_buffer{4} will be "01111010"after the
ByteToStr ... function.
con_data_buffer{5} := ByteToStr(data1\Char);
The content of the array component con_data_buffer{5} will be "z" after the ByteToStr
... function.
Return value
Data type: string
The result of the conversion operation with the following format:
(*) If it is a non-writable ASCII character then the return format will be RAPID character
code format (e.g.“ \07” for BEL control character).
Format
Characters
String length
Range
Dec .....:
’0’ -’ 9’
1-3
"0" - "255"
Hex .....:
’0’ -’ 9’, ’A’ -’F’
2
"00" - "FF"
Okt ......:
’0’ - ’7’
3
"000" - "377"
Bin ......:
’0’ - ’1’
8
"00000000" - "11111111"
Char ....:
Any ASCII char (*)
1
One ASCII char
Continues on next page
2 Functions
2.15. ByteToStr - Converts a byte to a string data
RobotWare - OS
785
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
ByteToStr (BitData [\Hex] | [\Okt] | [\Bin] | [\Char])
BitData
Data type: byte
The bit data to be converted.
If the optional switch argument is omitted then the data will be converted in decimal (Dec)
format.
[\Hex]
Hexadecimal
Data type: switch
The data will be converted in hexadecimal format.
[\Okt]
Octal
Data type: switch
The data will be converted in octal format.
[\Bin]
Binary
Data type: switch
The data will be converted in binary format.
[\Char]
Character
Data type: switch
The data will be converted in ASCII character format.
Limitations
The range for a data type byte is 0 to 255 decimal.
Syntax
ByteToStr’(’
[BitData ’:=’] <expression ( IN ) of byte>
[’\’ Hex ] | [’\’ Okt] | [’\’ Bin] | [’\’ Char]
’)’
A function with a return value of the data type string .
Related information
For information about
See
Convert a string to a byte data
StrToByte - Converts a string to a byte data on page 1007
Other bit (byte) functions
Technical reference manual - RAPID overview , section
RAPID summary - Mathematics - Bit functions
Other string functions
Technical reference manual - RAPID overview , section
RAPID summary - String functions
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 787
|
2 Functions
2.15. ByteToStr - Converts a byte to a string data
RobotWare - OS
3HAC 16581-1 Revision: J
784
© Copyright 2004-2010 ABB. All rights reserved.
2.15. ByteToStr - Converts a byte to a string data
Usage
ByteToStr ( Byte To String ) is used to convert a byte into a string data with a defined byte
data format.
Basic examples
Basic examples of the function ByteToStr are illustrated below.
Example 1
VAR string con_data_buffer{5};
VAR byte data1 := 122;
con_data_buffer{1} := ByteToStr(data1);
The content of the array component con_data_buffer{1} will be "122" after the
ByteToStr ... function.
con_data_buffer{2} := ByteToStr(data1\Hex);
The content of the array component con_data_buffer{2} will be "7A" after the
ByteToStr ... function.
con_data_buffer{3} := ByteToStr(data1\Okt);
The content of the array component con_data_buffer{3} will be "172" after the
ByteToStr ... function.
con_data_buffer{4} := ByteToStr(data1\Bin);
The content of the array component con_data_buffer{4} will be "01111010"after the
ByteToStr ... function.
con_data_buffer{5} := ByteToStr(data1\Char);
The content of the array component con_data_buffer{5} will be "z" after the ByteToStr
... function.
Return value
Data type: string
The result of the conversion operation with the following format:
(*) If it is a non-writable ASCII character then the return format will be RAPID character
code format (e.g.“ \07” for BEL control character).
Format
Characters
String length
Range
Dec .....:
’0’ -’ 9’
1-3
"0" - "255"
Hex .....:
’0’ -’ 9’, ’A’ -’F’
2
"00" - "FF"
Okt ......:
’0’ - ’7’
3
"000" - "377"
Bin ......:
’0’ - ’1’
8
"00000000" - "11111111"
Char ....:
Any ASCII char (*)
1
One ASCII char
Continues on next page
2 Functions
2.15. ByteToStr - Converts a byte to a string data
RobotWare - OS
785
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
ByteToStr (BitData [\Hex] | [\Okt] | [\Bin] | [\Char])
BitData
Data type: byte
The bit data to be converted.
If the optional switch argument is omitted then the data will be converted in decimal (Dec)
format.
[\Hex]
Hexadecimal
Data type: switch
The data will be converted in hexadecimal format.
[\Okt]
Octal
Data type: switch
The data will be converted in octal format.
[\Bin]
Binary
Data type: switch
The data will be converted in binary format.
[\Char]
Character
Data type: switch
The data will be converted in ASCII character format.
Limitations
The range for a data type byte is 0 to 255 decimal.
Syntax
ByteToStr’(’
[BitData ’:=’] <expression ( IN ) of byte>
[’\’ Hex ] | [’\’ Okt] | [’\’ Bin] | [’\’ Char]
’)’
A function with a return value of the data type string .
Related information
For information about
See
Convert a string to a byte data
StrToByte - Converts a string to a byte data on page 1007
Other bit (byte) functions
Technical reference manual - RAPID overview , section
RAPID summary - Mathematics - Bit functions
Other string functions
Technical reference manual - RAPID overview , section
RAPID summary - String functions
Continued
2 Functions
2.16. CalcJointT - Calculates joint angles from robtarget
RobotWare - OS
3HAC 16581-1 Revision: J
786
© Copyright 2004-2010 ABB. All rights reserved.
2.16. CalcJointT - Calculates joint angles from robtarget
Usage
CalcJointT ( Calculate Joint Target ) is used to calculate joint angles of the robot axes and
external axes from a specified robtarget data.
The input robtarget data should be specified in the same coordinate system as specified in
argument for Tool , WObj , and at execution time active program displacement ( ProgDisp )
and external axes offset ( EOffs) . The returned jointtarget data is expressed in the
calibration coordinate system.
If MultiMove application type semicoordinated or synchronized coordinated mode with the
coordinated workobject is moved by some mechanical unit located in another program task
then the function CalcJointT can be used if:
•
It is appropriate that the current position of the coordinated work object moved by the
mechanical unit is used in the calculation (current user frame). All other data will be
fetched from the RAPID program.
•
The mechanical unit located in another program task is standing still.
•
The argument \UseCurWObjPos is used.
Basic examples
Basic examples of the function CalcJointT are illustrated below.
Example 1
VAR jointtarget jointpos1;
CONST robtarget p1 := [...];
jointpos1 := CalcJointT(p1, tool1 \WObj:=wobj1);
The jointtarget value corresponding to the robtarget value p1 is stored in
jointpos1 . The tool tool1 and work object wobj1 are used for calculating the joint angles
jointpos1 .
Example 2
VAR jointtarget jointpos2;
CONST robtarget p2 := [...];
jointpos2 := CalcJointT(\UseCurWObjPos, p2, tool2 \WObj:=orb1);
The jointtarget value corresponding to the robtarget value p2 is stored in
jointpos2 . The tool tool 2 and work object orb1 are used for calculating the joint angles
jointpos2 . The current position of the standing still manipulator orb1 is not located in the
same program task as the TCP robot but is used for the calculation.
Return value
Data type: jointtarget
The angles in degrees for the axes of the robot on the arm side.
The values for the external axes, in mm for linear axes, in degrees for rotational axes.
The returned values are always related to the calibration position.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 788
|
2 Functions
2.15. ByteToStr - Converts a byte to a string data
RobotWare - OS
785
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
ByteToStr (BitData [\Hex] | [\Okt] | [\Bin] | [\Char])
BitData
Data type: byte
The bit data to be converted.
If the optional switch argument is omitted then the data will be converted in decimal (Dec)
format.
[\Hex]
Hexadecimal
Data type: switch
The data will be converted in hexadecimal format.
[\Okt]
Octal
Data type: switch
The data will be converted in octal format.
[\Bin]
Binary
Data type: switch
The data will be converted in binary format.
[\Char]
Character
Data type: switch
The data will be converted in ASCII character format.
Limitations
The range for a data type byte is 0 to 255 decimal.
Syntax
ByteToStr’(’
[BitData ’:=’] <expression ( IN ) of byte>
[’\’ Hex ] | [’\’ Okt] | [’\’ Bin] | [’\’ Char]
’)’
A function with a return value of the data type string .
Related information
For information about
See
Convert a string to a byte data
StrToByte - Converts a string to a byte data on page 1007
Other bit (byte) functions
Technical reference manual - RAPID overview , section
RAPID summary - Mathematics - Bit functions
Other string functions
Technical reference manual - RAPID overview , section
RAPID summary - String functions
Continued
2 Functions
2.16. CalcJointT - Calculates joint angles from robtarget
RobotWare - OS
3HAC 16581-1 Revision: J
786
© Copyright 2004-2010 ABB. All rights reserved.
2.16. CalcJointT - Calculates joint angles from robtarget
Usage
CalcJointT ( Calculate Joint Target ) is used to calculate joint angles of the robot axes and
external axes from a specified robtarget data.
The input robtarget data should be specified in the same coordinate system as specified in
argument for Tool , WObj , and at execution time active program displacement ( ProgDisp )
and external axes offset ( EOffs) . The returned jointtarget data is expressed in the
calibration coordinate system.
If MultiMove application type semicoordinated or synchronized coordinated mode with the
coordinated workobject is moved by some mechanical unit located in another program task
then the function CalcJointT can be used if:
•
It is appropriate that the current position of the coordinated work object moved by the
mechanical unit is used in the calculation (current user frame). All other data will be
fetched from the RAPID program.
•
The mechanical unit located in another program task is standing still.
•
The argument \UseCurWObjPos is used.
Basic examples
Basic examples of the function CalcJointT are illustrated below.
Example 1
VAR jointtarget jointpos1;
CONST robtarget p1 := [...];
jointpos1 := CalcJointT(p1, tool1 \WObj:=wobj1);
The jointtarget value corresponding to the robtarget value p1 is stored in
jointpos1 . The tool tool1 and work object wobj1 are used for calculating the joint angles
jointpos1 .
Example 2
VAR jointtarget jointpos2;
CONST robtarget p2 := [...];
jointpos2 := CalcJointT(\UseCurWObjPos, p2, tool2 \WObj:=orb1);
The jointtarget value corresponding to the robtarget value p2 is stored in
jointpos2 . The tool tool 2 and work object orb1 are used for calculating the joint angles
jointpos2 . The current position of the standing still manipulator orb1 is not located in the
same program task as the TCP robot but is used for the calculation.
Return value
Data type: jointtarget
The angles in degrees for the axes of the robot on the arm side.
The values for the external axes, in mm for linear axes, in degrees for rotational axes.
The returned values are always related to the calibration position.
Continues on next page
2 Functions
2.16. CalcJointT - Calculates joint angles from robtarget
RobotWare - OS
787
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
CalcJointT ( [\UseCurWObjPos] Rob_target Tool [\WObj] )
[\UseCurWObjPos]
Data type: switch
Use current position of the coordinated work object moved by the mechanical unit in another
task for the calculation (current user frame). All other data is fetched from the RAPID
program.
Rob_target
Data type: robtarget
The position of the robot and external axes in the outermost coordinate system, related to the
specified tool and work object and at execution time active program displacement
( ProgDisp) and/or external axes offset ( EOffs ).
Tool
Data type: tooldata
The tool used for calculation of the robot joint angles.
[\WObj]
Work Object
Data type: wobjdata
The work object (coordinate system) to which the robot position is related.
If this argument is omitted then the work object wobj0 is used. This argument must be
specified when using stationary tool, coordinated external axes, or conveyor.
Program execution
The returned jointtarget is calculated from the input robtarget . If use of the argument
\UseCurWObjPos also the current position of the mechanical unit that controls the user
frame is used. To calculate the robot joint angles, the specified Tool , WObj (including
coordinated user frame), and the ProgDisp active at execution time are taken into
consideration. To calculate the external axes position at the execution time, active EOffs is
taken into consideration.
The calculation always selects the robot configuration according to the specified
configuration data in the input robtarget data. Instructions ConfL and ConfJ do not affect
this calculation principle. When wrist singularity is used, robot axis 4 will be set to 0 degrees.
If there is any active program displacement ( ProgDisp ) and/or external axis offset ( EOffs )
at the time the robtarget is stored then the same program displacement and/or external axis
offset must be active when CalcJointT 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
| 789
|
2 Functions
2.16. CalcJointT - Calculates joint angles from robtarget
RobotWare - OS
3HAC 16581-1 Revision: J
786
© Copyright 2004-2010 ABB. All rights reserved.
2.16. CalcJointT - Calculates joint angles from robtarget
Usage
CalcJointT ( Calculate Joint Target ) is used to calculate joint angles of the robot axes and
external axes from a specified robtarget data.
The input robtarget data should be specified in the same coordinate system as specified in
argument for Tool , WObj , and at execution time active program displacement ( ProgDisp )
and external axes offset ( EOffs) . The returned jointtarget data is expressed in the
calibration coordinate system.
If MultiMove application type semicoordinated or synchronized coordinated mode with the
coordinated workobject is moved by some mechanical unit located in another program task
then the function CalcJointT can be used if:
•
It is appropriate that the current position of the coordinated work object moved by the
mechanical unit is used in the calculation (current user frame). All other data will be
fetched from the RAPID program.
•
The mechanical unit located in another program task is standing still.
•
The argument \UseCurWObjPos is used.
Basic examples
Basic examples of the function CalcJointT are illustrated below.
Example 1
VAR jointtarget jointpos1;
CONST robtarget p1 := [...];
jointpos1 := CalcJointT(p1, tool1 \WObj:=wobj1);
The jointtarget value corresponding to the robtarget value p1 is stored in
jointpos1 . The tool tool1 and work object wobj1 are used for calculating the joint angles
jointpos1 .
Example 2
VAR jointtarget jointpos2;
CONST robtarget p2 := [...];
jointpos2 := CalcJointT(\UseCurWObjPos, p2, tool2 \WObj:=orb1);
The jointtarget value corresponding to the robtarget value p2 is stored in
jointpos2 . The tool tool 2 and work object orb1 are used for calculating the joint angles
jointpos2 . The current position of the standing still manipulator orb1 is not located in the
same program task as the TCP robot but is used for the calculation.
Return value
Data type: jointtarget
The angles in degrees for the axes of the robot on the arm side.
The values for the external axes, in mm for linear axes, in degrees for rotational axes.
The returned values are always related to the calibration position.
Continues on next page
2 Functions
2.16. CalcJointT - Calculates joint angles from robtarget
RobotWare - OS
787
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
CalcJointT ( [\UseCurWObjPos] Rob_target Tool [\WObj] )
[\UseCurWObjPos]
Data type: switch
Use current position of the coordinated work object moved by the mechanical unit in another
task for the calculation (current user frame). All other data is fetched from the RAPID
program.
Rob_target
Data type: robtarget
The position of the robot and external axes in the outermost coordinate system, related to the
specified tool and work object and at execution time active program displacement
( ProgDisp) and/or external axes offset ( EOffs ).
Tool
Data type: tooldata
The tool used for calculation of the robot joint angles.
[\WObj]
Work Object
Data type: wobjdata
The work object (coordinate system) to which the robot position is related.
If this argument is omitted then the work object wobj0 is used. This argument must be
specified when using stationary tool, coordinated external axes, or conveyor.
Program execution
The returned jointtarget is calculated from the input robtarget . If use of the argument
\UseCurWObjPos also the current position of the mechanical unit that controls the user
frame is used. To calculate the robot joint angles, the specified Tool , WObj (including
coordinated user frame), and the ProgDisp active at execution time are taken into
consideration. To calculate the external axes position at the execution time, active EOffs is
taken into consideration.
The calculation always selects the robot configuration according to the specified
configuration data in the input robtarget data. Instructions ConfL and ConfJ do not affect
this calculation principle. When wrist singularity is used, robot axis 4 will be set to 0 degrees.
If there is any active program displacement ( ProgDisp ) and/or external axis offset ( EOffs )
at the time the robtarget is stored then the same program displacement and/or external axis
offset must be active when CalcJointT is executed.
Continued
Continues on next page
2 Functions
2.16. CalcJointT - Calculates joint angles from robtarget
RobotWare - OS
3HAC 16581-1 Revision: J
788
© Copyright 2004-2010 ABB. All rights reserved.
Limitation
If a coordinate frame is used then the coordinated unit has to be activated before using
CalcJointT .
The mechanical unit that controls the user frame in the work object must normally be
available in the same program task as the TCP robot which executes CalcJointT .
Normally CalcJointT uses robtarget , tooldata , and wobjdata from the RAPID
program to calculate jointtarget . For coordinated workobjects, the position of the
mechanical unit is given as external axes position in the robtarget . That is not the case if
the mechanical unit is controlled by another program task (MultiMove system) or the
mechanical unit is not controlled by the control system (Conveyor). For the MultiMove
System but not for the conveyor it is possible to use the argument \UseCurWObjPos if the
mechanical unit is standing still at the execution time of CalCJointT .
Error handling
If at least one axis is outside the working area or the limits are exceeded for at least one
coupled joint then the system variable ERRNO is set to ERR_ROBLIMIT and the execution
continues in the error handler.
If the mechanical unit that controls the work object (user frame) isn’t standing still at
execution time of CalJointT \UseCurWobjPos then the system variable ERRNO is set to
ERR_WOBJ_MOVING and the execution continues in the error handler.
The error handler can then deal with the situations.
Syntax
CalcJointT’(’
[’\’UseCurWObjPos ’,’]
[Rob_target’ :=’] <expression ( IN ) of robtarget>‘,’
[Tool ’:=’ ] <persistent ( PERS ) of tooldata>
[’\’WObj ’:=’ <persistent ( PERS ) of wobjdata>] ’)’
A function with a return value of the data type jointtarget.
Related information
For information about
See
Calculate robtarget from jointtarget
CalcRobT - Calculates robtarget from
jointtarget on page 789
Definition of position
robtarget - Position data on page 1176
Definition of joint position
jointtarget - Joint position data on page 1129
Definition of tools
tooldata - Tool data on page 1207
Definition of work objects
wobjdata - Work object data on page 1224
Coordinate systems
Technical reference manual - RAPID
overview , section Motion and I/O principles -
Coordinate systems
Program displacement coordinate system
PDispOn - Activates program displacement
on page 317
External axis offset coordinate system
EOffsOn - Activates an offset for external
axes on page 88
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 790
|
2 Functions
2.16. CalcJointT - Calculates joint angles from robtarget
RobotWare - OS
787
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Arguments
CalcJointT ( [\UseCurWObjPos] Rob_target Tool [\WObj] )
[\UseCurWObjPos]
Data type: switch
Use current position of the coordinated work object moved by the mechanical unit in another
task for the calculation (current user frame). All other data is fetched from the RAPID
program.
Rob_target
Data type: robtarget
The position of the robot and external axes in the outermost coordinate system, related to the
specified tool and work object and at execution time active program displacement
( ProgDisp) and/or external axes offset ( EOffs ).
Tool
Data type: tooldata
The tool used for calculation of the robot joint angles.
[\WObj]
Work Object
Data type: wobjdata
The work object (coordinate system) to which the robot position is related.
If this argument is omitted then the work object wobj0 is used. This argument must be
specified when using stationary tool, coordinated external axes, or conveyor.
Program execution
The returned jointtarget is calculated from the input robtarget . If use of the argument
\UseCurWObjPos also the current position of the mechanical unit that controls the user
frame is used. To calculate the robot joint angles, the specified Tool , WObj (including
coordinated user frame), and the ProgDisp active at execution time are taken into
consideration. To calculate the external axes position at the execution time, active EOffs is
taken into consideration.
The calculation always selects the robot configuration according to the specified
configuration data in the input robtarget data. Instructions ConfL and ConfJ do not affect
this calculation principle. When wrist singularity is used, robot axis 4 will be set to 0 degrees.
If there is any active program displacement ( ProgDisp ) and/or external axis offset ( EOffs )
at the time the robtarget is stored then the same program displacement and/or external axis
offset must be active when CalcJointT is executed.
Continued
Continues on next page
2 Functions
2.16. CalcJointT - Calculates joint angles from robtarget
RobotWare - OS
3HAC 16581-1 Revision: J
788
© Copyright 2004-2010 ABB. All rights reserved.
Limitation
If a coordinate frame is used then the coordinated unit has to be activated before using
CalcJointT .
The mechanical unit that controls the user frame in the work object must normally be
available in the same program task as the TCP robot which executes CalcJointT .
Normally CalcJointT uses robtarget , tooldata , and wobjdata from the RAPID
program to calculate jointtarget . For coordinated workobjects, the position of the
mechanical unit is given as external axes position in the robtarget . That is not the case if
the mechanical unit is controlled by another program task (MultiMove system) or the
mechanical unit is not controlled by the control system (Conveyor). For the MultiMove
System but not for the conveyor it is possible to use the argument \UseCurWObjPos if the
mechanical unit is standing still at the execution time of CalCJointT .
Error handling
If at least one axis is outside the working area or the limits are exceeded for at least one
coupled joint then the system variable ERRNO is set to ERR_ROBLIMIT and the execution
continues in the error handler.
If the mechanical unit that controls the work object (user frame) isn’t standing still at
execution time of CalJointT \UseCurWobjPos then the system variable ERRNO is set to
ERR_WOBJ_MOVING and the execution continues in the error handler.
The error handler can then deal with the situations.
Syntax
CalcJointT’(’
[’\’UseCurWObjPos ’,’]
[Rob_target’ :=’] <expression ( IN ) of robtarget>‘,’
[Tool ’:=’ ] <persistent ( PERS ) of tooldata>
[’\’WObj ’:=’ <persistent ( PERS ) of wobjdata>] ’)’
A function with a return value of the data type jointtarget.
Related information
For information about
See
Calculate robtarget from jointtarget
CalcRobT - Calculates robtarget from
jointtarget on page 789
Definition of position
robtarget - Position data on page 1176
Definition of joint position
jointtarget - Joint position data on page 1129
Definition of tools
tooldata - Tool data on page 1207
Definition of work objects
wobjdata - Work object data on page 1224
Coordinate systems
Technical reference manual - RAPID
overview , section Motion and I/O principles -
Coordinate systems
Program displacement coordinate system
PDispOn - Activates program displacement
on page 317
External axis offset coordinate system
EOffsOn - Activates an offset for external
axes on page 88
Continued
2 Functions
2.17. CalcRobT - Calculates robtarget from jointtarget
RobotWare - OS
789
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.17. CalcRobT - Calculates robtarget from jointtarget
Usage
CalcRobT ( Calculate Robot Target ) is used to calculate a robtarget data from a given
jointtarget data.
This function returns a robtarget value with position (x, y, z), orientation (q1 ... q4), robot
axes configuration, and external axes position.
The input jointtarget data should be specified in the calibration coordinate system.
The returned robtarget data is expressed in the outermost coordinate system. It takes the
specified tool, work object, and at execution time active program displacement ( ProgDisp )
and external axis offset ( EOffs ) into consideration.
Basic examples
Basic examples of the function CalcRobT are illustrated below.
Example 1
VAR robtarget p1;
CONST jointtarget jointpos1 := [...];
p1 := CalcRobT(jointpos1, tool1 \WObj:=wobj1);
The robtarget value corresponding to the jointtarget value jointpos1 is stored in
p1 . The tool tool1 and work object wobj1 are used for calculating the position of p1 .
Return value
Data type: robtarget
The robot and external axes position is returned in data type robtarget and expressed in the
outermost coordinate system. It takes the specified tool, work object, and at execution time
active program displacement ( ProgDisp ) and external axes offset ( EOffs ) into
consideration.
If there is no active ProgDisp then the robot position is expressed in the object coordinate
system. If there are no active EOffs then the external axis position is expressed in the
calibration coordinate system.
Arguments
CalcRobT
( Joint_target Tool [\WObj] )
Joint_target
Data type: jointtarget
The joint position for the robot axes and external axes related to the calibration coordinate
system.
Tool
Data type: tooldata
The tool used for calculation of the robot position.
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 791
|
2 Functions
2.16. CalcJointT - Calculates joint angles from robtarget
RobotWare - OS
3HAC 16581-1 Revision: J
788
© Copyright 2004-2010 ABB. All rights reserved.
Limitation
If a coordinate frame is used then the coordinated unit has to be activated before using
CalcJointT .
The mechanical unit that controls the user frame in the work object must normally be
available in the same program task as the TCP robot which executes CalcJointT .
Normally CalcJointT uses robtarget , tooldata , and wobjdata from the RAPID
program to calculate jointtarget . For coordinated workobjects, the position of the
mechanical unit is given as external axes position in the robtarget . That is not the case if
the mechanical unit is controlled by another program task (MultiMove system) or the
mechanical unit is not controlled by the control system (Conveyor). For the MultiMove
System but not for the conveyor it is possible to use the argument \UseCurWObjPos if the
mechanical unit is standing still at the execution time of CalCJointT .
Error handling
If at least one axis is outside the working area or the limits are exceeded for at least one
coupled joint then the system variable ERRNO is set to ERR_ROBLIMIT and the execution
continues in the error handler.
If the mechanical unit that controls the work object (user frame) isn’t standing still at
execution time of CalJointT \UseCurWobjPos then the system variable ERRNO is set to
ERR_WOBJ_MOVING and the execution continues in the error handler.
The error handler can then deal with the situations.
Syntax
CalcJointT’(’
[’\’UseCurWObjPos ’,’]
[Rob_target’ :=’] <expression ( IN ) of robtarget>‘,’
[Tool ’:=’ ] <persistent ( PERS ) of tooldata>
[’\’WObj ’:=’ <persistent ( PERS ) of wobjdata>] ’)’
A function with a return value of the data type jointtarget.
Related information
For information about
See
Calculate robtarget from jointtarget
CalcRobT - Calculates robtarget from
jointtarget on page 789
Definition of position
robtarget - Position data on page 1176
Definition of joint position
jointtarget - Joint position data on page 1129
Definition of tools
tooldata - Tool data on page 1207
Definition of work objects
wobjdata - Work object data on page 1224
Coordinate systems
Technical reference manual - RAPID
overview , section Motion and I/O principles -
Coordinate systems
Program displacement coordinate system
PDispOn - Activates program displacement
on page 317
External axis offset coordinate system
EOffsOn - Activates an offset for external
axes on page 88
Continued
2 Functions
2.17. CalcRobT - Calculates robtarget from jointtarget
RobotWare - OS
789
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.17. CalcRobT - Calculates robtarget from jointtarget
Usage
CalcRobT ( Calculate Robot Target ) is used to calculate a robtarget data from a given
jointtarget data.
This function returns a robtarget value with position (x, y, z), orientation (q1 ... q4), robot
axes configuration, and external axes position.
The input jointtarget data should be specified in the calibration coordinate system.
The returned robtarget data is expressed in the outermost coordinate system. It takes the
specified tool, work object, and at execution time active program displacement ( ProgDisp )
and external axis offset ( EOffs ) into consideration.
Basic examples
Basic examples of the function CalcRobT are illustrated below.
Example 1
VAR robtarget p1;
CONST jointtarget jointpos1 := [...];
p1 := CalcRobT(jointpos1, tool1 \WObj:=wobj1);
The robtarget value corresponding to the jointtarget value jointpos1 is stored in
p1 . The tool tool1 and work object wobj1 are used for calculating the position of p1 .
Return value
Data type: robtarget
The robot and external axes position is returned in data type robtarget and expressed in the
outermost coordinate system. It takes the specified tool, work object, and at execution time
active program displacement ( ProgDisp ) and external axes offset ( EOffs ) into
consideration.
If there is no active ProgDisp then the robot position is expressed in the object coordinate
system. If there are no active EOffs then the external axis position is expressed in the
calibration coordinate system.
Arguments
CalcRobT
( Joint_target Tool [\WObj] )
Joint_target
Data type: jointtarget
The joint position for the robot axes and external axes related to the calibration coordinate
system.
Tool
Data type: tooldata
The tool used for calculation of the robot position.
Continues on next page
2 Functions
2.17. CalcRobT - Calculates robtarget from jointtarget
RobotWare - OS
3HAC 16581-1 Revision: J
790
© Copyright 2004-2010 ABB. All rights reserved.
[\WObj]
Work Object
Data type: wobjdata
The work object (coordinate system) to which the robot position returned by the function is
related.
If this argument is omitted the work object wobj0 is used. This argument must be specified
when using stationary tool, coordinated external axes, or conveyor.
Program execution
The returned robtarget is calculated from the input jointtarget . To calculate the
cartesian robot position the specified Tool , WObj (including coordinated user frame), and at
the execution time active ProgDisp , are taken into consideration.
To calculate the external axes position, the EOffs active at execution time is also taken into
consideration.
Limitation
If a coordinate frame is used then the coordinated unit has to be activated before using
CalcRobT . The coordinated unit also has to be situated in the same task as the robot.
Syntax
CalcRobT’(’
[Joint_target ’:=’ ] <expression ( IN ) of jointtarget>‘,’
[Tool ’:=’ ] <persistent ( PERS ) of tooldata>
[’\’WObj ’:=’ <persistent ( PERS ) of wobjdata>] ’)’
A function with a return value of the data type robtarget .
Related information
For information about
See
Calculate jointtarget from robtarget
CalcJointT - Calculates joint angles from
robtarget on page 786
Definition of position
robtarget - Position data on page 1176
Definition of joint position
jointtarget - Joint position data on page 1129
Definition of tools
tooldata - Tool data on page 1207
Definition of work objects
wobjdata - Work object data on page 1224
Coordinate systems
Technical reference manual - RAPID overview ,
section Motion and I/O Principles - Coordinate
Systems
Program displacement coordinate system
PDispOn - Activates program displacement on
page 317
External axes offset coordinate system
EOffsOn - Activates an offset for external axes
on page 88
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 792
|
2 Functions
2.17. CalcRobT - Calculates robtarget from jointtarget
RobotWare - OS
789
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.17. CalcRobT - Calculates robtarget from jointtarget
Usage
CalcRobT ( Calculate Robot Target ) is used to calculate a robtarget data from a given
jointtarget data.
This function returns a robtarget value with position (x, y, z), orientation (q1 ... q4), robot
axes configuration, and external axes position.
The input jointtarget data should be specified in the calibration coordinate system.
The returned robtarget data is expressed in the outermost coordinate system. It takes the
specified tool, work object, and at execution time active program displacement ( ProgDisp )
and external axis offset ( EOffs ) into consideration.
Basic examples
Basic examples of the function CalcRobT are illustrated below.
Example 1
VAR robtarget p1;
CONST jointtarget jointpos1 := [...];
p1 := CalcRobT(jointpos1, tool1 \WObj:=wobj1);
The robtarget value corresponding to the jointtarget value jointpos1 is stored in
p1 . The tool tool1 and work object wobj1 are used for calculating the position of p1 .
Return value
Data type: robtarget
The robot and external axes position is returned in data type robtarget and expressed in the
outermost coordinate system. It takes the specified tool, work object, and at execution time
active program displacement ( ProgDisp ) and external axes offset ( EOffs ) into
consideration.
If there is no active ProgDisp then the robot position is expressed in the object coordinate
system. If there are no active EOffs then the external axis position is expressed in the
calibration coordinate system.
Arguments
CalcRobT
( Joint_target Tool [\WObj] )
Joint_target
Data type: jointtarget
The joint position for the robot axes and external axes related to the calibration coordinate
system.
Tool
Data type: tooldata
The tool used for calculation of the robot position.
Continues on next page
2 Functions
2.17. CalcRobT - Calculates robtarget from jointtarget
RobotWare - OS
3HAC 16581-1 Revision: J
790
© Copyright 2004-2010 ABB. All rights reserved.
[\WObj]
Work Object
Data type: wobjdata
The work object (coordinate system) to which the robot position returned by the function is
related.
If this argument is omitted the work object wobj0 is used. This argument must be specified
when using stationary tool, coordinated external axes, or conveyor.
Program execution
The returned robtarget is calculated from the input jointtarget . To calculate the
cartesian robot position the specified Tool , WObj (including coordinated user frame), and at
the execution time active ProgDisp , are taken into consideration.
To calculate the external axes position, the EOffs active at execution time is also taken into
consideration.
Limitation
If a coordinate frame is used then the coordinated unit has to be activated before using
CalcRobT . The coordinated unit also has to be situated in the same task as the robot.
Syntax
CalcRobT’(’
[Joint_target ’:=’ ] <expression ( IN ) of jointtarget>‘,’
[Tool ’:=’ ] <persistent ( PERS ) of tooldata>
[’\’WObj ’:=’ <persistent ( PERS ) of wobjdata>] ’)’
A function with a return value of the data type robtarget .
Related information
For information about
See
Calculate jointtarget from robtarget
CalcJointT - Calculates joint angles from
robtarget on page 786
Definition of position
robtarget - Position data on page 1176
Definition of joint position
jointtarget - Joint position data on page 1129
Definition of tools
tooldata - Tool data on page 1207
Definition of work objects
wobjdata - Work object data on page 1224
Coordinate systems
Technical reference manual - RAPID overview ,
section Motion and I/O Principles - Coordinate
Systems
Program displacement coordinate system
PDispOn - Activates program displacement on
page 317
External axes offset coordinate system
EOffsOn - Activates an offset for external axes
on page 88
Continued
2 Functions
2.18. CalcRotAxFrameZ - Calculate a rotational axis frame
RobotWare - OS
791
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.18. CalcRotAxFrameZ - Calculate a rotational axis frame
Usage
CalcRotAxFrameZ ( Calculate Rotational Axis Frame with positive Z-point ) is used to
calculate the user coordinate system of a rotational axis type mechanical unit. This function
is to be used when the master robot and the external axis are located in different RAPID tasks.
If they are in the same task then the function CalcRotAxisFrame should be used.
Description
The definition of a user frame for a rotational external axis requires that the turntable (or
similar mechanical structure) on the external axis has a marked reference point. Moreover,
the TCP robot’s base frame and TCP must be calibrated. The calibration procedure consists
of a number of positions for the robot’s TCP on the reference point when the turntable is
rotated to different angles. A positioning of the robots TCP in the positive z direction is also
needed. For definition of points for a rotational axis, see the figure below.
xx0500002468
The user coordinate system for the rotational axis has its origin in the center of the turntable.
The z direction coincides with the axis of rotation and the x axis goes through the reference
point.
The figure below shows the user coordinate system for two different positions of the turntable
(turntable seen from above).
xx0500002469
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 793
|
2 Functions
2.17. CalcRobT - Calculates robtarget from jointtarget
RobotWare - OS
3HAC 16581-1 Revision: J
790
© Copyright 2004-2010 ABB. All rights reserved.
[\WObj]
Work Object
Data type: wobjdata
The work object (coordinate system) to which the robot position returned by the function is
related.
If this argument is omitted the work object wobj0 is used. This argument must be specified
when using stationary tool, coordinated external axes, or conveyor.
Program execution
The returned robtarget is calculated from the input jointtarget . To calculate the
cartesian robot position the specified Tool , WObj (including coordinated user frame), and at
the execution time active ProgDisp , are taken into consideration.
To calculate the external axes position, the EOffs active at execution time is also taken into
consideration.
Limitation
If a coordinate frame is used then the coordinated unit has to be activated before using
CalcRobT . The coordinated unit also has to be situated in the same task as the robot.
Syntax
CalcRobT’(’
[Joint_target ’:=’ ] <expression ( IN ) of jointtarget>‘,’
[Tool ’:=’ ] <persistent ( PERS ) of tooldata>
[’\’WObj ’:=’ <persistent ( PERS ) of wobjdata>] ’)’
A function with a return value of the data type robtarget .
Related information
For information about
See
Calculate jointtarget from robtarget
CalcJointT - Calculates joint angles from
robtarget on page 786
Definition of position
robtarget - Position data on page 1176
Definition of joint position
jointtarget - Joint position data on page 1129
Definition of tools
tooldata - Tool data on page 1207
Definition of work objects
wobjdata - Work object data on page 1224
Coordinate systems
Technical reference manual - RAPID overview ,
section Motion and I/O Principles - Coordinate
Systems
Program displacement coordinate system
PDispOn - Activates program displacement on
page 317
External axes offset coordinate system
EOffsOn - Activates an offset for external axes
on page 88
Continued
2 Functions
2.18. CalcRotAxFrameZ - Calculate a rotational axis frame
RobotWare - OS
791
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.18. CalcRotAxFrameZ - Calculate a rotational axis frame
Usage
CalcRotAxFrameZ ( Calculate Rotational Axis Frame with positive Z-point ) is used to
calculate the user coordinate system of a rotational axis type mechanical unit. This function
is to be used when the master robot and the external axis are located in different RAPID tasks.
If they are in the same task then the function CalcRotAxisFrame should be used.
Description
The definition of a user frame for a rotational external axis requires that the turntable (or
similar mechanical structure) on the external axis has a marked reference point. Moreover,
the TCP robot’s base frame and TCP must be calibrated. The calibration procedure consists
of a number of positions for the robot’s TCP on the reference point when the turntable is
rotated to different angles. A positioning of the robots TCP in the positive z direction is also
needed. For definition of points for a rotational axis, see the figure below.
xx0500002468
The user coordinate system for the rotational axis has its origin in the center of the turntable.
The z direction coincides with the axis of rotation and the x axis goes through the reference
point.
The figure below shows the user coordinate system for two different positions of the turntable
(turntable seen from above).
xx0500002469
Continues on next page
2 Functions
2.18. CalcRotAxFrameZ - Calculate a rotational axis frame
RobotWare - OS
3HAC 16581-1 Revision: J
792
© Copyright 2004-2010 ABB. All rights reserved.
Basic examples
Basic examples of the function CalcRotAxFrameZ are illustrated below.
Example 1
CONST robtarget pos1 := [...];
CONST robtarget pos2 := [...];
CONST robtarget pos3 := [...];
CONST robtarget pos4 := [...];
CONST robtarget zpos;
VAR robtarget targetlist{10};
VAR num max_err := 0;
VAR num mean_err := 0;
VAR pose resFr:=[...];
PERS tooldata tMyTool:= [...];
! Instructions for creating/ModPos pos1 - pos4 with TCP pointing
at the turntable.
MoveJ pos1, v10, fine, tMyTool;
MoveJ pos2, v10, fine, tMyTool;
MoveJ pos3, v10, fine, tMyTool;
MoveJ pos4, v10, fine, tMyTool;
!Instruction for creating/ModPos zpos with TCP pointing at a point
in positive z direction
MoveJ zpos, v10, fine, tMyTool;
! Add the targets to the array
targetlist{1}:= pos1;
targetlist{2}:= pos2;
targetlist{3}:= pos3;
targetlist{4}:= pos4;
resFr:=CalcRotAxFrameZ(targetlist, 4, zpos, max_err, mean_err);
! Update the system parameters.
IF (max_err < 1.0) AND (mean_err < 0.5) THEN
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_pos_x",resFr.trans.x/1000;
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_pos_y",resFr.trans.y/1000;
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_pos_z",resFr.trans.z/1000;
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_orient_u0",resFr.rot.q1;
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_orient_u1",resFr.rot.q2;
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_orient_u2",resFr.rot.q3;
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
| 794
|
2 Functions
2.18. CalcRotAxFrameZ - Calculate a rotational axis frame
RobotWare - OS
791
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.18. CalcRotAxFrameZ - Calculate a rotational axis frame
Usage
CalcRotAxFrameZ ( Calculate Rotational Axis Frame with positive Z-point ) is used to
calculate the user coordinate system of a rotational axis type mechanical unit. This function
is to be used when the master robot and the external axis are located in different RAPID tasks.
If they are in the same task then the function CalcRotAxisFrame should be used.
Description
The definition of a user frame for a rotational external axis requires that the turntable (or
similar mechanical structure) on the external axis has a marked reference point. Moreover,
the TCP robot’s base frame and TCP must be calibrated. The calibration procedure consists
of a number of positions for the robot’s TCP on the reference point when the turntable is
rotated to different angles. A positioning of the robots TCP in the positive z direction is also
needed. For definition of points for a rotational axis, see the figure below.
xx0500002468
The user coordinate system for the rotational axis has its origin in the center of the turntable.
The z direction coincides with the axis of rotation and the x axis goes through the reference
point.
The figure below shows the user coordinate system for two different positions of the turntable
(turntable seen from above).
xx0500002469
Continues on next page
2 Functions
2.18. CalcRotAxFrameZ - Calculate a rotational axis frame
RobotWare - OS
3HAC 16581-1 Revision: J
792
© Copyright 2004-2010 ABB. All rights reserved.
Basic examples
Basic examples of the function CalcRotAxFrameZ are illustrated below.
Example 1
CONST robtarget pos1 := [...];
CONST robtarget pos2 := [...];
CONST robtarget pos3 := [...];
CONST robtarget pos4 := [...];
CONST robtarget zpos;
VAR robtarget targetlist{10};
VAR num max_err := 0;
VAR num mean_err := 0;
VAR pose resFr:=[...];
PERS tooldata tMyTool:= [...];
! Instructions for creating/ModPos pos1 - pos4 with TCP pointing
at the turntable.
MoveJ pos1, v10, fine, tMyTool;
MoveJ pos2, v10, fine, tMyTool;
MoveJ pos3, v10, fine, tMyTool;
MoveJ pos4, v10, fine, tMyTool;
!Instruction for creating/ModPos zpos with TCP pointing at a point
in positive z direction
MoveJ zpos, v10, fine, tMyTool;
! Add the targets to the array
targetlist{1}:= pos1;
targetlist{2}:= pos2;
targetlist{3}:= pos3;
targetlist{4}:= pos4;
resFr:=CalcRotAxFrameZ(targetlist, 4, zpos, max_err, mean_err);
! Update the system parameters.
IF (max_err < 1.0) AND (mean_err < 0.5) THEN
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_pos_x",resFr.trans.x/1000;
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_pos_y",resFr.trans.y/1000;
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_pos_z",resFr.trans.z/1000;
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_orient_u0",resFr.rot.q1;
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_orient_u1",resFr.rot.q2;
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_orient_u2",resFr.rot.q3;
Continued
Continues on next page
2 Functions
2.18. CalcRotAxFrameZ - Calculate a rotational axis frame
RobotWare - OS
793
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_orient_u3",resFr.rot.q4;
TPReadFK reg1,"Warmstart required for calibration to take
effect."
,stEmpty,stEmpty,stEmpty, stEmpty,"OK";
WarmStart;
ENDIF
Four positions, pos1 - pos4 , are created/modposed so that the robot’s tool tMyTool points
to the same reference point on the external axis STN_1 but with different external axis
rotations. Position, zpos , is created/modposed so that the robot’s tool tMyTool points in the
positive z direction according to the definition of the positive z-direction of an external
rotational mechanical unit. Using the definition of the positive z-direction of an external
rotational mechanical unit, see Description on page 791 . The points are then used for
calculating the external axis base frame, resFr , in relation to the world coordinate system.
Finally, the frame is written to the configuration file and a warmstart is made to let the change
take effect.
xx0500002472
NOTE!
Definition of the positive z-direction of an external rotational mechanical unit:
Let the right hand’s fingers coincide with the positive rotation axis of the rotational axis. The
direction of the thumb then defines the positive z-direction. See the figure above.
Return value
Data type: pose
The calculated frame.
Arguments
CalcRotAxFrameZ (TargetList TargetsInList PositiveZPoint
MaxErr MeanErr)
TargetList
Data type: robtarget
Array of robtargets holding the positions defined by pointing out the turntable. Minimum
number of robtargets is 4, maximum 10.
TargetsInList
Data type: num
Number of robtargets in an array.
![Image]
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
| 795
|
2 Functions
2.18. CalcRotAxFrameZ - Calculate a rotational axis frame
RobotWare - OS
3HAC 16581-1 Revision: J
792
© Copyright 2004-2010 ABB. All rights reserved.
Basic examples
Basic examples of the function CalcRotAxFrameZ are illustrated below.
Example 1
CONST robtarget pos1 := [...];
CONST robtarget pos2 := [...];
CONST robtarget pos3 := [...];
CONST robtarget pos4 := [...];
CONST robtarget zpos;
VAR robtarget targetlist{10};
VAR num max_err := 0;
VAR num mean_err := 0;
VAR pose resFr:=[...];
PERS tooldata tMyTool:= [...];
! Instructions for creating/ModPos pos1 - pos4 with TCP pointing
at the turntable.
MoveJ pos1, v10, fine, tMyTool;
MoveJ pos2, v10, fine, tMyTool;
MoveJ pos3, v10, fine, tMyTool;
MoveJ pos4, v10, fine, tMyTool;
!Instruction for creating/ModPos zpos with TCP pointing at a point
in positive z direction
MoveJ zpos, v10, fine, tMyTool;
! Add the targets to the array
targetlist{1}:= pos1;
targetlist{2}:= pos2;
targetlist{3}:= pos3;
targetlist{4}:= pos4;
resFr:=CalcRotAxFrameZ(targetlist, 4, zpos, max_err, mean_err);
! Update the system parameters.
IF (max_err < 1.0) AND (mean_err < 0.5) THEN
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_pos_x",resFr.trans.x/1000;
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_pos_y",resFr.trans.y/1000;
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_pos_z",resFr.trans.z/1000;
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_orient_u0",resFr.rot.q1;
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_orient_u1",resFr.rot.q2;
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_orient_u2",resFr.rot.q3;
Continued
Continues on next page
2 Functions
2.18. CalcRotAxFrameZ - Calculate a rotational axis frame
RobotWare - OS
793
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_orient_u3",resFr.rot.q4;
TPReadFK reg1,"Warmstart required for calibration to take
effect."
,stEmpty,stEmpty,stEmpty, stEmpty,"OK";
WarmStart;
ENDIF
Four positions, pos1 - pos4 , are created/modposed so that the robot’s tool tMyTool points
to the same reference point on the external axis STN_1 but with different external axis
rotations. Position, zpos , is created/modposed so that the robot’s tool tMyTool points in the
positive z direction according to the definition of the positive z-direction of an external
rotational mechanical unit. Using the definition of the positive z-direction of an external
rotational mechanical unit, see Description on page 791 . The points are then used for
calculating the external axis base frame, resFr , in relation to the world coordinate system.
Finally, the frame is written to the configuration file and a warmstart is made to let the change
take effect.
xx0500002472
NOTE!
Definition of the positive z-direction of an external rotational mechanical unit:
Let the right hand’s fingers coincide with the positive rotation axis of the rotational axis. The
direction of the thumb then defines the positive z-direction. See the figure above.
Return value
Data type: pose
The calculated frame.
Arguments
CalcRotAxFrameZ (TargetList TargetsInList PositiveZPoint
MaxErr MeanErr)
TargetList
Data type: robtarget
Array of robtargets holding the positions defined by pointing out the turntable. Minimum
number of robtargets is 4, maximum 10.
TargetsInList
Data type: num
Number of robtargets in an array.
![Image]
Continued
Continues on next page
2 Functions
2.18. CalcRotAxFrameZ - Calculate a rotational axis frame
RobotWare - OS
3HAC 16581-1 Revision: J
794
© Copyright 2004-2010 ABB. All rights reserved.
PositiveZPoint
Data type: robtarget
robtarget holding the position defined by pointing out a point in the positive z direction.
Using the definition of the positive z-direction of an external rotational mechanical unit, see
Description on page 791 .
MaxErr
Maximum Error
Data type: num
The estimated maximum error in mm.
MeanErr
Mean Error
Data type: num
The estimated mean error in mm.
Error handling
If the positions don’t have the required relation or are not specified with enough accuracy then
the system variable ERRNO is set to ERR_FRAME . This error can then be handled in an error
handler.
Syntax
CalcRotAxFrameZ’(’
[TargetList ’:=’] <array {*} ( IN ) of robtarget>’ ,’
[TargetsInList’ :=’] <expression ( IN ) of num> ’,’
[PositiveZPoint’ :=’] <expression ( IN ) of robtarget> ’,’
[MaxErr ’:=’] <variable ( VAR ) of num> ’,’
[MeanErr ’:=’] <variable ( VAR ) of num>’)’
A function with a return value of the data type pose .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID
overview , section RAPID summary -
Mathematics
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 796
|
2 Functions
2.18. CalcRotAxFrameZ - Calculate a rotational axis frame
RobotWare - OS
793
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_orient_u3",resFr.rot.q4;
TPReadFK reg1,"Warmstart required for calibration to take
effect."
,stEmpty,stEmpty,stEmpty, stEmpty,"OK";
WarmStart;
ENDIF
Four positions, pos1 - pos4 , are created/modposed so that the robot’s tool tMyTool points
to the same reference point on the external axis STN_1 but with different external axis
rotations. Position, zpos , is created/modposed so that the robot’s tool tMyTool points in the
positive z direction according to the definition of the positive z-direction of an external
rotational mechanical unit. Using the definition of the positive z-direction of an external
rotational mechanical unit, see Description on page 791 . The points are then used for
calculating the external axis base frame, resFr , in relation to the world coordinate system.
Finally, the frame is written to the configuration file and a warmstart is made to let the change
take effect.
xx0500002472
NOTE!
Definition of the positive z-direction of an external rotational mechanical unit:
Let the right hand’s fingers coincide with the positive rotation axis of the rotational axis. The
direction of the thumb then defines the positive z-direction. See the figure above.
Return value
Data type: pose
The calculated frame.
Arguments
CalcRotAxFrameZ (TargetList TargetsInList PositiveZPoint
MaxErr MeanErr)
TargetList
Data type: robtarget
Array of robtargets holding the positions defined by pointing out the turntable. Minimum
number of robtargets is 4, maximum 10.
TargetsInList
Data type: num
Number of robtargets in an array.
![Image]
Continued
Continues on next page
2 Functions
2.18. CalcRotAxFrameZ - Calculate a rotational axis frame
RobotWare - OS
3HAC 16581-1 Revision: J
794
© Copyright 2004-2010 ABB. All rights reserved.
PositiveZPoint
Data type: robtarget
robtarget holding the position defined by pointing out a point in the positive z direction.
Using the definition of the positive z-direction of an external rotational mechanical unit, see
Description on page 791 .
MaxErr
Maximum Error
Data type: num
The estimated maximum error in mm.
MeanErr
Mean Error
Data type: num
The estimated mean error in mm.
Error handling
If the positions don’t have the required relation or are not specified with enough accuracy then
the system variable ERRNO is set to ERR_FRAME . This error can then be handled in an error
handler.
Syntax
CalcRotAxFrameZ’(’
[TargetList ’:=’] <array {*} ( IN ) of robtarget>’ ,’
[TargetsInList’ :=’] <expression ( IN ) of num> ’,’
[PositiveZPoint’ :=’] <expression ( IN ) of robtarget> ’,’
[MaxErr ’:=’] <variable ( VAR ) of num> ’,’
[MeanErr ’:=’] <variable ( VAR ) of num>’)’
A function with a return value of the data type pose .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID
overview , section RAPID summary -
Mathematics
Continued
2 Functions
2.19. CalcRotAxisFrame - Calculate a rotational axis frame
RobotWare - OS
795
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.19. CalcRotAxisFrame - Calculate a rotational axis frame
Usage
CalcRotAxisFrame ( Calculate Rotational Axis Frame ) is used to calculate the user
coordinate system of a rotational axis type mechanical unit. This function is to be used when
the master robot and the external axis are located in the same RAPID task. If they are in
different tasks the function CalcRotAxFrameZ should be used.
Description
The definition of a user frame for a rotational external axis requires that the turntable (or
similar mechanical structure) on the external axis has a marked reference point. Moreover,
the master robot’s base frame and TCP must be calibrated. The calibration procedure consists
of a number of positions for the robot’s TCP on the reference point when the turntable is
rotated to different angles. Definition of points for a rotational axis is illustrated in the figure
below.
xx0500002468
The user coordinate system for the rotational axis has its origin in the center of the turntable.
The z direction coincides with the axis of rotation and the x axis goes through the reference
point.
The figure below shows the user coordinate system for two different positions of the turntable
(turntable seen from above).
xx0500002469
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 797
|
2 Functions
2.18. CalcRotAxFrameZ - Calculate a rotational axis frame
RobotWare - OS
3HAC 16581-1 Revision: J
794
© Copyright 2004-2010 ABB. All rights reserved.
PositiveZPoint
Data type: robtarget
robtarget holding the position defined by pointing out a point in the positive z direction.
Using the definition of the positive z-direction of an external rotational mechanical unit, see
Description on page 791 .
MaxErr
Maximum Error
Data type: num
The estimated maximum error in mm.
MeanErr
Mean Error
Data type: num
The estimated mean error in mm.
Error handling
If the positions don’t have the required relation or are not specified with enough accuracy then
the system variable ERRNO is set to ERR_FRAME . This error can then be handled in an error
handler.
Syntax
CalcRotAxFrameZ’(’
[TargetList ’:=’] <array {*} ( IN ) of robtarget>’ ,’
[TargetsInList’ :=’] <expression ( IN ) of num> ’,’
[PositiveZPoint’ :=’] <expression ( IN ) of robtarget> ’,’
[MaxErr ’:=’] <variable ( VAR ) of num> ’,’
[MeanErr ’:=’] <variable ( VAR ) of num>’)’
A function with a return value of the data type pose .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID
overview , section RAPID summary -
Mathematics
Continued
2 Functions
2.19. CalcRotAxisFrame - Calculate a rotational axis frame
RobotWare - OS
795
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.19. CalcRotAxisFrame - Calculate a rotational axis frame
Usage
CalcRotAxisFrame ( Calculate Rotational Axis Frame ) is used to calculate the user
coordinate system of a rotational axis type mechanical unit. This function is to be used when
the master robot and the external axis are located in the same RAPID task. If they are in
different tasks the function CalcRotAxFrameZ should be used.
Description
The definition of a user frame for a rotational external axis requires that the turntable (or
similar mechanical structure) on the external axis has a marked reference point. Moreover,
the master robot’s base frame and TCP must be calibrated. The calibration procedure consists
of a number of positions for the robot’s TCP on the reference point when the turntable is
rotated to different angles. Definition of points for a rotational axis is illustrated in the figure
below.
xx0500002468
The user coordinate system for the rotational axis has its origin in the center of the turntable.
The z direction coincides with the axis of rotation and the x axis goes through the reference
point.
The figure below shows the user coordinate system for two different positions of the turntable
(turntable seen from above).
xx0500002469
Continues on next page
2 Functions
2.19. CalcRotAxisFrame - Calculate a rotational axis frame
RobotWare - OS
3HAC 16581-1 Revision: J
796
© Copyright 2004-2010 ABB. All rights reserved.
Basic examples
Basic examples of the function CalcRotAxisFrame are illustrated below.
Example 1
CONST robtarget pos1 := [...];
CONST robtarget pos2 := [...];
CONST robtarget pos3 := [...];
CONST robtarget pos4 := [...];
VAR robtarget targetlist{10};
VAR num max_err := 0;
VAR num mean_err := 0;
VAR pose resFr:=[...];
PERS tooldata tMyTool:= [...];
! Instructions needed for creating/ModPos pos1 - pos4 with TCP
pointing at the turntable.
MoveJ pos1, v10, fine, tMyTool;
MoveJ pos2, v10, fine, tMyTool;
MoveJ pos3, v10, fine, tMyTool;
MoveJ pos4, v10, fine, tMyTool;
! Add the targets to the array
targetlist{1}:= pos1;
targetlist{2}:= pos2;
targetlist{3}:= pos3;
targetlist{4}:= pos4;
resFr:=CalcRotAxisFrame(STN_1 , targetlist, 4, max_err, mean_err);
! Update the system parameters.
IF (max_err < 1.0) AND (mean_err < 0.5) THEN
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_pos_x",resFr.trans.x/1000;
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_pos_y",resFr.trans.y/1000;
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_pos_z",resFr.trans.z/1000;
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_orient_u0",resFr.rot.q1;
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_orient_u1",resFr.rot.q2;
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_orient_u2",resFr.rot.q3;
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_orient_u3",resFr.rot.q4;
TPReadFK reg1,"Warmstart required for calibration to take
effect.",stEmpty,stEmpty,stEmpty,stEmpty,"OK";
WarmStart;
ENDIF
Continued
Continues on next page
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 798
|
2 Functions
2.19. CalcRotAxisFrame - Calculate a rotational axis frame
RobotWare - OS
795
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.19. CalcRotAxisFrame - Calculate a rotational axis frame
Usage
CalcRotAxisFrame ( Calculate Rotational Axis Frame ) is used to calculate the user
coordinate system of a rotational axis type mechanical unit. This function is to be used when
the master robot and the external axis are located in the same RAPID task. If they are in
different tasks the function CalcRotAxFrameZ should be used.
Description
The definition of a user frame for a rotational external axis requires that the turntable (or
similar mechanical structure) on the external axis has a marked reference point. Moreover,
the master robot’s base frame and TCP must be calibrated. The calibration procedure consists
of a number of positions for the robot’s TCP on the reference point when the turntable is
rotated to different angles. Definition of points for a rotational axis is illustrated in the figure
below.
xx0500002468
The user coordinate system for the rotational axis has its origin in the center of the turntable.
The z direction coincides with the axis of rotation and the x axis goes through the reference
point.
The figure below shows the user coordinate system for two different positions of the turntable
(turntable seen from above).
xx0500002469
Continues on next page
2 Functions
2.19. CalcRotAxisFrame - Calculate a rotational axis frame
RobotWare - OS
3HAC 16581-1 Revision: J
796
© Copyright 2004-2010 ABB. All rights reserved.
Basic examples
Basic examples of the function CalcRotAxisFrame are illustrated below.
Example 1
CONST robtarget pos1 := [...];
CONST robtarget pos2 := [...];
CONST robtarget pos3 := [...];
CONST robtarget pos4 := [...];
VAR robtarget targetlist{10};
VAR num max_err := 0;
VAR num mean_err := 0;
VAR pose resFr:=[...];
PERS tooldata tMyTool:= [...];
! Instructions needed for creating/ModPos pos1 - pos4 with TCP
pointing at the turntable.
MoveJ pos1, v10, fine, tMyTool;
MoveJ pos2, v10, fine, tMyTool;
MoveJ pos3, v10, fine, tMyTool;
MoveJ pos4, v10, fine, tMyTool;
! Add the targets to the array
targetlist{1}:= pos1;
targetlist{2}:= pos2;
targetlist{3}:= pos3;
targetlist{4}:= pos4;
resFr:=CalcRotAxisFrame(STN_1 , targetlist, 4, max_err, mean_err);
! Update the system parameters.
IF (max_err < 1.0) AND (mean_err < 0.5) THEN
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_pos_x",resFr.trans.x/1000;
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_pos_y",resFr.trans.y/1000;
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_pos_z",resFr.trans.z/1000;
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_orient_u0",resFr.rot.q1;
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_orient_u1",resFr.rot.q2;
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_orient_u2",resFr.rot.q3;
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_orient_u3",resFr.rot.q4;
TPReadFK reg1,"Warmstart required for calibration to take
effect.",stEmpty,stEmpty,stEmpty,stEmpty,"OK";
WarmStart;
ENDIF
Continued
Continues on next page
2 Functions
2.19. CalcRotAxisFrame - Calculate a rotational axis frame
RobotWare - OS
797
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Four positions, pos1 - pos4 , are created/modposed so that the robot’s tool tMyTool points
to the same reference point on the external axis STN_1 but with different external axis
rotations. The points are then used for calculating the external axis base frame, resFr , in
relation to the world coordinate system. Finally, the frame is written to the configuration file
and a warmstart is made to let the change take effect.
Return value
Data type: pose
The calculated frame.
Arguments
CalcRotAxisFrame (MechUnit [\AxisNo] TargetList TargetsInList
MaxErr MeanErr)
MechUnit
Mechanical Unit
Data type: mecunit
Name of the mechanical unit to be calibrated.
[\AxisNo]
Data type: num
Optional argument defining the axis number for which a frame should be determined. Default
value is 1 applying to single rotational axis. For mechanical units with several axes, the axis
number should be supplied with this argument.
TargetList
Data type: robtarget
Array of robtargets holding the positions defined by pointing out the turntable. Minimum
number of robtargets is 4, maximum is 10.
TargetsInList
Data type: num
Number of robtargets in an array.
MaxErr
Maximum Error
Data type: num
The estimated maximum error in mm.
MeanErr
Mean Error
Data type: num
The estimated mean error in mm.
Error handling
If the positions don’t have the required relation or are not specified with enough accuracy then
the system variable ERRNO is set to ERR_FRAME . This error can then be handled in an 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
| 799
|
2 Functions
2.19. CalcRotAxisFrame - Calculate a rotational axis frame
RobotWare - OS
3HAC 16581-1 Revision: J
796
© Copyright 2004-2010 ABB. All rights reserved.
Basic examples
Basic examples of the function CalcRotAxisFrame are illustrated below.
Example 1
CONST robtarget pos1 := [...];
CONST robtarget pos2 := [...];
CONST robtarget pos3 := [...];
CONST robtarget pos4 := [...];
VAR robtarget targetlist{10};
VAR num max_err := 0;
VAR num mean_err := 0;
VAR pose resFr:=[...];
PERS tooldata tMyTool:= [...];
! Instructions needed for creating/ModPos pos1 - pos4 with TCP
pointing at the turntable.
MoveJ pos1, v10, fine, tMyTool;
MoveJ pos2, v10, fine, tMyTool;
MoveJ pos3, v10, fine, tMyTool;
MoveJ pos4, v10, fine, tMyTool;
! Add the targets to the array
targetlist{1}:= pos1;
targetlist{2}:= pos2;
targetlist{3}:= pos3;
targetlist{4}:= pos4;
resFr:=CalcRotAxisFrame(STN_1 , targetlist, 4, max_err, mean_err);
! Update the system parameters.
IF (max_err < 1.0) AND (mean_err < 0.5) THEN
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_pos_x",resFr.trans.x/1000;
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_pos_y",resFr.trans.y/1000;
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_pos_z",resFr.trans.z/1000;
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_orient_u0",resFr.rot.q1;
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_orient_u1",resFr.rot.q2;
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_orient_u2",resFr.rot.q3;
WriteCfgData "/MOC/SINGLE/STN_1",
"base_frame_orient_u3",resFr.rot.q4;
TPReadFK reg1,"Warmstart required for calibration to take
effect.",stEmpty,stEmpty,stEmpty,stEmpty,"OK";
WarmStart;
ENDIF
Continued
Continues on next page
2 Functions
2.19. CalcRotAxisFrame - Calculate a rotational axis frame
RobotWare - OS
797
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Four positions, pos1 - pos4 , are created/modposed so that the robot’s tool tMyTool points
to the same reference point on the external axis STN_1 but with different external axis
rotations. The points are then used for calculating the external axis base frame, resFr , in
relation to the world coordinate system. Finally, the frame is written to the configuration file
and a warmstart is made to let the change take effect.
Return value
Data type: pose
The calculated frame.
Arguments
CalcRotAxisFrame (MechUnit [\AxisNo] TargetList TargetsInList
MaxErr MeanErr)
MechUnit
Mechanical Unit
Data type: mecunit
Name of the mechanical unit to be calibrated.
[\AxisNo]
Data type: num
Optional argument defining the axis number for which a frame should be determined. Default
value is 1 applying to single rotational axis. For mechanical units with several axes, the axis
number should be supplied with this argument.
TargetList
Data type: robtarget
Array of robtargets holding the positions defined by pointing out the turntable. Minimum
number of robtargets is 4, maximum is 10.
TargetsInList
Data type: num
Number of robtargets in an array.
MaxErr
Maximum Error
Data type: num
The estimated maximum error in mm.
MeanErr
Mean Error
Data type: num
The estimated mean error in mm.
Error handling
If the positions don’t have the required relation or are not specified with enough accuracy then
the system variable ERRNO is set to ERR_FRAME . This error can then be handled in an error
handler.
Continued
Continues on next page
2 Functions
2.19. CalcRotAxisFrame - Calculate a rotational axis frame
RobotWare - OS
3HAC 16581-1 Revision: J
798
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
CalcRotAxisFrame’(’
[MechUnit ’:=’] <variable ( VAR ) of mecunit>
[\AxisNo ’:=’ <expression ( IN ) of num> ]’,’
[TargetList’:=’] <array {*} ( IN ) of robtarget> ’,’
[TargetsInList’:=’] <expression ( IN ) of num> ’,’
[MaxErr ’:=’] <variable ( VAR ) of num> ’,’
[MeanErr ’:=’] <variable ( VAR ) of num>’)’
A function with a return value of the data type pose .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID
overview , section RAPID summary -
Mathematics
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 800
|
2 Functions
2.19. CalcRotAxisFrame - Calculate a rotational axis frame
RobotWare - OS
797
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
Four positions, pos1 - pos4 , are created/modposed so that the robot’s tool tMyTool points
to the same reference point on the external axis STN_1 but with different external axis
rotations. The points are then used for calculating the external axis base frame, resFr , in
relation to the world coordinate system. Finally, the frame is written to the configuration file
and a warmstart is made to let the change take effect.
Return value
Data type: pose
The calculated frame.
Arguments
CalcRotAxisFrame (MechUnit [\AxisNo] TargetList TargetsInList
MaxErr MeanErr)
MechUnit
Mechanical Unit
Data type: mecunit
Name of the mechanical unit to be calibrated.
[\AxisNo]
Data type: num
Optional argument defining the axis number for which a frame should be determined. Default
value is 1 applying to single rotational axis. For mechanical units with several axes, the axis
number should be supplied with this argument.
TargetList
Data type: robtarget
Array of robtargets holding the positions defined by pointing out the turntable. Minimum
number of robtargets is 4, maximum is 10.
TargetsInList
Data type: num
Number of robtargets in an array.
MaxErr
Maximum Error
Data type: num
The estimated maximum error in mm.
MeanErr
Mean Error
Data type: num
The estimated mean error in mm.
Error handling
If the positions don’t have the required relation or are not specified with enough accuracy then
the system variable ERRNO is set to ERR_FRAME . This error can then be handled in an error
handler.
Continued
Continues on next page
2 Functions
2.19. CalcRotAxisFrame - Calculate a rotational axis frame
RobotWare - OS
3HAC 16581-1 Revision: J
798
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
CalcRotAxisFrame’(’
[MechUnit ’:=’] <variable ( VAR ) of mecunit>
[\AxisNo ’:=’ <expression ( IN ) of num> ]’,’
[TargetList’:=’] <array {*} ( IN ) of robtarget> ’,’
[TargetsInList’:=’] <expression ( IN ) of num> ’,’
[MaxErr ’:=’] <variable ( VAR ) of num> ’,’
[MeanErr ’:=’] <variable ( VAR ) of num>’)’
A function with a return value of the data type pose .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID
overview , section RAPID summary -
Mathematics
Continued
2 Functions
2.20. CDate - Reads the current date as a string
RobotWare-OS
799
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.20. CDate - Reads the current date as a string
Usage
CDate ( Current Date ) is used to read the current system date.
This function can be used to present the current date to the operator on the FlexPendant
display or to paste the current date into a text file that the program writes to.
Basic examples
Basic examples of the function CDate are illustrated below.
See also on page 799 .
Example 1
VAR string date;
date := CDate();
The current date is stored in the variable date .
Return value
Data type: string
The current date in a string.
The standard date format is “year-month-day”, e.g. ”1998-01-29”.
More examples
More examples of the function CDate are illustrated below.
Example 1
VAR string date;
date := CDate();
TPWrite "The current date is: "+date;
Write logfile, date;
The current date is written to the FlexPendant display and into a text file.
Syntax
CDate ’(’ ’)’
A function with a return value of the type string .
Related information
For information about
See
Time instructions
Technical reference manual - RAPID overview ,
section RAPID summary - System & time
Setting the system clock
Operating manual - IRC5 with FlexPendant , section
Changing FlexPendant settings
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 801
|
2 Functions
2.19. CalcRotAxisFrame - Calculate a rotational axis frame
RobotWare - OS
3HAC 16581-1 Revision: J
798
© Copyright 2004-2010 ABB. All rights reserved.
Syntax
CalcRotAxisFrame’(’
[MechUnit ’:=’] <variable ( VAR ) of mecunit>
[\AxisNo ’:=’ <expression ( IN ) of num> ]’,’
[TargetList’:=’] <array {*} ( IN ) of robtarget> ’,’
[TargetsInList’:=’] <expression ( IN ) of num> ’,’
[MaxErr ’:=’] <variable ( VAR ) of num> ’,’
[MeanErr ’:=’] <variable ( VAR ) of num>’)’
A function with a return value of the data type pose .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID
overview , section RAPID summary -
Mathematics
Continued
2 Functions
2.20. CDate - Reads the current date as a string
RobotWare-OS
799
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.20. CDate - Reads the current date as a string
Usage
CDate ( Current Date ) is used to read the current system date.
This function can be used to present the current date to the operator on the FlexPendant
display or to paste the current date into a text file that the program writes to.
Basic examples
Basic examples of the function CDate are illustrated below.
See also on page 799 .
Example 1
VAR string date;
date := CDate();
The current date is stored in the variable date .
Return value
Data type: string
The current date in a string.
The standard date format is “year-month-day”, e.g. ”1998-01-29”.
More examples
More examples of the function CDate are illustrated below.
Example 1
VAR string date;
date := CDate();
TPWrite "The current date is: "+date;
Write logfile, date;
The current date is written to the FlexPendant display and into a text file.
Syntax
CDate ’(’ ’)’
A function with a return value of the type string .
Related information
For information about
See
Time instructions
Technical reference manual - RAPID overview ,
section RAPID summary - System & time
Setting the system clock
Operating manual - IRC5 with FlexPendant , section
Changing FlexPendant settings
2 Functions
2.21. CJointT - Reads the current joint angles
RobotWare - OS
3HAC 16581-1 Revision: J
800
© Copyright 2004-2010 ABB. All rights reserved.
2.21. CJointT - Reads the current joint angles
Usage
CJointT ( Current Joint Target ) is used to read the current angles of the robot axes and
external axes.
Basic examples
Basic examples of the function CJointT are illustrated below.
See also More examples on page 801 .
Example 1
VAR jointtarget joints;
joints := CJointT();
The current angles of the axes for a robot and external axes are stored in joints .
Return value
Data type: jointtarget
The current angles in degrees for the axes of the robot on the arm side.
The current values for the external axes, in mm for linear axes, in degrees for rotational axes.
The returned values are related to the calibration position.
Arguments
CJointT ([\TaskRef]|[\TaskName])
[\TaskRef]
Task Reference
Data type: taskid
The program task identity from which the jointtarget should be read.
For all program tasks in the system, predefined variables of the data type taskid will be
available. The variable identity will be "taskname"+"Id", e.g. for the T_ROB1 task, and the
variable identity will be T_ROB1Id .
[\TaskName]
Data type: string
The program task name from which the jointtarget should be read.
If none of the arguments \TaskRef or \TaskName are specified then the current task 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
| 802
|
2 Functions
2.20. CDate - Reads the current date as a string
RobotWare-OS
799
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.20. CDate - Reads the current date as a string
Usage
CDate ( Current Date ) is used to read the current system date.
This function can be used to present the current date to the operator on the FlexPendant
display or to paste the current date into a text file that the program writes to.
Basic examples
Basic examples of the function CDate are illustrated below.
See also on page 799 .
Example 1
VAR string date;
date := CDate();
The current date is stored in the variable date .
Return value
Data type: string
The current date in a string.
The standard date format is “year-month-day”, e.g. ”1998-01-29”.
More examples
More examples of the function CDate are illustrated below.
Example 1
VAR string date;
date := CDate();
TPWrite "The current date is: "+date;
Write logfile, date;
The current date is written to the FlexPendant display and into a text file.
Syntax
CDate ’(’ ’)’
A function with a return value of the type string .
Related information
For information about
See
Time instructions
Technical reference manual - RAPID overview ,
section RAPID summary - System & time
Setting the system clock
Operating manual - IRC5 with FlexPendant , section
Changing FlexPendant settings
2 Functions
2.21. CJointT - Reads the current joint angles
RobotWare - OS
3HAC 16581-1 Revision: J
800
© Copyright 2004-2010 ABB. All rights reserved.
2.21. CJointT - Reads the current joint angles
Usage
CJointT ( Current Joint Target ) is used to read the current angles of the robot axes and
external axes.
Basic examples
Basic examples of the function CJointT are illustrated below.
See also More examples on page 801 .
Example 1
VAR jointtarget joints;
joints := CJointT();
The current angles of the axes for a robot and external axes are stored in joints .
Return value
Data type: jointtarget
The current angles in degrees for the axes of the robot on the arm side.
The current values for the external axes, in mm for linear axes, in degrees for rotational axes.
The returned values are related to the calibration position.
Arguments
CJointT ([\TaskRef]|[\TaskName])
[\TaskRef]
Task Reference
Data type: taskid
The program task identity from which the jointtarget should be read.
For all program tasks in the system, predefined variables of the data type taskid will be
available. The variable identity will be "taskname"+"Id", e.g. for the T_ROB1 task, and the
variable identity will be T_ROB1Id .
[\TaskName]
Data type: string
The program task name from which the jointtarget should be read.
If none of the arguments \TaskRef or \TaskName are specified then the current task is used.
Continues on next page
2 Functions
2.21. CJointT - Reads the current joint angles
RobotWare - OS
801
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of the function CJointT are illustrated below.
Example 1
! In task T_ROB1
VAR jointtarget joints;
joints := CJointT(\TaskRef:=T_ROB2Id);
The current position of the robot and external axes in task T_ROB2 are stored in joints in
task T_ROB1 .
Note that the robot in task T_ROB2 may be moving when the position is read. To make sure
the robot stands still, a stop point fine in the preceding movement instruction in task T_ROB2
could be programmed and instruction WaitSyncTask could be used to synchronize the
instructions in task T_ROB1 .
Example 2
! In task T_ROB1
VAR jointtarget joints;
joints := CJointT(\TaskName:="T_ROB2");
The same effect as Example 1 above.
Error handling
If argument \TaskRef or \TaskName specify some non-motion task then the system ERRNO
is set to ERR_NOT_MOVETASK . This error can be handled in the error handler.
But no error will be generated if argument \TaskRef or \TaskName specifies the non-
motion task that executes this function CJointT (reference to my own non-motion task). The
position will then be fetched from the connected motion task.
Syntax
CJointT’(’
[’\’ TaskRef’ :=’ <variable ( VAR ) of taskid>]
|[’\’ TaskName’ :=’ <expression ( IN ) of string>]’)’
A function with a return value of the data type jointtarget .
Related information
For information about
See
Definition of joint
jointtarget - Joint position data on page 1129
Reading the current motor angle
ReadMotor - Reads the current motor angles on
page 947
Continued
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 803
|
2 Functions
2.21. CJointT - Reads the current joint angles
RobotWare - OS
3HAC 16581-1 Revision: J
800
© Copyright 2004-2010 ABB. All rights reserved.
2.21. CJointT - Reads the current joint angles
Usage
CJointT ( Current Joint Target ) is used to read the current angles of the robot axes and
external axes.
Basic examples
Basic examples of the function CJointT are illustrated below.
See also More examples on page 801 .
Example 1
VAR jointtarget joints;
joints := CJointT();
The current angles of the axes for a robot and external axes are stored in joints .
Return value
Data type: jointtarget
The current angles in degrees for the axes of the robot on the arm side.
The current values for the external axes, in mm for linear axes, in degrees for rotational axes.
The returned values are related to the calibration position.
Arguments
CJointT ([\TaskRef]|[\TaskName])
[\TaskRef]
Task Reference
Data type: taskid
The program task identity from which the jointtarget should be read.
For all program tasks in the system, predefined variables of the data type taskid will be
available. The variable identity will be "taskname"+"Id", e.g. for the T_ROB1 task, and the
variable identity will be T_ROB1Id .
[\TaskName]
Data type: string
The program task name from which the jointtarget should be read.
If none of the arguments \TaskRef or \TaskName are specified then the current task is used.
Continues on next page
2 Functions
2.21. CJointT - Reads the current joint angles
RobotWare - OS
801
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of the function CJointT are illustrated below.
Example 1
! In task T_ROB1
VAR jointtarget joints;
joints := CJointT(\TaskRef:=T_ROB2Id);
The current position of the robot and external axes in task T_ROB2 are stored in joints in
task T_ROB1 .
Note that the robot in task T_ROB2 may be moving when the position is read. To make sure
the robot stands still, a stop point fine in the preceding movement instruction in task T_ROB2
could be programmed and instruction WaitSyncTask could be used to synchronize the
instructions in task T_ROB1 .
Example 2
! In task T_ROB1
VAR jointtarget joints;
joints := CJointT(\TaskName:="T_ROB2");
The same effect as Example 1 above.
Error handling
If argument \TaskRef or \TaskName specify some non-motion task then the system ERRNO
is set to ERR_NOT_MOVETASK . This error can be handled in the error handler.
But no error will be generated if argument \TaskRef or \TaskName specifies the non-
motion task that executes this function CJointT (reference to my own non-motion task). The
position will then be fetched from the connected motion task.
Syntax
CJointT’(’
[’\’ TaskRef’ :=’ <variable ( VAR ) of taskid>]
|[’\’ TaskName’ :=’ <expression ( IN ) of string>]’)’
A function with a return value of the data type jointtarget .
Related information
For information about
See
Definition of joint
jointtarget - Joint position data on page 1129
Reading the current motor angle
ReadMotor - Reads the current motor angles on
page 947
Continued
2 Functions
2.22. ClkRead - Reads a clock used for timing
RobotWare-OS
3HAC 16581-1 Revision: J
802
© Copyright 2004-2010 ABB. All rights reserved.
2.22. ClkRead - Reads a clock used for timing
Usage
ClkRead is used to read a clock that functions as a stop-watch used for timing.
Basic examples
Basic examples of the instruction ClkRead are illustrated below.
Example 1
reg1:=ClkRead(clock1);
The clock clock1 is read and the time in seconds is stored in the variable reg1 .
Return value
Data type: num
The time in seconds stored in the clock. Resolution 0.01 seconds.
Argument
ClkRead (Clock)
Clock
Data type: clock
The name of the clock to read.
Program execution
A clock can be read when it is stopped or running.
Once a clock is read it can be read again, started again, stopped, or reset.
Error handling
If the clock runs for 4,294,967 seconds (49 days 17 hours 2 minutes 47 seconds) then it
becomes overflowed and the system variable ERRNO is set to ERR_OVERFLOW.
The error can be handled in the error handler.
Syntax
ClkRead ’(’
[ Clock ’:=’ ] < variable ( VAR ) of clock > ’)’
A function with a return value of the type num .
Related information
For information about
See
Clock instructions
Technical reference manual - RAPID overview ,
section RAPID Summary - System & Time
More examples
ClkStart - Starts a clock used for timing on page 52
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 804
|
2 Functions
2.21. CJointT - Reads the current joint angles
RobotWare - OS
801
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
More examples
More examples of the function CJointT are illustrated below.
Example 1
! In task T_ROB1
VAR jointtarget joints;
joints := CJointT(\TaskRef:=T_ROB2Id);
The current position of the robot and external axes in task T_ROB2 are stored in joints in
task T_ROB1 .
Note that the robot in task T_ROB2 may be moving when the position is read. To make sure
the robot stands still, a stop point fine in the preceding movement instruction in task T_ROB2
could be programmed and instruction WaitSyncTask could be used to synchronize the
instructions in task T_ROB1 .
Example 2
! In task T_ROB1
VAR jointtarget joints;
joints := CJointT(\TaskName:="T_ROB2");
The same effect as Example 1 above.
Error handling
If argument \TaskRef or \TaskName specify some non-motion task then the system ERRNO
is set to ERR_NOT_MOVETASK . This error can be handled in the error handler.
But no error will be generated if argument \TaskRef or \TaskName specifies the non-
motion task that executes this function CJointT (reference to my own non-motion task). The
position will then be fetched from the connected motion task.
Syntax
CJointT’(’
[’\’ TaskRef’ :=’ <variable ( VAR ) of taskid>]
|[’\’ TaskName’ :=’ <expression ( IN ) of string>]’)’
A function with a return value of the data type jointtarget .
Related information
For information about
See
Definition of joint
jointtarget - Joint position data on page 1129
Reading the current motor angle
ReadMotor - Reads the current motor angles on
page 947
Continued
2 Functions
2.22. ClkRead - Reads a clock used for timing
RobotWare-OS
3HAC 16581-1 Revision: J
802
© Copyright 2004-2010 ABB. All rights reserved.
2.22. ClkRead - Reads a clock used for timing
Usage
ClkRead is used to read a clock that functions as a stop-watch used for timing.
Basic examples
Basic examples of the instruction ClkRead are illustrated below.
Example 1
reg1:=ClkRead(clock1);
The clock clock1 is read and the time in seconds is stored in the variable reg1 .
Return value
Data type: num
The time in seconds stored in the clock. Resolution 0.01 seconds.
Argument
ClkRead (Clock)
Clock
Data type: clock
The name of the clock to read.
Program execution
A clock can be read when it is stopped or running.
Once a clock is read it can be read again, started again, stopped, or reset.
Error handling
If the clock runs for 4,294,967 seconds (49 days 17 hours 2 minutes 47 seconds) then it
becomes overflowed and the system variable ERRNO is set to ERR_OVERFLOW.
The error can be handled in the error handler.
Syntax
ClkRead ’(’
[ Clock ’:=’ ] < variable ( VAR ) of clock > ’)’
A function with a return value of the type num .
Related information
For information about
See
Clock instructions
Technical reference manual - RAPID overview ,
section RAPID Summary - System & Time
More examples
ClkStart - Starts a clock used for timing on page 52
2 Functions
2.23. CorrRead - Reads the current total offsets
Path Offset
803
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.23. CorrRead - Reads the current total offsets
Usage
CorrRead is used to read the total corrections delivered by all connected correction
generators.
CorrRead can be used to:
•
find out how much the current path differs from the original path.
•
take actions to reduce the difference.
Basic examples
Basic examples of the function CorrRead are illustrated below.
See also More examples on page 803 .
Example 1
VAR pos offset;
...
offset := CorrRead();
The current offsets delivered by all connected correction generators are available in the
variable offset.
Return value
Data type: pos
The total absolute offsets delivered from all connected correction generators so far.
More examples
For more examples of the function CorrRead , see instruction CorrCon .
Syntax
CorrRead’ (’ ’)’
A function with a return value of the data type pos.
Related information
For information about
See
Connects to a correction generator
CorrCon - Connects to a correction generator
on page 71
Disconnects from a correction generator
CorrDiscon - Disconnects from a correction
generator on page 76
Writes to a correction generator
CorrWrite - Writes to a correction generator on
page 77
Removes all correction generators
CorrClear - Removes all correction generators
on page 70
Correction descriptor
corrdescr - Correction generator descriptor on
page 1099
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 805
|
2 Functions
2.22. ClkRead - Reads a clock used for timing
RobotWare-OS
3HAC 16581-1 Revision: J
802
© Copyright 2004-2010 ABB. All rights reserved.
2.22. ClkRead - Reads a clock used for timing
Usage
ClkRead is used to read a clock that functions as a stop-watch used for timing.
Basic examples
Basic examples of the instruction ClkRead are illustrated below.
Example 1
reg1:=ClkRead(clock1);
The clock clock1 is read and the time in seconds is stored in the variable reg1 .
Return value
Data type: num
The time in seconds stored in the clock. Resolution 0.01 seconds.
Argument
ClkRead (Clock)
Clock
Data type: clock
The name of the clock to read.
Program execution
A clock can be read when it is stopped or running.
Once a clock is read it can be read again, started again, stopped, or reset.
Error handling
If the clock runs for 4,294,967 seconds (49 days 17 hours 2 minutes 47 seconds) then it
becomes overflowed and the system variable ERRNO is set to ERR_OVERFLOW.
The error can be handled in the error handler.
Syntax
ClkRead ’(’
[ Clock ’:=’ ] < variable ( VAR ) of clock > ’)’
A function with a return value of the type num .
Related information
For information about
See
Clock instructions
Technical reference manual - RAPID overview ,
section RAPID Summary - System & Time
More examples
ClkStart - Starts a clock used for timing on page 52
2 Functions
2.23. CorrRead - Reads the current total offsets
Path Offset
803
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.23. CorrRead - Reads the current total offsets
Usage
CorrRead is used to read the total corrections delivered by all connected correction
generators.
CorrRead can be used to:
•
find out how much the current path differs from the original path.
•
take actions to reduce the difference.
Basic examples
Basic examples of the function CorrRead are illustrated below.
See also More examples on page 803 .
Example 1
VAR pos offset;
...
offset := CorrRead();
The current offsets delivered by all connected correction generators are available in the
variable offset.
Return value
Data type: pos
The total absolute offsets delivered from all connected correction generators so far.
More examples
For more examples of the function CorrRead , see instruction CorrCon .
Syntax
CorrRead’ (’ ’)’
A function with a return value of the data type pos.
Related information
For information about
See
Connects to a correction generator
CorrCon - Connects to a correction generator
on page 71
Disconnects from a correction generator
CorrDiscon - Disconnects from a correction
generator on page 76
Writes to a correction generator
CorrWrite - Writes to a correction generator on
page 77
Removes all correction generators
CorrClear - Removes all correction generators
on page 70
Correction descriptor
corrdescr - Correction generator descriptor on
page 1099
2 Functions
2.24. Cos - Calculates the cosine value
RobotWare - OS
3HAC 16581-1 Revision: J
804
© Copyright 2004-2010 ABB. All rights reserved.
2.24. Cos - Calculates the cosine value
Usage
Cos ( Cosine ) is used to calculate the cosine value from an angle value.
Basic examples
Basic examples of the function Cos are illustrated below.
Example 1
VAR num angle;
VAR num value;
...
...
value := Cos(angle);
value will get the cosine value of angle .
Return value
Data type: num
The cosine value, range = [-1, 1] .
Arguments
Cos (Angle)
Angle
Data type: num
The angle value, expressed in degrees.
Syntax
Cos’(’
[Angle ’:=’] <expression ( IN ) of num>
’)’
A function with a return value of the data type num .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID overview ,
section RAPID summary - Mathematics
|
ABB_Technical_Reference_Manual
|
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
| 806
|
2 Functions
2.23. CorrRead - Reads the current total offsets
Path Offset
803
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.23. CorrRead - Reads the current total offsets
Usage
CorrRead is used to read the total corrections delivered by all connected correction
generators.
CorrRead can be used to:
•
find out how much the current path differs from the original path.
•
take actions to reduce the difference.
Basic examples
Basic examples of the function CorrRead are illustrated below.
See also More examples on page 803 .
Example 1
VAR pos offset;
...
offset := CorrRead();
The current offsets delivered by all connected correction generators are available in the
variable offset.
Return value
Data type: pos
The total absolute offsets delivered from all connected correction generators so far.
More examples
For more examples of the function CorrRead , see instruction CorrCon .
Syntax
CorrRead’ (’ ’)’
A function with a return value of the data type pos.
Related information
For information about
See
Connects to a correction generator
CorrCon - Connects to a correction generator
on page 71
Disconnects from a correction generator
CorrDiscon - Disconnects from a correction
generator on page 76
Writes to a correction generator
CorrWrite - Writes to a correction generator on
page 77
Removes all correction generators
CorrClear - Removes all correction generators
on page 70
Correction descriptor
corrdescr - Correction generator descriptor on
page 1099
2 Functions
2.24. Cos - Calculates the cosine value
RobotWare - OS
3HAC 16581-1 Revision: J
804
© Copyright 2004-2010 ABB. All rights reserved.
2.24. Cos - Calculates the cosine value
Usage
Cos ( Cosine ) is used to calculate the cosine value from an angle value.
Basic examples
Basic examples of the function Cos are illustrated below.
Example 1
VAR num angle;
VAR num value;
...
...
value := Cos(angle);
value will get the cosine value of angle .
Return value
Data type: num
The cosine value, range = [-1, 1] .
Arguments
Cos (Angle)
Angle
Data type: num
The angle value, expressed in degrees.
Syntax
Cos’(’
[Angle ’:=’] <expression ( IN ) of num>
’)’
A function with a return value of the data type num .
Related information
For information about
See
Mathematical instructions and functions
Technical reference manual - RAPID overview ,
section RAPID summary - Mathematics
2 Functions
2.25. CPos - Reads the current position (pos) data
RobotWare - OS
805
3HAC 16581-1 Revision: J
© Copyright 2004-2010 ABB. All rights reserved.
2.25. CPos - Reads the current position (pos) data
Usage
CPos (Current Position) is used to read the current position of the robot.
This function returns the x, y, and z values of the robot TCP as data of type pos. If the
complete robot position ( robtarget ) is to be read then use the function CRobT instead.
Basic examples
Basic examples of the function CPos are illustrated below.
See also More examples on page 806 .
VAR pos pos1;
MoveL *, v500, fine \Inpos := inpos50, tool1;
pos1 := CPos(\Tool:=tool1 \WObj:=wobj0);
The current position of the robot TCP is stored in variable pos1 . The tool tool1 and work
object wobj0 are used for calculating the position.
Note that the robot is standing still before the position is read and calculated. This is achieved
by using the stop point fine within position accuracy inpos50 in the preceding movement
instruction.
Return value
Data type: pos
The current position (pos) of the robot with x, y, and z in the outermost coordinate system,
taking the specified tool, work object, and active ProgDisp coordinate system into
consideration.
Arguments
CPos
([\Tool] [\WObj])
[ \Too l]
Data type: tooldata
The tool used for calculation of the current robot position.
If this argument is omitted then the current active tool is used.
[\WObj]
Work Object
Data type: wobjdata
The work object (coordinate system) to which the current robot position returned by the
function is related.
If this argument is omitted then the current active work object is used.
WARNING!
It is advised to always specify the arguments \Tool and \WObj during programming. The
function will then always return the wanted position even if another tool or work object are
activated.
Continues on next page
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.