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
807
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 2 Functions 2.25. CPos - Reads the current position (pos) data RobotWare - OS 3HAC 16581-1 Revision: J 806 © Copyright 2004-2010 ABB. All rights reserved. Program execution The coordinates returned represent the TCP position in the ProgDisp coordinate system. More examples More examples of the function CPos are illustrated below. VAR pos pos2; VAR pos pos3; VAR pos pos4; pos2 := CPos(\Tool:=grip3 \WObj:=fixture); ... pos3 := CPos(\Tool:=grip3 \WObj:=fixture); pos4 := pos3-pos2; The x, y, and z position of the robot is captured at two places within the program using the CPos function. The tool grip3 and work object fixture are used for calculating the position. The x, y, and z distances travelled between these positions are then calculated and stored in variable pos4 . Syntax CPos ’(’ [’\’Tool ’:=’ <persistent ( PERS ) of tooldata>] [’\’WObj ’:=’ <persistent ( PERS ) of wobjdata>] ’)’ A function with a return value of the data type pos . Related information For information about See Definition of position pos - Positions (only X, Y and Z) on page 1160 Definition of tools tooldata - Tool data on page 1207 Definition of work objects wobjdata - Work object data on page 1224 ProgDisp coordinate system PDispOn - Activates program displacement on page 317 Coordinate systems Technical reference manual - RAPID overview , section Motion and I/O Principles - Coordinate systems Reading the current robtarget CRobT - Reads the current position (robtarget) data on page 807 Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
808
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 2 Functions 2.25. CPos - Reads the current position (pos) data RobotWare - OS 3HAC 16581-1 Revision: J 806 © Copyright 2004-2010 ABB. All rights reserved. Program execution The coordinates returned represent the TCP position in the ProgDisp coordinate system. More examples More examples of the function CPos are illustrated below. VAR pos pos2; VAR pos pos3; VAR pos pos4; pos2 := CPos(\Tool:=grip3 \WObj:=fixture); ... pos3 := CPos(\Tool:=grip3 \WObj:=fixture); pos4 := pos3-pos2; The x, y, and z position of the robot is captured at two places within the program using the CPos function. The tool grip3 and work object fixture are used for calculating the position. The x, y, and z distances travelled between these positions are then calculated and stored in variable pos4 . Syntax CPos ’(’ [’\’Tool ’:=’ <persistent ( PERS ) of tooldata>] [’\’WObj ’:=’ <persistent ( PERS ) of wobjdata>] ’)’ A function with a return value of the data type pos . Related information For information about See Definition of position pos - Positions (only X, Y and Z) on page 1160 Definition of tools tooldata - Tool data on page 1207 Definition of work objects wobjdata - Work object data on page 1224 ProgDisp coordinate system PDispOn - Activates program displacement on page 317 Coordinate systems Technical reference manual - RAPID overview , section Motion and I/O Principles - Coordinate systems Reading the current robtarget CRobT - Reads the current position (robtarget) data on page 807 Continued 2 Functions 2.26. CRobT - Reads the current position (robtarget) data RobotWare - OS 807 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.26. CRobT - Reads the current position (robtarget) data Usage CRobT (Current Robot Target) is used to read the current position of a robot and external axes. This function returns a robtarget value with position (x, y, z), orientation (q1 ... q4), robot axes configuration, and external axes position. If only the x, y, and z values of the robot TCP ( pos ) are to be read then use the function CPos instead. Basic examples Basic examples of the function CRobT are illustrated below. See also More examples on page 808 . Example 1 VAR robtarget p1; MoveL *, v500, fine \Inpos := inpos50, tool1; p1 := CRobT(\Tool:=tool1 \WObj:=wobj0); The current position of the robot and external axes is stored in p1 . 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: robtarget The current position of a robot and external axes in the outermost coordinate system, taking the specified tool, work object, and active ProgDisp/ExtOffs coordinate system into consideration. Arguments CRobT ([\TaskRef]|[\TaskName] [\Tool] [\WObj]) [\TaskRef] Task Reference Data type: taskid The program task identity from which the robtarget 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 the variable identity will be T_ROB1Id . [\TaskName] Data type: string The program task name from which the robtarget 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
809
2 Functions 2.25. CPos - Reads the current position (pos) data RobotWare - OS 3HAC 16581-1 Revision: J 806 © Copyright 2004-2010 ABB. All rights reserved. Program execution The coordinates returned represent the TCP position in the ProgDisp coordinate system. More examples More examples of the function CPos are illustrated below. VAR pos pos2; VAR pos pos3; VAR pos pos4; pos2 := CPos(\Tool:=grip3 \WObj:=fixture); ... pos3 := CPos(\Tool:=grip3 \WObj:=fixture); pos4 := pos3-pos2; The x, y, and z position of the robot is captured at two places within the program using the CPos function. The tool grip3 and work object fixture are used for calculating the position. The x, y, and z distances travelled between these positions are then calculated and stored in variable pos4 . Syntax CPos ’(’ [’\’Tool ’:=’ <persistent ( PERS ) of tooldata>] [’\’WObj ’:=’ <persistent ( PERS ) of wobjdata>] ’)’ A function with a return value of the data type pos . Related information For information about See Definition of position pos - Positions (only X, Y and Z) on page 1160 Definition of tools tooldata - Tool data on page 1207 Definition of work objects wobjdata - Work object data on page 1224 ProgDisp coordinate system PDispOn - Activates program displacement on page 317 Coordinate systems Technical reference manual - RAPID overview , section Motion and I/O Principles - Coordinate systems Reading the current robtarget CRobT - Reads the current position (robtarget) data on page 807 Continued 2 Functions 2.26. CRobT - Reads the current position (robtarget) data RobotWare - OS 807 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.26. CRobT - Reads the current position (robtarget) data Usage CRobT (Current Robot Target) is used to read the current position of a robot and external axes. This function returns a robtarget value with position (x, y, z), orientation (q1 ... q4), robot axes configuration, and external axes position. If only the x, y, and z values of the robot TCP ( pos ) are to be read then use the function CPos instead. Basic examples Basic examples of the function CRobT are illustrated below. See also More examples on page 808 . Example 1 VAR robtarget p1; MoveL *, v500, fine \Inpos := inpos50, tool1; p1 := CRobT(\Tool:=tool1 \WObj:=wobj0); The current position of the robot and external axes is stored in p1 . 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: robtarget The current position of a robot and external axes in the outermost coordinate system, taking the specified tool, work object, and active ProgDisp/ExtOffs coordinate system into consideration. Arguments CRobT ([\TaskRef]|[\TaskName] [\Tool] [\WObj]) [\TaskRef] Task Reference Data type: taskid The program task identity from which the robtarget 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 the variable identity will be T_ROB1Id . [\TaskName] Data type: string The program task name from which the robtarget 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.26. CRobT - Reads the current position (robtarget) data RobotWare - OS 3HAC 16581-1 Revision: J 808 © Copyright 2004-2010 ABB. All rights reserved. [ \Tool] Data type: tooldata The persistent variable for the tool used to calculate the current robot position. If this argument is omitted then the current active tool is used. [\WObj] Work Object Data type: wobjdata The persistent variable for 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. Program execution The coordinates returned represent the TCP position in the ProgDisp coordinate system. External axes are represented in the ExtOffs coordinate system. If one of the arguments \TaskRef or \TaskName are used but arguments Tool and WObj are not used then the current tool and work object in the specified task will be used. More examples More examples of the function CRobT are illustrated below. Example 1 VAR robtarget p2; p2 := ORobT( CRobT(\Tool:=grip3 \WObj:=fixture) ); The current position in the object coordinate system (without any ProgDisp or ExtOffs ) of the robot and external axes is stored in p2 . The tool grip3 and work object fixture are used for calculating the position. Example 2 ! In task T_ROB1 VAR robtarget p3; p3 := CRobT(\TaskRef:=T_ROB2Id \Tool:=tool1 \WObj:=wobj0); The current position of the robot and external axes in task T_ROB2 are stored in p3 in task T_ROB1 . The tool tool1 and work object wobj0 are used for calculating the position. Note that the robot in task T_ROB2 may be moving when the position is read and calculated. 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 . 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
810
2 Functions 2.26. CRobT - Reads the current position (robtarget) data RobotWare - OS 807 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.26. CRobT - Reads the current position (robtarget) data Usage CRobT (Current Robot Target) is used to read the current position of a robot and external axes. This function returns a robtarget value with position (x, y, z), orientation (q1 ... q4), robot axes configuration, and external axes position. If only the x, y, and z values of the robot TCP ( pos ) are to be read then use the function CPos instead. Basic examples Basic examples of the function CRobT are illustrated below. See also More examples on page 808 . Example 1 VAR robtarget p1; MoveL *, v500, fine \Inpos := inpos50, tool1; p1 := CRobT(\Tool:=tool1 \WObj:=wobj0); The current position of the robot and external axes is stored in p1 . 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: robtarget The current position of a robot and external axes in the outermost coordinate system, taking the specified tool, work object, and active ProgDisp/ExtOffs coordinate system into consideration. Arguments CRobT ([\TaskRef]|[\TaskName] [\Tool] [\WObj]) [\TaskRef] Task Reference Data type: taskid The program task identity from which the robtarget 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 the variable identity will be T_ROB1Id . [\TaskName] Data type: string The program task name from which the robtarget 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.26. CRobT - Reads the current position (robtarget) data RobotWare - OS 3HAC 16581-1 Revision: J 808 © Copyright 2004-2010 ABB. All rights reserved. [ \Tool] Data type: tooldata The persistent variable for the tool used to calculate the current robot position. If this argument is omitted then the current active tool is used. [\WObj] Work Object Data type: wobjdata The persistent variable for 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. Program execution The coordinates returned represent the TCP position in the ProgDisp coordinate system. External axes are represented in the ExtOffs coordinate system. If one of the arguments \TaskRef or \TaskName are used but arguments Tool and WObj are not used then the current tool and work object in the specified task will be used. More examples More examples of the function CRobT are illustrated below. Example 1 VAR robtarget p2; p2 := ORobT( CRobT(\Tool:=grip3 \WObj:=fixture) ); The current position in the object coordinate system (without any ProgDisp or ExtOffs ) of the robot and external axes is stored in p2 . The tool grip3 and work object fixture are used for calculating the position. Example 2 ! In task T_ROB1 VAR robtarget p3; p3 := CRobT(\TaskRef:=T_ROB2Id \Tool:=tool1 \WObj:=wobj0); The current position of the robot and external axes in task T_ROB2 are stored in p3 in task T_ROB1 . The tool tool1 and work object wobj0 are used for calculating the position. Note that the robot in task T_ROB2 may be moving when the position is read and calculated. 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 . Continued Continues on next page 2 Functions 2.26. CRobT - Reads the current position (robtarget) data RobotWare - OS 809 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Example 3 ! In task T_ROB1 VAR robtarget p4; p4 := CRobT(\TaskName:="T_ROB2"); The current position of the robot and external axes in task T_ROB2 are stored in p4 in task T_ROB1 . The current tool and work object in task T_ROB2 are used for calculating the position. 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 the arguments \TaskRef or \TaskName specify the non- motion task that executes this function CRobT (reference to my own non-motion task). The position will then be fetched from the connected motion task. Syntax CRobT’(’ [’\’ TaskRef ’:=’ <variable ( VAR ) of taskid>] |[’\’ TaskName’ :=’ <expression ( IN ) of string>] [’\’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 Definition of position robtarget - Position data on page 1176 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 ProgDisp coordinate system PDispOn - Activates program displacement on page 317 ExtOffs coordinate system EOffsOn - Activates an offset for external axes on page 88 Reading the current pos (x, y, z only) CPos - Reads the current position (pos) data on page 805 Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
811
2 Functions 2.26. CRobT - Reads the current position (robtarget) data RobotWare - OS 3HAC 16581-1 Revision: J 808 © Copyright 2004-2010 ABB. All rights reserved. [ \Tool] Data type: tooldata The persistent variable for the tool used to calculate the current robot position. If this argument is omitted then the current active tool is used. [\WObj] Work Object Data type: wobjdata The persistent variable for 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. Program execution The coordinates returned represent the TCP position in the ProgDisp coordinate system. External axes are represented in the ExtOffs coordinate system. If one of the arguments \TaskRef or \TaskName are used but arguments Tool and WObj are not used then the current tool and work object in the specified task will be used. More examples More examples of the function CRobT are illustrated below. Example 1 VAR robtarget p2; p2 := ORobT( CRobT(\Tool:=grip3 \WObj:=fixture) ); The current position in the object coordinate system (without any ProgDisp or ExtOffs ) of the robot and external axes is stored in p2 . The tool grip3 and work object fixture are used for calculating the position. Example 2 ! In task T_ROB1 VAR robtarget p3; p3 := CRobT(\TaskRef:=T_ROB2Id \Tool:=tool1 \WObj:=wobj0); The current position of the robot and external axes in task T_ROB2 are stored in p3 in task T_ROB1 . The tool tool1 and work object wobj0 are used for calculating the position. Note that the robot in task T_ROB2 may be moving when the position is read and calculated. 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 . Continued Continues on next page 2 Functions 2.26. CRobT - Reads the current position (robtarget) data RobotWare - OS 809 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Example 3 ! In task T_ROB1 VAR robtarget p4; p4 := CRobT(\TaskName:="T_ROB2"); The current position of the robot and external axes in task T_ROB2 are stored in p4 in task T_ROB1 . The current tool and work object in task T_ROB2 are used for calculating the position. 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 the arguments \TaskRef or \TaskName specify the non- motion task that executes this function CRobT (reference to my own non-motion task). The position will then be fetched from the connected motion task. Syntax CRobT’(’ [’\’ TaskRef ’:=’ <variable ( VAR ) of taskid>] |[’\’ TaskName’ :=’ <expression ( IN ) of string>] [’\’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 Definition of position robtarget - Position data on page 1176 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 ProgDisp coordinate system PDispOn - Activates program displacement on page 317 ExtOffs coordinate system EOffsOn - Activates an offset for external axes on page 88 Reading the current pos (x, y, z only) CPos - Reads the current position (pos) data on page 805 Continued 2 Functions 2.27. CSpeedOverride - Reads the current override speed RobotWare - OS 3HAC 16581-1 Revision: J 810 © Copyright 2004-2010 ABB. All rights reserved. 2.27. CSpeedOverride - Reads the current override speed Usage CSpeedOverride is used to read the speed override set by the operator from the FlexPendant. The return value is displayed as a percentage where 100% corresponds to the programmed speed. In applications with instruction SpeedRefresh , this function can also be used to read current speed override value for this or connected motion program tasks. Note! Must not be mixed up with the argument Override in the RAPID instruction VelSet . Basic examples Basic examples of the function CSpeedOverride are illustrated below. Example 1 VAR num myspeed; myspeed := CSpeedOverride(); The current override speed will be stored in the variable myspeed . E.g. if the value is 100 then this is equivalent to 100%. Return value Data type: num The override speed value in percent of the programmed speed. This will be a numeric value in the range of 0 - 100. Arguments CSpeedOverride ( [\CTask] ) [\CTask ] Data type: switch Get current speed override value for this or connected motion program task. Used together with the instruction SpeedRefresh . If this argument is not used then the function returns current speed override for the whole system (all motion program tasks). Meaning the manual speed override, set from Teach Pendant. Syntax CSpeedOverride’(’ [’\’ CTask ] ’)’ A function with a return value of the data type num . Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
812
2 Functions 2.26. CRobT - Reads the current position (robtarget) data RobotWare - OS 809 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Example 3 ! In task T_ROB1 VAR robtarget p4; p4 := CRobT(\TaskName:="T_ROB2"); The current position of the robot and external axes in task T_ROB2 are stored in p4 in task T_ROB1 . The current tool and work object in task T_ROB2 are used for calculating the position. 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 the arguments \TaskRef or \TaskName specify the non- motion task that executes this function CRobT (reference to my own non-motion task). The position will then be fetched from the connected motion task. Syntax CRobT’(’ [’\’ TaskRef ’:=’ <variable ( VAR ) of taskid>] |[’\’ TaskName’ :=’ <expression ( IN ) of string>] [’\’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 Definition of position robtarget - Position data on page 1176 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 ProgDisp coordinate system PDispOn - Activates program displacement on page 317 ExtOffs coordinate system EOffsOn - Activates an offset for external axes on page 88 Reading the current pos (x, y, z only) CPos - Reads the current position (pos) data on page 805 Continued 2 Functions 2.27. CSpeedOverride - Reads the current override speed RobotWare - OS 3HAC 16581-1 Revision: J 810 © Copyright 2004-2010 ABB. All rights reserved. 2.27. CSpeedOverride - Reads the current override speed Usage CSpeedOverride is used to read the speed override set by the operator from the FlexPendant. The return value is displayed as a percentage where 100% corresponds to the programmed speed. In applications with instruction SpeedRefresh , this function can also be used to read current speed override value for this or connected motion program tasks. Note! Must not be mixed up with the argument Override in the RAPID instruction VelSet . Basic examples Basic examples of the function CSpeedOverride are illustrated below. Example 1 VAR num myspeed; myspeed := CSpeedOverride(); The current override speed will be stored in the variable myspeed . E.g. if the value is 100 then this is equivalent to 100%. Return value Data type: num The override speed value in percent of the programmed speed. This will be a numeric value in the range of 0 - 100. Arguments CSpeedOverride ( [\CTask] ) [\CTask ] Data type: switch Get current speed override value for this or connected motion program task. Used together with the instruction SpeedRefresh . If this argument is not used then the function returns current speed override for the whole system (all motion program tasks). Meaning the manual speed override, set from Teach Pendant. Syntax CSpeedOverride’(’ [’\’ CTask ] ’)’ A function with a return value of the data type num . Continues on next page 2 Functions 2.27. CSpeedOverride - Reads the current override speed RobotWare - OS 811 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Changing the Override Speed Operating manual - IRC5 with FlexPendant , section Programming and Testing Production Running - Quickset menu, Speed Update speed override from RAPID SpeedRefresh - Update speed override for ongoing movement on page 476 Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
813
2 Functions 2.27. CSpeedOverride - Reads the current override speed RobotWare - OS 3HAC 16581-1 Revision: J 810 © Copyright 2004-2010 ABB. All rights reserved. 2.27. CSpeedOverride - Reads the current override speed Usage CSpeedOverride is used to read the speed override set by the operator from the FlexPendant. The return value is displayed as a percentage where 100% corresponds to the programmed speed. In applications with instruction SpeedRefresh , this function can also be used to read current speed override value for this or connected motion program tasks. Note! Must not be mixed up with the argument Override in the RAPID instruction VelSet . Basic examples Basic examples of the function CSpeedOverride are illustrated below. Example 1 VAR num myspeed; myspeed := CSpeedOverride(); The current override speed will be stored in the variable myspeed . E.g. if the value is 100 then this is equivalent to 100%. Return value Data type: num The override speed value in percent of the programmed speed. This will be a numeric value in the range of 0 - 100. Arguments CSpeedOverride ( [\CTask] ) [\CTask ] Data type: switch Get current speed override value for this or connected motion program task. Used together with the instruction SpeedRefresh . If this argument is not used then the function returns current speed override for the whole system (all motion program tasks). Meaning the manual speed override, set from Teach Pendant. Syntax CSpeedOverride’(’ [’\’ CTask ] ’)’ A function with a return value of the data type num . Continues on next page 2 Functions 2.27. CSpeedOverride - Reads the current override speed RobotWare - OS 811 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Changing the Override Speed Operating manual - IRC5 with FlexPendant , section Programming and Testing Production Running - Quickset menu, Speed Update speed override from RAPID SpeedRefresh - Update speed override for ongoing movement on page 476 Continued 2 Functions 2.28. CTime - Reads the current time as a string RobotWare-OS 3HAC 16581-1 Revision: J 812 © Copyright 2004-2010 ABB. All rights reserved. 2.28. CTime - Reads the current time as a string Usage CTime is used to read the current system time. This function can be used to present the current time to the operator on the FlexPendant display or to paste the current time into a text file that the program writes to. Basic examples Basic examples of the function CTime are illustrated below. Example 1 VAR string time; time := CTime(); The current time is stored in the variable time. Return value Data type: string The current time in a string. The standard time format is "hours:minutes:seconds", e.g. "18:20:46". More example More examples of the function CTime are illustrated below. Example 1 VAR string time; time := CTime(); TPWrite "The current time is: "+time; Write logfile, time; The current time is written to the FlexPendant display and written into a text file. Syntax CTime ’(’ ’)’ A function with a return value of the type string . Related information For information about See Time and date 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
814
2 Functions 2.27. CSpeedOverride - Reads the current override speed RobotWare - OS 811 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Changing the Override Speed Operating manual - IRC5 with FlexPendant , section Programming and Testing Production Running - Quickset menu, Speed Update speed override from RAPID SpeedRefresh - Update speed override for ongoing movement on page 476 Continued 2 Functions 2.28. CTime - Reads the current time as a string RobotWare-OS 3HAC 16581-1 Revision: J 812 © Copyright 2004-2010 ABB. All rights reserved. 2.28. CTime - Reads the current time as a string Usage CTime is used to read the current system time. This function can be used to present the current time to the operator on the FlexPendant display or to paste the current time into a text file that the program writes to. Basic examples Basic examples of the function CTime are illustrated below. Example 1 VAR string time; time := CTime(); The current time is stored in the variable time. Return value Data type: string The current time in a string. The standard time format is "hours:minutes:seconds", e.g. "18:20:46". More example More examples of the function CTime are illustrated below. Example 1 VAR string time; time := CTime(); TPWrite "The current time is: "+time; Write logfile, time; The current time is written to the FlexPendant display and written into a text file. Syntax CTime ’(’ ’)’ A function with a return value of the type string . Related information For information about See Time and date 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.29. CTool - Reads the current tool data RobotWare - OS 813 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.29. CTool - Reads the current tool data Usage CTool ( Current Tool ) is used to read the data of the current tool. Basic examples Basic examples of the function CTool are illustrated below: Example 1 PERS tooldata temp_tool:= [ TRUE, [ [0, 0, 0], [1, 0, 0 ,0] ], [0.001, [0, 0, 0.001], [1, 0, 0, 0], 0, 0, 0] ]; temp_tool := CTool(); The value of the current tool is stored in the variable temp_tool . Return value Data type: tooldata This function returns a tooldata value holding the value of the current tool, i.e. the tool last used in a movement instruction. The value returned represents the TCP position and orientation in the wrist centre coordinate system. See tooldata . Syntax CTool’(’’)’ A function with a return value of the data type tooldata . Related information For information about See Definition of tools tooldata - Tool data on page 1207 Coordinate systems Technical reference manual - RAPID overview , section Motion and I/O principles - Coordinate Systems
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
815
2 Functions 2.28. CTime - Reads the current time as a string RobotWare-OS 3HAC 16581-1 Revision: J 812 © Copyright 2004-2010 ABB. All rights reserved. 2.28. CTime - Reads the current time as a string Usage CTime is used to read the current system time. This function can be used to present the current time to the operator on the FlexPendant display or to paste the current time into a text file that the program writes to. Basic examples Basic examples of the function CTime are illustrated below. Example 1 VAR string time; time := CTime(); The current time is stored in the variable time. Return value Data type: string The current time in a string. The standard time format is "hours:minutes:seconds", e.g. "18:20:46". More example More examples of the function CTime are illustrated below. Example 1 VAR string time; time := CTime(); TPWrite "The current time is: "+time; Write logfile, time; The current time is written to the FlexPendant display and written into a text file. Syntax CTime ’(’ ’)’ A function with a return value of the type string . Related information For information about See Time and date 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.29. CTool - Reads the current tool data RobotWare - OS 813 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.29. CTool - Reads the current tool data Usage CTool ( Current Tool ) is used to read the data of the current tool. Basic examples Basic examples of the function CTool are illustrated below: Example 1 PERS tooldata temp_tool:= [ TRUE, [ [0, 0, 0], [1, 0, 0 ,0] ], [0.001, [0, 0, 0.001], [1, 0, 0, 0], 0, 0, 0] ]; temp_tool := CTool(); The value of the current tool is stored in the variable temp_tool . Return value Data type: tooldata This function returns a tooldata value holding the value of the current tool, i.e. the tool last used in a movement instruction. The value returned represents the TCP position and orientation in the wrist centre coordinate system. See tooldata . Syntax CTool’(’’)’ A function with a return value of the data type tooldata . Related information For information about See Definition of tools tooldata - Tool data on page 1207 Coordinate systems Technical reference manual - RAPID overview , section Motion and I/O principles - Coordinate Systems 2 Functions 2.30. CWObj - Reads the current work object data RobotWare - OS 3HAC 16581-1 Revision: J 814 © Copyright 2004-2010 ABB. All rights reserved. 2.30. CWObj - Reads the current work object data Usage CWObj ( Current Work Object ) is used to read the data of the current work object. Basic examples Basic examples of the function CWObj are illustrated below. Example 1 PERS wobjdata temp_wobj:= [FALSE, TRUE, "", [[0,0,0], [1,0,0,0]], [[0,0,0], [1,0,0,0]]]; temp_wobj := CWObj(); The value of the current work object is stored in the variable temp_wobj . Return value Data type: wobjdata This function returns a wobjdata value holding the value of the current work object, i.e. the work object last used in a movement instruction. The value returned represents the work object position and orientation in the world coordinate system. See wobjdata . Syntax CWObj’(’’)’ A function with a return value of the data type wobjdata . Related information For information about See 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
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
816
2 Functions 2.29. CTool - Reads the current tool data RobotWare - OS 813 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.29. CTool - Reads the current tool data Usage CTool ( Current Tool ) is used to read the data of the current tool. Basic examples Basic examples of the function CTool are illustrated below: Example 1 PERS tooldata temp_tool:= [ TRUE, [ [0, 0, 0], [1, 0, 0 ,0] ], [0.001, [0, 0, 0.001], [1, 0, 0, 0], 0, 0, 0] ]; temp_tool := CTool(); The value of the current tool is stored in the variable temp_tool . Return value Data type: tooldata This function returns a tooldata value holding the value of the current tool, i.e. the tool last used in a movement instruction. The value returned represents the TCP position and orientation in the wrist centre coordinate system. See tooldata . Syntax CTool’(’’)’ A function with a return value of the data type tooldata . Related information For information about See Definition of tools tooldata - Tool data on page 1207 Coordinate systems Technical reference manual - RAPID overview , section Motion and I/O principles - Coordinate Systems 2 Functions 2.30. CWObj - Reads the current work object data RobotWare - OS 3HAC 16581-1 Revision: J 814 © Copyright 2004-2010 ABB. All rights reserved. 2.30. CWObj - Reads the current work object data Usage CWObj ( Current Work Object ) is used to read the data of the current work object. Basic examples Basic examples of the function CWObj are illustrated below. Example 1 PERS wobjdata temp_wobj:= [FALSE, TRUE, "", [[0,0,0], [1,0,0,0]], [[0,0,0], [1,0,0,0]]]; temp_wobj := CWObj(); The value of the current work object is stored in the variable temp_wobj . Return value Data type: wobjdata This function returns a wobjdata value holding the value of the current work object, i.e. the work object last used in a movement instruction. The value returned represents the work object position and orientation in the world coordinate system. See wobjdata . Syntax CWObj’(’’)’ A function with a return value of the data type wobjdata . Related information For information about See 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 2 Functions 2.31. DecToHex - Convert from decimal to hexadecimal RobotWare - OS 815 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.31. DecToHex - Convert from decimal to hexadecimal Usage DecToHex is used to convert a number specified in a readable string in the base 10 to the base 16. The resulting string is constructed from the character set [0-9,A-F,a-f]. This routine handle numbers from 0 up to 9223372036854775807dec or 7FFFFFFFFFFFFFFF hex. Basic examples Basic examples of the function DecToHex are illustrated below. Example 1 VAR string str; str := DecToHex("99999999"); The variable str is given the value "5F5E0FF" . Return value Data type: string The string converted to a hexadecimal representation of the given number in the inparameter string. Arguments DecToHex ( Str ) Str String Data type: string The string to convert. Syntax DecToHex’(’ [ Str ’:=’ ] <expression ( IN ) of string> ’)’ 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
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
817
2 Functions 2.30. CWObj - Reads the current work object data RobotWare - OS 3HAC 16581-1 Revision: J 814 © Copyright 2004-2010 ABB. All rights reserved. 2.30. CWObj - Reads the current work object data Usage CWObj ( Current Work Object ) is used to read the data of the current work object. Basic examples Basic examples of the function CWObj are illustrated below. Example 1 PERS wobjdata temp_wobj:= [FALSE, TRUE, "", [[0,0,0], [1,0,0,0]], [[0,0,0], [1,0,0,0]]]; temp_wobj := CWObj(); The value of the current work object is stored in the variable temp_wobj . Return value Data type: wobjdata This function returns a wobjdata value holding the value of the current work object, i.e. the work object last used in a movement instruction. The value returned represents the work object position and orientation in the world coordinate system. See wobjdata . Syntax CWObj’(’’)’ A function with a return value of the data type wobjdata . Related information For information about See 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 2 Functions 2.31. DecToHex - Convert from decimal to hexadecimal RobotWare - OS 815 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.31. DecToHex - Convert from decimal to hexadecimal Usage DecToHex is used to convert a number specified in a readable string in the base 10 to the base 16. The resulting string is constructed from the character set [0-9,A-F,a-f]. This routine handle numbers from 0 up to 9223372036854775807dec or 7FFFFFFFFFFFFFFF hex. Basic examples Basic examples of the function DecToHex are illustrated below. Example 1 VAR string str; str := DecToHex("99999999"); The variable str is given the value "5F5E0FF" . Return value Data type: string The string converted to a hexadecimal representation of the given number in the inparameter string. Arguments DecToHex ( Str ) Str String Data type: string The string to convert. Syntax DecToHex’(’ [ Str ’:=’ ] <expression ( IN ) of string> ’)’ 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 2 Functions 2.32. DefAccFrame - Define an accurate frame RobotWare - OS 3HAC 16581-1 Revision: J 816 © Copyright 2004-2010 ABB. All rights reserved. 2.32. DefAccFrame - Define an accurate frame Usage DefAccFrame ( Define Accurate Frame ) is used to define a framed from three to ten original positions and the same number of displaced positions. Description A frame can be defined when a set of targets are known at two different locations. Thus, the same physical positions are used but expressed differently. Consider it in two different approaches: 1. The same physical positions are expressed in relation to different coordinate systems. For example, a number of positions are retrieved from a CAD drawing, thus the positions are expressed in a CAD local coordinate system. The same positions are then expressed in robot world coordinate system. From these two sets of positions the frame between CAD coordinate system and robot world coordinate system is calculated. 2. A number of positions are related to an object in an original position. After a displacement of the object, the positions are determined again (often searched for). From these two sets of positions (old positions, new positions) the displacement frame is calculated. Three targets are enough to define a frame, but to improve accuracy several points should be used. Basic examples Basic examples of the function DefAccFrame are illustrated below. Example 1 xx0500002179 CONST robtarget p1 := [...]; CONST robtarget p2 := [...]; CONST robtarget p3 := [...]; CONST robtarget p4 := [...]; CONST robtarget p5 := [...]; Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
818
2 Functions 2.31. DecToHex - Convert from decimal to hexadecimal RobotWare - OS 815 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.31. DecToHex - Convert from decimal to hexadecimal Usage DecToHex is used to convert a number specified in a readable string in the base 10 to the base 16. The resulting string is constructed from the character set [0-9,A-F,a-f]. This routine handle numbers from 0 up to 9223372036854775807dec or 7FFFFFFFFFFFFFFF hex. Basic examples Basic examples of the function DecToHex are illustrated below. Example 1 VAR string str; str := DecToHex("99999999"); The variable str is given the value "5F5E0FF" . Return value Data type: string The string converted to a hexadecimal representation of the given number in the inparameter string. Arguments DecToHex ( Str ) Str String Data type: string The string to convert. Syntax DecToHex’(’ [ Str ’:=’ ] <expression ( IN ) of string> ’)’ 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 2 Functions 2.32. DefAccFrame - Define an accurate frame RobotWare - OS 3HAC 16581-1 Revision: J 816 © Copyright 2004-2010 ABB. All rights reserved. 2.32. DefAccFrame - Define an accurate frame Usage DefAccFrame ( Define Accurate Frame ) is used to define a framed from three to ten original positions and the same number of displaced positions. Description A frame can be defined when a set of targets are known at two different locations. Thus, the same physical positions are used but expressed differently. Consider it in two different approaches: 1. The same physical positions are expressed in relation to different coordinate systems. For example, a number of positions are retrieved from a CAD drawing, thus the positions are expressed in a CAD local coordinate system. The same positions are then expressed in robot world coordinate system. From these two sets of positions the frame between CAD coordinate system and robot world coordinate system is calculated. 2. A number of positions are related to an object in an original position. After a displacement of the object, the positions are determined again (often searched for). From these two sets of positions (old positions, new positions) the displacement frame is calculated. Three targets are enough to define a frame, but to improve accuracy several points should be used. Basic examples Basic examples of the function DefAccFrame are illustrated below. Example 1 xx0500002179 CONST robtarget p1 := [...]; CONST robtarget p2 := [...]; CONST robtarget p3 := [...]; CONST robtarget p4 := [...]; CONST robtarget p5 := [...]; Continues on next page 2 Functions 2.32. DefAccFrame - Define an accurate frame RobotWare - OS 817 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. VAR robtarget p6 := [...]; VAR robtarget p7 := [...]; VAR robtarget p8 := [...]; VAR robtarget p9 := [...]; VAR robtarget p10 := [...]; VAR robtarget pWCS{5}; VAR robtarget pCAD{5}; VAR pose frame1; VAR num max_err; VAR num mean_err; ! Add positions to robtarget arrays pCAD{1}:=p1; ... pCAD{5}:=p5; pWCS{1}:=p6; ... pWCS{5}:=p10; frame1 := DefAccFrame (pCAD, pWCS, 5, max_err, mean_err); Five positions p1- p5 related to an object have been stored. The five positions are also stored in relation to world coordinate system as p6-p10 . From these 10 positions the frame, frame1 , between the object and the world coordinate system is calculated. The frame will be the CAD frame expressed in the world coordinate system. If the input order of the targetlists is exchanged, i.e. DefAccFrame ( pWCS, pCAD.... ) then the world frame will be expressed in the CAD coordinate system. Return value Data type: pose The calculated TargetListOne frame expressed in the TargetListTwo coordinate system. Arguments DefAccFrame (TargetListOne TargetListTwo TargetsInList MaxErr MeanErr) TargetListOne Data type: robtarget Array of robtargets holding the positions defined in coordinate system one. Minimum number of robtargets is 3, maximum is 10. TargetListTwo Data type: robtarget Array of robtargets holding the positions defined in coordinate system two. Minimum number of robtargets is 3, maximum is 10. 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
819
2 Functions 2.32. DefAccFrame - Define an accurate frame RobotWare - OS 3HAC 16581-1 Revision: J 816 © Copyright 2004-2010 ABB. All rights reserved. 2.32. DefAccFrame - Define an accurate frame Usage DefAccFrame ( Define Accurate Frame ) is used to define a framed from three to ten original positions and the same number of displaced positions. Description A frame can be defined when a set of targets are known at two different locations. Thus, the same physical positions are used but expressed differently. Consider it in two different approaches: 1. The same physical positions are expressed in relation to different coordinate systems. For example, a number of positions are retrieved from a CAD drawing, thus the positions are expressed in a CAD local coordinate system. The same positions are then expressed in robot world coordinate system. From these two sets of positions the frame between CAD coordinate system and robot world coordinate system is calculated. 2. A number of positions are related to an object in an original position. After a displacement of the object, the positions are determined again (often searched for). From these two sets of positions (old positions, new positions) the displacement frame is calculated. Three targets are enough to define a frame, but to improve accuracy several points should be used. Basic examples Basic examples of the function DefAccFrame are illustrated below. Example 1 xx0500002179 CONST robtarget p1 := [...]; CONST robtarget p2 := [...]; CONST robtarget p3 := [...]; CONST robtarget p4 := [...]; CONST robtarget p5 := [...]; Continues on next page 2 Functions 2.32. DefAccFrame - Define an accurate frame RobotWare - OS 817 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. VAR robtarget p6 := [...]; VAR robtarget p7 := [...]; VAR robtarget p8 := [...]; VAR robtarget p9 := [...]; VAR robtarget p10 := [...]; VAR robtarget pWCS{5}; VAR robtarget pCAD{5}; VAR pose frame1; VAR num max_err; VAR num mean_err; ! Add positions to robtarget arrays pCAD{1}:=p1; ... pCAD{5}:=p5; pWCS{1}:=p6; ... pWCS{5}:=p10; frame1 := DefAccFrame (pCAD, pWCS, 5, max_err, mean_err); Five positions p1- p5 related to an object have been stored. The five positions are also stored in relation to world coordinate system as p6-p10 . From these 10 positions the frame, frame1 , between the object and the world coordinate system is calculated. The frame will be the CAD frame expressed in the world coordinate system. If the input order of the targetlists is exchanged, i.e. DefAccFrame ( pWCS, pCAD.... ) then the world frame will be expressed in the CAD coordinate system. Return value Data type: pose The calculated TargetListOne frame expressed in the TargetListTwo coordinate system. Arguments DefAccFrame (TargetListOne TargetListTwo TargetsInList MaxErr MeanErr) TargetListOne Data type: robtarget Array of robtargets holding the positions defined in coordinate system one. Minimum number of robtargets is 3, maximum is 10. TargetListTwo Data type: robtarget Array of robtargets holding the positions defined in coordinate system two. Minimum number of robtargets is 3, maximum is 10. Continued Continues on next page 2 Functions 2.32. DefAccFrame - Define an accurate frame RobotWare - OS 3HAC 16581-1 Revision: J 818 © Copyright 2004-2010 ABB. All rights reserved. TargetsInList Data type: num Number of robtargets in an array. MaxErr Data type: num The estimated maximum error in mm. MeanErr 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 DefAccFrame’(’ [TargetListOne’:=’] <array {*} ( IN ) of robtarget>’ ,’ [TargetListTwo’ :=’] <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 Calculating a frame from three positions DefFrame - Define a frame on page 822 Calculate a frame from 6 positions DefDFrame - Define a displacement frame on page 819 Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
820
2 Functions 2.32. DefAccFrame - Define an accurate frame RobotWare - OS 817 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. VAR robtarget p6 := [...]; VAR robtarget p7 := [...]; VAR robtarget p8 := [...]; VAR robtarget p9 := [...]; VAR robtarget p10 := [...]; VAR robtarget pWCS{5}; VAR robtarget pCAD{5}; VAR pose frame1; VAR num max_err; VAR num mean_err; ! Add positions to robtarget arrays pCAD{1}:=p1; ... pCAD{5}:=p5; pWCS{1}:=p6; ... pWCS{5}:=p10; frame1 := DefAccFrame (pCAD, pWCS, 5, max_err, mean_err); Five positions p1- p5 related to an object have been stored. The five positions are also stored in relation to world coordinate system as p6-p10 . From these 10 positions the frame, frame1 , between the object and the world coordinate system is calculated. The frame will be the CAD frame expressed in the world coordinate system. If the input order of the targetlists is exchanged, i.e. DefAccFrame ( pWCS, pCAD.... ) then the world frame will be expressed in the CAD coordinate system. Return value Data type: pose The calculated TargetListOne frame expressed in the TargetListTwo coordinate system. Arguments DefAccFrame (TargetListOne TargetListTwo TargetsInList MaxErr MeanErr) TargetListOne Data type: robtarget Array of robtargets holding the positions defined in coordinate system one. Minimum number of robtargets is 3, maximum is 10. TargetListTwo Data type: robtarget Array of robtargets holding the positions defined in coordinate system two. Minimum number of robtargets is 3, maximum is 10. Continued Continues on next page 2 Functions 2.32. DefAccFrame - Define an accurate frame RobotWare - OS 3HAC 16581-1 Revision: J 818 © Copyright 2004-2010 ABB. All rights reserved. TargetsInList Data type: num Number of robtargets in an array. MaxErr Data type: num The estimated maximum error in mm. MeanErr 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 DefAccFrame’(’ [TargetListOne’:=’] <array {*} ( IN ) of robtarget>’ ,’ [TargetListTwo’ :=’] <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 Calculating a frame from three positions DefFrame - Define a frame on page 822 Calculate a frame from 6 positions DefDFrame - Define a displacement frame on page 819 Continued 2 Functions 2.33. DefDFrame - Define a displacement frame RobotWare - OS 819 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.33. DefDFrame - Define a displacement frame Usage DefDFrame ( Define Displacement Frame ) is used to calculate a displacement frame from three original positions and three displaced positions. Basic examples Basic examples of the function DefDFrame are illustrated below. Example 1 xx0500002177 CONST robtarget p1 := [...]; CONST robtarget p2 := [...]; CONST robtarget p3 := [...]; VAR robtarget p4; VAR robtarget p5; VAR robtarget p6; VAR pose frame1; ... !Search for the new positions SearchL sen1, p4, *, v50, tool1; ... SearchL sen1, p5, *, v50, tool1; ... SearchL sen1, p6, *, v50, tool1; frame1 := DefDframe (p1, p2, p3, p4, p5, p6); ... !Activation of the displacement defined by frame1 PDispSet frame1; Three positions p1-p3 related to an object in an original position have been stored. After a displacement of the object, three new positions are searched for and stored as p4-p6 . The displacement frame is calculated from these six positions. Then the calculated frame is used to displace all the stored positions in the program. Return value Data type: pose The displacement frame. Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
821
2 Functions 2.32. DefAccFrame - Define an accurate frame RobotWare - OS 3HAC 16581-1 Revision: J 818 © Copyright 2004-2010 ABB. All rights reserved. TargetsInList Data type: num Number of robtargets in an array. MaxErr Data type: num The estimated maximum error in mm. MeanErr 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 DefAccFrame’(’ [TargetListOne’:=’] <array {*} ( IN ) of robtarget>’ ,’ [TargetListTwo’ :=’] <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 Calculating a frame from three positions DefFrame - Define a frame on page 822 Calculate a frame from 6 positions DefDFrame - Define a displacement frame on page 819 Continued 2 Functions 2.33. DefDFrame - Define a displacement frame RobotWare - OS 819 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.33. DefDFrame - Define a displacement frame Usage DefDFrame ( Define Displacement Frame ) is used to calculate a displacement frame from three original positions and three displaced positions. Basic examples Basic examples of the function DefDFrame are illustrated below. Example 1 xx0500002177 CONST robtarget p1 := [...]; CONST robtarget p2 := [...]; CONST robtarget p3 := [...]; VAR robtarget p4; VAR robtarget p5; VAR robtarget p6; VAR pose frame1; ... !Search for the new positions SearchL sen1, p4, *, v50, tool1; ... SearchL sen1, p5, *, v50, tool1; ... SearchL sen1, p6, *, v50, tool1; frame1 := DefDframe (p1, p2, p3, p4, p5, p6); ... !Activation of the displacement defined by frame1 PDispSet frame1; Three positions p1-p3 related to an object in an original position have been stored. After a displacement of the object, three new positions are searched for and stored as p4-p6 . The displacement frame is calculated from these six positions. Then the calculated frame is used to displace all the stored positions in the program. Return value Data type: pose The displacement frame. Continues on next page 2 Functions 2.33. DefDFrame - Define a displacement frame RobotWare - OS 3HAC 16581-1 Revision: J 820 © Copyright 2004-2010 ABB. All rights reserved. Arguments DefDFrame (OldP1 OldP2 OldP3 NewP1 NewP2 NewP3) OldP1 Data type: robtarget The first original position. OldP2 Data type: robtarget The second original position. OldP3 Data type: robtarget The third original position. NewP1 Data type: robtarget The first displaced position. The difference between OldP1 and NewP1 will define the translation part of the frame and must be measured and determined with great accuracy. NewP2 Data type: robtarget The second displaced position. The line NewP1 ... NewP2 will define the rotation of the old line OldP1 ... OldP2 . NewP3 Data type: robtarget The third displaced position. This position will define the rotation of the plane, e.g. it should be placed on the new plane of NewP1 , NewP2 , and NewP3 . Error handling If it is not possible to calculate the frame because of bad accuracy in the positions then the system variable ERRNO is set to ERR_FRAME . This error can then be handled in the error handler. Syntax DefDFrame’(’ [OldP1 ’:=’] <expression ( IN ) of robtarget>’ ,’ [OldP2 ’:=’] <expression ( IN ) of robtarget> ’,’ [OldP3 ’:=’] <expression ( IN ) of robtarget> ’,’ [NewP1 ’:=’] <expression ( IN ) of robtarget> ’,’ [NewP2 ’:=’] <expression ( IN ) of robtarget> ’,’ [NewP3 ’:=’] <expression ( IN ) of robtarget> ’)’ A function with a return value of the data type pose . 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
822
2 Functions 2.33. DefDFrame - Define a displacement frame RobotWare - OS 819 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.33. DefDFrame - Define a displacement frame Usage DefDFrame ( Define Displacement Frame ) is used to calculate a displacement frame from three original positions and three displaced positions. Basic examples Basic examples of the function DefDFrame are illustrated below. Example 1 xx0500002177 CONST robtarget p1 := [...]; CONST robtarget p2 := [...]; CONST robtarget p3 := [...]; VAR robtarget p4; VAR robtarget p5; VAR robtarget p6; VAR pose frame1; ... !Search for the new positions SearchL sen1, p4, *, v50, tool1; ... SearchL sen1, p5, *, v50, tool1; ... SearchL sen1, p6, *, v50, tool1; frame1 := DefDframe (p1, p2, p3, p4, p5, p6); ... !Activation of the displacement defined by frame1 PDispSet frame1; Three positions p1-p3 related to an object in an original position have been stored. After a displacement of the object, three new positions are searched for and stored as p4-p6 . The displacement frame is calculated from these six positions. Then the calculated frame is used to displace all the stored positions in the program. Return value Data type: pose The displacement frame. Continues on next page 2 Functions 2.33. DefDFrame - Define a displacement frame RobotWare - OS 3HAC 16581-1 Revision: J 820 © Copyright 2004-2010 ABB. All rights reserved. Arguments DefDFrame (OldP1 OldP2 OldP3 NewP1 NewP2 NewP3) OldP1 Data type: robtarget The first original position. OldP2 Data type: robtarget The second original position. OldP3 Data type: robtarget The third original position. NewP1 Data type: robtarget The first displaced position. The difference between OldP1 and NewP1 will define the translation part of the frame and must be measured and determined with great accuracy. NewP2 Data type: robtarget The second displaced position. The line NewP1 ... NewP2 will define the rotation of the old line OldP1 ... OldP2 . NewP3 Data type: robtarget The third displaced position. This position will define the rotation of the plane, e.g. it should be placed on the new plane of NewP1 , NewP2 , and NewP3 . Error handling If it is not possible to calculate the frame because of bad accuracy in the positions then the system variable ERRNO is set to ERR_FRAME . This error can then be handled in the error handler. Syntax DefDFrame’(’ [OldP1 ’:=’] <expression ( IN ) of robtarget>’ ,’ [OldP2 ’:=’] <expression ( IN ) of robtarget> ’,’ [OldP3 ’:=’] <expression ( IN ) of robtarget> ’,’ [NewP1 ’:=’] <expression ( IN ) of robtarget> ’,’ [NewP2 ’:=’] <expression ( IN ) of robtarget> ’,’ [NewP3 ’:=’] <expression ( IN ) of robtarget> ’)’ A function with a return value of the data type pose . Continued Continues on next page 2 Functions 2.33. DefDFrame - Define a displacement frame RobotWare - OS 821 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Activation of displacement frame PDispSet - Activates program displacement using known frame on page 321 Manual definition of displacement frame Operating manual - IRC5 with FlexPendant , section Calibrating Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
823
2 Functions 2.33. DefDFrame - Define a displacement frame RobotWare - OS 3HAC 16581-1 Revision: J 820 © Copyright 2004-2010 ABB. All rights reserved. Arguments DefDFrame (OldP1 OldP2 OldP3 NewP1 NewP2 NewP3) OldP1 Data type: robtarget The first original position. OldP2 Data type: robtarget The second original position. OldP3 Data type: robtarget The third original position. NewP1 Data type: robtarget The first displaced position. The difference between OldP1 and NewP1 will define the translation part of the frame and must be measured and determined with great accuracy. NewP2 Data type: robtarget The second displaced position. The line NewP1 ... NewP2 will define the rotation of the old line OldP1 ... OldP2 . NewP3 Data type: robtarget The third displaced position. This position will define the rotation of the plane, e.g. it should be placed on the new plane of NewP1 , NewP2 , and NewP3 . Error handling If it is not possible to calculate the frame because of bad accuracy in the positions then the system variable ERRNO is set to ERR_FRAME . This error can then be handled in the error handler. Syntax DefDFrame’(’ [OldP1 ’:=’] <expression ( IN ) of robtarget>’ ,’ [OldP2 ’:=’] <expression ( IN ) of robtarget> ’,’ [OldP3 ’:=’] <expression ( IN ) of robtarget> ’,’ [NewP1 ’:=’] <expression ( IN ) of robtarget> ’,’ [NewP2 ’:=’] <expression ( IN ) of robtarget> ’,’ [NewP3 ’:=’] <expression ( IN ) of robtarget> ’)’ A function with a return value of the data type pose . Continued Continues on next page 2 Functions 2.33. DefDFrame - Define a displacement frame RobotWare - OS 821 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Activation of displacement frame PDispSet - Activates program displacement using known frame on page 321 Manual definition of displacement frame Operating manual - IRC5 with FlexPendant , section Calibrating Continued 2 Functions 2.34. DefFrame - Define a frame RobotWare - OS 3HAC 16581-1 Revision: J 822 © Copyright 2004-2010 ABB. All rights reserved. 2.34. DefFrame - Define a frame Usage DefFrame ( Define Frame ) is used to calculate a frame, from three positions defining the frame. Basic examples Basic examples of the function DefFrame are illustrated below. Example 1 xx0500002181 Three positions, p1- p3 related to the object coordinate system are used to define the new coordinate system, frame1 . The first position, p1 , is defining the origin of the new coordinate system. The second position, p2 , is defining the direction of the x-axis. The third position, p3 , is defining the location of the xy-plane. The defined frame1 may be used as a displacement frame, as shown in the example below: CONST robtarget p1 := [...]; CONST robtarget p2 := [...]; CONST robtarget p3 := [...]; VAR pose frame1; ... ... frame1 := DefFrame (p1, p2, p3); ... ... !Activation of the displacement defined by frame1 PDispSet frame1; Return value Data type: pose The calculated frame. The calculation is related to the active object coordinate system. Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
824
2 Functions 2.33. DefDFrame - Define a displacement frame RobotWare - OS 821 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Activation of displacement frame PDispSet - Activates program displacement using known frame on page 321 Manual definition of displacement frame Operating manual - IRC5 with FlexPendant , section Calibrating Continued 2 Functions 2.34. DefFrame - Define a frame RobotWare - OS 3HAC 16581-1 Revision: J 822 © Copyright 2004-2010 ABB. All rights reserved. 2.34. DefFrame - Define a frame Usage DefFrame ( Define Frame ) is used to calculate a frame, from three positions defining the frame. Basic examples Basic examples of the function DefFrame are illustrated below. Example 1 xx0500002181 Three positions, p1- p3 related to the object coordinate system are used to define the new coordinate system, frame1 . The first position, p1 , is defining the origin of the new coordinate system. The second position, p2 , is defining the direction of the x-axis. The third position, p3 , is defining the location of the xy-plane. The defined frame1 may be used as a displacement frame, as shown in the example below: CONST robtarget p1 := [...]; CONST robtarget p2 := [...]; CONST robtarget p3 := [...]; VAR pose frame1; ... ... frame1 := DefFrame (p1, p2, p3); ... ... !Activation of the displacement defined by frame1 PDispSet frame1; Return value Data type: pose The calculated frame. The calculation is related to the active object coordinate system. Continues on next page 2 Functions 2.34. DefFrame - Define a frame RobotWare - OS 823 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Arguments DefFrame (NewP1 NewP2 NewP3 [\Origin]) NewP1 Data type: robtarget The first position, which will define the origin of the new coordinate system. NewP2 Data type: robtarget The second position, which will define the direction of the x-axis of the new coordinate frame. NewP3 Data type: robtarget The third position, which will define the xy-plane of the new coordinate system. The position of point 3 will be on the positive y side, see the figure above. [\Origin] Data type: num Optional argument, which will define how the origin of the new coordinate system will be placed. Origin = 1 means that the origin is placed in NewP1 , i.e. the same as if this argument is omitted. Origin = 2 means that the origin is placed in NewP2 . See the figure below. xx0500002178 Origin = 3 means that the origin is placed on the line going through NewP1 and NewP2 and so that NewP3 will be placed on the y axis. See the figure below. xx0500002180 Other values, or if Origin is omitted, will place the origin in NewP1 . 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
825
2 Functions 2.34. DefFrame - Define a frame RobotWare - OS 3HAC 16581-1 Revision: J 822 © Copyright 2004-2010 ABB. All rights reserved. 2.34. DefFrame - Define a frame Usage DefFrame ( Define Frame ) is used to calculate a frame, from three positions defining the frame. Basic examples Basic examples of the function DefFrame are illustrated below. Example 1 xx0500002181 Three positions, p1- p3 related to the object coordinate system are used to define the new coordinate system, frame1 . The first position, p1 , is defining the origin of the new coordinate system. The second position, p2 , is defining the direction of the x-axis. The third position, p3 , is defining the location of the xy-plane. The defined frame1 may be used as a displacement frame, as shown in the example below: CONST robtarget p1 := [...]; CONST robtarget p2 := [...]; CONST robtarget p3 := [...]; VAR pose frame1; ... ... frame1 := DefFrame (p1, p2, p3); ... ... !Activation of the displacement defined by frame1 PDispSet frame1; Return value Data type: pose The calculated frame. The calculation is related to the active object coordinate system. Continues on next page 2 Functions 2.34. DefFrame - Define a frame RobotWare - OS 823 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Arguments DefFrame (NewP1 NewP2 NewP3 [\Origin]) NewP1 Data type: robtarget The first position, which will define the origin of the new coordinate system. NewP2 Data type: robtarget The second position, which will define the direction of the x-axis of the new coordinate frame. NewP3 Data type: robtarget The third position, which will define the xy-plane of the new coordinate system. The position of point 3 will be on the positive y side, see the figure above. [\Origin] Data type: num Optional argument, which will define how the origin of the new coordinate system will be placed. Origin = 1 means that the origin is placed in NewP1 , i.e. the same as if this argument is omitted. Origin = 2 means that the origin is placed in NewP2 . See the figure below. xx0500002178 Origin = 3 means that the origin is placed on the line going through NewP1 and NewP2 and so that NewP3 will be placed on the y axis. See the figure below. xx0500002180 Other values, or if Origin is omitted, will place the origin in NewP1 . Continued Continues on next page 2 Functions 2.34. DefFrame - Define a frame RobotWare - OS 3HAC 16581-1 Revision: J 824 © Copyright 2004-2010 ABB. All rights reserved. Error handling If the frame cannot be calculated because of the below limitations then the system variable ERRNO is set to ERR_FRAME . This error can then be handled in the error handler. Limitations The three positions p1 - p3 , defining the frame, must define a well shaped triangle. The most well shaped triangle is the one with all sides of equal length. xx0500002182 The triangle is not considered to be well shaped if the angle α is too small. The angle α is too small if: |cos α | < 1 - 10 -4 The triangle p1 , p2 , p3 must not be too small, i.e. the positions cannot be too close. The distances between the positions p1 - p2 and p1 - p3 must not be less than 0.1 mm. Syntax DefFrame’(’ [NewP1 ’:=’] <expression ( IN ) of robtarget>’ ,’ [NewP2 ’:=’] <expression ( IN ) of robtarget> ’,’ [NewP3 ’:=’] <expression ( IN ) of robtarget> [’\’Origin’:=’ <expression ( IN ) 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 Activation of displacement frame PDispSet - Activates program displacement using known frame on page 321 Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
826
2 Functions 2.34. DefFrame - Define a frame RobotWare - OS 823 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Arguments DefFrame (NewP1 NewP2 NewP3 [\Origin]) NewP1 Data type: robtarget The first position, which will define the origin of the new coordinate system. NewP2 Data type: robtarget The second position, which will define the direction of the x-axis of the new coordinate frame. NewP3 Data type: robtarget The third position, which will define the xy-plane of the new coordinate system. The position of point 3 will be on the positive y side, see the figure above. [\Origin] Data type: num Optional argument, which will define how the origin of the new coordinate system will be placed. Origin = 1 means that the origin is placed in NewP1 , i.e. the same as if this argument is omitted. Origin = 2 means that the origin is placed in NewP2 . See the figure below. xx0500002178 Origin = 3 means that the origin is placed on the line going through NewP1 and NewP2 and so that NewP3 will be placed on the y axis. See the figure below. xx0500002180 Other values, or if Origin is omitted, will place the origin in NewP1 . Continued Continues on next page 2 Functions 2.34. DefFrame - Define a frame RobotWare - OS 3HAC 16581-1 Revision: J 824 © Copyright 2004-2010 ABB. All rights reserved. Error handling If the frame cannot be calculated because of the below limitations then the system variable ERRNO is set to ERR_FRAME . This error can then be handled in the error handler. Limitations The three positions p1 - p3 , defining the frame, must define a well shaped triangle. The most well shaped triangle is the one with all sides of equal length. xx0500002182 The triangle is not considered to be well shaped if the angle α is too small. The angle α is too small if: |cos α | < 1 - 10 -4 The triangle p1 , p2 , p3 must not be too small, i.e. the positions cannot be too close. The distances between the positions p1 - p2 and p1 - p3 must not be less than 0.1 mm. Syntax DefFrame’(’ [NewP1 ’:=’] <expression ( IN ) of robtarget>’ ,’ [NewP2 ’:=’] <expression ( IN ) of robtarget> ’,’ [NewP3 ’:=’] <expression ( IN ) of robtarget> [’\’Origin’:=’ <expression ( IN ) 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 Activation of displacement frame PDispSet - Activates program displacement using known frame on page 321 Continued 2 Functions 2.35. Dim - Obtains the size of an array RobotWare - OS 825 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.35. Dim - Obtains the size of an array Usage Dim ( Dimension ) is used to obtain the number of elements in an array. Basic examples Basic examples of the function Dim are illustrated below. See also More examples on page 826 . Example 1 PROC arrmul(VAR num array{*}, num factor) FOR index FROM 1 TO Dim(array, 1) DO array{index} := array{index} * factor; ENDFOR ENDPROC All elements of a num array are multiplied by a factor. This procedure can take any one- dimensional array of data type num as an input. Return value Data type: num The number of array elements of the specified dimension. Arguments Dim (ArrPar DimNo) ArrPar Array Parameter Data type: Any type The name of the array. DimNo Dimension Number Data type: num The desired array dimension: 1 = first dimension 2 = second dimension 3 = third dimension Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
827
2 Functions 2.34. DefFrame - Define a frame RobotWare - OS 3HAC 16581-1 Revision: J 824 © Copyright 2004-2010 ABB. All rights reserved. Error handling If the frame cannot be calculated because of the below limitations then the system variable ERRNO is set to ERR_FRAME . This error can then be handled in the error handler. Limitations The three positions p1 - p3 , defining the frame, must define a well shaped triangle. The most well shaped triangle is the one with all sides of equal length. xx0500002182 The triangle is not considered to be well shaped if the angle α is too small. The angle α is too small if: |cos α | < 1 - 10 -4 The triangle p1 , p2 , p3 must not be too small, i.e. the positions cannot be too close. The distances between the positions p1 - p2 and p1 - p3 must not be less than 0.1 mm. Syntax DefFrame’(’ [NewP1 ’:=’] <expression ( IN ) of robtarget>’ ,’ [NewP2 ’:=’] <expression ( IN ) of robtarget> ’,’ [NewP3 ’:=’] <expression ( IN ) of robtarget> [’\’Origin’:=’ <expression ( IN ) 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 Activation of displacement frame PDispSet - Activates program displacement using known frame on page 321 Continued 2 Functions 2.35. Dim - Obtains the size of an array RobotWare - OS 825 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.35. Dim - Obtains the size of an array Usage Dim ( Dimension ) is used to obtain the number of elements in an array. Basic examples Basic examples of the function Dim are illustrated below. See also More examples on page 826 . Example 1 PROC arrmul(VAR num array{*}, num factor) FOR index FROM 1 TO Dim(array, 1) DO array{index} := array{index} * factor; ENDFOR ENDPROC All elements of a num array are multiplied by a factor. This procedure can take any one- dimensional array of data type num as an input. Return value Data type: num The number of array elements of the specified dimension. Arguments Dim (ArrPar DimNo) ArrPar Array Parameter Data type: Any type The name of the array. DimNo Dimension Number Data type: num The desired array dimension: 1 = first dimension 2 = second dimension 3 = third dimension Continues on next page 2 Functions 2.35. Dim - Obtains the size of an array RobotWare - OS 3HAC 16581-1 Revision: J 826 © Copyright 2004-2010 ABB. All rights reserved. More examples More examples of how to use the function Dim are illustrated below. Example 1 PROC add_matrix(VAR num array1{*,*,*}, num array2{*,*,*}) IF Dim(array1,1) <> Dim(array2,1) OR Dim(array1,2) <> Dim(array2,2) OR Dim(array1,3) <> Dim(array2,3) THEN TPWrite "The size of the matrices are not the same"; Stop; ELSE FOR i1 FROM 1 TO Dim(array1, 1) DO FOR i2 FROM 1 TO Dim(array1, 2) DO FOR i3 FROM 1 TO Dim(array1, 3) DO array1{i1,i2,i3} := array1{i1,i2,i3} + array2{i1,i2,i3}; ENDFOR ENDFOR ENDFOR ENDIF RETURN; ENDPROC Two matrices are added. If the size of the matrices differs then the program stops and an error message appears. This procedure can take any three-dimensional array of data type num as an input. Syntax Dim ’(’ [ArrPar’:=’] <reference ( REF ) of any type> ’,’ [DimNo’:=’] <expression ( IN ) of num> ’)’ A REF parameter requires that the corresponding argument be either a constant, a variable, or an entire persistent. The argument could also be an IN parameter, a VAR parameter, or an entire PERS parameter. A function with a return value of the data type num . Related information For information about See Array parameters Technical reference manual - RAPID overview , section Basic characteristics - Routines Array declaration Technical reference manual - RAPID overview , section Basic characteristics - Data Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
828
2 Functions 2.35. Dim - Obtains the size of an array RobotWare - OS 825 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.35. Dim - Obtains the size of an array Usage Dim ( Dimension ) is used to obtain the number of elements in an array. Basic examples Basic examples of the function Dim are illustrated below. See also More examples on page 826 . Example 1 PROC arrmul(VAR num array{*}, num factor) FOR index FROM 1 TO Dim(array, 1) DO array{index} := array{index} * factor; ENDFOR ENDPROC All elements of a num array are multiplied by a factor. This procedure can take any one- dimensional array of data type num as an input. Return value Data type: num The number of array elements of the specified dimension. Arguments Dim (ArrPar DimNo) ArrPar Array Parameter Data type: Any type The name of the array. DimNo Dimension Number Data type: num The desired array dimension: 1 = first dimension 2 = second dimension 3 = third dimension Continues on next page 2 Functions 2.35. Dim - Obtains the size of an array RobotWare - OS 3HAC 16581-1 Revision: J 826 © Copyright 2004-2010 ABB. All rights reserved. More examples More examples of how to use the function Dim are illustrated below. Example 1 PROC add_matrix(VAR num array1{*,*,*}, num array2{*,*,*}) IF Dim(array1,1) <> Dim(array2,1) OR Dim(array1,2) <> Dim(array2,2) OR Dim(array1,3) <> Dim(array2,3) THEN TPWrite "The size of the matrices are not the same"; Stop; ELSE FOR i1 FROM 1 TO Dim(array1, 1) DO FOR i2 FROM 1 TO Dim(array1, 2) DO FOR i3 FROM 1 TO Dim(array1, 3) DO array1{i1,i2,i3} := array1{i1,i2,i3} + array2{i1,i2,i3}; ENDFOR ENDFOR ENDFOR ENDIF RETURN; ENDPROC Two matrices are added. If the size of the matrices differs then the program stops and an error message appears. This procedure can take any three-dimensional array of data type num as an input. Syntax Dim ’(’ [ArrPar’:=’] <reference ( REF ) of any type> ’,’ [DimNo’:=’] <expression ( IN ) of num> ’)’ A REF parameter requires that the corresponding argument be either a constant, a variable, or an entire persistent. The argument could also be an IN parameter, a VAR parameter, or an entire PERS parameter. A function with a return value of the data type num . Related information For information about See Array parameters Technical reference manual - RAPID overview , section Basic characteristics - Routines Array declaration Technical reference manual - RAPID overview , section Basic characteristics - Data Continued 2 Functions 2.36. Distance - Distance between two points RobotWare - OS 827 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.36. Distance - Distance between two points Usage Distance is used to calculate the distance between two points in the space. Basic examples Basic examples of the function Distance are illustrated below. Example 1 xx0500002321 VAR num dist; CONST pos p1 := [4,0,4]; CONST pos p2 := [-4,4,4]; ... dist := Distance(p1, p2); The distance in space between the points p1 and p2 is calculated and stored in the variable dist . Return value Data type: num The distance (always positive) in mm between the points. Arguments Distance (Point1 Point2) Point1 Data type: pos The first point described by the pos data type. Point2 Data type: pos The second point described by the pos data type. Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
829
2 Functions 2.35. Dim - Obtains the size of an array RobotWare - OS 3HAC 16581-1 Revision: J 826 © Copyright 2004-2010 ABB. All rights reserved. More examples More examples of how to use the function Dim are illustrated below. Example 1 PROC add_matrix(VAR num array1{*,*,*}, num array2{*,*,*}) IF Dim(array1,1) <> Dim(array2,1) OR Dim(array1,2) <> Dim(array2,2) OR Dim(array1,3) <> Dim(array2,3) THEN TPWrite "The size of the matrices are not the same"; Stop; ELSE FOR i1 FROM 1 TO Dim(array1, 1) DO FOR i2 FROM 1 TO Dim(array1, 2) DO FOR i3 FROM 1 TO Dim(array1, 3) DO array1{i1,i2,i3} := array1{i1,i2,i3} + array2{i1,i2,i3}; ENDFOR ENDFOR ENDFOR ENDIF RETURN; ENDPROC Two matrices are added. If the size of the matrices differs then the program stops and an error message appears. This procedure can take any three-dimensional array of data type num as an input. Syntax Dim ’(’ [ArrPar’:=’] <reference ( REF ) of any type> ’,’ [DimNo’:=’] <expression ( IN ) of num> ’)’ A REF parameter requires that the corresponding argument be either a constant, a variable, or an entire persistent. The argument could also be an IN parameter, a VAR parameter, or an entire PERS parameter. A function with a return value of the data type num . Related information For information about See Array parameters Technical reference manual - RAPID overview , section Basic characteristics - Routines Array declaration Technical reference manual - RAPID overview , section Basic characteristics - Data Continued 2 Functions 2.36. Distance - Distance between two points RobotWare - OS 827 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.36. Distance - Distance between two points Usage Distance is used to calculate the distance between two points in the space. Basic examples Basic examples of the function Distance are illustrated below. Example 1 xx0500002321 VAR num dist; CONST pos p1 := [4,0,4]; CONST pos p2 := [-4,4,4]; ... dist := Distance(p1, p2); The distance in space between the points p1 and p2 is calculated and stored in the variable dist . Return value Data type: num The distance (always positive) in mm between the points. Arguments Distance (Point1 Point2) Point1 Data type: pos The first point described by the pos data type. Point2 Data type: pos The second point described by the pos data type. Continues on next page 2 Functions 2.36. Distance - Distance between two points RobotWare - OS 3HAC 16581-1 Revision: J 828 © Copyright 2004-2010 ABB. All rights reserved. Program execution Calculation of the distance between the two points: xx0500002322 xx0500002323 Syntax Distance’(’ [Point1 ’:=’] <expression ( IN ) of pos> ’,’ [Point2 ’:=’] <expression ( IN ) of pos> ’)’ 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 Definition of pos pos - Positions (only X, Y and Z) on page 1160 Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
830
2 Functions 2.36. Distance - Distance between two points RobotWare - OS 827 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.36. Distance - Distance between two points Usage Distance is used to calculate the distance between two points in the space. Basic examples Basic examples of the function Distance are illustrated below. Example 1 xx0500002321 VAR num dist; CONST pos p1 := [4,0,4]; CONST pos p2 := [-4,4,4]; ... dist := Distance(p1, p2); The distance in space between the points p1 and p2 is calculated and stored in the variable dist . Return value Data type: num The distance (always positive) in mm between the points. Arguments Distance (Point1 Point2) Point1 Data type: pos The first point described by the pos data type. Point2 Data type: pos The second point described by the pos data type. Continues on next page 2 Functions 2.36. Distance - Distance between two points RobotWare - OS 3HAC 16581-1 Revision: J 828 © Copyright 2004-2010 ABB. All rights reserved. Program execution Calculation of the distance between the two points: xx0500002322 xx0500002323 Syntax Distance’(’ [Point1 ’:=’] <expression ( IN ) of pos> ’,’ [Point2 ’:=’] <expression ( IN ) of pos> ’)’ 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 Definition of pos pos - Positions (only X, Y and Z) on page 1160 Continued 2 Functions 2.37. DnumToNum - Converts dnum to num RobotWare - OS 829 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.37. DnumToNum - Converts dnum to num Usage DnumToNum converts a dnum to a num if possible, otherwise it generates a recoverable error. Basic examples A basic example of the function DnumToNum is illustrated below. Example 1 VAR num mynum:=0; VAR dnum mydnum:=8388607; VAR dnum testFloat:=8388609; VAR dnum anotherdnum:=4294967295; ! Works OK mynum:=DnumToNum(mydnum); ! Accept floating point value mynum:=DnumToNum(testFloat); ! Cause error recovery error mynum:=DnumToNum(anotherdnum \Integer); The dnum value 8388607 is returned by the function as the num value 8388607. The dnum value 8388609 is returned by the function as the num value 8.38861E+06 . The dnum value 4294967295 generates the recoverable error ERR_ARGVALERR . Return value Data type: num The input dnum value can be in the range -8388607 to 8388608 and return the same value as a num . If the \Integer switch is not used, the input dnum value can be in the range - 3.40282347E+38 to 3.40282347E+38 and the return value might become a floating point value. Arguments DnumToNum (Value [\Integer]) Value Data type: dnum The numeric value to be converted. [\Integer] Data type: switch Only integer values If switch \Integer is not used, an down cast is made even if the value becomes a floating point value. If it is not used, a check is made whether the value is an integer between -8388607 to 8388608. If it is not, a recoverable error is generated. Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
831
2 Functions 2.36. Distance - Distance between two points RobotWare - OS 3HAC 16581-1 Revision: J 828 © Copyright 2004-2010 ABB. All rights reserved. Program execution Calculation of the distance between the two points: xx0500002322 xx0500002323 Syntax Distance’(’ [Point1 ’:=’] <expression ( IN ) of pos> ’,’ [Point2 ’:=’] <expression ( IN ) of pos> ’)’ 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 Definition of pos pos - Positions (only X, Y and Z) on page 1160 Continued 2 Functions 2.37. DnumToNum - Converts dnum to num RobotWare - OS 829 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.37. DnumToNum - Converts dnum to num Usage DnumToNum converts a dnum to a num if possible, otherwise it generates a recoverable error. Basic examples A basic example of the function DnumToNum is illustrated below. Example 1 VAR num mynum:=0; VAR dnum mydnum:=8388607; VAR dnum testFloat:=8388609; VAR dnum anotherdnum:=4294967295; ! Works OK mynum:=DnumToNum(mydnum); ! Accept floating point value mynum:=DnumToNum(testFloat); ! Cause error recovery error mynum:=DnumToNum(anotherdnum \Integer); The dnum value 8388607 is returned by the function as the num value 8388607. The dnum value 8388609 is returned by the function as the num value 8.38861E+06 . The dnum value 4294967295 generates the recoverable error ERR_ARGVALERR . Return value Data type: num The input dnum value can be in the range -8388607 to 8388608 and return the same value as a num . If the \Integer switch is not used, the input dnum value can be in the range - 3.40282347E+38 to 3.40282347E+38 and the return value might become a floating point value. Arguments DnumToNum (Value [\Integer]) Value Data type: dnum The numeric value to be converted. [\Integer] Data type: switch Only integer values If switch \Integer is not used, an down cast is made even if the value becomes a floating point value. If it is not used, a check is made whether the value is an integer between -8388607 to 8388608. If it is not, a recoverable error is generated. Continues on next page 2 Functions 2.37. DnumToNum - Converts dnum to num RobotWare - OS 3HAC 16581-1 Revision: J 830 © Copyright 2004-2010 ABB. All rights reserved. Error handling The following recoverable errors can be generated. The errors can be handled in an error handler. The system variable ERRNO will be set to: Syntax DnumToNum [ Value ’:=’ ] < expression ( IN ) of dnum > [\ Integer]’ ;’ A function with a return value of the data type num . Related information Error code Description ERR_ARGVALERR Value is above 8388608 or below -8388607 or not an integer (if optional argument Integer is used) ERR_NUM_LIMIT Value is above 3.40282347E+38 or below -3.40282347E+38 ERR_INT_NOTVAL Value is not an integer For information about See Dnum data type dnum - Double numeric values on page 1104 . Num data type num - Numeric values on page 1146 . Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
832
2 Functions 2.37. DnumToNum - Converts dnum to num RobotWare - OS 829 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.37. DnumToNum - Converts dnum to num Usage DnumToNum converts a dnum to a num if possible, otherwise it generates a recoverable error. Basic examples A basic example of the function DnumToNum is illustrated below. Example 1 VAR num mynum:=0; VAR dnum mydnum:=8388607; VAR dnum testFloat:=8388609; VAR dnum anotherdnum:=4294967295; ! Works OK mynum:=DnumToNum(mydnum); ! Accept floating point value mynum:=DnumToNum(testFloat); ! Cause error recovery error mynum:=DnumToNum(anotherdnum \Integer); The dnum value 8388607 is returned by the function as the num value 8388607. The dnum value 8388609 is returned by the function as the num value 8.38861E+06 . The dnum value 4294967295 generates the recoverable error ERR_ARGVALERR . Return value Data type: num The input dnum value can be in the range -8388607 to 8388608 and return the same value as a num . If the \Integer switch is not used, the input dnum value can be in the range - 3.40282347E+38 to 3.40282347E+38 and the return value might become a floating point value. Arguments DnumToNum (Value [\Integer]) Value Data type: dnum The numeric value to be converted. [\Integer] Data type: switch Only integer values If switch \Integer is not used, an down cast is made even if the value becomes a floating point value. If it is not used, a check is made whether the value is an integer between -8388607 to 8388608. If it is not, a recoverable error is generated. Continues on next page 2 Functions 2.37. DnumToNum - Converts dnum to num RobotWare - OS 3HAC 16581-1 Revision: J 830 © Copyright 2004-2010 ABB. All rights reserved. Error handling The following recoverable errors can be generated. The errors can be handled in an error handler. The system variable ERRNO will be set to: Syntax DnumToNum [ Value ’:=’ ] < expression ( IN ) of dnum > [\ Integer]’ ;’ A function with a return value of the data type num . Related information Error code Description ERR_ARGVALERR Value is above 8388608 or below -8388607 or not an integer (if optional argument Integer is used) ERR_NUM_LIMIT Value is above 3.40282347E+38 or below -3.40282347E+38 ERR_INT_NOTVAL Value is not an integer For information about See Dnum data type dnum - Double numeric values on page 1104 . Num data type num - Numeric values on page 1146 . Continued 2 Functions 2.38. DotProd - Dot product of two pos vectors RobotWare - OS 831 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.38. DotProd - Dot product of two pos vectors Usage DotProd ( Dot Product ) is used to calculate the dot (or scalar) product of two pos vectors. The typical use is to calculate the projection of one vector upon the other or to calculate the angle between the two vectors. Basic examples Basic examples of the function DotProd are illustrated below. Example 1 xx0500002449 The dot or scalar product of two vectors A and B is a scalar, which equals the products of the magnitudes of A and B and the cosine of the angle between them. . The dot product: • is less than or equal to the product of their magnitudes. • can be either a positive or a negative quantity, depending on whether the angle between them is smaller or larger then 90 degrees. • is equal to the product of the magnitude of one vector and the projection of the other vector upon the first one. • is zero when the vectors are perpendicular to each other. The vectors are described by the data type pos and the dot product by the data type num : VAR num dotprod; VAR pos vector1; VAR pos vector2; ... ... vector1 := [1,1,1]; vector2 := [1,2,3]; dotprod := DotProd(vector1, vector2); Return value Data type: num The value of the dot product of the two vectors. Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
833
2 Functions 2.37. DnumToNum - Converts dnum to num RobotWare - OS 3HAC 16581-1 Revision: J 830 © Copyright 2004-2010 ABB. All rights reserved. Error handling The following recoverable errors can be generated. The errors can be handled in an error handler. The system variable ERRNO will be set to: Syntax DnumToNum [ Value ’:=’ ] < expression ( IN ) of dnum > [\ Integer]’ ;’ A function with a return value of the data type num . Related information Error code Description ERR_ARGVALERR Value is above 8388608 or below -8388607 or not an integer (if optional argument Integer is used) ERR_NUM_LIMIT Value is above 3.40282347E+38 or below -3.40282347E+38 ERR_INT_NOTVAL Value is not an integer For information about See Dnum data type dnum - Double numeric values on page 1104 . Num data type num - Numeric values on page 1146 . Continued 2 Functions 2.38. DotProd - Dot product of two pos vectors RobotWare - OS 831 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.38. DotProd - Dot product of two pos vectors Usage DotProd ( Dot Product ) is used to calculate the dot (or scalar) product of two pos vectors. The typical use is to calculate the projection of one vector upon the other or to calculate the angle between the two vectors. Basic examples Basic examples of the function DotProd are illustrated below. Example 1 xx0500002449 The dot or scalar product of two vectors A and B is a scalar, which equals the products of the magnitudes of A and B and the cosine of the angle between them. . The dot product: • is less than or equal to the product of their magnitudes. • can be either a positive or a negative quantity, depending on whether the angle between them is smaller or larger then 90 degrees. • is equal to the product of the magnitude of one vector and the projection of the other vector upon the first one. • is zero when the vectors are perpendicular to each other. The vectors are described by the data type pos and the dot product by the data type num : VAR num dotprod; VAR pos vector1; VAR pos vector2; ... ... vector1 := [1,1,1]; vector2 := [1,2,3]; dotprod := DotProd(vector1, vector2); Return value Data type: num The value of the dot product of the two vectors. Continues on next page 2 Functions 2.38. DotProd - Dot product of two pos vectors RobotWare - OS 3HAC 16581-1 Revision: J 832 © Copyright 2004-2010 ABB. All rights reserved. Arguments DotProd (Vector1 Vector2) Vector1 Data type: pos The first vector described by the pos data type. Vector2 Data type: pos The second vector described by the pos data type. Syntax DotProd’(’ [Vector1 ’:=’] <expression ( IN ) of pos>’,’ [Vector2 ’:=’] <expression ( IN ) of pos> ’)’ 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 Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
834
2 Functions 2.38. DotProd - Dot product of two pos vectors RobotWare - OS 831 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.38. DotProd - Dot product of two pos vectors Usage DotProd ( Dot Product ) is used to calculate the dot (or scalar) product of two pos vectors. The typical use is to calculate the projection of one vector upon the other or to calculate the angle between the two vectors. Basic examples Basic examples of the function DotProd are illustrated below. Example 1 xx0500002449 The dot or scalar product of two vectors A and B is a scalar, which equals the products of the magnitudes of A and B and the cosine of the angle between them. . The dot product: • is less than or equal to the product of their magnitudes. • can be either a positive or a negative quantity, depending on whether the angle between them is smaller or larger then 90 degrees. • is equal to the product of the magnitude of one vector and the projection of the other vector upon the first one. • is zero when the vectors are perpendicular to each other. The vectors are described by the data type pos and the dot product by the data type num : VAR num dotprod; VAR pos vector1; VAR pos vector2; ... ... vector1 := [1,1,1]; vector2 := [1,2,3]; dotprod := DotProd(vector1, vector2); Return value Data type: num The value of the dot product of the two vectors. Continues on next page 2 Functions 2.38. DotProd - Dot product of two pos vectors RobotWare - OS 3HAC 16581-1 Revision: J 832 © Copyright 2004-2010 ABB. All rights reserved. Arguments DotProd (Vector1 Vector2) Vector1 Data type: pos The first vector described by the pos data type. Vector2 Data type: pos The second vector described by the pos data type. Syntax DotProd’(’ [Vector1 ’:=’] <expression ( IN ) of pos>’,’ [Vector2 ’:=’] <expression ( IN ) of pos> ’)’ 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 Continued 2 Functions 2.39. DOutput - Reads the value of a digital output signal RobotWare - OS 833 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.39. DOutput - Reads the value of a digital output signal Usage DOutput is used to read the current value of a digital output signal. Basic examples Basic examples of the function DOutput are illustrated below. See also More examples on page 833 . Example 1 IF DOutput(do2) = 1 THEN... If the current value of the signal do2 is equal to 1, then ... Return value Data type: dionum The current value of the signal (0 or 1). Arguments DOutput (Signal) Signal Data type: signaldo The name of the signal to be read. Program execution The value read depends on the configuration of the signal. If the signal is inverted in the system parameters then the value returned by this function is the opposite of the true value of the physical channel. 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. More examples More examples of the function DOutput are illustrated below. Example 1 IF DOutput(auto_on) <> active THEN . . . If the current value of the system signal auto_on is not active then ... , i.e. if the robot is in the manual operating mode, then ... NOTE! The signal must first be defined as a system output in the system parameters. Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
835
2 Functions 2.38. DotProd - Dot product of two pos vectors RobotWare - OS 3HAC 16581-1 Revision: J 832 © Copyright 2004-2010 ABB. All rights reserved. Arguments DotProd (Vector1 Vector2) Vector1 Data type: pos The first vector described by the pos data type. Vector2 Data type: pos The second vector described by the pos data type. Syntax DotProd’(’ [Vector1 ’:=’] <expression ( IN ) of pos>’,’ [Vector2 ’:=’] <expression ( IN ) of pos> ’)’ 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 Continued 2 Functions 2.39. DOutput - Reads the value of a digital output signal RobotWare - OS 833 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.39. DOutput - Reads the value of a digital output signal Usage DOutput is used to read the current value of a digital output signal. Basic examples Basic examples of the function DOutput are illustrated below. See also More examples on page 833 . Example 1 IF DOutput(do2) = 1 THEN... If the current value of the signal do2 is equal to 1, then ... Return value Data type: dionum The current value of the signal (0 or 1). Arguments DOutput (Signal) Signal Data type: signaldo The name of the signal to be read. Program execution The value read depends on the configuration of the signal. If the signal is inverted in the system parameters then the value returned by this function is the opposite of the true value of the physical channel. 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. More examples More examples of the function DOutput are illustrated below. Example 1 IF DOutput(auto_on) <> active THEN . . . If the current value of the system signal auto_on is not active then ... , i.e. if the robot is in the manual operating mode, then ... NOTE! The signal must first be defined as a system output in the system parameters. Continues on next page 2 Functions 2.39. DOutput - Reads the value of a digital output signal RobotWare - OS 3HAC 16581-1 Revision: J 834 © Copyright 2004-2010 ABB. All rights reserved. Syntax DOutput ’(’ [ Signal ’:=’ ] < variable ( VAR ) of signaldo > ’)’ A function with a return value of the data type dionum . Related information For information about See Set a digital output signal SetDO - Changes the value of a digital output signal on page 440 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
836
2 Functions 2.39. DOutput - Reads the value of a digital output signal RobotWare - OS 833 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.39. DOutput - Reads the value of a digital output signal Usage DOutput is used to read the current value of a digital output signal. Basic examples Basic examples of the function DOutput are illustrated below. See also More examples on page 833 . Example 1 IF DOutput(do2) = 1 THEN... If the current value of the signal do2 is equal to 1, then ... Return value Data type: dionum The current value of the signal (0 or 1). Arguments DOutput (Signal) Signal Data type: signaldo The name of the signal to be read. Program execution The value read depends on the configuration of the signal. If the signal is inverted in the system parameters then the value returned by this function is the opposite of the true value of the physical channel. 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. More examples More examples of the function DOutput are illustrated below. Example 1 IF DOutput(auto_on) <> active THEN . . . If the current value of the system signal auto_on is not active then ... , i.e. if the robot is in the manual operating mode, then ... NOTE! The signal must first be defined as a system output in the system parameters. Continues on next page 2 Functions 2.39. DOutput - Reads the value of a digital output signal RobotWare - OS 3HAC 16581-1 Revision: J 834 © Copyright 2004-2010 ABB. All rights reserved. Syntax DOutput ’(’ [ Signal ’:=’ ] < variable ( VAR ) of signaldo > ’)’ A function with a return value of the data type dionum . Related information For information about See Set a digital output signal SetDO - Changes the value of a digital output signal on page 440 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.40. EulerZYX - Gets euler angles from orient RobotWare - OS 835 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.40. EulerZYX - Gets euler angles from orient Usage EulerZYX ( Euler ZYX rotations ) is used to get an Euler angle component from an orient type variable. Basic examples Basic examples of the function EulerZYX are illustrated below. Example 1 VAR num anglex; VAR num angley; VAR num anglez; VAR pose object; ... ... anglex := EulerZYX(\X, object.rot); angley := EulerZYX(\Y, object.rot); anglez := EulerZYX(\Z, object.rot); Return value Data type: num The corresponding Euler angle, expressed in degrees, range from [-180, 180]. Arguments EulerZYX ([\X] | [\Y] | [\Z] Rotation) [\X] Data type: switch Gets the rotation around the X axis. [\Y] Data type: switch Gets the rotation around the Y axis. [\Z] Data type: switch Gets the rotation around the Z axis. Note! The arguments \X , \Y , and \Z are mutually exclusive. If none of these are specified then a run-time error is generated. Rotation Data type: orient The rotation in its quaternion 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
837
2 Functions 2.39. DOutput - Reads the value of a digital output signal RobotWare - OS 3HAC 16581-1 Revision: J 834 © Copyright 2004-2010 ABB. All rights reserved. Syntax DOutput ’(’ [ Signal ’:=’ ] < variable ( VAR ) of signaldo > ’)’ A function with a return value of the data type dionum . Related information For information about See Set a digital output signal SetDO - Changes the value of a digital output signal on page 440 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.40. EulerZYX - Gets euler angles from orient RobotWare - OS 835 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.40. EulerZYX - Gets euler angles from orient Usage EulerZYX ( Euler ZYX rotations ) is used to get an Euler angle component from an orient type variable. Basic examples Basic examples of the function EulerZYX are illustrated below. Example 1 VAR num anglex; VAR num angley; VAR num anglez; VAR pose object; ... ... anglex := EulerZYX(\X, object.rot); angley := EulerZYX(\Y, object.rot); anglez := EulerZYX(\Z, object.rot); Return value Data type: num The corresponding Euler angle, expressed in degrees, range from [-180, 180]. Arguments EulerZYX ([\X] | [\Y] | [\Z] Rotation) [\X] Data type: switch Gets the rotation around the X axis. [\Y] Data type: switch Gets the rotation around the Y axis. [\Z] Data type: switch Gets the rotation around the Z axis. Note! The arguments \X , \Y , and \Z are mutually exclusive. If none of these are specified then a run-time error is generated. Rotation Data type: orient The rotation in its quaternion representation. Continues on next page 2 Functions 2.40. EulerZYX - Gets euler angles from orient RobotWare - OS 3HAC 16581-1 Revision: J 836 © Copyright 2004-2010 ABB. All rights reserved. Syntax EulerZYX’(’ ['\'X ’,’] | ['\'Y’ ,’] | ['\'Z’,’] [Rotation’:=’] <expression ( IN ) of orient> ’)’ 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 Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
838
2 Functions 2.40. EulerZYX - Gets euler angles from orient RobotWare - OS 835 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.40. EulerZYX - Gets euler angles from orient Usage EulerZYX ( Euler ZYX rotations ) is used to get an Euler angle component from an orient type variable. Basic examples Basic examples of the function EulerZYX are illustrated below. Example 1 VAR num anglex; VAR num angley; VAR num anglez; VAR pose object; ... ... anglex := EulerZYX(\X, object.rot); angley := EulerZYX(\Y, object.rot); anglez := EulerZYX(\Z, object.rot); Return value Data type: num The corresponding Euler angle, expressed in degrees, range from [-180, 180]. Arguments EulerZYX ([\X] | [\Y] | [\Z] Rotation) [\X] Data type: switch Gets the rotation around the X axis. [\Y] Data type: switch Gets the rotation around the Y axis. [\Z] Data type: switch Gets the rotation around the Z axis. Note! The arguments \X , \Y , and \Z are mutually exclusive. If none of these are specified then a run-time error is generated. Rotation Data type: orient The rotation in its quaternion representation. Continues on next page 2 Functions 2.40. EulerZYX - Gets euler angles from orient RobotWare - OS 3HAC 16581-1 Revision: J 836 © Copyright 2004-2010 ABB. All rights reserved. Syntax EulerZYX’(’ ['\'X ’,’] | ['\'Y’ ,’] | ['\'Z’,’] [Rotation’:=’] <expression ( IN ) of orient> ’)’ 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 Continued 2 Functions 2.41. EventType - Get current event type inside any event routine RobotWare - OS 837 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.41. EventType - Get current event type inside any event routine Usage EventType can be used in any event routine and then returns the current executed event type. If EventType is called from any program task routine then EventType always returns 0 meaning EVENT_NONE. Basic examples Basic examples of the function EventType are illustrated below. Example 1 TEST EventType() CASE EVENT_NONE: ! Not executing any event CASE EVENT_POWERON: ! Executing POWER ON event CASE EVENT_START: ! Executing START event CASE EVENT_STOP: ! Executing STOP event CASE EVENT_QSTOP: ! Executing QSTOP event CASE EVENT_RESTART: ! Executing RESTART event CASE EVENT_RESET: ! Executing RESET event CASE EVENT_STEP: ! Executing STEP event ENDTEST Use of function EventType inside any event routine to find out which system event, if any, is executing now. Return value Data type: event_type The current executed event type 1 ... 7, or 0 if no event routine is executed. Predefined data The following predefined symbolic constants of type event_type can be used to check the return value: CONST event_type EVENT_NONE := 0; CONST event_type EVENT_POWERON := 1; CONST event_type EVENT_START := 2; CONST event_type EVENT_STOP := 3; CONST event_type EVENT_QSTOP:= 4; CONST event_type EVENT_RESTART := 5; CONST event_type EVENT_RESET := 6; CONST event_type EVENT_STEP := 7; Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
839
2 Functions 2.40. EulerZYX - Gets euler angles from orient RobotWare - OS 3HAC 16581-1 Revision: J 836 © Copyright 2004-2010 ABB. All rights reserved. Syntax EulerZYX’(’ ['\'X ’,’] | ['\'Y’ ,’] | ['\'Z’,’] [Rotation’:=’] <expression ( IN ) of orient> ’)’ 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 Continued 2 Functions 2.41. EventType - Get current event type inside any event routine RobotWare - OS 837 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.41. EventType - Get current event type inside any event routine Usage EventType can be used in any event routine and then returns the current executed event type. If EventType is called from any program task routine then EventType always returns 0 meaning EVENT_NONE. Basic examples Basic examples of the function EventType are illustrated below. Example 1 TEST EventType() CASE EVENT_NONE: ! Not executing any event CASE EVENT_POWERON: ! Executing POWER ON event CASE EVENT_START: ! Executing START event CASE EVENT_STOP: ! Executing STOP event CASE EVENT_QSTOP: ! Executing QSTOP event CASE EVENT_RESTART: ! Executing RESTART event CASE EVENT_RESET: ! Executing RESET event CASE EVENT_STEP: ! Executing STEP event ENDTEST Use of function EventType inside any event routine to find out which system event, if any, is executing now. Return value Data type: event_type The current executed event type 1 ... 7, or 0 if no event routine is executed. Predefined data The following predefined symbolic constants of type event_type can be used to check the return value: CONST event_type EVENT_NONE := 0; CONST event_type EVENT_POWERON := 1; CONST event_type EVENT_START := 2; CONST event_type EVENT_STOP := 3; CONST event_type EVENT_QSTOP:= 4; CONST event_type EVENT_RESTART := 5; CONST event_type EVENT_RESET := 6; CONST event_type EVENT_STEP := 7; Continues on next page 2 Functions 2.41. EventType - Get current event type inside any event routine RobotWare - OS 3HAC 16581-1 Revision: J 838 © Copyright 2004-2010 ABB. All rights reserved. Syntax EventType’(’ ’)’ A function with a return value of the data type event_type . Related information For information about See Event routines in general Technical reference manual - System parameters , section Controller - Event Routine Data type event_type, predefined constants event_type - Event routine type on page 1116 Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
840
2 Functions 2.41. EventType - Get current event type inside any event routine RobotWare - OS 837 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.41. EventType - Get current event type inside any event routine Usage EventType can be used in any event routine and then returns the current executed event type. If EventType is called from any program task routine then EventType always returns 0 meaning EVENT_NONE. Basic examples Basic examples of the function EventType are illustrated below. Example 1 TEST EventType() CASE EVENT_NONE: ! Not executing any event CASE EVENT_POWERON: ! Executing POWER ON event CASE EVENT_START: ! Executing START event CASE EVENT_STOP: ! Executing STOP event CASE EVENT_QSTOP: ! Executing QSTOP event CASE EVENT_RESTART: ! Executing RESTART event CASE EVENT_RESET: ! Executing RESET event CASE EVENT_STEP: ! Executing STEP event ENDTEST Use of function EventType inside any event routine to find out which system event, if any, is executing now. Return value Data type: event_type The current executed event type 1 ... 7, or 0 if no event routine is executed. Predefined data The following predefined symbolic constants of type event_type can be used to check the return value: CONST event_type EVENT_NONE := 0; CONST event_type EVENT_POWERON := 1; CONST event_type EVENT_START := 2; CONST event_type EVENT_STOP := 3; CONST event_type EVENT_QSTOP:= 4; CONST event_type EVENT_RESTART := 5; CONST event_type EVENT_RESET := 6; CONST event_type EVENT_STEP := 7; Continues on next page 2 Functions 2.41. EventType - Get current event type inside any event routine RobotWare - OS 3HAC 16581-1 Revision: J 838 © Copyright 2004-2010 ABB. All rights reserved. Syntax EventType’(’ ’)’ A function with a return value of the data type event_type . Related information For information about See Event routines in general Technical reference manual - System parameters , section Controller - Event Routine Data type event_type, predefined constants event_type - Event routine type on page 1116 Continued 2 Functions 2.42. ExecHandler - Get type of execution handler RobotWare - OS 839 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.42. ExecHandler - Get type of execution handler Usage ExecHandler can be used to find out if the actual RAPID code is executed in any RAPID program routine handler. Basic examples Basic example of the function ExecHandler is illustrated below. Example 1 TEST ExecHandler() CASE HANDLER_NONE: ! Not executing in any routine handler CASE HANDLER_BWD: ! Executing in routine BACKWARD handler CASE HANDLER_ERR: ! Executing in routine ERROR handler CASE HANDLER_UNDO: ! Executing in routine UNDO handler ENDTEST Use of function ExecHandler to find out if the code is executing in some type of routine handler or not. HANDLER_ERR will be returned even if the call is executed in a submethod to the error handler. Return value Data type: handler_type The current executed handler type 1 ... 3, or 0 if not executing in any routine handler. Predefined data The following predefined symbolic constants of type handler_type can be used to check the return value: CONST handler_type HANDLER_NONE := 0; CONST handler_type HANDLER_BWD := 1; CONST handler_type HANDLER_ERR := 2; CONST handler_type HANDLER_UNDO := 3; Syntax ExecHandler’(’ ’)’ A function with a return value of the data type handler_type . Related information For information about See Type of execution handler handler_type - Type of execution handler on page 1120
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
841
2 Functions 2.41. EventType - Get current event type inside any event routine RobotWare - OS 3HAC 16581-1 Revision: J 838 © Copyright 2004-2010 ABB. All rights reserved. Syntax EventType’(’ ’)’ A function with a return value of the data type event_type . Related information For information about See Event routines in general Technical reference manual - System parameters , section Controller - Event Routine Data type event_type, predefined constants event_type - Event routine type on page 1116 Continued 2 Functions 2.42. ExecHandler - Get type of execution handler RobotWare - OS 839 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.42. ExecHandler - Get type of execution handler Usage ExecHandler can be used to find out if the actual RAPID code is executed in any RAPID program routine handler. Basic examples Basic example of the function ExecHandler is illustrated below. Example 1 TEST ExecHandler() CASE HANDLER_NONE: ! Not executing in any routine handler CASE HANDLER_BWD: ! Executing in routine BACKWARD handler CASE HANDLER_ERR: ! Executing in routine ERROR handler CASE HANDLER_UNDO: ! Executing in routine UNDO handler ENDTEST Use of function ExecHandler to find out if the code is executing in some type of routine handler or not. HANDLER_ERR will be returned even if the call is executed in a submethod to the error handler. Return value Data type: handler_type The current executed handler type 1 ... 3, or 0 if not executing in any routine handler. Predefined data The following predefined symbolic constants of type handler_type can be used to check the return value: CONST handler_type HANDLER_NONE := 0; CONST handler_type HANDLER_BWD := 1; CONST handler_type HANDLER_ERR := 2; CONST handler_type HANDLER_UNDO := 3; Syntax ExecHandler’(’ ’)’ A function with a return value of the data type handler_type . Related information For information about See Type of execution handler handler_type - Type of execution handler on page 1120 2 Functions 2.43. ExecLevel - Get execution level RobotWare - OS 3HAC 16581-1 Revision: J 840 © Copyright 2004-2010 ABB. All rights reserved. 2.43. ExecLevel - Get execution level Usage ExecLevel can be used to find out current execution level for the RAPID code that currently is executed. Basic examples Basic example of the function ExecLevel is illustrated below. Example 1 TEST ExecLevel() CASE LEVEL_NORMAL: ! Execute on base level CASE LEVEL_TRAP: ! Execute in TRAP routine CASE LEVEL_SERVICE: ! Execute in service, event or system input interrupt routine ENDTEST Use of function ExecLevel to find out the current execution level. Return value Data type: exec_level The current execution level 0... 2. Predefined data The following predefined symbolic constants of type event_level can be used to check the return value: CONST exec_level LEVEL_NORMAL := 0; CONST exec_level LEVEL_TRAP := 1; CONST exec_level LEVEL_SERVICE := 2; Syntax ExecLevel’(’ ’)’ A function with a return value of the data type exec_level . Related information For information about See Data type for execution level exec_level - Execution level on page 1117
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
842
2 Functions 2.42. ExecHandler - Get type of execution handler RobotWare - OS 839 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.42. ExecHandler - Get type of execution handler Usage ExecHandler can be used to find out if the actual RAPID code is executed in any RAPID program routine handler. Basic examples Basic example of the function ExecHandler is illustrated below. Example 1 TEST ExecHandler() CASE HANDLER_NONE: ! Not executing in any routine handler CASE HANDLER_BWD: ! Executing in routine BACKWARD handler CASE HANDLER_ERR: ! Executing in routine ERROR handler CASE HANDLER_UNDO: ! Executing in routine UNDO handler ENDTEST Use of function ExecHandler to find out if the code is executing in some type of routine handler or not. HANDLER_ERR will be returned even if the call is executed in a submethod to the error handler. Return value Data type: handler_type The current executed handler type 1 ... 3, or 0 if not executing in any routine handler. Predefined data The following predefined symbolic constants of type handler_type can be used to check the return value: CONST handler_type HANDLER_NONE := 0; CONST handler_type HANDLER_BWD := 1; CONST handler_type HANDLER_ERR := 2; CONST handler_type HANDLER_UNDO := 3; Syntax ExecHandler’(’ ’)’ A function with a return value of the data type handler_type . Related information For information about See Type of execution handler handler_type - Type of execution handler on page 1120 2 Functions 2.43. ExecLevel - Get execution level RobotWare - OS 3HAC 16581-1 Revision: J 840 © Copyright 2004-2010 ABB. All rights reserved. 2.43. ExecLevel - Get execution level Usage ExecLevel can be used to find out current execution level for the RAPID code that currently is executed. Basic examples Basic example of the function ExecLevel is illustrated below. Example 1 TEST ExecLevel() CASE LEVEL_NORMAL: ! Execute on base level CASE LEVEL_TRAP: ! Execute in TRAP routine CASE LEVEL_SERVICE: ! Execute in service, event or system input interrupt routine ENDTEST Use of function ExecLevel to find out the current execution level. Return value Data type: exec_level The current execution level 0... 2. Predefined data The following predefined symbolic constants of type event_level can be used to check the return value: CONST exec_level LEVEL_NORMAL := 0; CONST exec_level LEVEL_TRAP := 1; CONST exec_level LEVEL_SERVICE := 2; Syntax ExecLevel’(’ ’)’ A function with a return value of the data type exec_level . Related information For information about See Data type for execution level exec_level - Execution level on page 1117 2 Functions 2.44. Exp - Calculates the exponential value RobotWare - OS 841 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.44. Exp - Calculates the exponential value Usage Exp ( Exponential ) is used to calculate the exponential value, e x . Basic examples Basic examples of the function Exp are illustrated below. Example 1 VAR num x; VAR num value; ... value:= Exp( x); value will get the exponential value of x . Return value Data type: num The exponential value e x . Arguments Exp (Exponent) Exponent Data type: num The exponent argument value. Syntax Exp’(’ [Exponent ’:=’] <expression ( IN ) of num>’)’ A function with a return value of the data type num . Related information For information about See Mathematical instructions and functions Technical reference manual - RAPID overview , section RAPID Summary - Mathematics
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
843
2 Functions 2.43. ExecLevel - Get execution level RobotWare - OS 3HAC 16581-1 Revision: J 840 © Copyright 2004-2010 ABB. All rights reserved. 2.43. ExecLevel - Get execution level Usage ExecLevel can be used to find out current execution level for the RAPID code that currently is executed. Basic examples Basic example of the function ExecLevel is illustrated below. Example 1 TEST ExecLevel() CASE LEVEL_NORMAL: ! Execute on base level CASE LEVEL_TRAP: ! Execute in TRAP routine CASE LEVEL_SERVICE: ! Execute in service, event or system input interrupt routine ENDTEST Use of function ExecLevel to find out the current execution level. Return value Data type: exec_level The current execution level 0... 2. Predefined data The following predefined symbolic constants of type event_level can be used to check the return value: CONST exec_level LEVEL_NORMAL := 0; CONST exec_level LEVEL_TRAP := 1; CONST exec_level LEVEL_SERVICE := 2; Syntax ExecLevel’(’ ’)’ A function with a return value of the data type exec_level . Related information For information about See Data type for execution level exec_level - Execution level on page 1117 2 Functions 2.44. Exp - Calculates the exponential value RobotWare - OS 841 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.44. Exp - Calculates the exponential value Usage Exp ( Exponential ) is used to calculate the exponential value, e x . Basic examples Basic examples of the function Exp are illustrated below. Example 1 VAR num x; VAR num value; ... value:= Exp( x); value will get the exponential value of x . Return value Data type: num The exponential value e x . Arguments Exp (Exponent) Exponent Data type: num The exponent argument value. Syntax Exp’(’ [Exponent ’:=’] <expression ( IN ) of num>’)’ A function with a return value of the data type num . Related information For information about See Mathematical instructions and functions Technical reference manual - RAPID overview , section RAPID Summary - Mathematics 2 Functions 2.45. FileSize - Retrieve the size of a file RobotWare - OS 3HAC 16581-1 Revision: J 842 © Copyright 2004-2010 ABB. All rights reserved. 2.45. FileSize - Retrieve the size of a file Usage FileSize is used to retrieve the size of the specified file. Basic examples Basic examples of the function FileSize are illustrated below. See also More examples on page 842 . Example 1 PROC listfile(string filename) VAR num size; size := FileSize(filename); TPWrite filename+" size: "+NumToStr(size,0)+" Bytes"; ENDPROC This procedure prints out the name of specified file together with a size specification. Return value Data type: num The size in bytes. Arguments FileSize (Path) Path Data type: string The file name specified with full or relative path. Program execution This function returns a numeric that specifies the size in bytes of the specified file. It is also possible to get the same information about a directory. More examples Basic examples of the function are illustrated below. Example 1 This example lists all files bigger than 1 KByte under the " HOME :" directory structure, including all subdirectories. PROC searchdir(string dirname, string actionproc) VAR dir directory; VAR string filename; IF IsFile(dirname \Directory) THEN OpenDir directory, dirname; WHILE ReadDir(directory, filename) DO ! .. and . is the parent and resp. this directory IF filename <> ".." AND filename <> "." THEN searchdir dirname+"/"+filename, actionproc; Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
844
2 Functions 2.44. Exp - Calculates the exponential value RobotWare - OS 841 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.44. Exp - Calculates the exponential value Usage Exp ( Exponential ) is used to calculate the exponential value, e x . Basic examples Basic examples of the function Exp are illustrated below. Example 1 VAR num x; VAR num value; ... value:= Exp( x); value will get the exponential value of x . Return value Data type: num The exponential value e x . Arguments Exp (Exponent) Exponent Data type: num The exponent argument value. Syntax Exp’(’ [Exponent ’:=’] <expression ( IN ) of num>’)’ A function with a return value of the data type num . Related information For information about See Mathematical instructions and functions Technical reference manual - RAPID overview , section RAPID Summary - Mathematics 2 Functions 2.45. FileSize - Retrieve the size of a file RobotWare - OS 3HAC 16581-1 Revision: J 842 © Copyright 2004-2010 ABB. All rights reserved. 2.45. FileSize - Retrieve the size of a file Usage FileSize is used to retrieve the size of the specified file. Basic examples Basic examples of the function FileSize are illustrated below. See also More examples on page 842 . Example 1 PROC listfile(string filename) VAR num size; size := FileSize(filename); TPWrite filename+" size: "+NumToStr(size,0)+" Bytes"; ENDPROC This procedure prints out the name of specified file together with a size specification. Return value Data type: num The size in bytes. Arguments FileSize (Path) Path Data type: string The file name specified with full or relative path. Program execution This function returns a numeric that specifies the size in bytes of the specified file. It is also possible to get the same information about a directory. More examples Basic examples of the function are illustrated below. Example 1 This example lists all files bigger than 1 KByte under the " HOME :" directory structure, including all subdirectories. PROC searchdir(string dirname, string actionproc) VAR dir directory; VAR string filename; IF IsFile(dirname \Directory) THEN OpenDir directory, dirname; WHILE ReadDir(directory, filename) DO ! .. and . is the parent and resp. this directory IF filename <> ".." AND filename <> "." THEN searchdir dirname+"/"+filename, actionproc; Continues on next page 2 Functions 2.45. FileSize - Retrieve the size of a file RobotWare - OS 843 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. ENDIF ENDWHILE CloseDir directory; ELSE %actionproc% dirname; ENDIF ERROR RAISE; ENDPROC PROC listfile(string filename) IF FileSize(filename) > 1024 THEN TPWrite filename; ENDIF ENDPROC PROC main() ! Execute the listfile routine for all files found under the ! tree of HOME: searchdir "HOME:","listfile"; ENDPROC This program traverses the directory structure under " HOME :" and for each file found it calls the listfile procedure. The searchdir is a generic part that knows nothing about the start of the search or which routine should be called for each file. It uses IsFile to check whether it has found a subdirectory or a file and it uses the late binding mechanism to call the procedure specified in actionproc for all files found. The actionproc routine listfile checks whether the file is bigger than 1 KBytes. Error handling If the file does not exist, the system variable ERRNO is set to ERR_FILEACC . This error can then be handled in the error handler. Syntax FileSize ’(’ [ Path ’:=’ ] < expression ( IN ) of string> ’)’ A function with a return value of the data type 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
845
2 Functions 2.45. FileSize - Retrieve the size of a file RobotWare - OS 3HAC 16581-1 Revision: J 842 © Copyright 2004-2010 ABB. All rights reserved. 2.45. FileSize - Retrieve the size of a file Usage FileSize is used to retrieve the size of the specified file. Basic examples Basic examples of the function FileSize are illustrated below. See also More examples on page 842 . Example 1 PROC listfile(string filename) VAR num size; size := FileSize(filename); TPWrite filename+" size: "+NumToStr(size,0)+" Bytes"; ENDPROC This procedure prints out the name of specified file together with a size specification. Return value Data type: num The size in bytes. Arguments FileSize (Path) Path Data type: string The file name specified with full or relative path. Program execution This function returns a numeric that specifies the size in bytes of the specified file. It is also possible to get the same information about a directory. More examples Basic examples of the function are illustrated below. Example 1 This example lists all files bigger than 1 KByte under the " HOME :" directory structure, including all subdirectories. PROC searchdir(string dirname, string actionproc) VAR dir directory; VAR string filename; IF IsFile(dirname \Directory) THEN OpenDir directory, dirname; WHILE ReadDir(directory, filename) DO ! .. and . is the parent and resp. this directory IF filename <> ".." AND filename <> "." THEN searchdir dirname+"/"+filename, actionproc; Continues on next page 2 Functions 2.45. FileSize - Retrieve the size of a file RobotWare - OS 843 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. ENDIF ENDWHILE CloseDir directory; ELSE %actionproc% dirname; ENDIF ERROR RAISE; ENDPROC PROC listfile(string filename) IF FileSize(filename) > 1024 THEN TPWrite filename; ENDIF ENDPROC PROC main() ! Execute the listfile routine for all files found under the ! tree of HOME: searchdir "HOME:","listfile"; ENDPROC This program traverses the directory structure under " HOME :" and for each file found it calls the listfile procedure. The searchdir is a generic part that knows nothing about the start of the search or which routine should be called for each file. It uses IsFile to check whether it has found a subdirectory or a file and it uses the late binding mechanism to call the procedure specified in actionproc for all files found. The actionproc routine listfile checks whether the file is bigger than 1 KBytes. Error handling If the file does not exist, the system variable ERRNO is set to ERR_FILEACC . This error can then be handled in the error handler. Syntax FileSize ’(’ [ Path ’:=’ ] < expression ( IN ) of string> ’)’ A function with a return value of the data type num . Continued Continues on next page 2 Functions 2.45. FileSize - Retrieve the size of a file RobotWare - OS 3HAC 16581-1 Revision: J 844 © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Make a directory MakeDir - Create a new directory on page 218 Remove a directory RemoveDir - Delete a directory on page 355 Rename a file RenameFile - Rename a file on page 357 Remove a file RemoveFile - Delete a file on page 356 Copy a file CopyFile - Copy a file on page 65 Check file type IsFile - Check the type of a file on page 878 Check file system size FSSize - Retrieve the size of a file system on page 848 Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
846
2 Functions 2.45. FileSize - Retrieve the size of a file RobotWare - OS 843 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. ENDIF ENDWHILE CloseDir directory; ELSE %actionproc% dirname; ENDIF ERROR RAISE; ENDPROC PROC listfile(string filename) IF FileSize(filename) > 1024 THEN TPWrite filename; ENDIF ENDPROC PROC main() ! Execute the listfile routine for all files found under the ! tree of HOME: searchdir "HOME:","listfile"; ENDPROC This program traverses the directory structure under " HOME :" and for each file found it calls the listfile procedure. The searchdir is a generic part that knows nothing about the start of the search or which routine should be called for each file. It uses IsFile to check whether it has found a subdirectory or a file and it uses the late binding mechanism to call the procedure specified in actionproc for all files found. The actionproc routine listfile checks whether the file is bigger than 1 KBytes. Error handling If the file does not exist, the system variable ERRNO is set to ERR_FILEACC . This error can then be handled in the error handler. Syntax FileSize ’(’ [ Path ’:=’ ] < expression ( IN ) of string> ’)’ A function with a return value of the data type num . Continued Continues on next page 2 Functions 2.45. FileSize - Retrieve the size of a file RobotWare - OS 3HAC 16581-1 Revision: J 844 © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Make a directory MakeDir - Create a new directory on page 218 Remove a directory RemoveDir - Delete a directory on page 355 Rename a file RenameFile - Rename a file on page 357 Remove a file RemoveFile - Delete a file on page 356 Copy a file CopyFile - Copy a file on page 65 Check file type IsFile - Check the type of a file on page 878 Check file system size FSSize - Retrieve the size of a file system on page 848 Continued 2 Functions 2.46. FileTime - Retrieve time information about a file RobotWare-OS 845 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.46. FileTime - Retrieve time information about a file Usage FileTime is used to retrieve the last time for modification, access or file status change of a file. The time is measured in seconds since 00:00:00 GMT, Jan. 1 1970. The time is returned as a num and optionally also in a stringdig . Basic example Basic examples of the function FileTime are illustrated below. See also More examples on page 846 . Example 1 IF FileTime ("HOME:/mymod.mod" \ModifyTime) > ModTime ("mymod") THEN UnLoad "HOME:mymod.mod"; Load \Dynamic, "HOME:mymod.mod"; ENDIF This program reloads a module if the source file is newer. It uses the ModTime to retrieve the latest modification time for the specified module, and to compare it to the FileTime\ModifyTime at the source. Then, if the source is newer, the program unloads and loads the module again. Limitation in this example: The data type num cannot handle positive integers above 8388608 seconds with exact representation. To get better dissolution, see example in function StrDigCmp . Return value Data type: num The time measured in seconds since 00:00:00 GMT, Jan. 1 1970. Arguments FileTime ( Path [\ModifyTime] | [\AccessTime] | [\StatCTime] [\StrDig]) Path Data type: string The file specified with a full or relative path. [\ModifyTime] Data type: switch Last modification time. [\AccessTime] Data type: switch Time of last access (read, execute of modify). [\StatCTime] Data type: switch Last file status (access qualification) change time. Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
847
2 Functions 2.45. FileSize - Retrieve the size of a file RobotWare - OS 3HAC 16581-1 Revision: J 844 © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Make a directory MakeDir - Create a new directory on page 218 Remove a directory RemoveDir - Delete a directory on page 355 Rename a file RenameFile - Rename a file on page 357 Remove a file RemoveFile - Delete a file on page 356 Copy a file CopyFile - Copy a file on page 65 Check file type IsFile - Check the type of a file on page 878 Check file system size FSSize - Retrieve the size of a file system on page 848 Continued 2 Functions 2.46. FileTime - Retrieve time information about a file RobotWare-OS 845 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.46. FileTime - Retrieve time information about a file Usage FileTime is used to retrieve the last time for modification, access or file status change of a file. The time is measured in seconds since 00:00:00 GMT, Jan. 1 1970. The time is returned as a num and optionally also in a stringdig . Basic example Basic examples of the function FileTime are illustrated below. See also More examples on page 846 . Example 1 IF FileTime ("HOME:/mymod.mod" \ModifyTime) > ModTime ("mymod") THEN UnLoad "HOME:mymod.mod"; Load \Dynamic, "HOME:mymod.mod"; ENDIF This program reloads a module if the source file is newer. It uses the ModTime to retrieve the latest modification time for the specified module, and to compare it to the FileTime\ModifyTime at the source. Then, if the source is newer, the program unloads and loads the module again. Limitation in this example: The data type num cannot handle positive integers above 8388608 seconds with exact representation. To get better dissolution, see example in function StrDigCmp . Return value Data type: num The time measured in seconds since 00:00:00 GMT, Jan. 1 1970. Arguments FileTime ( Path [\ModifyTime] | [\AccessTime] | [\StatCTime] [\StrDig]) Path Data type: string The file specified with a full or relative path. [\ModifyTime] Data type: switch Last modification time. [\AccessTime] Data type: switch Time of last access (read, execute of modify). [\StatCTime] Data type: switch Last file status (access qualification) change time. Continues on next page 2 Functions 2.46. FileTime - Retrieve time information about a file RobotWare-OS 3HAC 16581-1 Revision: J 846 © Copyright 2004-2010 ABB. All rights reserved. [\StrDig] String Digit Data type: stringdig To get the file time in a stringdig representation. Further use in StrDigCmp can handle positive integers above 8388608 with exact representation. Program execution This function returns a numeric that specifies the time since the last: • Modification • Access • File status change of the specified file. It is also possible to get the same information about a directory. More examples More examples of the function FileTime are illustrated below. This is a complete example that implements an alert service for maximum 10 files. LOCAL RECORD falert string filename; num ftime; ENDRECORD LOCAL VAR falert myfiles[10]; LOCAL VAR num currentpos:=0; LOCAL VAR intnum timeint; PROC alertInit(num freq) currentpos:=0; CONNECT timeint WITH mytrap; ITimer freq,timeint; ENDPROC LOCAL TRAP mytrap VAR num pos:=1; WHILE pos <= currentpos DO IF FileTime(myfiles{pos}.filename \ModifyTime) > myfiles{pos}.ftime THEN TPWrite "The file "+myfiles{pos}.filename+" is changed"; ENDIF pos := pos+1; ENDWHILE ENDTRAP Continued Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
848
2 Functions 2.46. FileTime - Retrieve time information about a file RobotWare-OS 845 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.46. FileTime - Retrieve time information about a file Usage FileTime is used to retrieve the last time for modification, access or file status change of a file. The time is measured in seconds since 00:00:00 GMT, Jan. 1 1970. The time is returned as a num and optionally also in a stringdig . Basic example Basic examples of the function FileTime are illustrated below. See also More examples on page 846 . Example 1 IF FileTime ("HOME:/mymod.mod" \ModifyTime) > ModTime ("mymod") THEN UnLoad "HOME:mymod.mod"; Load \Dynamic, "HOME:mymod.mod"; ENDIF This program reloads a module if the source file is newer. It uses the ModTime to retrieve the latest modification time for the specified module, and to compare it to the FileTime\ModifyTime at the source. Then, if the source is newer, the program unloads and loads the module again. Limitation in this example: The data type num cannot handle positive integers above 8388608 seconds with exact representation. To get better dissolution, see example in function StrDigCmp . Return value Data type: num The time measured in seconds since 00:00:00 GMT, Jan. 1 1970. Arguments FileTime ( Path [\ModifyTime] | [\AccessTime] | [\StatCTime] [\StrDig]) Path Data type: string The file specified with a full or relative path. [\ModifyTime] Data type: switch Last modification time. [\AccessTime] Data type: switch Time of last access (read, execute of modify). [\StatCTime] Data type: switch Last file status (access qualification) change time. Continues on next page 2 Functions 2.46. FileTime - Retrieve time information about a file RobotWare-OS 3HAC 16581-1 Revision: J 846 © Copyright 2004-2010 ABB. All rights reserved. [\StrDig] String Digit Data type: stringdig To get the file time in a stringdig representation. Further use in StrDigCmp can handle positive integers above 8388608 with exact representation. Program execution This function returns a numeric that specifies the time since the last: • Modification • Access • File status change of the specified file. It is also possible to get the same information about a directory. More examples More examples of the function FileTime are illustrated below. This is a complete example that implements an alert service for maximum 10 files. LOCAL RECORD falert string filename; num ftime; ENDRECORD LOCAL VAR falert myfiles[10]; LOCAL VAR num currentpos:=0; LOCAL VAR intnum timeint; PROC alertInit(num freq) currentpos:=0; CONNECT timeint WITH mytrap; ITimer freq,timeint; ENDPROC LOCAL TRAP mytrap VAR num pos:=1; WHILE pos <= currentpos DO IF FileTime(myfiles{pos}.filename \ModifyTime) > myfiles{pos}.ftime THEN TPWrite "The file "+myfiles{pos}.filename+" is changed"; ENDIF pos := pos+1; ENDWHILE ENDTRAP Continued Continues on next page 2 Functions 2.46. FileTime - Retrieve time information about a file RobotWare-OS 847 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. PROC alertNew(string filename) currentpos := currentpos+1; IF currentpos <= 10 THEN myfiles{currentpos}.filename := filename; myfiles{currentpos}.ftime := FileTime (filename \ModifyTime); ENDIF ENDPROC PROC alertFree() IDelete timeint; ENDPROC Error handling If the file does not exist, the system variable ERRNO is set to ERR_FILEACC. This error can then be handled in the error handler. Syntax FileTime ’(’ [ Path ’:=’ ] < expression ( IN ) of string> [ '\'ModifyTime] | [ '\'AccessTime] | [ '\'StatCTime] [ '\' StrDig’ :=’ < variable ( VAR ) of stringdig> ] ’)’ A function with a return value of the data type num . Related information For information about See Last modify time of a loaded module ModTime - Get file modify time for the loaded module on page 896 String with only digits ModTime - Get file modify time for the loaded module on page 896 stringdig - String with only digits on page 1197 Compare two strings with only digits ModTime - Get file modify time for the loaded module on page 896 StrDigCmp - Compare two strings with only digits on page 991 Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
849
2 Functions 2.46. FileTime - Retrieve time information about a file RobotWare-OS 3HAC 16581-1 Revision: J 846 © Copyright 2004-2010 ABB. All rights reserved. [\StrDig] String Digit Data type: stringdig To get the file time in a stringdig representation. Further use in StrDigCmp can handle positive integers above 8388608 with exact representation. Program execution This function returns a numeric that specifies the time since the last: • Modification • Access • File status change of the specified file. It is also possible to get the same information about a directory. More examples More examples of the function FileTime are illustrated below. This is a complete example that implements an alert service for maximum 10 files. LOCAL RECORD falert string filename; num ftime; ENDRECORD LOCAL VAR falert myfiles[10]; LOCAL VAR num currentpos:=0; LOCAL VAR intnum timeint; PROC alertInit(num freq) currentpos:=0; CONNECT timeint WITH mytrap; ITimer freq,timeint; ENDPROC LOCAL TRAP mytrap VAR num pos:=1; WHILE pos <= currentpos DO IF FileTime(myfiles{pos}.filename \ModifyTime) > myfiles{pos}.ftime THEN TPWrite "The file "+myfiles{pos}.filename+" is changed"; ENDIF pos := pos+1; ENDWHILE ENDTRAP Continued Continues on next page 2 Functions 2.46. FileTime - Retrieve time information about a file RobotWare-OS 847 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. PROC alertNew(string filename) currentpos := currentpos+1; IF currentpos <= 10 THEN myfiles{currentpos}.filename := filename; myfiles{currentpos}.ftime := FileTime (filename \ModifyTime); ENDIF ENDPROC PROC alertFree() IDelete timeint; ENDPROC Error handling If the file does not exist, the system variable ERRNO is set to ERR_FILEACC. This error can then be handled in the error handler. Syntax FileTime ’(’ [ Path ’:=’ ] < expression ( IN ) of string> [ '\'ModifyTime] | [ '\'AccessTime] | [ '\'StatCTime] [ '\' StrDig’ :=’ < variable ( VAR ) of stringdig> ] ’)’ A function with a return value of the data type num . Related information For information about See Last modify time of a loaded module ModTime - Get file modify time for the loaded module on page 896 String with only digits ModTime - Get file modify time for the loaded module on page 896 stringdig - String with only digits on page 1197 Compare two strings with only digits ModTime - Get file modify time for the loaded module on page 896 StrDigCmp - Compare two strings with only digits on page 991 Continued 2 Functions 2.47. FSSize - Retrieve the size of a file system RobotWare - OS 3HAC 16581-1 Revision: J 848 © Copyright 2004-2010 ABB. All rights reserved. 2.47. FSSize - Retrieve the size of a file system Usage FSSize ( File System Size ) is used to retrieve the size of the file system in which a specified file resides. The size in bytes, kilo bytes or mega bytes are returned as a num . Basic example Basic examples of the function FSSize are illustrated below. See also More examples on page 849 . Example 1 PROC main() VAR num totalfsyssize; VAR num freefsyssize; freefsyssize := FSSize("HOME:/spy.log" \Free); totalfsyssize := FSSize("HOME:/spy.log" \Total); TPWrite NumToStr(((totalfsyssize - freefsyssize)/ totalfsyssize)*100,0) +" percent used"; ENDPROC This procedure prints out the amount of disk space used on the HOME : file system (flash disk /hd0a/ ) as a percentage. Return value Data type: num The size in bytes. Arguments FSSize (Name [\Total] | [\Free] [\Kbyte] [\Mbyte]) Name Data type: string The name of a file in the file system, specified with full or relative path. [ \Total ] Data type: switch Retrieves the total amount of space in the file system. [ \Free ] Data type: switch Retrieves the amount of free space in the file system. [ \Kbyte ] Data type: switch Convert the number of bytes read to kilobytes, e.g divide the size with 1024. Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
850
2 Functions 2.46. FileTime - Retrieve time information about a file RobotWare-OS 847 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. PROC alertNew(string filename) currentpos := currentpos+1; IF currentpos <= 10 THEN myfiles{currentpos}.filename := filename; myfiles{currentpos}.ftime := FileTime (filename \ModifyTime); ENDIF ENDPROC PROC alertFree() IDelete timeint; ENDPROC Error handling If the file does not exist, the system variable ERRNO is set to ERR_FILEACC. This error can then be handled in the error handler. Syntax FileTime ’(’ [ Path ’:=’ ] < expression ( IN ) of string> [ '\'ModifyTime] | [ '\'AccessTime] | [ '\'StatCTime] [ '\' StrDig’ :=’ < variable ( VAR ) of stringdig> ] ’)’ A function with a return value of the data type num . Related information For information about See Last modify time of a loaded module ModTime - Get file modify time for the loaded module on page 896 String with only digits ModTime - Get file modify time for the loaded module on page 896 stringdig - String with only digits on page 1197 Compare two strings with only digits ModTime - Get file modify time for the loaded module on page 896 StrDigCmp - Compare two strings with only digits on page 991 Continued 2 Functions 2.47. FSSize - Retrieve the size of a file system RobotWare - OS 3HAC 16581-1 Revision: J 848 © Copyright 2004-2010 ABB. All rights reserved. 2.47. FSSize - Retrieve the size of a file system Usage FSSize ( File System Size ) is used to retrieve the size of the file system in which a specified file resides. The size in bytes, kilo bytes or mega bytes are returned as a num . Basic example Basic examples of the function FSSize are illustrated below. See also More examples on page 849 . Example 1 PROC main() VAR num totalfsyssize; VAR num freefsyssize; freefsyssize := FSSize("HOME:/spy.log" \Free); totalfsyssize := FSSize("HOME:/spy.log" \Total); TPWrite NumToStr(((totalfsyssize - freefsyssize)/ totalfsyssize)*100,0) +" percent used"; ENDPROC This procedure prints out the amount of disk space used on the HOME : file system (flash disk /hd0a/ ) as a percentage. Return value Data type: num The size in bytes. Arguments FSSize (Name [\Total] | [\Free] [\Kbyte] [\Mbyte]) Name Data type: string The name of a file in the file system, specified with full or relative path. [ \Total ] Data type: switch Retrieves the total amount of space in the file system. [ \Free ] Data type: switch Retrieves the amount of free space in the file system. [ \Kbyte ] Data type: switch Convert the number of bytes read to kilobytes, e.g divide the size with 1024. Continues on next page 2 Functions 2.47. FSSize - Retrieve the size of a file system RobotWare - OS 849 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. [ \Mbyte ] Data type: switch Convert the number of bytes read to megabytes, e.g divide the size with 1048576 (1024*1024). Program execution This function returns a numeric that specifies the size of the file system in which the specified file resides. More examples More examples of the function FSSize are illustrated below. Example 1 LOCAL VAR intnum timeint; LOCAL TRAP mytrap IF FSSize("HOME:/spy.log" \Free)/FSSize("HOME:/spy.log" \Total) <= 0.1 THEN TPWrite "The disk is almost full"; alertFree; ENDIF ENDTRAP PROC alertInit(num freq) CONNECT timeint WITH mytrap; ITimer freq,timeint; ENDPROC PROC alertFree() IDelete timeint; ENDPROC This is a complete example for implementing an alert service that prints a warning on the FlexPendant when the remaining free space in the " HOME :" file system is less than 10%. Error handling The following recoverable errors can be generated. The errors can be handled in an ERROR handler. The system variable ERRNO will be set to: Syntax FSSize’(’ [ Name ’:=’ ] < expression ( IN ) of string> [ ´\´Total ] | [ ´\´Free ] [ ´\´Kbyte ] [ ´\´Mbyte ]’)’ A function with a return value of the data type num . ERR_FILEACC The file system does not exist ERR_FILESIZE The size exceeds the max integer value for a num, 8388608 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
851
2 Functions 2.47. FSSize - Retrieve the size of a file system RobotWare - OS 3HAC 16581-1 Revision: J 848 © Copyright 2004-2010 ABB. All rights reserved. 2.47. FSSize - Retrieve the size of a file system Usage FSSize ( File System Size ) is used to retrieve the size of the file system in which a specified file resides. The size in bytes, kilo bytes or mega bytes are returned as a num . Basic example Basic examples of the function FSSize are illustrated below. See also More examples on page 849 . Example 1 PROC main() VAR num totalfsyssize; VAR num freefsyssize; freefsyssize := FSSize("HOME:/spy.log" \Free); totalfsyssize := FSSize("HOME:/spy.log" \Total); TPWrite NumToStr(((totalfsyssize - freefsyssize)/ totalfsyssize)*100,0) +" percent used"; ENDPROC This procedure prints out the amount of disk space used on the HOME : file system (flash disk /hd0a/ ) as a percentage. Return value Data type: num The size in bytes. Arguments FSSize (Name [\Total] | [\Free] [\Kbyte] [\Mbyte]) Name Data type: string The name of a file in the file system, specified with full or relative path. [ \Total ] Data type: switch Retrieves the total amount of space in the file system. [ \Free ] Data type: switch Retrieves the amount of free space in the file system. [ \Kbyte ] Data type: switch Convert the number of bytes read to kilobytes, e.g divide the size with 1024. Continues on next page 2 Functions 2.47. FSSize - Retrieve the size of a file system RobotWare - OS 849 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. [ \Mbyte ] Data type: switch Convert the number of bytes read to megabytes, e.g divide the size with 1048576 (1024*1024). Program execution This function returns a numeric that specifies the size of the file system in which the specified file resides. More examples More examples of the function FSSize are illustrated below. Example 1 LOCAL VAR intnum timeint; LOCAL TRAP mytrap IF FSSize("HOME:/spy.log" \Free)/FSSize("HOME:/spy.log" \Total) <= 0.1 THEN TPWrite "The disk is almost full"; alertFree; ENDIF ENDTRAP PROC alertInit(num freq) CONNECT timeint WITH mytrap; ITimer freq,timeint; ENDPROC PROC alertFree() IDelete timeint; ENDPROC This is a complete example for implementing an alert service that prints a warning on the FlexPendant when the remaining free space in the " HOME :" file system is less than 10%. Error handling The following recoverable errors can be generated. The errors can be handled in an ERROR handler. The system variable ERRNO will be set to: Syntax FSSize’(’ [ Name ’:=’ ] < expression ( IN ) of string> [ ´\´Total ] | [ ´\´Free ] [ ´\´Kbyte ] [ ´\´Mbyte ]’)’ A function with a return value of the data type num . ERR_FILEACC The file system does not exist ERR_FILESIZE The size exceeds the max integer value for a num, 8388608 Continued Continues on next page 2 Functions 2.47. FSSize - Retrieve the size of a file system RobotWare - OS 3HAC 16581-1 Revision: J 850 © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Make a directory MakeDir - Create a new directory on page 218 Remove a directory RemoveDir - Delete a directory on page 355 Rename a file RenameFile - Rename a file on page 357 Remove a file RemoveFile - Delete a file on page 356 Copy a file CopyFile - Copy a file on page 65 Check file type IsFile - Check the type of a file on page 878 Check file size FileSize - Retrieve the size of a file on page 842 Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
852
2 Functions 2.47. FSSize - Retrieve the size of a file system RobotWare - OS 849 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. [ \Mbyte ] Data type: switch Convert the number of bytes read to megabytes, e.g divide the size with 1048576 (1024*1024). Program execution This function returns a numeric that specifies the size of the file system in which the specified file resides. More examples More examples of the function FSSize are illustrated below. Example 1 LOCAL VAR intnum timeint; LOCAL TRAP mytrap IF FSSize("HOME:/spy.log" \Free)/FSSize("HOME:/spy.log" \Total) <= 0.1 THEN TPWrite "The disk is almost full"; alertFree; ENDIF ENDTRAP PROC alertInit(num freq) CONNECT timeint WITH mytrap; ITimer freq,timeint; ENDPROC PROC alertFree() IDelete timeint; ENDPROC This is a complete example for implementing an alert service that prints a warning on the FlexPendant when the remaining free space in the " HOME :" file system is less than 10%. Error handling The following recoverable errors can be generated. The errors can be handled in an ERROR handler. The system variable ERRNO will be set to: Syntax FSSize’(’ [ Name ’:=’ ] < expression ( IN ) of string> [ ´\´Total ] | [ ´\´Free ] [ ´\´Kbyte ] [ ´\´Mbyte ]’)’ A function with a return value of the data type num . ERR_FILEACC The file system does not exist ERR_FILESIZE The size exceeds the max integer value for a num, 8388608 Continued Continues on next page 2 Functions 2.47. FSSize - Retrieve the size of a file system RobotWare - OS 3HAC 16581-1 Revision: J 850 © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Make a directory MakeDir - Create a new directory on page 218 Remove a directory RemoveDir - Delete a directory on page 355 Rename a file RenameFile - Rename a file on page 357 Remove a file RemoveFile - Delete a file on page 356 Copy a file CopyFile - Copy a file on page 65 Check file type IsFile - Check the type of a file on page 878 Check file size FileSize - Retrieve the size of a file on page 842 Continued 2 Functions 2.48. GetMecUnitName - Get the name of the mechanical unit RobotWare - OS 851 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.48. GetMecUnitName - Get the name of the mechanical unit Usage GetMecUnitName is used to get the name of a mechanical unit with one of the installed mechanical units as the argument. This function returns the mechanical units name as a string . Basic examples Basic examples of the function GetMecUnitName are illustrated below. Example 1 VAR string mecname; mecname:= GetMecUnitName(T_ROB1); mecname will get the value "T_ROB1" as a string . All mechanical units (data type mecunit ) such as T_ROB1 are predefined in the system. Return value Data type: string The return value will be the mechanical unit name as a string . Arguments GetMecUnitName ( MechUnit ) MechUnit Mechanical Unit Data type: mecunit MechUnit takes one of the predefined mechanical units found in the configuration. Syntax GetMecUnitName’(’ [ MechUnit ’:=’ ] < variable ( VAR ) of mecunit > ’)’ A function with a return value of the data type string . Related information For information about See Mechanical unit mecunit - Mechanical unit on page 1139
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
853
2 Functions 2.47. FSSize - Retrieve the size of a file system RobotWare - OS 3HAC 16581-1 Revision: J 850 © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Make a directory MakeDir - Create a new directory on page 218 Remove a directory RemoveDir - Delete a directory on page 355 Rename a file RenameFile - Rename a file on page 357 Remove a file RemoveFile - Delete a file on page 356 Copy a file CopyFile - Copy a file on page 65 Check file type IsFile - Check the type of a file on page 878 Check file size FileSize - Retrieve the size of a file on page 842 Continued 2 Functions 2.48. GetMecUnitName - Get the name of the mechanical unit RobotWare - OS 851 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.48. GetMecUnitName - Get the name of the mechanical unit Usage GetMecUnitName is used to get the name of a mechanical unit with one of the installed mechanical units as the argument. This function returns the mechanical units name as a string . Basic examples Basic examples of the function GetMecUnitName are illustrated below. Example 1 VAR string mecname; mecname:= GetMecUnitName(T_ROB1); mecname will get the value "T_ROB1" as a string . All mechanical units (data type mecunit ) such as T_ROB1 are predefined in the system. Return value Data type: string The return value will be the mechanical unit name as a string . Arguments GetMecUnitName ( MechUnit ) MechUnit Mechanical Unit Data type: mecunit MechUnit takes one of the predefined mechanical units found in the configuration. Syntax GetMecUnitName’(’ [ MechUnit ’:=’ ] < variable ( VAR ) of mecunit > ’)’ A function with a return value of the data type string . Related information For information about See Mechanical unit mecunit - Mechanical unit on page 1139 2 Functions 2.49. GetNextMechUnit - Get name and data for mechanical units RobotWare - OS 3HAC 16581-1 Revision: J 852 © Copyright 2004-2010 ABB. All rights reserved. 2.49. GetNextMechUnit - Get name and data for mechanical units Usage GetNextMechUnit ( Get Next Mechanical Unit ) is used for retrieving the name of mechanical units in the robot system. Besides the mechanical unit name, several optional properties of the mechanical unit can be retrieved. Basic examples Basic examples of the function GetNextMechUnit are illustrated below. See also More examples on page 853 . Example 1 VAR num listno := 0; VAR string name := ""; TPWrite "List of mechanical units:"; WHILE GetNextMechUnit(listno, name) DO TPWrite name; ! listno := listno + 1 is done by GetNextMechUnit ENDWHILE The name of all mechanical units available in the system, will be displayed on the FlexPendant. Return Value Data type: bool TRUE if a mechanical unit was found, otherwise FALSE . Arguments GetNextMechUnit ( ListNumber UnitName [\MecRef] [\TCPRob] [\NoOfAxes] [\MecTaskNo] [\MotPlanNo] [\Active] [\DriveModule] [\OKToDeact]) ListNumber Data type: num This specifies which items in the system internal list of mechanical units are to be retrieved. At return, this variable is always incremented by one by the system to make it easy to access the next unit in the list. The first mechanical unit in the list has index 0. UnitName Data type: string The name of the mechanical unit. [\MecRef] Data type: mecunit The system reference to the mechanical 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
854
2 Functions 2.48. GetMecUnitName - Get the name of the mechanical unit RobotWare - OS 851 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.48. GetMecUnitName - Get the name of the mechanical unit Usage GetMecUnitName is used to get the name of a mechanical unit with one of the installed mechanical units as the argument. This function returns the mechanical units name as a string . Basic examples Basic examples of the function GetMecUnitName are illustrated below. Example 1 VAR string mecname; mecname:= GetMecUnitName(T_ROB1); mecname will get the value "T_ROB1" as a string . All mechanical units (data type mecunit ) such as T_ROB1 are predefined in the system. Return value Data type: string The return value will be the mechanical unit name as a string . Arguments GetMecUnitName ( MechUnit ) MechUnit Mechanical Unit Data type: mecunit MechUnit takes one of the predefined mechanical units found in the configuration. Syntax GetMecUnitName’(’ [ MechUnit ’:=’ ] < variable ( VAR ) of mecunit > ’)’ A function with a return value of the data type string . Related information For information about See Mechanical unit mecunit - Mechanical unit on page 1139 2 Functions 2.49. GetNextMechUnit - Get name and data for mechanical units RobotWare - OS 3HAC 16581-1 Revision: J 852 © Copyright 2004-2010 ABB. All rights reserved. 2.49. GetNextMechUnit - Get name and data for mechanical units Usage GetNextMechUnit ( Get Next Mechanical Unit ) is used for retrieving the name of mechanical units in the robot system. Besides the mechanical unit name, several optional properties of the mechanical unit can be retrieved. Basic examples Basic examples of the function GetNextMechUnit are illustrated below. See also More examples on page 853 . Example 1 VAR num listno := 0; VAR string name := ""; TPWrite "List of mechanical units:"; WHILE GetNextMechUnit(listno, name) DO TPWrite name; ! listno := listno + 1 is done by GetNextMechUnit ENDWHILE The name of all mechanical units available in the system, will be displayed on the FlexPendant. Return Value Data type: bool TRUE if a mechanical unit was found, otherwise FALSE . Arguments GetNextMechUnit ( ListNumber UnitName [\MecRef] [\TCPRob] [\NoOfAxes] [\MecTaskNo] [\MotPlanNo] [\Active] [\DriveModule] [\OKToDeact]) ListNumber Data type: num This specifies which items in the system internal list of mechanical units are to be retrieved. At return, this variable is always incremented by one by the system to make it easy to access the next unit in the list. The first mechanical unit in the list has index 0. UnitName Data type: string The name of the mechanical unit. [\MecRef] Data type: mecunit The system reference to the mechanical unit. Continues on next page 2 Functions 2.49. GetNextMechUnit - Get name and data for mechanical units RobotWare - OS 853 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. [\TCPRob] Data type: bool TRUE if the mechanical unit is a TCP robot, otherwise FALSE. [\NoOfAxes] Data type: num Number of axes for the mechanical unit. Integer value. [\MecTaskNo] Data type: num The program task number that controls the mechanical unit. Integer value in range 1-20. If not controlling by any program task, -1 is returned. This actual connection is defined in the system parameters domain controller (can in some application be redefined at runtime). [\MotPlanNo] Data type: num The motion planner number that controls the mechanical unit. Integer value in range 1-6. If not controlling by any motion planner, -1 is returned. This connection is defined in the system parameters domain controller. [\Active] Data type: bool TRUE if the mechanical unit is active, otherwise FALSE. [\DriveModule] Data type: num The Drive Module number 1 - 4 used by this mechanical unit. [\OKToDeact] Data type: bool Return TRUE, if allowed to deactivate the mechanical unit from RAPID program. More examples More examples of the instruction GetNextMechUnit are illustrated below. Example 1 VAR num listno := 4; VAR string name := ""; VAR bool found := FALSE; found := GetNextMechUnit (listno, name); If found is set to TRUE , the name of mechanical unit number 4 will be in the variable name , else name contains only an empty string. 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
855
2 Functions 2.49. GetNextMechUnit - Get name and data for mechanical units RobotWare - OS 3HAC 16581-1 Revision: J 852 © Copyright 2004-2010 ABB. All rights reserved. 2.49. GetNextMechUnit - Get name and data for mechanical units Usage GetNextMechUnit ( Get Next Mechanical Unit ) is used for retrieving the name of mechanical units in the robot system. Besides the mechanical unit name, several optional properties of the mechanical unit can be retrieved. Basic examples Basic examples of the function GetNextMechUnit are illustrated below. See also More examples on page 853 . Example 1 VAR num listno := 0; VAR string name := ""; TPWrite "List of mechanical units:"; WHILE GetNextMechUnit(listno, name) DO TPWrite name; ! listno := listno + 1 is done by GetNextMechUnit ENDWHILE The name of all mechanical units available in the system, will be displayed on the FlexPendant. Return Value Data type: bool TRUE if a mechanical unit was found, otherwise FALSE . Arguments GetNextMechUnit ( ListNumber UnitName [\MecRef] [\TCPRob] [\NoOfAxes] [\MecTaskNo] [\MotPlanNo] [\Active] [\DriveModule] [\OKToDeact]) ListNumber Data type: num This specifies which items in the system internal list of mechanical units are to be retrieved. At return, this variable is always incremented by one by the system to make it easy to access the next unit in the list. The first mechanical unit in the list has index 0. UnitName Data type: string The name of the mechanical unit. [\MecRef] Data type: mecunit The system reference to the mechanical unit. Continues on next page 2 Functions 2.49. GetNextMechUnit - Get name and data for mechanical units RobotWare - OS 853 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. [\TCPRob] Data type: bool TRUE if the mechanical unit is a TCP robot, otherwise FALSE. [\NoOfAxes] Data type: num Number of axes for the mechanical unit. Integer value. [\MecTaskNo] Data type: num The program task number that controls the mechanical unit. Integer value in range 1-20. If not controlling by any program task, -1 is returned. This actual connection is defined in the system parameters domain controller (can in some application be redefined at runtime). [\MotPlanNo] Data type: num The motion planner number that controls the mechanical unit. Integer value in range 1-6. If not controlling by any motion planner, -1 is returned. This connection is defined in the system parameters domain controller. [\Active] Data type: bool TRUE if the mechanical unit is active, otherwise FALSE. [\DriveModule] Data type: num The Drive Module number 1 - 4 used by this mechanical unit. [\OKToDeact] Data type: bool Return TRUE, if allowed to deactivate the mechanical unit from RAPID program. More examples More examples of the instruction GetNextMechUnit are illustrated below. Example 1 VAR num listno := 4; VAR string name := ""; VAR bool found := FALSE; found := GetNextMechUnit (listno, name); If found is set to TRUE , the name of mechanical unit number 4 will be in the variable name , else name contains only an empty string. Continued Continues on next page 2 Functions 2.49. GetNextMechUnit - Get name and data for mechanical units RobotWare - OS 3HAC 16581-1 Revision: J 854 © Copyright 2004-2010 ABB. All rights reserved. Syntax GetNextMechUnit ’(’ [ ListNumber ’:=’ ] < variable ( VAR ) of num>’ ,’ [ UnitName’ :=’ ] < variable ( VAR ) of string> ’,’ [ ’\’ MecRef’ :=’ < variable ( VAR ) of mecunit> ] [ ’\’ TCPRob’ :=’ < variable ( VAR ) of bool> ] [ ’\’ NoOfAxes’ :=’ < variable ( VAR ) of num> ] [ ’\’ MecTaskNo’ :=’ < variable ( VAR ) of num> ] [ ’\’ MotPlanNo’ :=’ < variable ( VAR ) of num> ] [ ’\’ Active’ :=’ < variable ( VAR ) of bool>] [ ’\’ DriveModule’ :=’ < variable ( VAR ) of num>] [ ’\’ OKToDeact’ :=’ < variable ( VAR ) of bool>] ’;’ A function with a return value of the data type bool . Related information For information about See Mechanical unit mecunit - Mechanical unit on page 1139 Activating/Deactivating mechanical units ActUnit - Activates a mechanical unit on page 17 DeactUnit - Deactivates a mechanical unit on page 79 Characteristics of non-value data types Technical reference manual - RAPID overview , section Basic Characteristics - Data types Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
856
2 Functions 2.49. GetNextMechUnit - Get name and data for mechanical units RobotWare - OS 853 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. [\TCPRob] Data type: bool TRUE if the mechanical unit is a TCP robot, otherwise FALSE. [\NoOfAxes] Data type: num Number of axes for the mechanical unit. Integer value. [\MecTaskNo] Data type: num The program task number that controls the mechanical unit. Integer value in range 1-20. If not controlling by any program task, -1 is returned. This actual connection is defined in the system parameters domain controller (can in some application be redefined at runtime). [\MotPlanNo] Data type: num The motion planner number that controls the mechanical unit. Integer value in range 1-6. If not controlling by any motion planner, -1 is returned. This connection is defined in the system parameters domain controller. [\Active] Data type: bool TRUE if the mechanical unit is active, otherwise FALSE. [\DriveModule] Data type: num The Drive Module number 1 - 4 used by this mechanical unit. [\OKToDeact] Data type: bool Return TRUE, if allowed to deactivate the mechanical unit from RAPID program. More examples More examples of the instruction GetNextMechUnit are illustrated below. Example 1 VAR num listno := 4; VAR string name := ""; VAR bool found := FALSE; found := GetNextMechUnit (listno, name); If found is set to TRUE , the name of mechanical unit number 4 will be in the variable name , else name contains only an empty string. Continued Continues on next page 2 Functions 2.49. GetNextMechUnit - Get name and data for mechanical units RobotWare - OS 3HAC 16581-1 Revision: J 854 © Copyright 2004-2010 ABB. All rights reserved. Syntax GetNextMechUnit ’(’ [ ListNumber ’:=’ ] < variable ( VAR ) of num>’ ,’ [ UnitName’ :=’ ] < variable ( VAR ) of string> ’,’ [ ’\’ MecRef’ :=’ < variable ( VAR ) of mecunit> ] [ ’\’ TCPRob’ :=’ < variable ( VAR ) of bool> ] [ ’\’ NoOfAxes’ :=’ < variable ( VAR ) of num> ] [ ’\’ MecTaskNo’ :=’ < variable ( VAR ) of num> ] [ ’\’ MotPlanNo’ :=’ < variable ( VAR ) of num> ] [ ’\’ Active’ :=’ < variable ( VAR ) of bool>] [ ’\’ DriveModule’ :=’ < variable ( VAR ) of num>] [ ’\’ OKToDeact’ :=’ < variable ( VAR ) of bool>] ’;’ A function with a return value of the data type bool . Related information For information about See Mechanical unit mecunit - Mechanical unit on page 1139 Activating/Deactivating mechanical units ActUnit - Activates a mechanical unit on page 17 DeactUnit - Deactivates a mechanical unit on page 79 Characteristics of non-value data types Technical reference manual - RAPID overview , section Basic Characteristics - Data types Continued 2 Functions 2.50. GetNextSym - Get next matching symbol RobotWare - OS 855 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.50. GetNextSym - Get next matching symbol Usage GetNextSym ( Get Next Symbol ) is used together with SetDataSearch to retrieve data objects from the system. Basic examples Basic examples of the function GetNextSym are illustrated below. Example 1 VAR datapos block; VAR string name; VAR bool truevar:=TRUE; ... SetDataSearch "bool" \Object:="my.*" \InMod:="mymod"\LocalSym; WHILE GetNextSym(name,block) DO SetDataVal name\Block:=block,truevar; ENDWHILE This session will set all local bool data objects that begin with my in the module mymod to TRUE . Return value Data type: bool TRUE if a new object has been retrieved, the object name and its enclosed block is then returned in its arguments. FALSE if no more objects match. Arguments GetNextSym (Object Block [\Recursive]) Object Data type: string Variable ( VAR or PERS ) to store the name of the data object that will be retrieved. Block Data type: datapos The enclosed block to the object. [ \Recursive ] Data type: switch This will force the search to enter the block below, e.g. if the search session has begun at the task level, it will also search modules and routines below the task. Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
857
2 Functions 2.49. GetNextMechUnit - Get name and data for mechanical units RobotWare - OS 3HAC 16581-1 Revision: J 854 © Copyright 2004-2010 ABB. All rights reserved. Syntax GetNextMechUnit ’(’ [ ListNumber ’:=’ ] < variable ( VAR ) of num>’ ,’ [ UnitName’ :=’ ] < variable ( VAR ) of string> ’,’ [ ’\’ MecRef’ :=’ < variable ( VAR ) of mecunit> ] [ ’\’ TCPRob’ :=’ < variable ( VAR ) of bool> ] [ ’\’ NoOfAxes’ :=’ < variable ( VAR ) of num> ] [ ’\’ MecTaskNo’ :=’ < variable ( VAR ) of num> ] [ ’\’ MotPlanNo’ :=’ < variable ( VAR ) of num> ] [ ’\’ Active’ :=’ < variable ( VAR ) of bool>] [ ’\’ DriveModule’ :=’ < variable ( VAR ) of num>] [ ’\’ OKToDeact’ :=’ < variable ( VAR ) of bool>] ’;’ A function with a return value of the data type bool . Related information For information about See Mechanical unit mecunit - Mechanical unit on page 1139 Activating/Deactivating mechanical units ActUnit - Activates a mechanical unit on page 17 DeactUnit - Deactivates a mechanical unit on page 79 Characteristics of non-value data types Technical reference manual - RAPID overview , section Basic Characteristics - Data types Continued 2 Functions 2.50. GetNextSym - Get next matching symbol RobotWare - OS 855 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.50. GetNextSym - Get next matching symbol Usage GetNextSym ( Get Next Symbol ) is used together with SetDataSearch to retrieve data objects from the system. Basic examples Basic examples of the function GetNextSym are illustrated below. Example 1 VAR datapos block; VAR string name; VAR bool truevar:=TRUE; ... SetDataSearch "bool" \Object:="my.*" \InMod:="mymod"\LocalSym; WHILE GetNextSym(name,block) DO SetDataVal name\Block:=block,truevar; ENDWHILE This session will set all local bool data objects that begin with my in the module mymod to TRUE . Return value Data type: bool TRUE if a new object has been retrieved, the object name and its enclosed block is then returned in its arguments. FALSE if no more objects match. Arguments GetNextSym (Object Block [\Recursive]) Object Data type: string Variable ( VAR or PERS ) to store the name of the data object that will be retrieved. Block Data type: datapos The enclosed block to the object. [ \Recursive ] Data type: switch This will force the search to enter the block below, e.g. if the search session has begun at the task level, it will also search modules and routines below the task. Continues on next page 2 Functions 2.50. GetNextSym - Get next matching symbol RobotWare - OS 3HAC 16581-1 Revision: J 856 © Copyright 2004-2010 ABB. All rights reserved. Syntax GetNextSym ‘(‘ [ Object ’:=’ ] < variable or persistent ( INOUT ) of string > ’,’ [ Block ’:=’] <variable ( VAR ) of datapos> [’\’Recursive ] ’)’ A function with a return value of the data type bool . Related information For information about See Define a symbol set in a search session SetDataSearch - Define the symbol set in a search sequence on page 433 Get the value of a data object GetDataVal - Get the value of a data object on page 110 Set the value of a data object SetDataVal - Set the value of a data object on page 437 Set the value of many data objects SetAllDataVal - Set a value to all data objects in a defined set on page 429 The related data type datapos datapos - Enclosing block for a data object on page 1101 Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
858
2 Functions 2.50. GetNextSym - Get next matching symbol RobotWare - OS 855 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.50. GetNextSym - Get next matching symbol Usage GetNextSym ( Get Next Symbol ) is used together with SetDataSearch to retrieve data objects from the system. Basic examples Basic examples of the function GetNextSym are illustrated below. Example 1 VAR datapos block; VAR string name; VAR bool truevar:=TRUE; ... SetDataSearch "bool" \Object:="my.*" \InMod:="mymod"\LocalSym; WHILE GetNextSym(name,block) DO SetDataVal name\Block:=block,truevar; ENDWHILE This session will set all local bool data objects that begin with my in the module mymod to TRUE . Return value Data type: bool TRUE if a new object has been retrieved, the object name and its enclosed block is then returned in its arguments. FALSE if no more objects match. Arguments GetNextSym (Object Block [\Recursive]) Object Data type: string Variable ( VAR or PERS ) to store the name of the data object that will be retrieved. Block Data type: datapos The enclosed block to the object. [ \Recursive ] Data type: switch This will force the search to enter the block below, e.g. if the search session has begun at the task level, it will also search modules and routines below the task. Continues on next page 2 Functions 2.50. GetNextSym - Get next matching symbol RobotWare - OS 3HAC 16581-1 Revision: J 856 © Copyright 2004-2010 ABB. All rights reserved. Syntax GetNextSym ‘(‘ [ Object ’:=’ ] < variable or persistent ( INOUT ) of string > ’,’ [ Block ’:=’] <variable ( VAR ) of datapos> [’\’Recursive ] ’)’ A function with a return value of the data type bool . Related information For information about See Define a symbol set in a search session SetDataSearch - Define the symbol set in a search sequence on page 433 Get the value of a data object GetDataVal - Get the value of a data object on page 110 Set the value of a data object SetDataVal - Set the value of a data object on page 437 Set the value of many data objects SetAllDataVal - Set a value to all data objects in a defined set on page 429 The related data type datapos datapos - Enclosing block for a data object on page 1101 Continued 2 Functions 2.51. GetSysInfo - Get information about the system RobotWare - OS 857 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.51. GetSysInfo - Get information about the system Usage GetSysInfo is used to read information about the system. Available information includes Serial Number, SoftWare Version, Robot Type, Controller ID or Lan ip address. Basic examples Basic examples of the function GetSysInfo are illustrated below. Example 1 VAR string serial; VAR string version; VAR string rtype; VAR string cid; VAR string lanip; VAR string clang; serial := GetSysInfo(\SerialNo); version := GetSysInfo(\SWVersion); rtype := GetSysInfo(\RobotType); cid := GetSysInfo(\CtrlId); lanip := GetSysInfo(\LanIp); clang := GetSysInfo(\CtrlLang); The serial number will be stored in the variable serial , the version number will be stored in the variable version , the robot number will be stored in the variable rtype, the controller ID number will be stored in the variable cid , the LAN ip address will be stored in the variable lanip and the controller language will be stored in the variable clang . Examples of returned strings: Serial Number: 14-21858 Software Version: ROBOTWARE_5.08.134 Robot Type: 2400/16 Type A Controller ID: 44-1267 LAN ip address: 192.168.8.103 Language: en Return value Data type: string One of Serial Number, SoftWare Version, Robot Type, Controller ID, LAN ip address or Controller Language. Read more about the return values in Arguments below. Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
859
2 Functions 2.50. GetNextSym - Get next matching symbol RobotWare - OS 3HAC 16581-1 Revision: J 856 © Copyright 2004-2010 ABB. All rights reserved. Syntax GetNextSym ‘(‘ [ Object ’:=’ ] < variable or persistent ( INOUT ) of string > ’,’ [ Block ’:=’] <variable ( VAR ) of datapos> [’\’Recursive ] ’)’ A function with a return value of the data type bool . Related information For information about See Define a symbol set in a search session SetDataSearch - Define the symbol set in a search sequence on page 433 Get the value of a data object GetDataVal - Get the value of a data object on page 110 Set the value of a data object SetDataVal - Set the value of a data object on page 437 Set the value of many data objects SetAllDataVal - Set a value to all data objects in a defined set on page 429 The related data type datapos datapos - Enclosing block for a data object on page 1101 Continued 2 Functions 2.51. GetSysInfo - Get information about the system RobotWare - OS 857 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.51. GetSysInfo - Get information about the system Usage GetSysInfo is used to read information about the system. Available information includes Serial Number, SoftWare Version, Robot Type, Controller ID or Lan ip address. Basic examples Basic examples of the function GetSysInfo are illustrated below. Example 1 VAR string serial; VAR string version; VAR string rtype; VAR string cid; VAR string lanip; VAR string clang; serial := GetSysInfo(\SerialNo); version := GetSysInfo(\SWVersion); rtype := GetSysInfo(\RobotType); cid := GetSysInfo(\CtrlId); lanip := GetSysInfo(\LanIp); clang := GetSysInfo(\CtrlLang); The serial number will be stored in the variable serial , the version number will be stored in the variable version , the robot number will be stored in the variable rtype, the controller ID number will be stored in the variable cid , the LAN ip address will be stored in the variable lanip and the controller language will be stored in the variable clang . Examples of returned strings: Serial Number: 14-21858 Software Version: ROBOTWARE_5.08.134 Robot Type: 2400/16 Type A Controller ID: 44-1267 LAN ip address: 192.168.8.103 Language: en Return value Data type: string One of Serial Number, SoftWare Version, Robot Type, Controller ID, LAN ip address or Controller Language. Read more about the return values in Arguments below. Continues on next page 2 Functions 2.51. GetSysInfo - Get information about the system RobotWare - OS 3HAC 16581-1 Revision: J 858 © Copyright 2004-2010 ABB. All rights reserved. Arguments GetSysInfo ([\SerialNo] | [\SWVersion] | [\RobotType] | [\CtrlId] | [\LanIp] | [\CtrlLang]) One of the arguments SerialNo , SWVersion , RobotType , CtrlId , LanIp or CtrlLang must be present. [ \SerialNo ] Serial Number Data type: switch Returns the serial number. [ \SWVersion ] Software Version Data type: switch Returns the software version. [ \RobotType ] Data type: switch Returns the robot type in the current or connected task. If the mechanical unit is not a TCP- robot, a "-" is returned. [ \CtrlId ] Controller ID Data type: switch Returns the controller ID. Returns an empty string if no Controller ID is specified. A string with " VC " is returned if this option is used in the Virtual Controller. [ \LanIp ] Lan Ip address Data type: switch Returns the LAN ip address for the controller. A string with " VC " is returned if this option is used in the Virtual Controller. An empty string is returned if no LAN ip address is configured in the system. [ \CtrlLang ] Controller Language Data type: switch Returns the language used on the controller. Return value Language cs Czech zh Chinese (simplified Chinese, mainland Chinese) da Danish nl Dutch en English fi Finnish fr French 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
860
2 Functions 2.51. GetSysInfo - Get information about the system RobotWare - OS 857 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.51. GetSysInfo - Get information about the system Usage GetSysInfo is used to read information about the system. Available information includes Serial Number, SoftWare Version, Robot Type, Controller ID or Lan ip address. Basic examples Basic examples of the function GetSysInfo are illustrated below. Example 1 VAR string serial; VAR string version; VAR string rtype; VAR string cid; VAR string lanip; VAR string clang; serial := GetSysInfo(\SerialNo); version := GetSysInfo(\SWVersion); rtype := GetSysInfo(\RobotType); cid := GetSysInfo(\CtrlId); lanip := GetSysInfo(\LanIp); clang := GetSysInfo(\CtrlLang); The serial number will be stored in the variable serial , the version number will be stored in the variable version , the robot number will be stored in the variable rtype, the controller ID number will be stored in the variable cid , the LAN ip address will be stored in the variable lanip and the controller language will be stored in the variable clang . Examples of returned strings: Serial Number: 14-21858 Software Version: ROBOTWARE_5.08.134 Robot Type: 2400/16 Type A Controller ID: 44-1267 LAN ip address: 192.168.8.103 Language: en Return value Data type: string One of Serial Number, SoftWare Version, Robot Type, Controller ID, LAN ip address or Controller Language. Read more about the return values in Arguments below. Continues on next page 2 Functions 2.51. GetSysInfo - Get information about the system RobotWare - OS 3HAC 16581-1 Revision: J 858 © Copyright 2004-2010 ABB. All rights reserved. Arguments GetSysInfo ([\SerialNo] | [\SWVersion] | [\RobotType] | [\CtrlId] | [\LanIp] | [\CtrlLang]) One of the arguments SerialNo , SWVersion , RobotType , CtrlId , LanIp or CtrlLang must be present. [ \SerialNo ] Serial Number Data type: switch Returns the serial number. [ \SWVersion ] Software Version Data type: switch Returns the software version. [ \RobotType ] Data type: switch Returns the robot type in the current or connected task. If the mechanical unit is not a TCP- robot, a "-" is returned. [ \CtrlId ] Controller ID Data type: switch Returns the controller ID. Returns an empty string if no Controller ID is specified. A string with " VC " is returned if this option is used in the Virtual Controller. [ \LanIp ] Lan Ip address Data type: switch Returns the LAN ip address for the controller. A string with " VC " is returned if this option is used in the Virtual Controller. An empty string is returned if no LAN ip address is configured in the system. [ \CtrlLang ] Controller Language Data type: switch Returns the language used on the controller. Return value Language cs Czech zh Chinese (simplified Chinese, mainland Chinese) da Danish nl Dutch en English fi Finnish fr French Continued Continues on next page 2 Functions 2.51. GetSysInfo - Get information about the system RobotWare - OS 859 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Syntax GetSysInfo’(’ [’\’SerialNo] | [’\’SWVersion] | [’\’RobotType] | [’\’CtrlId] | [’\’LanIp] | [’\’CtrlLang]’)’ A function with a return value of the data type string . Related information de German hu Hungarian it Italian ja Japanese ko Korean pt Portuguese (Brazilian Portuguese) ru Russian es Spanish sv Swedish tr Turkish Return value Language For information about See Test the identity of the system IsSysId - Test system identity on page 890 Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
861
2 Functions 2.51. GetSysInfo - Get information about the system RobotWare - OS 3HAC 16581-1 Revision: J 858 © Copyright 2004-2010 ABB. All rights reserved. Arguments GetSysInfo ([\SerialNo] | [\SWVersion] | [\RobotType] | [\CtrlId] | [\LanIp] | [\CtrlLang]) One of the arguments SerialNo , SWVersion , RobotType , CtrlId , LanIp or CtrlLang must be present. [ \SerialNo ] Serial Number Data type: switch Returns the serial number. [ \SWVersion ] Software Version Data type: switch Returns the software version. [ \RobotType ] Data type: switch Returns the robot type in the current or connected task. If the mechanical unit is not a TCP- robot, a "-" is returned. [ \CtrlId ] Controller ID Data type: switch Returns the controller ID. Returns an empty string if no Controller ID is specified. A string with " VC " is returned if this option is used in the Virtual Controller. [ \LanIp ] Lan Ip address Data type: switch Returns the LAN ip address for the controller. A string with " VC " is returned if this option is used in the Virtual Controller. An empty string is returned if no LAN ip address is configured in the system. [ \CtrlLang ] Controller Language Data type: switch Returns the language used on the controller. Return value Language cs Czech zh Chinese (simplified Chinese, mainland Chinese) da Danish nl Dutch en English fi Finnish fr French Continued Continues on next page 2 Functions 2.51. GetSysInfo - Get information about the system RobotWare - OS 859 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Syntax GetSysInfo’(’ [’\’SerialNo] | [’\’SWVersion] | [’\’RobotType] | [’\’CtrlId] | [’\’LanIp] | [’\’CtrlLang]’)’ A function with a return value of the data type string . Related information de German hu Hungarian it Italian ja Japanese ko Korean pt Portuguese (Brazilian Portuguese) ru Russian es Spanish sv Swedish tr Turkish Return value Language For information about See Test the identity of the system IsSysId - Test system identity on page 890 Continued 2 Functions 2.52. GetTaskName - Gets the name and number of current task RobotWare - OS 3HAC 16581-1 Revision: J 860 © Copyright 2004-2010 ABB. All rights reserved. 2.52. GetTaskName - Gets the name and number of current task Usage GetTaskName is used to get the identity of the current program task, with its name and number. It is also possible from some Non Motion Task to get the name and number of its connected Motion Task . For MultiMove System the system parameter Controller/Tasks/Use Mechanical Unit Group define the connected Motion Task and in a base system the main task is always the connected Motion Task from any other task. Basic examples Basic examples of the function GetTaskName are illustrated below. Example 1 VAR string taskname; ... taskname := GetTaskName(); The current task name is returned in the variable taskname. Example 2 VAR string taskname; VAR num taskno; ... taskname := GetTaskName(\TaskNo:=taskno); The current task name is returned in the variable taskname . The integer identity of the task is stored in the variable taskno . Example 3 VAR string taskname; VAR num taskno; ... taskname := GetTaskName(\MecTaskNo:=taskno); If current task is a Non Motion Task task, the name of the connected motion task is returned in the variable taskname . The numerical identity of the connected motion task is stored in the variable taskno . If current task controls some mechanical units, current task name is returned in the variable taskname . The numerical identity of the task is stored in the variable taskno . Return value Data type: string The name of the task in which the function is executed or the name of the connected motion task. Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
862
2 Functions 2.51. GetSysInfo - Get information about the system RobotWare - OS 859 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Syntax GetSysInfo’(’ [’\’SerialNo] | [’\’SWVersion] | [’\’RobotType] | [’\’CtrlId] | [’\’LanIp] | [’\’CtrlLang]’)’ A function with a return value of the data type string . Related information de German hu Hungarian it Italian ja Japanese ko Korean pt Portuguese (Brazilian Portuguese) ru Russian es Spanish sv Swedish tr Turkish Return value Language For information about See Test the identity of the system IsSysId - Test system identity on page 890 Continued 2 Functions 2.52. GetTaskName - Gets the name and number of current task RobotWare - OS 3HAC 16581-1 Revision: J 860 © Copyright 2004-2010 ABB. All rights reserved. 2.52. GetTaskName - Gets the name and number of current task Usage GetTaskName is used to get the identity of the current program task, with its name and number. It is also possible from some Non Motion Task to get the name and number of its connected Motion Task . For MultiMove System the system parameter Controller/Tasks/Use Mechanical Unit Group define the connected Motion Task and in a base system the main task is always the connected Motion Task from any other task. Basic examples Basic examples of the function GetTaskName are illustrated below. Example 1 VAR string taskname; ... taskname := GetTaskName(); The current task name is returned in the variable taskname. Example 2 VAR string taskname; VAR num taskno; ... taskname := GetTaskName(\TaskNo:=taskno); The current task name is returned in the variable taskname . The integer identity of the task is stored in the variable taskno . Example 3 VAR string taskname; VAR num taskno; ... taskname := GetTaskName(\MecTaskNo:=taskno); If current task is a Non Motion Task task, the name of the connected motion task is returned in the variable taskname . The numerical identity of the connected motion task is stored in the variable taskno . If current task controls some mechanical units, current task name is returned in the variable taskname . The numerical identity of the task is stored in the variable taskno . Return value Data type: string The name of the task in which the function is executed or the name of the connected motion task. Continues on next page 2 Functions 2.52. GetTaskName - Gets the name and number of current task RobotWare - OS 861 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Arguments GetTaskName ( [\TaskNo] | [\MecTaskNo] ) [\TaskNo] Data type: num Return current task name (same functionality if none of the switch \TaskNo or \MecTaskNo is used). Also get the identity of the current task represented as a integer value. The numbers returned will be in the range 1-20. [\MecTaskNo] Data type: num Return connected motion task name or current motion task name. Also get the identity of connected or current motion task represented as a integer value. The numbers returned will be in the range 1-20. Syntax GetTaskName’(’ [ \TaskNo ’:=’ ] < variable ( VAR ) of num > [ \MecTaskNo’:=’ ] < variable ( VAR ) of num > ’)’ A function with a return value of the data type string . Related information For information about See Multitasking Technical reference manual - RAPID overview , section RAPID Overview - RAPID summary Multitasking Technical reference manual - RAPID overview , section Basic characteristics - Mul- titasking Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
863
2 Functions 2.52. GetTaskName - Gets the name and number of current task RobotWare - OS 3HAC 16581-1 Revision: J 860 © Copyright 2004-2010 ABB. All rights reserved. 2.52. GetTaskName - Gets the name and number of current task Usage GetTaskName is used to get the identity of the current program task, with its name and number. It is also possible from some Non Motion Task to get the name and number of its connected Motion Task . For MultiMove System the system parameter Controller/Tasks/Use Mechanical Unit Group define the connected Motion Task and in a base system the main task is always the connected Motion Task from any other task. Basic examples Basic examples of the function GetTaskName are illustrated below. Example 1 VAR string taskname; ... taskname := GetTaskName(); The current task name is returned in the variable taskname. Example 2 VAR string taskname; VAR num taskno; ... taskname := GetTaskName(\TaskNo:=taskno); The current task name is returned in the variable taskname . The integer identity of the task is stored in the variable taskno . Example 3 VAR string taskname; VAR num taskno; ... taskname := GetTaskName(\MecTaskNo:=taskno); If current task is a Non Motion Task task, the name of the connected motion task is returned in the variable taskname . The numerical identity of the connected motion task is stored in the variable taskno . If current task controls some mechanical units, current task name is returned in the variable taskname . The numerical identity of the task is stored in the variable taskno . Return value Data type: string The name of the task in which the function is executed or the name of the connected motion task. Continues on next page 2 Functions 2.52. GetTaskName - Gets the name and number of current task RobotWare - OS 861 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Arguments GetTaskName ( [\TaskNo] | [\MecTaskNo] ) [\TaskNo] Data type: num Return current task name (same functionality if none of the switch \TaskNo or \MecTaskNo is used). Also get the identity of the current task represented as a integer value. The numbers returned will be in the range 1-20. [\MecTaskNo] Data type: num Return connected motion task name or current motion task name. Also get the identity of connected or current motion task represented as a integer value. The numbers returned will be in the range 1-20. Syntax GetTaskName’(’ [ \TaskNo ’:=’ ] < variable ( VAR ) of num > [ \MecTaskNo’:=’ ] < variable ( VAR ) of num > ’)’ A function with a return value of the data type string . Related information For information about See Multitasking Technical reference manual - RAPID overview , section RAPID Overview - RAPID summary Multitasking Technical reference manual - RAPID overview , section Basic characteristics - Mul- titasking Continued 2 Functions 2.53. GetTime - Reads the current time as a numeric value RobotWare - OS 3HAC 16581-1 Revision: J 862 © Copyright 2004-2010 ABB. All rights reserved. 2.53. GetTime - Reads the current time as a numeric value Usage GetTime is used to read a specified component of the current system time as a numeric value. GetTime can be used to: • have the program perform an action at a certain time • perform certain activities on a weekday • abstain from performing certain activities on the weekend • respond to errors differently depending on the time of day. Basic examples Basic examples of the function GetTime are illustrated below. Example 1 hour := GetTime(\Hour); The current hour is stored in the variable hour . Return value Data type: num One of the four time components specified below. Argument GetTime ( [\WDay] | [\Hour] | [\Min] | [\Sec] ) [\ WDay] Data type: switch Return the current weekday. Range: 1 to 7 (Monday to Sunday). [\Hour] Data type: switch Return the current hour. Range: 0 to 23. [\ Min] Data type: switch Return the current minute. Range: 0 to 59. [\ Sec] Data type: switch Return the current second. Range: 0 to 59. One of the arguments must be specified, otherwise program execution stops with an error message. Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
864
2 Functions 2.52. GetTaskName - Gets the name and number of current task RobotWare - OS 861 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Arguments GetTaskName ( [\TaskNo] | [\MecTaskNo] ) [\TaskNo] Data type: num Return current task name (same functionality if none of the switch \TaskNo or \MecTaskNo is used). Also get the identity of the current task represented as a integer value. The numbers returned will be in the range 1-20. [\MecTaskNo] Data type: num Return connected motion task name or current motion task name. Also get the identity of connected or current motion task represented as a integer value. The numbers returned will be in the range 1-20. Syntax GetTaskName’(’ [ \TaskNo ’:=’ ] < variable ( VAR ) of num > [ \MecTaskNo’:=’ ] < variable ( VAR ) of num > ’)’ A function with a return value of the data type string . Related information For information about See Multitasking Technical reference manual - RAPID overview , section RAPID Overview - RAPID summary Multitasking Technical reference manual - RAPID overview , section Basic characteristics - Mul- titasking Continued 2 Functions 2.53. GetTime - Reads the current time as a numeric value RobotWare - OS 3HAC 16581-1 Revision: J 862 © Copyright 2004-2010 ABB. All rights reserved. 2.53. GetTime - Reads the current time as a numeric value Usage GetTime is used to read a specified component of the current system time as a numeric value. GetTime can be used to: • have the program perform an action at a certain time • perform certain activities on a weekday • abstain from performing certain activities on the weekend • respond to errors differently depending on the time of day. Basic examples Basic examples of the function GetTime are illustrated below. Example 1 hour := GetTime(\Hour); The current hour is stored in the variable hour . Return value Data type: num One of the four time components specified below. Argument GetTime ( [\WDay] | [\Hour] | [\Min] | [\Sec] ) [\ WDay] Data type: switch Return the current weekday. Range: 1 to 7 (Monday to Sunday). [\Hour] Data type: switch Return the current hour. Range: 0 to 23. [\ Min] Data type: switch Return the current minute. Range: 0 to 59. [\ Sec] Data type: switch Return the current second. Range: 0 to 59. One of the arguments must be specified, otherwise program execution stops with an error message. Continues on next page 2 Functions 2.53. GetTime - Reads the current time as a numeric value RobotWare - OS 863 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. More examples More examples of the function GetTime are illustrated below. Example 1 weekday := GetTime(\WDay); hour := GetTime(\Hour); IF weekday < 6 AND hour >6 AND hour < 16 THEN production; ELSE maintenance; ENDIF If it is a weekday and the time is between 7:00 and 15:59 the robot performs production. At all other times, the robot is in the maintenance mode. Syntax GetTime ’(’ [’\’ WDay ] | [ ’\’ Hour ] | [ ’\’ Min ] | [ ’\’ Sec ] ’)’ A function with a return value of the type num . Related information For information about See Time and date instructions Technical reference manual - RAPID overview , section RAPID summary - System & time Setting the system clock Operating manual - IRC5 with FlexPendant , section Changing FlexPendant settings Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
865
2 Functions 2.53. GetTime - Reads the current time as a numeric value RobotWare - OS 3HAC 16581-1 Revision: J 862 © Copyright 2004-2010 ABB. All rights reserved. 2.53. GetTime - Reads the current time as a numeric value Usage GetTime is used to read a specified component of the current system time as a numeric value. GetTime can be used to: • have the program perform an action at a certain time • perform certain activities on a weekday • abstain from performing certain activities on the weekend • respond to errors differently depending on the time of day. Basic examples Basic examples of the function GetTime are illustrated below. Example 1 hour := GetTime(\Hour); The current hour is stored in the variable hour . Return value Data type: num One of the four time components specified below. Argument GetTime ( [\WDay] | [\Hour] | [\Min] | [\Sec] ) [\ WDay] Data type: switch Return the current weekday. Range: 1 to 7 (Monday to Sunday). [\Hour] Data type: switch Return the current hour. Range: 0 to 23. [\ Min] Data type: switch Return the current minute. Range: 0 to 59. [\ Sec] Data type: switch Return the current second. Range: 0 to 59. One of the arguments must be specified, otherwise program execution stops with an error message. Continues on next page 2 Functions 2.53. GetTime - Reads the current time as a numeric value RobotWare - OS 863 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. More examples More examples of the function GetTime are illustrated below. Example 1 weekday := GetTime(\WDay); hour := GetTime(\Hour); IF weekday < 6 AND hour >6 AND hour < 16 THEN production; ELSE maintenance; ENDIF If it is a weekday and the time is between 7:00 and 15:59 the robot performs production. At all other times, the robot is in the maintenance mode. Syntax GetTime ’(’ [’\’ WDay ] | [ ’\’ Hour ] | [ ’\’ Min ] | [ ’\’ Sec ] ’)’ A function with a return value of the type num . Related information For information about See Time and date instructions Technical reference manual - RAPID overview , section RAPID summary - System & time Setting the system clock Operating manual - IRC5 with FlexPendant , section Changing FlexPendant settings Continued 2 Functions 2.54. GInputDnum - Read value of group input signal RobotWare - OS 3HAC 16581-1 Revision: J 864 © Copyright 2004-2010 ABB. All rights reserved. 2.54. GInputDnum - Read value of group input signal Usage GInputDnum is used to read the current value of a group of digital input signals. Basic examples Basic examples of the function GInputDnum are illustrated below. Example 1 IF GInputDnum(gi2) = 55 THEN ... If the current value of the signal gi2 is equal to 55 , then ... Example 2 IF GInputDnum(gi2) = 4294967295 THEN ... If the current value of the signal gi2 is equal to 4294967295 , then ... Return value Data type: dnum The current value of the signal (a positive integer). The values of each signal in the group are read and interpreted as an unsigned binary number. This binary number is then converted to an integer. The value returned lies within a range that is dependent on the number of signals in the group. Number of signals Allowed value 1 0-1 2 0-3 3 0-7 4 0-15 5 0-31 6 0-63 7 0-127 8 0-255 9 0-511 10 0-1023 11 0-2047 12 0-4095 13 0-8191 14 0-16383 15 0-32767 16 0-65535 17 0-131071 18 0-262143 19 0-524287 20 0-1048575 21 0-2097151 Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
866
2 Functions 2.53. GetTime - Reads the current time as a numeric value RobotWare - OS 863 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. More examples More examples of the function GetTime are illustrated below. Example 1 weekday := GetTime(\WDay); hour := GetTime(\Hour); IF weekday < 6 AND hour >6 AND hour < 16 THEN production; ELSE maintenance; ENDIF If it is a weekday and the time is between 7:00 and 15:59 the robot performs production. At all other times, the robot is in the maintenance mode. Syntax GetTime ’(’ [’\’ WDay ] | [ ’\’ Hour ] | [ ’\’ Min ] | [ ’\’ Sec ] ’)’ A function with a return value of the type num . Related information For information about See Time and date instructions Technical reference manual - RAPID overview , section RAPID summary - System & time Setting the system clock Operating manual - IRC5 with FlexPendant , section Changing FlexPendant settings Continued 2 Functions 2.54. GInputDnum - Read value of group input signal RobotWare - OS 3HAC 16581-1 Revision: J 864 © Copyright 2004-2010 ABB. All rights reserved. 2.54. GInputDnum - Read value of group input signal Usage GInputDnum is used to read the current value of a group of digital input signals. Basic examples Basic examples of the function GInputDnum are illustrated below. Example 1 IF GInputDnum(gi2) = 55 THEN ... If the current value of the signal gi2 is equal to 55 , then ... Example 2 IF GInputDnum(gi2) = 4294967295 THEN ... If the current value of the signal gi2 is equal to 4294967295 , then ... Return value Data type: dnum The current value of the signal (a positive integer). The values of each signal in the group are read and interpreted as an unsigned binary number. This binary number is then converted to an integer. The value returned lies within a range that is dependent on the number of signals in the group. Number of signals Allowed value 1 0-1 2 0-3 3 0-7 4 0-15 5 0-31 6 0-63 7 0-127 8 0-255 9 0-511 10 0-1023 11 0-2047 12 0-4095 13 0-8191 14 0-16383 15 0-32767 16 0-65535 17 0-131071 18 0-262143 19 0-524287 20 0-1048575 21 0-2097151 Continues on next page 2 Functions 2.54. GInputDnum - Read value of group input signal RobotWare - OS 865 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Arguments GInputDnum (Signal) Signal Data type: signalgi The name of the signal group 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: Syntax GInputDnum ’(’ [ Signal ’:=’ ] < variable ( VAR ) of signalgi > ’)’ A function with a return value of data type dnum . Related information 22 0-4194303 23 0-8388607 24 0-16777215 25 0-33554431 26 0-67108863 27 0-134217727 28 0-268435455 29 0-536870911 30 0-1073741823 31 0-2147483647 32 0-4294967295 Number of signals Allowed value Error code Description ERR_NORUNUNIT No contact with the unit. For information about See Input/Output instructions Technical reference manual - RAPID overview, section RAPID Summary - Input and Output Signals Input/Output functionality in general Technical reference manual - RAPID overview, section Motion and I/O Principles 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
867
2 Functions 2.54. GInputDnum - Read value of group input signal RobotWare - OS 3HAC 16581-1 Revision: J 864 © Copyright 2004-2010 ABB. All rights reserved. 2.54. GInputDnum - Read value of group input signal Usage GInputDnum is used to read the current value of a group of digital input signals. Basic examples Basic examples of the function GInputDnum are illustrated below. Example 1 IF GInputDnum(gi2) = 55 THEN ... If the current value of the signal gi2 is equal to 55 , then ... Example 2 IF GInputDnum(gi2) = 4294967295 THEN ... If the current value of the signal gi2 is equal to 4294967295 , then ... Return value Data type: dnum The current value of the signal (a positive integer). The values of each signal in the group are read and interpreted as an unsigned binary number. This binary number is then converted to an integer. The value returned lies within a range that is dependent on the number of signals in the group. Number of signals Allowed value 1 0-1 2 0-3 3 0-7 4 0-15 5 0-31 6 0-63 7 0-127 8 0-255 9 0-511 10 0-1023 11 0-2047 12 0-4095 13 0-8191 14 0-16383 15 0-32767 16 0-65535 17 0-131071 18 0-262143 19 0-524287 20 0-1048575 21 0-2097151 Continues on next page 2 Functions 2.54. GInputDnum - Read value of group input signal RobotWare - OS 865 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Arguments GInputDnum (Signal) Signal Data type: signalgi The name of the signal group 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: Syntax GInputDnum ’(’ [ Signal ’:=’ ] < variable ( VAR ) of signalgi > ’)’ A function with a return value of data type dnum . Related information 22 0-4194303 23 0-8388607 24 0-16777215 25 0-33554431 26 0-67108863 27 0-134217727 28 0-268435455 29 0-536870911 30 0-1073741823 31 0-2147483647 32 0-4294967295 Number of signals Allowed value Error code Description ERR_NORUNUNIT No contact with the unit. For information about See Input/Output instructions Technical reference manual - RAPID overview, section RAPID Summary - Input and Output Signals Input/Output functionality in general Technical reference manual - RAPID overview, section Motion and I/O Principles Configuration of I/O Technical reference manual - System parameters Continued 2 Functions 2.55. GOutput - Reads the value of a group of digital output signals RobotWare - OS 3HAC 16581-1 Revision: J 866 © Copyright 2004-2010 ABB. All rights reserved. 2.55. GOutput - Reads the value of a group of digital output signals Usage GOutput is used to read the current value of a group of digital output signals. Basic examples Basic example of the function GOutput is illustrated below. Example 1 IF GOutput(go2) = 5 THEN ... If the current value of the signal go2 is equal to 5 , then ... Return value Data type: num The current value of the signal (a positive integer). The values of each signal in the group are read and interpreted as an unsigned binary number. This binary number is then converted to an integer. The value returned lies within a range that is dependent on the number of signals in the group. No. of signals Permitted value 1 0-1 2 0-3 3 0-7 4 0-15 5 0-31 6 0-63 7 0-127 8 0-255 9 0-511 10 0-1023 11 0-2047 12 0-4095 13 0-8191 14 0-16383 15 0-32767 16 0-65535 17 0-131071 18 0-262143 19 0-524287 20 0-1048575 21 0-2097151 22 0-4194303 23 0-8388607 Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
868
2 Functions 2.54. GInputDnum - Read value of group input signal RobotWare - OS 865 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Arguments GInputDnum (Signal) Signal Data type: signalgi The name of the signal group 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: Syntax GInputDnum ’(’ [ Signal ’:=’ ] < variable ( VAR ) of signalgi > ’)’ A function with a return value of data type dnum . Related information 22 0-4194303 23 0-8388607 24 0-16777215 25 0-33554431 26 0-67108863 27 0-134217727 28 0-268435455 29 0-536870911 30 0-1073741823 31 0-2147483647 32 0-4294967295 Number of signals Allowed value Error code Description ERR_NORUNUNIT No contact with the unit. For information about See Input/Output instructions Technical reference manual - RAPID overview, section RAPID Summary - Input and Output Signals Input/Output functionality in general Technical reference manual - RAPID overview, section Motion and I/O Principles Configuration of I/O Technical reference manual - System parameters Continued 2 Functions 2.55. GOutput - Reads the value of a group of digital output signals RobotWare - OS 3HAC 16581-1 Revision: J 866 © Copyright 2004-2010 ABB. All rights reserved. 2.55. GOutput - Reads the value of a group of digital output signals Usage GOutput is used to read the current value of a group of digital output signals. Basic examples Basic example of the function GOutput is illustrated below. Example 1 IF GOutput(go2) = 5 THEN ... If the current value of the signal go2 is equal to 5 , then ... Return value Data type: num The current value of the signal (a positive integer). The values of each signal in the group are read and interpreted as an unsigned binary number. This binary number is then converted to an integer. The value returned lies within a range that is dependent on the number of signals in the group. No. of signals Permitted value 1 0-1 2 0-3 3 0-7 4 0-15 5 0-31 6 0-63 7 0-127 8 0-255 9 0-511 10 0-1023 11 0-2047 12 0-4095 13 0-8191 14 0-16383 15 0-32767 16 0-65535 17 0-131071 18 0-262143 19 0-524287 20 0-1048575 21 0-2097151 22 0-4194303 23 0-8388607 Continues on next page 2 Functions 2.55. GOutput - Reads the value of a group of digital output signals RobotWare - OS 867 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Arguments GOutput (Signal) Signal Data type: signalgo The name of the signal group to be read. Error handling Following recoverable error can be generated. The error can be handled in an error handler. The system variable ERRNO will be set to: ERR_NORUNUNIT if there is no contact with the unit. Syntax GOutput ’(’ [ Signal ’:=’ ] < variable ( VAR ) of signalgo > ’)’ A function with a return value of data type num . Related information For information about See Set an output signal group SetGO - Changes the value of a group of digital output signals on page 442 Read a group of output signals GOutputDnum - Read value of group output signal on page 868 Read a group of input signals GInputDnum - Read value of group input signal on page 864 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
869
2 Functions 2.55. GOutput - Reads the value of a group of digital output signals RobotWare - OS 3HAC 16581-1 Revision: J 866 © Copyright 2004-2010 ABB. All rights reserved. 2.55. GOutput - Reads the value of a group of digital output signals Usage GOutput is used to read the current value of a group of digital output signals. Basic examples Basic example of the function GOutput is illustrated below. Example 1 IF GOutput(go2) = 5 THEN ... If the current value of the signal go2 is equal to 5 , then ... Return value Data type: num The current value of the signal (a positive integer). The values of each signal in the group are read and interpreted as an unsigned binary number. This binary number is then converted to an integer. The value returned lies within a range that is dependent on the number of signals in the group. No. of signals Permitted value 1 0-1 2 0-3 3 0-7 4 0-15 5 0-31 6 0-63 7 0-127 8 0-255 9 0-511 10 0-1023 11 0-2047 12 0-4095 13 0-8191 14 0-16383 15 0-32767 16 0-65535 17 0-131071 18 0-262143 19 0-524287 20 0-1048575 21 0-2097151 22 0-4194303 23 0-8388607 Continues on next page 2 Functions 2.55. GOutput - Reads the value of a group of digital output signals RobotWare - OS 867 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Arguments GOutput (Signal) Signal Data type: signalgo The name of the signal group to be read. Error handling Following recoverable error can be generated. The error can be handled in an error handler. The system variable ERRNO will be set to: ERR_NORUNUNIT if there is no contact with the unit. Syntax GOutput ’(’ [ Signal ’:=’ ] < variable ( VAR ) of signalgo > ’)’ A function with a return value of data type num . Related information For information about See Set an output signal group SetGO - Changes the value of a group of digital output signals on page 442 Read a group of output signals GOutputDnum - Read value of group output signal on page 868 Read a group of input signals GInputDnum - Read value of group input signal on page 864 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.56. GOutputDnum - Read value of group output signal RobotWare - OS 3HAC 16581-1 Revision: J 868 © Copyright 2004-2010 ABB. All rights reserved. 2.56. GOutputDnum - Read value of group output signal Usage GOutputDnum is used to read the current value of a group of digital output signals. Basic examples Basic examples of the function GOutputDnum are illustrated below. Example 1 IF GOutputDnum(go2) = 55 THEN ... If the current value of the signal go2 is equal to 55 , then ... Example 2 IF GOutputDnum(go2) = 4294967295 THEN ... If the current value of the signal go2 is equal to 4294967295 , then ... Return value Data type: dnum The current value of the signal (a positive integer). The values of each signal in the group are read and interpreted as an unsigned binary number. This binary number is then converted to an integer. The value returned lies within a range that is dependent on the number of signals in the group. Number of signals Allowed value 1 0-1 2 0-3 3 0-7 4 0-15 5 0-31 6 0-63 7 0-127 8 0-255 9 0-511 10 0-1023 11 0-2047 12 0-4095 13 0-8191 14 0-16383 15 0-32767 16 0-65535 17 0-131071 18 0-262143 19 0-524287 20 0-1048575 21 0-2097151 Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
870
2 Functions 2.55. GOutput - Reads the value of a group of digital output signals RobotWare - OS 867 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Arguments GOutput (Signal) Signal Data type: signalgo The name of the signal group to be read. Error handling Following recoverable error can be generated. The error can be handled in an error handler. The system variable ERRNO will be set to: ERR_NORUNUNIT if there is no contact with the unit. Syntax GOutput ’(’ [ Signal ’:=’ ] < variable ( VAR ) of signalgo > ’)’ A function with a return value of data type num . Related information For information about See Set an output signal group SetGO - Changes the value of a group of digital output signals on page 442 Read a group of output signals GOutputDnum - Read value of group output signal on page 868 Read a group of input signals GInputDnum - Read value of group input signal on page 864 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.56. GOutputDnum - Read value of group output signal RobotWare - OS 3HAC 16581-1 Revision: J 868 © Copyright 2004-2010 ABB. All rights reserved. 2.56. GOutputDnum - Read value of group output signal Usage GOutputDnum is used to read the current value of a group of digital output signals. Basic examples Basic examples of the function GOutputDnum are illustrated below. Example 1 IF GOutputDnum(go2) = 55 THEN ... If the current value of the signal go2 is equal to 55 , then ... Example 2 IF GOutputDnum(go2) = 4294967295 THEN ... If the current value of the signal go2 is equal to 4294967295 , then ... Return value Data type: dnum The current value of the signal (a positive integer). The values of each signal in the group are read and interpreted as an unsigned binary number. This binary number is then converted to an integer. The value returned lies within a range that is dependent on the number of signals in the group. Number of signals Allowed value 1 0-1 2 0-3 3 0-7 4 0-15 5 0-31 6 0-63 7 0-127 8 0-255 9 0-511 10 0-1023 11 0-2047 12 0-4095 13 0-8191 14 0-16383 15 0-32767 16 0-65535 17 0-131071 18 0-262143 19 0-524287 20 0-1048575 21 0-2097151 Continues on next page 2 Functions 2.56. GOutputDnum - Read value of group output signal RobotWare - OS 869 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Arguments GOutputDnum (Signal) Signal Data type: signalgo The name of the signal group 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: Syntax GOutputDnum ’(’ [ Signal ’:=’ ] < variable ( VAR ) of signalgo > ’)’ A function with a return value of data type dnum . Related information 22 0-4194303 23 0-8388607 24 0-16777215 25 0-33554431 26 0-67108863 27 0-134217727 28 0-268435455 29 0-536870911 30 0-1073741823 31 0-2147483647 32 0-4294967295 Number of signals Allowed value Error code Description ERR_NORUNUNIT No contact with the unit For information about See Set an output signal group SetGO - Changes the value of a group of digital output signals on page 442 I 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 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
871
2 Functions 2.56. GOutputDnum - Read value of group output signal RobotWare - OS 3HAC 16581-1 Revision: J 868 © Copyright 2004-2010 ABB. All rights reserved. 2.56. GOutputDnum - Read value of group output signal Usage GOutputDnum is used to read the current value of a group of digital output signals. Basic examples Basic examples of the function GOutputDnum are illustrated below. Example 1 IF GOutputDnum(go2) = 55 THEN ... If the current value of the signal go2 is equal to 55 , then ... Example 2 IF GOutputDnum(go2) = 4294967295 THEN ... If the current value of the signal go2 is equal to 4294967295 , then ... Return value Data type: dnum The current value of the signal (a positive integer). The values of each signal in the group are read and interpreted as an unsigned binary number. This binary number is then converted to an integer. The value returned lies within a range that is dependent on the number of signals in the group. Number of signals Allowed value 1 0-1 2 0-3 3 0-7 4 0-15 5 0-31 6 0-63 7 0-127 8 0-255 9 0-511 10 0-1023 11 0-2047 12 0-4095 13 0-8191 14 0-16383 15 0-32767 16 0-65535 17 0-131071 18 0-262143 19 0-524287 20 0-1048575 21 0-2097151 Continues on next page 2 Functions 2.56. GOutputDnum - Read value of group output signal RobotWare - OS 869 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Arguments GOutputDnum (Signal) Signal Data type: signalgo The name of the signal group 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: Syntax GOutputDnum ’(’ [ Signal ’:=’ ] < variable ( VAR ) of signalgo > ’)’ A function with a return value of data type dnum . Related information 22 0-4194303 23 0-8388607 24 0-16777215 25 0-33554431 26 0-67108863 27 0-134217727 28 0-268435455 29 0-536870911 30 0-1073741823 31 0-2147483647 32 0-4294967295 Number of signals Allowed value Error code Description ERR_NORUNUNIT No contact with the unit For information about See Set an output signal group SetGO - Changes the value of a group of digital output signals on page 442 I 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 Configuration of I/O Technical reference manual - System parameters Continued 2 Functions 2.57. HexToDec - Convert from hexadecimal to decimal RobotWare - OS 3HAC 16581-1 Revision: J 870 © Copyright 2004-2010 ABB. All rights reserved. 2.57. HexToDec - Convert from hexadecimal to decimal Usage HexToDec is used to convert a number specified in a readable string in the base 16 to the base 10. The input string should be constructed from the character set [0-9,A-F,a-f]. This routine handle numbers from 0 up to 9223372036854775807dec or 7FFFFFFFFFFFFFFF hex. Basic examples Basic examples of the function HexToDec are illustrated below. Example 1 VAR string str; str := HexToDec("5F5E0FF"); The variable str is given the value "99999999". Return value Data type: string The string converted to a decimal representation of the given number in the inparameter string. Arguments HexToDec ( Str ) Str String Data type: string The string to convert. Syntax HexToDec’(’ [ Str ’:=’ ] <expression ( IN ) of string> ’)’ 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
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
872
2 Functions 2.56. GOutputDnum - Read value of group output signal RobotWare - OS 869 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Arguments GOutputDnum (Signal) Signal Data type: signalgo The name of the signal group 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: Syntax GOutputDnum ’(’ [ Signal ’:=’ ] < variable ( VAR ) of signalgo > ’)’ A function with a return value of data type dnum . Related information 22 0-4194303 23 0-8388607 24 0-16777215 25 0-33554431 26 0-67108863 27 0-134217727 28 0-268435455 29 0-536870911 30 0-1073741823 31 0-2147483647 32 0-4294967295 Number of signals Allowed value Error code Description ERR_NORUNUNIT No contact with the unit For information about See Set an output signal group SetGO - Changes the value of a group of digital output signals on page 442 I 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 Configuration of I/O Technical reference manual - System parameters Continued 2 Functions 2.57. HexToDec - Convert from hexadecimal to decimal RobotWare - OS 3HAC 16581-1 Revision: J 870 © Copyright 2004-2010 ABB. All rights reserved. 2.57. HexToDec - Convert from hexadecimal to decimal Usage HexToDec is used to convert a number specified in a readable string in the base 16 to the base 10. The input string should be constructed from the character set [0-9,A-F,a-f]. This routine handle numbers from 0 up to 9223372036854775807dec or 7FFFFFFFFFFFFFFF hex. Basic examples Basic examples of the function HexToDec are illustrated below. Example 1 VAR string str; str := HexToDec("5F5E0FF"); The variable str is given the value "99999999". Return value Data type: string The string converted to a decimal representation of the given number in the inparameter string. Arguments HexToDec ( Str ) Str String Data type: string The string to convert. Syntax HexToDec’(’ [ Str ’:=’ ] <expression ( IN ) of string> ’)’ 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 2 Functions 2.58. IndInpos - Independent axis in position status Independent Axis 871 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.58. IndInpos - Independent axis in position status Usage IndInpos is used to test whether an independent axis has reached the selected position. Basic examples Basic examples of the function IndInpos are illustrated below Example 1 IndAMove Station_A,1\ToAbsNum:=90,20; WaitUntil IndInpos(Station_A,1) = TRUE; WaitTime 0.2; Wait until axis 1 of Station_A is in the 90 degrees position. Return value Data type: bool The table describes the return values from IndInpos : Arguments IndInpos ( MecUnit Axis ) MecUnit Mechanical Unit Data type: mecunit The name of the mechanical unit. Axis Data type: num The number of the current axis for the mechanical unit (1-6). Limitations An independent axis executed with the instruction IndCMove always returns the value FALSE , even when the speed is set to zero. A wait period of 0.2 seconds should be added after the instruction, to ensure that the correct status has been achieved. This time period should be longer for external axes with poor performance. Error handling If the axis is not activated, the system variable ERRNO is set to ERR_AXIS_ACT . If the axis is not in independent mode, the system variable ERRNO will be set to ERR_AXIS_IND. These errors can then be handled in the error handler. Return value Axis status TRUE In position and has zero speed. FALSE Not in position and/or has not zero speed. Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
873
2 Functions 2.57. HexToDec - Convert from hexadecimal to decimal RobotWare - OS 3HAC 16581-1 Revision: J 870 © Copyright 2004-2010 ABB. All rights reserved. 2.57. HexToDec - Convert from hexadecimal to decimal Usage HexToDec is used to convert a number specified in a readable string in the base 16 to the base 10. The input string should be constructed from the character set [0-9,A-F,a-f]. This routine handle numbers from 0 up to 9223372036854775807dec or 7FFFFFFFFFFFFFFF hex. Basic examples Basic examples of the function HexToDec are illustrated below. Example 1 VAR string str; str := HexToDec("5F5E0FF"); The variable str is given the value "99999999". Return value Data type: string The string converted to a decimal representation of the given number in the inparameter string. Arguments HexToDec ( Str ) Str String Data type: string The string to convert. Syntax HexToDec’(’ [ Str ’:=’ ] <expression ( IN ) of string> ’)’ 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 2 Functions 2.58. IndInpos - Independent axis in position status Independent Axis 871 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.58. IndInpos - Independent axis in position status Usage IndInpos is used to test whether an independent axis has reached the selected position. Basic examples Basic examples of the function IndInpos are illustrated below Example 1 IndAMove Station_A,1\ToAbsNum:=90,20; WaitUntil IndInpos(Station_A,1) = TRUE; WaitTime 0.2; Wait until axis 1 of Station_A is in the 90 degrees position. Return value Data type: bool The table describes the return values from IndInpos : Arguments IndInpos ( MecUnit Axis ) MecUnit Mechanical Unit Data type: mecunit The name of the mechanical unit. Axis Data type: num The number of the current axis for the mechanical unit (1-6). Limitations An independent axis executed with the instruction IndCMove always returns the value FALSE , even when the speed is set to zero. A wait period of 0.2 seconds should be added after the instruction, to ensure that the correct status has been achieved. This time period should be longer for external axes with poor performance. Error handling If the axis is not activated, the system variable ERRNO is set to ERR_AXIS_ACT . If the axis is not in independent mode, the system variable ERRNO will be set to ERR_AXIS_IND. These errors can then be handled in the error handler. Return value Axis status TRUE In position and has zero speed. FALSE Not in position and/or has not zero speed. Continues on next page 2 Functions 2.58. IndInpos - Independent axis in position status Independent Axis 3HAC 16581-1 Revision: J 872 © Copyright 2004-2010 ABB. All rights reserved. Syntax IndInpos ’(’ [ MecUnit’:=’ ] < variable ( VAR ) of mecunit>’,’ [ Axis’:=’ ] < expression ( IN ) of num>’)’ A function with a return value of the data type bool . Related information For information about See Independent axes in general Technical reference manual - RAPID overview , section Motion and I/O Principles - Positioning during program execution Other independent instruction and functions Technical reference manual - RAPID overview , section RAPID summary - Motion Check the speed status for independent axes IndSpeed - Independent speed status on page 873 Defining independent joints Technical reference manual - System parameters , section Motion - Arm Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
874
2 Functions 2.58. IndInpos - Independent axis in position status Independent Axis 871 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.58. IndInpos - Independent axis in position status Usage IndInpos is used to test whether an independent axis has reached the selected position. Basic examples Basic examples of the function IndInpos are illustrated below Example 1 IndAMove Station_A,1\ToAbsNum:=90,20; WaitUntil IndInpos(Station_A,1) = TRUE; WaitTime 0.2; Wait until axis 1 of Station_A is in the 90 degrees position. Return value Data type: bool The table describes the return values from IndInpos : Arguments IndInpos ( MecUnit Axis ) MecUnit Mechanical Unit Data type: mecunit The name of the mechanical unit. Axis Data type: num The number of the current axis for the mechanical unit (1-6). Limitations An independent axis executed with the instruction IndCMove always returns the value FALSE , even when the speed is set to zero. A wait period of 0.2 seconds should be added after the instruction, to ensure that the correct status has been achieved. This time period should be longer for external axes with poor performance. Error handling If the axis is not activated, the system variable ERRNO is set to ERR_AXIS_ACT . If the axis is not in independent mode, the system variable ERRNO will be set to ERR_AXIS_IND. These errors can then be handled in the error handler. Return value Axis status TRUE In position and has zero speed. FALSE Not in position and/or has not zero speed. Continues on next page 2 Functions 2.58. IndInpos - Independent axis in position status Independent Axis 3HAC 16581-1 Revision: J 872 © Copyright 2004-2010 ABB. All rights reserved. Syntax IndInpos ’(’ [ MecUnit’:=’ ] < variable ( VAR ) of mecunit>’,’ [ Axis’:=’ ] < expression ( IN ) of num>’)’ A function with a return value of the data type bool . Related information For information about See Independent axes in general Technical reference manual - RAPID overview , section Motion and I/O Principles - Positioning during program execution Other independent instruction and functions Technical reference manual - RAPID overview , section RAPID summary - Motion Check the speed status for independent axes IndSpeed - Independent speed status on page 873 Defining independent joints Technical reference manual - System parameters , section Motion - Arm Continued 2 Functions 2.59. IndSpeed - Independent speed status Independent Axis 873 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.59. IndSpeed - Independent speed status Usage IndSpeed is used to test whether an independent axis has reached the selected speed. Basic examples Basic examples of the function IndSpeed are illustrated below. Example 1 IndCMove Station_A, 2, 3.4; WaitUntil IndSpeed(Station_A,2 \InSpeed) = TRUE; WaitTime 0.2; Wait until axis 2 of Station_A has reached the speed 3.4 degrees/s. Return value Data type: bool The table describes the return values from IndSpeed \IndSpeed : The table describes the return values from IndSpeed \ZeroSpeed: Arguments IndSpeed ( MecUnit Axis [ \InSpeed ] | [ \ZeroSpeed ] ) MecUnit Mechanical Unit Data type: mecunit The name of the mechanical unit. Axis Data type: num The number of the current axis for the mechanical unit (1-6). [ \InSpeed ] Data type: switch IndSpeed returns value TRUE if the axis has reached the selected speed otherwise FALSE . [ \ZeroSpeed ] Data type: switch IndSpeed returns value TRUE if the axis has zero speed otherwise FALSE . If both the arguments \InSpeed and \ZeroSpeed are omitted, an error message will be displayed. Return value Axis status TRUE Has reached the selected speed. FALSE Has not reached the selected speed. Return value Axis status TRUE Zero speed. FALSE Not zero speed Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
875
2 Functions 2.58. IndInpos - Independent axis in position status Independent Axis 3HAC 16581-1 Revision: J 872 © Copyright 2004-2010 ABB. All rights reserved. Syntax IndInpos ’(’ [ MecUnit’:=’ ] < variable ( VAR ) of mecunit>’,’ [ Axis’:=’ ] < expression ( IN ) of num>’)’ A function with a return value of the data type bool . Related information For information about See Independent axes in general Technical reference manual - RAPID overview , section Motion and I/O Principles - Positioning during program execution Other independent instruction and functions Technical reference manual - RAPID overview , section RAPID summary - Motion Check the speed status for independent axes IndSpeed - Independent speed status on page 873 Defining independent joints Technical reference manual - System parameters , section Motion - Arm Continued 2 Functions 2.59. IndSpeed - Independent speed status Independent Axis 873 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.59. IndSpeed - Independent speed status Usage IndSpeed is used to test whether an independent axis has reached the selected speed. Basic examples Basic examples of the function IndSpeed are illustrated below. Example 1 IndCMove Station_A, 2, 3.4; WaitUntil IndSpeed(Station_A,2 \InSpeed) = TRUE; WaitTime 0.2; Wait until axis 2 of Station_A has reached the speed 3.4 degrees/s. Return value Data type: bool The table describes the return values from IndSpeed \IndSpeed : The table describes the return values from IndSpeed \ZeroSpeed: Arguments IndSpeed ( MecUnit Axis [ \InSpeed ] | [ \ZeroSpeed ] ) MecUnit Mechanical Unit Data type: mecunit The name of the mechanical unit. Axis Data type: num The number of the current axis for the mechanical unit (1-6). [ \InSpeed ] Data type: switch IndSpeed returns value TRUE if the axis has reached the selected speed otherwise FALSE . [ \ZeroSpeed ] Data type: switch IndSpeed returns value TRUE if the axis has zero speed otherwise FALSE . If both the arguments \InSpeed and \ZeroSpeed are omitted, an error message will be displayed. Return value Axis status TRUE Has reached the selected speed. FALSE Has not reached the selected speed. Return value Axis status TRUE Zero speed. FALSE Not zero speed Continues on next page 2 Functions 2.59. IndSpeed - Independent speed status Independent Axis 3HAC 16581-1 Revision: J 874 © Copyright 2004-2010 ABB. All rights reserved. Limitation The function IndSpeed\InSpeed will always return the value FALSE in the following situations: • The robot is in manual mode with reduced speed. • The speed is reduced using the VelSet instruction. • The speed is reduced from the production window. A wait period of 0.2 seconds should be added after the instruction to ensure that the correct status is obtained. This time period should be longer for external axes with poor performance. Error handling If the axis is not activated, the system variable ERRNO is set to ERR_AXIS_ACT . If the axis is not in independent mode, the system variable ERRNO will be set to ERR_AXIS_IND. These errors can then be handled in the error handler. Syntax IndSpeed ’(’ [ MecUnit’:=’ ] < variable ( VAR ) of mecunit>’,’ [ Axis’:=’ ] < expression ( IN ) of num> [ ’\’ InSpeed ] | [ ’\’ ZeroSpeed ] ’)’ A function with a return value of the data type bool . Related information For information about See Independent axes in general Technical reference manual - RAPID overview , section Motion and I/O principles - Positioning during program execution Other independent instruction and functions Technical reference manual - RAPID overview , section RAPID summary - Motion More examples IndCMove - Independent continuous movement on page 137 Check the position status for independent axes IndInpos - Independent axis in position status on page 871 Defining independent joints Technical reference manual - System parameters , section Motion - Arm Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
876
2 Functions 2.59. IndSpeed - Independent speed status Independent Axis 873 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.59. IndSpeed - Independent speed status Usage IndSpeed is used to test whether an independent axis has reached the selected speed. Basic examples Basic examples of the function IndSpeed are illustrated below. Example 1 IndCMove Station_A, 2, 3.4; WaitUntil IndSpeed(Station_A,2 \InSpeed) = TRUE; WaitTime 0.2; Wait until axis 2 of Station_A has reached the speed 3.4 degrees/s. Return value Data type: bool The table describes the return values from IndSpeed \IndSpeed : The table describes the return values from IndSpeed \ZeroSpeed: Arguments IndSpeed ( MecUnit Axis [ \InSpeed ] | [ \ZeroSpeed ] ) MecUnit Mechanical Unit Data type: mecunit The name of the mechanical unit. Axis Data type: num The number of the current axis for the mechanical unit (1-6). [ \InSpeed ] Data type: switch IndSpeed returns value TRUE if the axis has reached the selected speed otherwise FALSE . [ \ZeroSpeed ] Data type: switch IndSpeed returns value TRUE if the axis has zero speed otherwise FALSE . If both the arguments \InSpeed and \ZeroSpeed are omitted, an error message will be displayed. Return value Axis status TRUE Has reached the selected speed. FALSE Has not reached the selected speed. Return value Axis status TRUE Zero speed. FALSE Not zero speed Continues on next page 2 Functions 2.59. IndSpeed - Independent speed status Independent Axis 3HAC 16581-1 Revision: J 874 © Copyright 2004-2010 ABB. All rights reserved. Limitation The function IndSpeed\InSpeed will always return the value FALSE in the following situations: • The robot is in manual mode with reduced speed. • The speed is reduced using the VelSet instruction. • The speed is reduced from the production window. A wait period of 0.2 seconds should be added after the instruction to ensure that the correct status is obtained. This time period should be longer for external axes with poor performance. Error handling If the axis is not activated, the system variable ERRNO is set to ERR_AXIS_ACT . If the axis is not in independent mode, the system variable ERRNO will be set to ERR_AXIS_IND. These errors can then be handled in the error handler. Syntax IndSpeed ’(’ [ MecUnit’:=’ ] < variable ( VAR ) of mecunit>’,’ [ Axis’:=’ ] < expression ( IN ) of num> [ ’\’ InSpeed ] | [ ’\’ ZeroSpeed ] ’)’ A function with a return value of the data type bool . Related information For information about See Independent axes in general Technical reference manual - RAPID overview , section Motion and I/O principles - Positioning during program execution Other independent instruction and functions Technical reference manual - RAPID overview , section RAPID summary - Motion More examples IndCMove - Independent continuous movement on page 137 Check the position status for independent axes IndInpos - Independent axis in position status on page 871 Defining independent joints Technical reference manual - System parameters , section Motion - Arm Continued 2 Functions 2.60. IOUnitState - Get current state of I/O unit RobotWare - OS 875 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.60. IOUnitState - Get current state of I/O unit Usage IOUnitState is used to find out the current state of an I/O unit. It is physical state and logical state define the status for an I/O unit. Basic examples Basic examples of the instruction IOUnitState are illustrated below. Example 1 IF (IOUnitState("UNIT1" \Phys)=IOUNIT_PHYS_STATE_RUNNING) THEN ! Possible to access some signal on the I/O unit ELSE ! Read/Write some signal on the I/O unit result in error ENDIF Test is done to see if the I/O unit UNIT1 is up and running. Example 2 IF (IOUnitState("UNIT1" \Logic)=IOUNIT_LOG_STATE_DISABLED) THEN ! Unit is disabled by user from RAPID or FlexPendant ELSE ! Unit is enabled. ENDIF Test is done to see if the I/O unit UNIT1 is disabled. Return value Data type: iounit_state The return value has different values depending on if the optional arguments \Logic or \Phys or no optional argument at all is used. The I/O unit logical states describes the state a user can order the unit into.The state of the I/ O unit as defined in the table below when using optional argument \Logic . Return value Symbolic constant Comment 10 IOUNIT_LOG_STATE_DISABLED Unit is disabled by user from RAPID, FlexPendant or System Parameters. 11 IOUNIT_LOG_STATE_ENABLED Unit is enabled by user from RAPID, FlexPendant or System Parameters. Default after startup. Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
877
2 Functions 2.59. IndSpeed - Independent speed status Independent Axis 3HAC 16581-1 Revision: J 874 © Copyright 2004-2010 ABB. All rights reserved. Limitation The function IndSpeed\InSpeed will always return the value FALSE in the following situations: • The robot is in manual mode with reduced speed. • The speed is reduced using the VelSet instruction. • The speed is reduced from the production window. A wait period of 0.2 seconds should be added after the instruction to ensure that the correct status is obtained. This time period should be longer for external axes with poor performance. Error handling If the axis is not activated, the system variable ERRNO is set to ERR_AXIS_ACT . If the axis is not in independent mode, the system variable ERRNO will be set to ERR_AXIS_IND. These errors can then be handled in the error handler. Syntax IndSpeed ’(’ [ MecUnit’:=’ ] < variable ( VAR ) of mecunit>’,’ [ Axis’:=’ ] < expression ( IN ) of num> [ ’\’ InSpeed ] | [ ’\’ ZeroSpeed ] ’)’ A function with a return value of the data type bool . Related information For information about See Independent axes in general Technical reference manual - RAPID overview , section Motion and I/O principles - Positioning during program execution Other independent instruction and functions Technical reference manual - RAPID overview , section RAPID summary - Motion More examples IndCMove - Independent continuous movement on page 137 Check the position status for independent axes IndInpos - Independent axis in position status on page 871 Defining independent joints Technical reference manual - System parameters , section Motion - Arm Continued 2 Functions 2.60. IOUnitState - Get current state of I/O unit RobotWare - OS 875 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.60. IOUnitState - Get current state of I/O unit Usage IOUnitState is used to find out the current state of an I/O unit. It is physical state and logical state define the status for an I/O unit. Basic examples Basic examples of the instruction IOUnitState are illustrated below. Example 1 IF (IOUnitState("UNIT1" \Phys)=IOUNIT_PHYS_STATE_RUNNING) THEN ! Possible to access some signal on the I/O unit ELSE ! Read/Write some signal on the I/O unit result in error ENDIF Test is done to see if the I/O unit UNIT1 is up and running. Example 2 IF (IOUnitState("UNIT1" \Logic)=IOUNIT_LOG_STATE_DISABLED) THEN ! Unit is disabled by user from RAPID or FlexPendant ELSE ! Unit is enabled. ENDIF Test is done to see if the I/O unit UNIT1 is disabled. Return value Data type: iounit_state The return value has different values depending on if the optional arguments \Logic or \Phys or no optional argument at all is used. The I/O unit logical states describes the state a user can order the unit into.The state of the I/ O unit as defined in the table below when using optional argument \Logic . Return value Symbolic constant Comment 10 IOUNIT_LOG_STATE_DISABLED Unit is disabled by user from RAPID, FlexPendant or System Parameters. 11 IOUNIT_LOG_STATE_ENABLED Unit is enabled by user from RAPID, FlexPendant or System Parameters. Default after startup. Continues on next page 2 Functions 2.60. IOUnitState - Get current state of I/O unit RobotWare - OS 3HAC 16581-1 Revision: J 876 © Copyright 2004-2010 ABB. All rights reserved. When the unit is logically enabled by the user and the fieldbus driver intends to take a unit into physical state IOUNIT_PHYS_STATE_RUNNING , the unit could get into other states for various reasons (see table below). The state of the I/O unit as defined in the table below when using optional argument \Phys . - NOTE! For RobotWare 5.08 and earlier versions it is not possible to use the instruction IOUnitState with optional arguments \Phys or \Logic . From RobotWare 5.09 it is recommended to use the optional arguments \Phys or \Logic . The state of the I/O unit is defined in the table below when not using any of the optional arguments \Phys or \Logic . 1) Not possible to get this state in the RAPID program with current version of RobotWare - OS. Return value Symbolic constant Comment 20 IOUNIT_PHYS_STATE_DEACTIVATED Unit is not running, disabled by user 21 IOUNIT_PHYS_STATE_RUNNING Unit is running 22 IOUNIT_PHYS_STATE_ERROR Unit is not working because of some runtime error 23 IOUNIT_PHYS_STATE_UNCONNECTED Unit is configured but not connected to the bus or the bus is stopped 24 IOUNIT_PHYS_STATE_UNCONFIGURED Unit is not configured but connected to the bus. 1) 25 IOUNIT_PHYS_STATE_STARTUP Unit is in start up mode. 1) 26 IOUNIT_PHYS_STATE_INIT Unit is created. 1) Return value Symbolic constant Comment 1 IOUNIT_RUNNING Unit is up and running 2 IOUNIT_RUNERROR Unit is not working because of some runtime error 3 IOUNIT_DISABLE Unit is disabled by user from RAPID or FlexPendant 4 IOUNIT_OTHERERR Other configuration or startup errors 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
878
2 Functions 2.60. IOUnitState - Get current state of I/O unit RobotWare - OS 875 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.60. IOUnitState - Get current state of I/O unit Usage IOUnitState is used to find out the current state of an I/O unit. It is physical state and logical state define the status for an I/O unit. Basic examples Basic examples of the instruction IOUnitState are illustrated below. Example 1 IF (IOUnitState("UNIT1" \Phys)=IOUNIT_PHYS_STATE_RUNNING) THEN ! Possible to access some signal on the I/O unit ELSE ! Read/Write some signal on the I/O unit result in error ENDIF Test is done to see if the I/O unit UNIT1 is up and running. Example 2 IF (IOUnitState("UNIT1" \Logic)=IOUNIT_LOG_STATE_DISABLED) THEN ! Unit is disabled by user from RAPID or FlexPendant ELSE ! Unit is enabled. ENDIF Test is done to see if the I/O unit UNIT1 is disabled. Return value Data type: iounit_state The return value has different values depending on if the optional arguments \Logic or \Phys or no optional argument at all is used. The I/O unit logical states describes the state a user can order the unit into.The state of the I/ O unit as defined in the table below when using optional argument \Logic . Return value Symbolic constant Comment 10 IOUNIT_LOG_STATE_DISABLED Unit is disabled by user from RAPID, FlexPendant or System Parameters. 11 IOUNIT_LOG_STATE_ENABLED Unit is enabled by user from RAPID, FlexPendant or System Parameters. Default after startup. Continues on next page 2 Functions 2.60. IOUnitState - Get current state of I/O unit RobotWare - OS 3HAC 16581-1 Revision: J 876 © Copyright 2004-2010 ABB. All rights reserved. When the unit is logically enabled by the user and the fieldbus driver intends to take a unit into physical state IOUNIT_PHYS_STATE_RUNNING , the unit could get into other states for various reasons (see table below). The state of the I/O unit as defined in the table below when using optional argument \Phys . - NOTE! For RobotWare 5.08 and earlier versions it is not possible to use the instruction IOUnitState with optional arguments \Phys or \Logic . From RobotWare 5.09 it is recommended to use the optional arguments \Phys or \Logic . The state of the I/O unit is defined in the table below when not using any of the optional arguments \Phys or \Logic . 1) Not possible to get this state in the RAPID program with current version of RobotWare - OS. Return value Symbolic constant Comment 20 IOUNIT_PHYS_STATE_DEACTIVATED Unit is not running, disabled by user 21 IOUNIT_PHYS_STATE_RUNNING Unit is running 22 IOUNIT_PHYS_STATE_ERROR Unit is not working because of some runtime error 23 IOUNIT_PHYS_STATE_UNCONNECTED Unit is configured but not connected to the bus or the bus is stopped 24 IOUNIT_PHYS_STATE_UNCONFIGURED Unit is not configured but connected to the bus. 1) 25 IOUNIT_PHYS_STATE_STARTUP Unit is in start up mode. 1) 26 IOUNIT_PHYS_STATE_INIT Unit is created. 1) Return value Symbolic constant Comment 1 IOUNIT_RUNNING Unit is up and running 2 IOUNIT_RUNERROR Unit is not working because of some runtime error 3 IOUNIT_DISABLE Unit is disabled by user from RAPID or FlexPendant 4 IOUNIT_OTHERERR Other configuration or startup errors Continued Continues on next page 2 Functions 2.60. IOUnitState - Get current state of I/O unit RobotWare - OS 877 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Arguments IOUnitState (UnitName [\Phys] | [\Logic]) UnitName Data type: string The name of the I/O unit to be checked (with same name as configured). [\Phys] Physical Data type: switch If using this parameter the physical state of the I/O unit is read. [\Logic] Logical Data type: switch If using this parameter the logical state of the I/O unit is read. Syntax IOUnitState ´(´ [ UnitName ’:=’ ] < expression ( IN ) of string > [ ’\’ Phys] | [ ’\’ Logic] ´)´ A function with a return value of the data type iounit_state . Related information For information about See State of I/O unit IOEnable - Enable I/O unit on page 162 iounit_state - State of I/O unit on page 1128 Enable an I/O unit IOEnable - Enable I/O unit on page 162 Disabling an I/O unit IODisable - Disable I/O unit on page 159 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
879
2 Functions 2.60. IOUnitState - Get current state of I/O unit RobotWare - OS 3HAC 16581-1 Revision: J 876 © Copyright 2004-2010 ABB. All rights reserved. When the unit is logically enabled by the user and the fieldbus driver intends to take a unit into physical state IOUNIT_PHYS_STATE_RUNNING , the unit could get into other states for various reasons (see table below). The state of the I/O unit as defined in the table below when using optional argument \Phys . - NOTE! For RobotWare 5.08 and earlier versions it is not possible to use the instruction IOUnitState with optional arguments \Phys or \Logic . From RobotWare 5.09 it is recommended to use the optional arguments \Phys or \Logic . The state of the I/O unit is defined in the table below when not using any of the optional arguments \Phys or \Logic . 1) Not possible to get this state in the RAPID program with current version of RobotWare - OS. Return value Symbolic constant Comment 20 IOUNIT_PHYS_STATE_DEACTIVATED Unit is not running, disabled by user 21 IOUNIT_PHYS_STATE_RUNNING Unit is running 22 IOUNIT_PHYS_STATE_ERROR Unit is not working because of some runtime error 23 IOUNIT_PHYS_STATE_UNCONNECTED Unit is configured but not connected to the bus or the bus is stopped 24 IOUNIT_PHYS_STATE_UNCONFIGURED Unit is not configured but connected to the bus. 1) 25 IOUNIT_PHYS_STATE_STARTUP Unit is in start up mode. 1) 26 IOUNIT_PHYS_STATE_INIT Unit is created. 1) Return value Symbolic constant Comment 1 IOUNIT_RUNNING Unit is up and running 2 IOUNIT_RUNERROR Unit is not working because of some runtime error 3 IOUNIT_DISABLE Unit is disabled by user from RAPID or FlexPendant 4 IOUNIT_OTHERERR Other configuration or startup errors Continued Continues on next page 2 Functions 2.60. IOUnitState - Get current state of I/O unit RobotWare - OS 877 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Arguments IOUnitState (UnitName [\Phys] | [\Logic]) UnitName Data type: string The name of the I/O unit to be checked (with same name as configured). [\Phys] Physical Data type: switch If using this parameter the physical state of the I/O unit is read. [\Logic] Logical Data type: switch If using this parameter the logical state of the I/O unit is read. Syntax IOUnitState ´(´ [ UnitName ’:=’ ] < expression ( IN ) of string > [ ’\’ Phys] | [ ’\’ Logic] ´)´ A function with a return value of the data type iounit_state . Related information For information about See State of I/O unit IOEnable - Enable I/O unit on page 162 iounit_state - State of I/O unit on page 1128 Enable an I/O unit IOEnable - Enable I/O unit on page 162 Disabling an I/O unit IODisable - Disable I/O unit on page 159 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.61. IsFile - Check the type of a file RobotWare - OS 3HAC 16581-1 Revision: J 878 © Copyright 2004-2010 ABB. All rights reserved. 2.61. IsFile - Check the type of a file Usage The IsFile function obtains information about the named file or directory and checks whether it is the same as the specified type. If no type is specified, only an existence check is performed. The path argument specifies the file. Read, write or execute permission for the named file is not required, but all directories listed in the path name leading to the file must be searchable. Basic examples Basic examples of the function IsFile are illustrated below. See also More examples on page 879 . Example 1 PROC printFT(string filename) IF IsFile(filename \Directory) THEN TPWrite filename+" is a directory"; RETURN; ENDIF IF IsFile(filename \Fifo) THEN TPWrite filename+" is a fifo file"; RETURN; ENDIF IF IsFile(filename \RegFile) THEN TPWrite filename+" is a regular file"; RETURN; ENDIF IF IsFile(filename \BlockSpec) THEN TPWrite filename+" is a block special file"; RETURN; ENDIF IF IsFile(filename \CharSpec) THEN TPWrite filename+" is a character special file"; RETURN; ENDIF ENDPROC This example prints out the filename and the type of the specified file on the FlexPendant. Return value Data type: bool The function will return TRUE if the specified type and actual type match, otherwise FALSE . When no type is specified, it returns TRUE if the file exists and otherwise FALSE . Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
880
2 Functions 2.60. IOUnitState - Get current state of I/O unit RobotWare - OS 877 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Arguments IOUnitState (UnitName [\Phys] | [\Logic]) UnitName Data type: string The name of the I/O unit to be checked (with same name as configured). [\Phys] Physical Data type: switch If using this parameter the physical state of the I/O unit is read. [\Logic] Logical Data type: switch If using this parameter the logical state of the I/O unit is read. Syntax IOUnitState ´(´ [ UnitName ’:=’ ] < expression ( IN ) of string > [ ’\’ Phys] | [ ’\’ Logic] ´)´ A function with a return value of the data type iounit_state . Related information For information about See State of I/O unit IOEnable - Enable I/O unit on page 162 iounit_state - State of I/O unit on page 1128 Enable an I/O unit IOEnable - Enable I/O unit on page 162 Disabling an I/O unit IODisable - Disable I/O unit on page 159 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.61. IsFile - Check the type of a file RobotWare - OS 3HAC 16581-1 Revision: J 878 © Copyright 2004-2010 ABB. All rights reserved. 2.61. IsFile - Check the type of a file Usage The IsFile function obtains information about the named file or directory and checks whether it is the same as the specified type. If no type is specified, only an existence check is performed. The path argument specifies the file. Read, write or execute permission for the named file is not required, but all directories listed in the path name leading to the file must be searchable. Basic examples Basic examples of the function IsFile are illustrated below. See also More examples on page 879 . Example 1 PROC printFT(string filename) IF IsFile(filename \Directory) THEN TPWrite filename+" is a directory"; RETURN; ENDIF IF IsFile(filename \Fifo) THEN TPWrite filename+" is a fifo file"; RETURN; ENDIF IF IsFile(filename \RegFile) THEN TPWrite filename+" is a regular file"; RETURN; ENDIF IF IsFile(filename \BlockSpec) THEN TPWrite filename+" is a block special file"; RETURN; ENDIF IF IsFile(filename \CharSpec) THEN TPWrite filename+" is a character special file"; RETURN; ENDIF ENDPROC This example prints out the filename and the type of the specified file on the FlexPendant. Return value Data type: bool The function will return TRUE if the specified type and actual type match, otherwise FALSE . When no type is specified, it returns TRUE if the file exists and otherwise FALSE . Continues on next page 2 Functions 2.61. IsFile - Check the type of a file RobotWare - OS 879 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Arguments IsFile (Path [\Directory] [\Fifo] [\RegFile] [\BlockSpec] [\CharSpec]) Path Data type: string The file specified with a full or relative path. [ \Directory ] Data type: switch Is the file a directory. [ \Fifo ] Data type: switch Is the file a fifo file. [ \RegFile ] Data type: switch Is the file a regular file, i.e. a normal binary or ASCII file. [ \BlockSpec ] Data type: switch Is the file a block special file. [ \CharSpec ] Data type: switch Is the file a character special file. Program execution This function returns a bool that specifies match or not. More examples More examples of the function IsFile are illustrated below. Example 1 This example implements a generic traverse of a directory structure function. PROC searchdir(string dirname, string actionproc) VAR dir directory; VAR string filename; IF IsFile(dirname \Directory) THEN OpenDir directory, dirname; WHILE ReadDir(directory, filename) DO ! .. and . is the parent and resp. this directory IF filename <> ".." AND filename <> "." THEN searchdir dirname+"/"+filename, actionproc; ENDIF ENDWHILE CloseDir directory; 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
881
2 Functions 2.61. IsFile - Check the type of a file RobotWare - OS 3HAC 16581-1 Revision: J 878 © Copyright 2004-2010 ABB. All rights reserved. 2.61. IsFile - Check the type of a file Usage The IsFile function obtains information about the named file or directory and checks whether it is the same as the specified type. If no type is specified, only an existence check is performed. The path argument specifies the file. Read, write or execute permission for the named file is not required, but all directories listed in the path name leading to the file must be searchable. Basic examples Basic examples of the function IsFile are illustrated below. See also More examples on page 879 . Example 1 PROC printFT(string filename) IF IsFile(filename \Directory) THEN TPWrite filename+" is a directory"; RETURN; ENDIF IF IsFile(filename \Fifo) THEN TPWrite filename+" is a fifo file"; RETURN; ENDIF IF IsFile(filename \RegFile) THEN TPWrite filename+" is a regular file"; RETURN; ENDIF IF IsFile(filename \BlockSpec) THEN TPWrite filename+" is a block special file"; RETURN; ENDIF IF IsFile(filename \CharSpec) THEN TPWrite filename+" is a character special file"; RETURN; ENDIF ENDPROC This example prints out the filename and the type of the specified file on the FlexPendant. Return value Data type: bool The function will return TRUE if the specified type and actual type match, otherwise FALSE . When no type is specified, it returns TRUE if the file exists and otherwise FALSE . Continues on next page 2 Functions 2.61. IsFile - Check the type of a file RobotWare - OS 879 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Arguments IsFile (Path [\Directory] [\Fifo] [\RegFile] [\BlockSpec] [\CharSpec]) Path Data type: string The file specified with a full or relative path. [ \Directory ] Data type: switch Is the file a directory. [ \Fifo ] Data type: switch Is the file a fifo file. [ \RegFile ] Data type: switch Is the file a regular file, i.e. a normal binary or ASCII file. [ \BlockSpec ] Data type: switch Is the file a block special file. [ \CharSpec ] Data type: switch Is the file a character special file. Program execution This function returns a bool that specifies match or not. More examples More examples of the function IsFile are illustrated below. Example 1 This example implements a generic traverse of a directory structure function. PROC searchdir(string dirname, string actionproc) VAR dir directory; VAR string filename; IF IsFile(dirname \Directory) THEN OpenDir directory, dirname; WHILE ReadDir(directory, filename) DO ! .. and . is the parent and resp. this directory IF filename <> ".." AND filename <> "." THEN searchdir dirname+"/"+filename, actionproc; ENDIF ENDWHILE CloseDir directory; Continued Continues on next page 2 Functions 2.61. IsFile - Check the type of a file RobotWare - OS 3HAC 16581-1 Revision: J 880 © Copyright 2004-2010 ABB. All rights reserved. ELSE %actionproc% dirname; ENDIF ERROR RAISE; ENDPROC PROC listfile(string filename) TPWrite filename; ENDPROC PROC main() ! Execute the listfile routine for all files found under the ! tree of HOME: searchdir "HOME:","listfile"; ENDPROC This program traverses the directory structure under the " HOME :" and for each file found, it calls the listfile procedure. The searchdir is the generic part that knows nothing about the start of the search or which routine should be called for each file. It uses IsFile to check whether it has found a subdirectory or a file and it uses the late binding mechanism to call the procedure specified in actionproc for all files found. The actionproc routine should be a procedure with one parameter of the type string . Error handling If the file does not exist and there is a type specified, the system variable ERRNO is set to ERR_FILEACC . This error can then be handled in the error handler. Limitations This function is not possible to use against serial channels or field buses. If using against FTP or NFS mounted discs, the file existance or type information is not always updated. To get correct information an explicit order may be needed against the search path (with instruction Open ) before using IsFile . Syntax Isfile ’(’ [ Path’:=’ ] < expression ( IN ) of string> [ ´\´Directory ] | [ ´\´Fifo ] | [ ´\´RegFile ] | [ ´\´BlockSpec ] | [ ´\´CharSpec ] ’)’ A function with a return value of the data type bool . 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
882
2 Functions 2.61. IsFile - Check the type of a file RobotWare - OS 879 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Arguments IsFile (Path [\Directory] [\Fifo] [\RegFile] [\BlockSpec] [\CharSpec]) Path Data type: string The file specified with a full or relative path. [ \Directory ] Data type: switch Is the file a directory. [ \Fifo ] Data type: switch Is the file a fifo file. [ \RegFile ] Data type: switch Is the file a regular file, i.e. a normal binary or ASCII file. [ \BlockSpec ] Data type: switch Is the file a block special file. [ \CharSpec ] Data type: switch Is the file a character special file. Program execution This function returns a bool that specifies match or not. More examples More examples of the function IsFile are illustrated below. Example 1 This example implements a generic traverse of a directory structure function. PROC searchdir(string dirname, string actionproc) VAR dir directory; VAR string filename; IF IsFile(dirname \Directory) THEN OpenDir directory, dirname; WHILE ReadDir(directory, filename) DO ! .. and . is the parent and resp. this directory IF filename <> ".." AND filename <> "." THEN searchdir dirname+"/"+filename, actionproc; ENDIF ENDWHILE CloseDir directory; Continued Continues on next page 2 Functions 2.61. IsFile - Check the type of a file RobotWare - OS 3HAC 16581-1 Revision: J 880 © Copyright 2004-2010 ABB. All rights reserved. ELSE %actionproc% dirname; ENDIF ERROR RAISE; ENDPROC PROC listfile(string filename) TPWrite filename; ENDPROC PROC main() ! Execute the listfile routine for all files found under the ! tree of HOME: searchdir "HOME:","listfile"; ENDPROC This program traverses the directory structure under the " HOME :" and for each file found, it calls the listfile procedure. The searchdir is the generic part that knows nothing about the start of the search or which routine should be called for each file. It uses IsFile to check whether it has found a subdirectory or a file and it uses the late binding mechanism to call the procedure specified in actionproc for all files found. The actionproc routine should be a procedure with one parameter of the type string . Error handling If the file does not exist and there is a type specified, the system variable ERRNO is set to ERR_FILEACC . This error can then be handled in the error handler. Limitations This function is not possible to use against serial channels or field buses. If using against FTP or NFS mounted discs, the file existance or type information is not always updated. To get correct information an explicit order may be needed against the search path (with instruction Open ) before using IsFile . Syntax Isfile ’(’ [ Path’:=’ ] < expression ( IN ) of string> [ ´\´Directory ] | [ ´\´Fifo ] | [ ´\´RegFile ] | [ ´\´BlockSpec ] | [ ´\´CharSpec ] ’)’ A function with a return value of the data type bool . Continued Continues on next page 2 Functions 2.61. IsFile - Check the type of a file RobotWare - OS 881 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Directory dir - File directory structure on page 1103 Open a directory OpenDir - Open a directory on page 285 Close a directory CloseDir - Close a directory on page 56 Read a directory ReadDir - Read next entry in a directory on page 944 Make a directory MakeDir - Create a new directory on page 218 Remove a directory RemoveDir - Delete a directory on page 355 Rename a file RenameFile - Rename a file on page 357 Remove a file RemoveFile - Delete a file on page 356 Copy a file CopyFile - Copy a file on page 65 Check file size FileSize - Retrieve the size of a file on page 842 Check file system size FSSize - Retrieve the size of a file system on page 848 Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
883
2 Functions 2.61. IsFile - Check the type of a file RobotWare - OS 3HAC 16581-1 Revision: J 880 © Copyright 2004-2010 ABB. All rights reserved. ELSE %actionproc% dirname; ENDIF ERROR RAISE; ENDPROC PROC listfile(string filename) TPWrite filename; ENDPROC PROC main() ! Execute the listfile routine for all files found under the ! tree of HOME: searchdir "HOME:","listfile"; ENDPROC This program traverses the directory structure under the " HOME :" and for each file found, it calls the listfile procedure. The searchdir is the generic part that knows nothing about the start of the search or which routine should be called for each file. It uses IsFile to check whether it has found a subdirectory or a file and it uses the late binding mechanism to call the procedure specified in actionproc for all files found. The actionproc routine should be a procedure with one parameter of the type string . Error handling If the file does not exist and there is a type specified, the system variable ERRNO is set to ERR_FILEACC . This error can then be handled in the error handler. Limitations This function is not possible to use against serial channels or field buses. If using against FTP or NFS mounted discs, the file existance or type information is not always updated. To get correct information an explicit order may be needed against the search path (with instruction Open ) before using IsFile . Syntax Isfile ’(’ [ Path’:=’ ] < expression ( IN ) of string> [ ´\´Directory ] | [ ´\´Fifo ] | [ ´\´RegFile ] | [ ´\´BlockSpec ] | [ ´\´CharSpec ] ’)’ A function with a return value of the data type bool . Continued Continues on next page 2 Functions 2.61. IsFile - Check the type of a file RobotWare - OS 881 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Directory dir - File directory structure on page 1103 Open a directory OpenDir - Open a directory on page 285 Close a directory CloseDir - Close a directory on page 56 Read a directory ReadDir - Read next entry in a directory on page 944 Make a directory MakeDir - Create a new directory on page 218 Remove a directory RemoveDir - Delete a directory on page 355 Rename a file RenameFile - Rename a file on page 357 Remove a file RemoveFile - Delete a file on page 356 Copy a file CopyFile - Copy a file on page 65 Check file size FileSize - Retrieve the size of a file on page 842 Check file system size FSSize - Retrieve the size of a file system on page 848 Continued 2 Functions 2.62. IsMechUnitActive - Is mechanical unit active RobotWare - OS 3HAC 16581-1 Revision: J 882 © Copyright 2004-2010 ABB. All rights reserved. 2.62. IsMechUnitActive - Is mechanical unit active Usage IsMechUnitActive ( Is Mechanical Unit Active ) is used to check whether a mechanical unit is activated or not. Basic examples Basic examples of the function IsMechUnitActive are illustrated below. Example 1 IF IsMechUnitActive(SpotWeldGun) CloseGun SpotWeldGun; If the mechanical unit SpotWeldGun is active, the routine CloseGun will be invoked in which the gun is closed. Return value Data type: bool The function returns: • TRUE , if the mechanical unit is active • FALSE , if the mechanical unit is deactive Arguments IsMechUnitActive ( MechUnit ) MechUnit Mechanical Unit Data type: mecunit The name of the mechanical unit. Syntax IsMechUnitActive ’(’ [MechUnit’:=’] < variable ( VAR ) of mecunit> ´,´ A function with a return value of the data type bool . Related information For information about See Activating mechanical units ActUnit - Activates a mechanical unit on page 17 Deactivating mechanical units DeactUnit - Deactivates a mechanical unit on page 79 Mechanical units mecunit - Mechanical unit on page 1139
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
884
2 Functions 2.61. IsFile - Check the type of a file RobotWare - OS 881 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Directory dir - File directory structure on page 1103 Open a directory OpenDir - Open a directory on page 285 Close a directory CloseDir - Close a directory on page 56 Read a directory ReadDir - Read next entry in a directory on page 944 Make a directory MakeDir - Create a new directory on page 218 Remove a directory RemoveDir - Delete a directory on page 355 Rename a file RenameFile - Rename a file on page 357 Remove a file RemoveFile - Delete a file on page 356 Copy a file CopyFile - Copy a file on page 65 Check file size FileSize - Retrieve the size of a file on page 842 Check file system size FSSize - Retrieve the size of a file system on page 848 Continued 2 Functions 2.62. IsMechUnitActive - Is mechanical unit active RobotWare - OS 3HAC 16581-1 Revision: J 882 © Copyright 2004-2010 ABB. All rights reserved. 2.62. IsMechUnitActive - Is mechanical unit active Usage IsMechUnitActive ( Is Mechanical Unit Active ) is used to check whether a mechanical unit is activated or not. Basic examples Basic examples of the function IsMechUnitActive are illustrated below. Example 1 IF IsMechUnitActive(SpotWeldGun) CloseGun SpotWeldGun; If the mechanical unit SpotWeldGun is active, the routine CloseGun will be invoked in which the gun is closed. Return value Data type: bool The function returns: • TRUE , if the mechanical unit is active • FALSE , if the mechanical unit is deactive Arguments IsMechUnitActive ( MechUnit ) MechUnit Mechanical Unit Data type: mecunit The name of the mechanical unit. Syntax IsMechUnitActive ’(’ [MechUnit’:=’] < variable ( VAR ) of mecunit> ´,´ A function with a return value of the data type bool . Related information For information about See Activating mechanical units ActUnit - Activates a mechanical unit on page 17 Deactivating mechanical units DeactUnit - Deactivates a mechanical unit on page 79 Mechanical units mecunit - Mechanical unit on page 1139 2 Functions 2.63. IsPers - Is persistent RobotWare - OS 883 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.63. IsPers - Is persistent Usage IsPers is used to test if a data object is a persistent variable or not. Basic examples Basic examples of the function IsPers are illustrated below. Example 1 PROC procedure1 (INOUT num parameter1) IF IsVar(parameter1) THEN ! For this call reference to a variable ... ELSEIF IsPers(parameter1) THEN ! For this call reference to a persistent variable ... ELSE ! Should not happen EXIT; ENDIF ENDPROC The procedure procedure1 will take different actions depending on whether the actual parameter parameter1 is a variable or a persistent variable. Return value Data type: bool TRUE if the tested actual INOUT parameter is a persistent variable. FALSE if the tested actual INOUT parameter is not a persistent variable. Arguments IsPers (DatObj) DatObj () Data Object Data type: any type The name of the formal INOUT parameter. Syntax IsPers’(’ [ DatObj’ :=’ ] < var or pers ( INOUT ) of any type > ’)’ A function with a return value of the data type bool . Related information For information about See Test if variable IsVar - Is variable on page 891 Types of parameters (access modes) Technical reference manual - RAPID overview , section Basic characteristics - Routines
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
885
2 Functions 2.62. IsMechUnitActive - Is mechanical unit active RobotWare - OS 3HAC 16581-1 Revision: J 882 © Copyright 2004-2010 ABB. All rights reserved. 2.62. IsMechUnitActive - Is mechanical unit active Usage IsMechUnitActive ( Is Mechanical Unit Active ) is used to check whether a mechanical unit is activated or not. Basic examples Basic examples of the function IsMechUnitActive are illustrated below. Example 1 IF IsMechUnitActive(SpotWeldGun) CloseGun SpotWeldGun; If the mechanical unit SpotWeldGun is active, the routine CloseGun will be invoked in which the gun is closed. Return value Data type: bool The function returns: • TRUE , if the mechanical unit is active • FALSE , if the mechanical unit is deactive Arguments IsMechUnitActive ( MechUnit ) MechUnit Mechanical Unit Data type: mecunit The name of the mechanical unit. Syntax IsMechUnitActive ’(’ [MechUnit’:=’] < variable ( VAR ) of mecunit> ´,´ A function with a return value of the data type bool . Related information For information about See Activating mechanical units ActUnit - Activates a mechanical unit on page 17 Deactivating mechanical units DeactUnit - Deactivates a mechanical unit on page 79 Mechanical units mecunit - Mechanical unit on page 1139 2 Functions 2.63. IsPers - Is persistent RobotWare - OS 883 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.63. IsPers - Is persistent Usage IsPers is used to test if a data object is a persistent variable or not. Basic examples Basic examples of the function IsPers are illustrated below. Example 1 PROC procedure1 (INOUT num parameter1) IF IsVar(parameter1) THEN ! For this call reference to a variable ... ELSEIF IsPers(parameter1) THEN ! For this call reference to a persistent variable ... ELSE ! Should not happen EXIT; ENDIF ENDPROC The procedure procedure1 will take different actions depending on whether the actual parameter parameter1 is a variable or a persistent variable. Return value Data type: bool TRUE if the tested actual INOUT parameter is a persistent variable. FALSE if the tested actual INOUT parameter is not a persistent variable. Arguments IsPers (DatObj) DatObj () Data Object Data type: any type The name of the formal INOUT parameter. Syntax IsPers’(’ [ DatObj’ :=’ ] < var or pers ( INOUT ) of any type > ’)’ A function with a return value of the data type bool . Related information For information about See Test if variable IsVar - Is variable on page 891 Types of parameters (access modes) Technical reference manual - RAPID overview , section Basic characteristics - Routines 2 Functions 2.64. IsStopMoveAct - Is stop move flags active RobotWare - OS 3HAC 16581-1 Revision: J 884 © Copyright 2004-2010 ABB. All rights reserved. 2.64. IsStopMoveAct - Is stop move flags active Usage IsStopMoveAct is used to get the status of the stop move flags for a current or connected motion task. Basic examples Basic examples of the function IsStopMoveAct are illustrated below. Example 1 stopflag2:= IsStopMoveAct(\FromNonMoveTask); stopflag2 will be TRUE if the stop move flag from non-motion tasks is set in current or connected motion task, else it will be FALSE. Example 2 IF IsStopMoveAct(\FromMoveTask) THEN StartMove; ENDIF If the stop move flag from motion task is set in the current motion task, it will be reset by the StartMove instruction. Return value Data type: bool The return value will be TRUE if the selected stop move flag is set, else the return value will be FALSE. Arguments IsStopMoveAct ( [\FromMoveTask] | [\FromNonMoveTask] ) [\FromMoveTask] Data type: switch FromMoveTask is used to get the status of the stop move flag of type private motion task. This type of stop move flag can only be set by: • The motion task itself with instruction StopMove • After leaving the RestoPath level in the program • At execution in an asynchronous error handler for process- or motion errors before any StorePath and after any RestoPath [\FromNonMoveTask] Data type: switch FromNonMoveTask is used to get the status of the stop move flag of type any non-motion tasks. This type of stop move flag can only be set by any non-motion task in connected or all motion tasks with the instruction StopMove . Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
886
2 Functions 2.63. IsPers - Is persistent RobotWare - OS 883 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.63. IsPers - Is persistent Usage IsPers is used to test if a data object is a persistent variable or not. Basic examples Basic examples of the function IsPers are illustrated below. Example 1 PROC procedure1 (INOUT num parameter1) IF IsVar(parameter1) THEN ! For this call reference to a variable ... ELSEIF IsPers(parameter1) THEN ! For this call reference to a persistent variable ... ELSE ! Should not happen EXIT; ENDIF ENDPROC The procedure procedure1 will take different actions depending on whether the actual parameter parameter1 is a variable or a persistent variable. Return value Data type: bool TRUE if the tested actual INOUT parameter is a persistent variable. FALSE if the tested actual INOUT parameter is not a persistent variable. Arguments IsPers (DatObj) DatObj () Data Object Data type: any type The name of the formal INOUT parameter. Syntax IsPers’(’ [ DatObj’ :=’ ] < var or pers ( INOUT ) of any type > ’)’ A function with a return value of the data type bool . Related information For information about See Test if variable IsVar - Is variable on page 891 Types of parameters (access modes) Technical reference manual - RAPID overview , section Basic characteristics - Routines 2 Functions 2.64. IsStopMoveAct - Is stop move flags active RobotWare - OS 3HAC 16581-1 Revision: J 884 © Copyright 2004-2010 ABB. All rights reserved. 2.64. IsStopMoveAct - Is stop move flags active Usage IsStopMoveAct is used to get the status of the stop move flags for a current or connected motion task. Basic examples Basic examples of the function IsStopMoveAct are illustrated below. Example 1 stopflag2:= IsStopMoveAct(\FromNonMoveTask); stopflag2 will be TRUE if the stop move flag from non-motion tasks is set in current or connected motion task, else it will be FALSE. Example 2 IF IsStopMoveAct(\FromMoveTask) THEN StartMove; ENDIF If the stop move flag from motion task is set in the current motion task, it will be reset by the StartMove instruction. Return value Data type: bool The return value will be TRUE if the selected stop move flag is set, else the return value will be FALSE. Arguments IsStopMoveAct ( [\FromMoveTask] | [\FromNonMoveTask] ) [\FromMoveTask] Data type: switch FromMoveTask is used to get the status of the stop move flag of type private motion task. This type of stop move flag can only be set by: • The motion task itself with instruction StopMove • After leaving the RestoPath level in the program • At execution in an asynchronous error handler for process- or motion errors before any StorePath and after any RestoPath [\FromNonMoveTask] Data type: switch FromNonMoveTask is used to get the status of the stop move flag of type any non-motion tasks. This type of stop move flag can only be set by any non-motion task in connected or all motion tasks with the instruction StopMove . Continues on next page 2 Functions 2.64. IsStopMoveAct - Is stop move flags active RobotWare - OS 885 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Syntax IsStopMoveAct’(’ [’\’ FromMoveTask] | [’\’ FromNonMoveTask]’ )’ A function with a return value of the data type bool . Related information For information about See Stop robot movement StopMove - Stops robot movement on page 515 Restart robot movement StartMove - Restarts robot movement on page 486 Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
887
2 Functions 2.64. IsStopMoveAct - Is stop move flags active RobotWare - OS 3HAC 16581-1 Revision: J 884 © Copyright 2004-2010 ABB. All rights reserved. 2.64. IsStopMoveAct - Is stop move flags active Usage IsStopMoveAct is used to get the status of the stop move flags for a current or connected motion task. Basic examples Basic examples of the function IsStopMoveAct are illustrated below. Example 1 stopflag2:= IsStopMoveAct(\FromNonMoveTask); stopflag2 will be TRUE if the stop move flag from non-motion tasks is set in current or connected motion task, else it will be FALSE. Example 2 IF IsStopMoveAct(\FromMoveTask) THEN StartMove; ENDIF If the stop move flag from motion task is set in the current motion task, it will be reset by the StartMove instruction. Return value Data type: bool The return value will be TRUE if the selected stop move flag is set, else the return value will be FALSE. Arguments IsStopMoveAct ( [\FromMoveTask] | [\FromNonMoveTask] ) [\FromMoveTask] Data type: switch FromMoveTask is used to get the status of the stop move flag of type private motion task. This type of stop move flag can only be set by: • The motion task itself with instruction StopMove • After leaving the RestoPath level in the program • At execution in an asynchronous error handler for process- or motion errors before any StorePath and after any RestoPath [\FromNonMoveTask] Data type: switch FromNonMoveTask is used to get the status of the stop move flag of type any non-motion tasks. This type of stop move flag can only be set by any non-motion task in connected or all motion tasks with the instruction StopMove . Continues on next page 2 Functions 2.64. IsStopMoveAct - Is stop move flags active RobotWare - OS 885 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Syntax IsStopMoveAct’(’ [’\’ FromMoveTask] | [’\’ FromNonMoveTask]’ )’ A function with a return value of the data type bool . Related information For information about See Stop robot movement StopMove - Stops robot movement on page 515 Restart robot movement StartMove - Restarts robot movement on page 486 Continued 2 Functions 2.65. IsStopStateEvent - Test whether moved program pointer RobotWare - OS 3HAC 16581-1 Revision: J 886 © Copyright 2004-2010 ABB. All rights reserved. 2.65. IsStopStateEvent - Test whether moved program pointer Usage IsStopStateEvent returns information about the movement of the Program Pointer (PP) in current program task. Basic examples Basic examples of the function IsStopStateEvent are illustrated below. Example 1 IF IsStopStateEvent (\PPMoved) = TRUE THEN ! PP has been moved during the last program stop ELSE ! PP has not been moved during the last program stop ENDIF IF IsStopStateEvent (\PPToMain) THEN ! PP has been moved to main routine during the last program stop ENDIF Return value Data type: bool Status if and how PP has been moved during the last stop state. TRUE if PP has been moved during the last stop. FALSE if PP has not been moved during the last stop. If PP has been moved to the main routine, both \PPMoved and \PPToMain will return TRUE . If PP has been moved to a routine, both \PPMoved and \PPToMain will return TRUE . If PP has been moved within a list of a routine, \PPMoved will return TRUE and \PPToMain will return FALSE . After calling a service routine (keep execution context in main program sequence) \PPMove will return FALSE and \PPToMain will return FALSE . Arguments IsStopStateEvent ([\PPMoved] | [\PPToMain]) [ \PPMoved ] Data type: switch Test whether PP has been moved. [ \PPToMain ] Data type: switch Test whether PP has been moved to main or to a routine. Limitations This function in most cases cannot be used during forward or backward execution because the system is in stop state between every single step. Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
888
2 Functions 2.64. IsStopMoveAct - Is stop move flags active RobotWare - OS 885 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Syntax IsStopMoveAct’(’ [’\’ FromMoveTask] | [’\’ FromNonMoveTask]’ )’ A function with a return value of the data type bool . Related information For information about See Stop robot movement StopMove - Stops robot movement on page 515 Restart robot movement StartMove - Restarts robot movement on page 486 Continued 2 Functions 2.65. IsStopStateEvent - Test whether moved program pointer RobotWare - OS 3HAC 16581-1 Revision: J 886 © Copyright 2004-2010 ABB. All rights reserved. 2.65. IsStopStateEvent - Test whether moved program pointer Usage IsStopStateEvent returns information about the movement of the Program Pointer (PP) in current program task. Basic examples Basic examples of the function IsStopStateEvent are illustrated below. Example 1 IF IsStopStateEvent (\PPMoved) = TRUE THEN ! PP has been moved during the last program stop ELSE ! PP has not been moved during the last program stop ENDIF IF IsStopStateEvent (\PPToMain) THEN ! PP has been moved to main routine during the last program stop ENDIF Return value Data type: bool Status if and how PP has been moved during the last stop state. TRUE if PP has been moved during the last stop. FALSE if PP has not been moved during the last stop. If PP has been moved to the main routine, both \PPMoved and \PPToMain will return TRUE . If PP has been moved to a routine, both \PPMoved and \PPToMain will return TRUE . If PP has been moved within a list of a routine, \PPMoved will return TRUE and \PPToMain will return FALSE . After calling a service routine (keep execution context in main program sequence) \PPMove will return FALSE and \PPToMain will return FALSE . Arguments IsStopStateEvent ([\PPMoved] | [\PPToMain]) [ \PPMoved ] Data type: switch Test whether PP has been moved. [ \PPToMain ] Data type: switch Test whether PP has been moved to main or to a routine. Limitations This function in most cases cannot be used during forward or backward execution because the system is in stop state between every single step. Continues on next page 2 Functions 2.65. IsStopStateEvent - Test whether moved program pointer RobotWare - OS 887 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Syntax IsStopStateEvent’(’ [’\’ PPMoved] | [’\’ PPToMain] ´)´ A function with a return value of the data type bool . Related information For information about See Making own instructions Technical reference manual - RAPID overview , section - Programming off-line - Making your own instructions Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
889
2 Functions 2.65. IsStopStateEvent - Test whether moved program pointer RobotWare - OS 3HAC 16581-1 Revision: J 886 © Copyright 2004-2010 ABB. All rights reserved. 2.65. IsStopStateEvent - Test whether moved program pointer Usage IsStopStateEvent returns information about the movement of the Program Pointer (PP) in current program task. Basic examples Basic examples of the function IsStopStateEvent are illustrated below. Example 1 IF IsStopStateEvent (\PPMoved) = TRUE THEN ! PP has been moved during the last program stop ELSE ! PP has not been moved during the last program stop ENDIF IF IsStopStateEvent (\PPToMain) THEN ! PP has been moved to main routine during the last program stop ENDIF Return value Data type: bool Status if and how PP has been moved during the last stop state. TRUE if PP has been moved during the last stop. FALSE if PP has not been moved during the last stop. If PP has been moved to the main routine, both \PPMoved and \PPToMain will return TRUE . If PP has been moved to a routine, both \PPMoved and \PPToMain will return TRUE . If PP has been moved within a list of a routine, \PPMoved will return TRUE and \PPToMain will return FALSE . After calling a service routine (keep execution context in main program sequence) \PPMove will return FALSE and \PPToMain will return FALSE . Arguments IsStopStateEvent ([\PPMoved] | [\PPToMain]) [ \PPMoved ] Data type: switch Test whether PP has been moved. [ \PPToMain ] Data type: switch Test whether PP has been moved to main or to a routine. Limitations This function in most cases cannot be used during forward or backward execution because the system is in stop state between every single step. Continues on next page 2 Functions 2.65. IsStopStateEvent - Test whether moved program pointer RobotWare - OS 887 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Syntax IsStopStateEvent’(’ [’\’ PPMoved] | [’\’ PPToMain] ´)´ A function with a return value of the data type bool . Related information For information about See Making own instructions Technical reference manual - RAPID overview , section - Programming off-line - Making your own instructions Continued 2 Functions 2.66. IsSyncMoveOn - Test if in synchronized movement mode RobotWare - OS 3HAC 16581-1 Revision: J 888 © Copyright 2004-2010 ABB. All rights reserved. 2.66. IsSyncMoveOn - Test if in synchronized movement mode Usage IsSyncMoveOn is used to test if the current program task of type Motion Task is in synchronized movement mode or not. It is also possible from some Non Motion Task to test if the connected Motion Task is in synchronized movement mode or not. The system parameter Controller/Tasks/Use Mechanical Unit Group define the connected Motion Task . When the Motion Task is executing at StorePath level IsSyncMoveOn will test if the task is in synchronized mode on that level, independently of the synchronized mode on the original level. The instruction IsSyncMoveOn is usually used in a MultiMove system with option Coordinated Robots but can be used in any system and in any program task. Basic examples Basic examples of the function IsSyncMoveOn are illustrated below. Example 1 Program example in task T_ROB1 PERS tasks task_list{2} := [ ["T_ROB1"], ["T_ROB2"] ]; VAR syncident sync1; VAR syncident sync2; VAR syncident sync3; PROC main() ... MoveL p_zone, vmax, z50, tcp1; WaitSyncTask sync1, task_list; MoveL p_fine, v1000, fine, tcp1; syncmove; ... ENDPROC PROC syncmove() SyncMoveOn sync2, task_list; MoveL * \ID:=10, v100, z10, tcp1 \WOBJ:= rob2_obj; MoveL * \ID:=20, v100, fine, tcp1 \WOBJ:= rob2_obj; SyncMoveOff sync3; UNDO SyncMoveUndo; ENDPROC Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
890
2 Functions 2.65. IsStopStateEvent - Test whether moved program pointer RobotWare - OS 887 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Syntax IsStopStateEvent’(’ [’\’ PPMoved] | [’\’ PPToMain] ´)´ A function with a return value of the data type bool . Related information For information about See Making own instructions Technical reference manual - RAPID overview , section - Programming off-line - Making your own instructions Continued 2 Functions 2.66. IsSyncMoveOn - Test if in synchronized movement mode RobotWare - OS 3HAC 16581-1 Revision: J 888 © Copyright 2004-2010 ABB. All rights reserved. 2.66. IsSyncMoveOn - Test if in synchronized movement mode Usage IsSyncMoveOn is used to test if the current program task of type Motion Task is in synchronized movement mode or not. It is also possible from some Non Motion Task to test if the connected Motion Task is in synchronized movement mode or not. The system parameter Controller/Tasks/Use Mechanical Unit Group define the connected Motion Task . When the Motion Task is executing at StorePath level IsSyncMoveOn will test if the task is in synchronized mode on that level, independently of the synchronized mode on the original level. The instruction IsSyncMoveOn is usually used in a MultiMove system with option Coordinated Robots but can be used in any system and in any program task. Basic examples Basic examples of the function IsSyncMoveOn are illustrated below. Example 1 Program example in task T_ROB1 PERS tasks task_list{2} := [ ["T_ROB1"], ["T_ROB2"] ]; VAR syncident sync1; VAR syncident sync2; VAR syncident sync3; PROC main() ... MoveL p_zone, vmax, z50, tcp1; WaitSyncTask sync1, task_list; MoveL p_fine, v1000, fine, tcp1; syncmove; ... ENDPROC PROC syncmove() SyncMoveOn sync2, task_list; MoveL * \ID:=10, v100, z10, tcp1 \WOBJ:= rob2_obj; MoveL * \ID:=20, v100, fine, tcp1 \WOBJ:= rob2_obj; SyncMoveOff sync3; UNDO SyncMoveUndo; ENDPROC Continues on next page 2 Functions 2.66. IsSyncMoveOn - Test if in synchronized movement mode RobotWare - OS 889 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Program example in task BCK1 PROC main() ... IF IsSyncMoveOn() THEN ! Connected Motion Task is in synchronized movement mode ELSE ! Connected Motion Task is in independent mode ENDIF ... ENDPROC At the execution time of IsSyncMoveOn , in the background task BCK1 , we test if the connected motion task at that moment is in synchronized movement mode or not. Return value Data type: bool TRUE if current or connected program task is in synchronized movement mode at the moment, otherwise FALSE . Program execution Test if current or connected program task is in synchronized movement mode at the moment or not. If the MotionTask is executing at StorePath level , the SyncMoveOn will test if the task is in synchronized movement on the StorePath level , not on the original level. Syntax IsSyncMoveOn ’(’ ’)’ A function with a return value of the data type bool . Related information For information about See Specify cooperated program tasks tasks - RAPID program tasks on page 1204 Identity for synchronization point syncident - Identity for synchronization point on page 1200 Start coordinated synchronized movements SyncMoveOn - Start coordinated synchro- nized movements on page 534 End coordinated synchronized movements SyncMoveOff - End coordinated synchronized movements on page 528 Set independent movements SyncMoveUndo - Set independent movements on page 545 Store path and execute on new level StorePath - Stores the path when an interrupt occurs on page 521 Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
891
2 Functions 2.66. IsSyncMoveOn - Test if in synchronized movement mode RobotWare - OS 3HAC 16581-1 Revision: J 888 © Copyright 2004-2010 ABB. All rights reserved. 2.66. IsSyncMoveOn - Test if in synchronized movement mode Usage IsSyncMoveOn is used to test if the current program task of type Motion Task is in synchronized movement mode or not. It is also possible from some Non Motion Task to test if the connected Motion Task is in synchronized movement mode or not. The system parameter Controller/Tasks/Use Mechanical Unit Group define the connected Motion Task . When the Motion Task is executing at StorePath level IsSyncMoveOn will test if the task is in synchronized mode on that level, independently of the synchronized mode on the original level. The instruction IsSyncMoveOn is usually used in a MultiMove system with option Coordinated Robots but can be used in any system and in any program task. Basic examples Basic examples of the function IsSyncMoveOn are illustrated below. Example 1 Program example in task T_ROB1 PERS tasks task_list{2} := [ ["T_ROB1"], ["T_ROB2"] ]; VAR syncident sync1; VAR syncident sync2; VAR syncident sync3; PROC main() ... MoveL p_zone, vmax, z50, tcp1; WaitSyncTask sync1, task_list; MoveL p_fine, v1000, fine, tcp1; syncmove; ... ENDPROC PROC syncmove() SyncMoveOn sync2, task_list; MoveL * \ID:=10, v100, z10, tcp1 \WOBJ:= rob2_obj; MoveL * \ID:=20, v100, fine, tcp1 \WOBJ:= rob2_obj; SyncMoveOff sync3; UNDO SyncMoveUndo; ENDPROC Continues on next page 2 Functions 2.66. IsSyncMoveOn - Test if in synchronized movement mode RobotWare - OS 889 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Program example in task BCK1 PROC main() ... IF IsSyncMoveOn() THEN ! Connected Motion Task is in synchronized movement mode ELSE ! Connected Motion Task is in independent mode ENDIF ... ENDPROC At the execution time of IsSyncMoveOn , in the background task BCK1 , we test if the connected motion task at that moment is in synchronized movement mode or not. Return value Data type: bool TRUE if current or connected program task is in synchronized movement mode at the moment, otherwise FALSE . Program execution Test if current or connected program task is in synchronized movement mode at the moment or not. If the MotionTask is executing at StorePath level , the SyncMoveOn will test if the task is in synchronized movement on the StorePath level , not on the original level. Syntax IsSyncMoveOn ’(’ ’)’ A function with a return value of the data type bool . Related information For information about See Specify cooperated program tasks tasks - RAPID program tasks on page 1204 Identity for synchronization point syncident - Identity for synchronization point on page 1200 Start coordinated synchronized movements SyncMoveOn - Start coordinated synchro- nized movements on page 534 End coordinated synchronized movements SyncMoveOff - End coordinated synchronized movements on page 528 Set independent movements SyncMoveUndo - Set independent movements on page 545 Store path and execute on new level StorePath - Stores the path when an interrupt occurs on page 521 Continued 2 Functions 2.67. IsSysId - Test system identity RobotWare - OS 3HAC 16581-1 Revision: J 890 © Copyright 2004-2010 ABB. All rights reserved. 2.67. IsSysId - Test system identity Usage IsSysId ( System Identity ) can be used to test the system identity using the system serial number. Basic examples Basic examples of the function IsSysId are illustrated below. Example 1 IF NOT IsSysId("6400-1234") THEN ErrWrite "System identity fault","Faulty system identity for this program"; EXIT; ENDIF The program is made for a special robot system with serial number 6400-1234 and cannot be used by another robot system. Return value Data type: bool TRUE = The robot system serial number is the same as specified in the test. FALSE = The robot system serial number is not the same as specified in the test. Arguments IsSysId ( SystemId) SystemId Data type: string The robot system serial number, marking the system identity. Syntax IsSysId ’(’ [ SystemId’:=’ ] < expression ( IN ) of string> ´)´ A function with a return value of the data type bool. Related information For information about See Read system information GetSysInfo - Get information about the system on page 857
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
892
2 Functions 2.66. IsSyncMoveOn - Test if in synchronized movement mode RobotWare - OS 889 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Program example in task BCK1 PROC main() ... IF IsSyncMoveOn() THEN ! Connected Motion Task is in synchronized movement mode ELSE ! Connected Motion Task is in independent mode ENDIF ... ENDPROC At the execution time of IsSyncMoveOn , in the background task BCK1 , we test if the connected motion task at that moment is in synchronized movement mode or not. Return value Data type: bool TRUE if current or connected program task is in synchronized movement mode at the moment, otherwise FALSE . Program execution Test if current or connected program task is in synchronized movement mode at the moment or not. If the MotionTask is executing at StorePath level , the SyncMoveOn will test if the task is in synchronized movement on the StorePath level , not on the original level. Syntax IsSyncMoveOn ’(’ ’)’ A function with a return value of the data type bool . Related information For information about See Specify cooperated program tasks tasks - RAPID program tasks on page 1204 Identity for synchronization point syncident - Identity for synchronization point on page 1200 Start coordinated synchronized movements SyncMoveOn - Start coordinated synchro- nized movements on page 534 End coordinated synchronized movements SyncMoveOff - End coordinated synchronized movements on page 528 Set independent movements SyncMoveUndo - Set independent movements on page 545 Store path and execute on new level StorePath - Stores the path when an interrupt occurs on page 521 Continued 2 Functions 2.67. IsSysId - Test system identity RobotWare - OS 3HAC 16581-1 Revision: J 890 © Copyright 2004-2010 ABB. All rights reserved. 2.67. IsSysId - Test system identity Usage IsSysId ( System Identity ) can be used to test the system identity using the system serial number. Basic examples Basic examples of the function IsSysId are illustrated below. Example 1 IF NOT IsSysId("6400-1234") THEN ErrWrite "System identity fault","Faulty system identity for this program"; EXIT; ENDIF The program is made for a special robot system with serial number 6400-1234 and cannot be used by another robot system. Return value Data type: bool TRUE = The robot system serial number is the same as specified in the test. FALSE = The robot system serial number is not the same as specified in the test. Arguments IsSysId ( SystemId) SystemId Data type: string The robot system serial number, marking the system identity. Syntax IsSysId ’(’ [ SystemId’:=’ ] < expression ( IN ) of string> ´)´ A function with a return value of the data type bool. Related information For information about See Read system information GetSysInfo - Get information about the system on page 857 2 Functions 2.68. IsVar - Is variable RobotWare - OS 891 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.68. IsVar - Is variable Usage IsVar is used to test whether a data object is a variable or not. Basic examples Basic examples of the function IsVar are illustrated below. Example 1 PROC procedure1 (INOUT num parameter1) IF IsVAR(parameter1) THEN ! For this call reference to a variable ... ELSEIF IsPers(parameter1) THEN ! For this call reference to a persistent variable ... ELSE ! Should not happen EXIT; ENDIF ENDPROC The procedure procedure1 will take different actions, depending on whether the actual parameter parameter1 is a variable or a persistent variable. Return value Data type: bool TRUE if the tested actual INOUT parameter is a variable. FALSE if the tested actual INOUT parameter is not a variable. Arguments IsVar (DatObj) DatObj Data Object Data type: any type The name of the formal INOUT parameter. Syntax IsVar’(’ [ DatObj’ :=’ ] < var or pers ( INOUT ) of any type > ’)’ A function with a return value of the data type bool . Related information For information about See Test if persistent IsPers - Is persistent on page 883 Types of parameters (access modes) Technical reference manual - RAPID overview , section Basic characteristics - Routines
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
893
2 Functions 2.67. IsSysId - Test system identity RobotWare - OS 3HAC 16581-1 Revision: J 890 © Copyright 2004-2010 ABB. All rights reserved. 2.67. IsSysId - Test system identity Usage IsSysId ( System Identity ) can be used to test the system identity using the system serial number. Basic examples Basic examples of the function IsSysId are illustrated below. Example 1 IF NOT IsSysId("6400-1234") THEN ErrWrite "System identity fault","Faulty system identity for this program"; EXIT; ENDIF The program is made for a special robot system with serial number 6400-1234 and cannot be used by another robot system. Return value Data type: bool TRUE = The robot system serial number is the same as specified in the test. FALSE = The robot system serial number is not the same as specified in the test. Arguments IsSysId ( SystemId) SystemId Data type: string The robot system serial number, marking the system identity. Syntax IsSysId ’(’ [ SystemId’:=’ ] < expression ( IN ) of string> ´)´ A function with a return value of the data type bool. Related information For information about See Read system information GetSysInfo - Get information about the system on page 857 2 Functions 2.68. IsVar - Is variable RobotWare - OS 891 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.68. IsVar - Is variable Usage IsVar is used to test whether a data object is a variable or not. Basic examples Basic examples of the function IsVar are illustrated below. Example 1 PROC procedure1 (INOUT num parameter1) IF IsVAR(parameter1) THEN ! For this call reference to a variable ... ELSEIF IsPers(parameter1) THEN ! For this call reference to a persistent variable ... ELSE ! Should not happen EXIT; ENDIF ENDPROC The procedure procedure1 will take different actions, depending on whether the actual parameter parameter1 is a variable or a persistent variable. Return value Data type: bool TRUE if the tested actual INOUT parameter is a variable. FALSE if the tested actual INOUT parameter is not a variable. Arguments IsVar (DatObj) DatObj Data Object Data type: any type The name of the formal INOUT parameter. Syntax IsVar’(’ [ DatObj’ :=’ ] < var or pers ( INOUT ) of any type > ’)’ A function with a return value of the data type bool . Related information For information about See Test if persistent IsPers - Is persistent on page 883 Types of parameters (access modes) Technical reference manual - RAPID overview , section Basic characteristics - Routines 2 Functions 2.69. MaxRobSpeed - Maximum robot speed RobotWare - OS 3HAC 16581-1 Revision: J 892 © Copyright 2004-2010 ABB. All rights reserved. 2.69. MaxRobSpeed - Maximum robot speed Usage MaxRobSpeed ( Maximum Robot Speed ) returns the maximum TCP speed for the used robot type. Basic examples Basic examples of the function MaxRobSpeed are illustrated below. Example 1 TPWrite "Max. TCP speed in mm/s for my robot="\Num:=MaxRobSpeed(); The message Max. TCP speed in mm/s for my robot = 5000 is written on the FlexPendant. Return value Data type: num Return the max. TCP speed in mm/s for the used robot type and normal practical TCP values. If extremely large TCP values are used in the tool frame, one should create his own speeddata with bigger TCP speed than returned by MaxRobSpeed . Syntax MaxRobSpeed ’(’ ’)’ A function with a return value of the data type num . Related information For information about See Definition of velocity speeddata - Speed data on page 1185 Definition of maximum velocity VelSet - Changes the programmed velocity on page 662
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
894
2 Functions 2.68. IsVar - Is variable RobotWare - OS 891 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.68. IsVar - Is variable Usage IsVar is used to test whether a data object is a variable or not. Basic examples Basic examples of the function IsVar are illustrated below. Example 1 PROC procedure1 (INOUT num parameter1) IF IsVAR(parameter1) THEN ! For this call reference to a variable ... ELSEIF IsPers(parameter1) THEN ! For this call reference to a persistent variable ... ELSE ! Should not happen EXIT; ENDIF ENDPROC The procedure procedure1 will take different actions, depending on whether the actual parameter parameter1 is a variable or a persistent variable. Return value Data type: bool TRUE if the tested actual INOUT parameter is a variable. FALSE if the tested actual INOUT parameter is not a variable. Arguments IsVar (DatObj) DatObj Data Object Data type: any type The name of the formal INOUT parameter. Syntax IsVar’(’ [ DatObj’ :=’ ] < var or pers ( INOUT ) of any type > ’)’ A function with a return value of the data type bool . Related information For information about See Test if persistent IsPers - Is persistent on page 883 Types of parameters (access modes) Technical reference manual - RAPID overview , section Basic characteristics - Routines 2 Functions 2.69. MaxRobSpeed - Maximum robot speed RobotWare - OS 3HAC 16581-1 Revision: J 892 © Copyright 2004-2010 ABB. All rights reserved. 2.69. MaxRobSpeed - Maximum robot speed Usage MaxRobSpeed ( Maximum Robot Speed ) returns the maximum TCP speed for the used robot type. Basic examples Basic examples of the function MaxRobSpeed are illustrated below. Example 1 TPWrite "Max. TCP speed in mm/s for my robot="\Num:=MaxRobSpeed(); The message Max. TCP speed in mm/s for my robot = 5000 is written on the FlexPendant. Return value Data type: num Return the max. TCP speed in mm/s for the used robot type and normal practical TCP values. If extremely large TCP values are used in the tool frame, one should create his own speeddata with bigger TCP speed than returned by MaxRobSpeed . Syntax MaxRobSpeed ’(’ ’)’ A function with a return value of the data type num . Related information For information about See Definition of velocity speeddata - Speed data on page 1185 Definition of maximum velocity VelSet - Changes the programmed velocity on page 662 2 Functions 2.70. MirPos - Mirroring of a position RobotWare - OS 893 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.70. MirPos - Mirroring of a position Usage MirPos ( Mirror Position ) is used to mirror the translation and rotation parts of a position. Basic examples Basic examples of the function MirPos are illustrated below. CONST robtarget p1:= [...]; VAR robtarget p2; PERS wobjdata mirror:= [...]; ... p2 := MirPos(p1, mirror); p1 is a robtarget storing a position of the robot and an orientation of the tool. This position is mirrored in the xy-plane of the frame defined by mirror , relative to the world coordinate system. The result is new robtarget data, which is stored in p2 . Return value Data type: robtarget The new position which is the mirrored position of the input position. Arguments MirPos (Point MirPlane [\WObj] [\MirY]) Point Data type: robtarget The input robot position. The orientation part of this position defines the current orientation of the tool coordinate system. MirPlane Mirror Plane Data type: wobjdata The work object data defining the mirror plane. The mirror plane is the xy-plane of the object frame defined in MirPlane . The location of the object frame is defined relative to the user frame (also defined in MirPlane ) which in turn is defined relative to the world frame. [\WObj] Work Object Data type: wobjdata The work object data defining the object frame and user frame relative to which the input position Point is defined. If this argument is left out the position is defined relative to the World coordinate system. NOTE! If the position is created with an active work object, this work object must be referred to in the argument. Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
895
2 Functions 2.69. MaxRobSpeed - Maximum robot speed RobotWare - OS 3HAC 16581-1 Revision: J 892 © Copyright 2004-2010 ABB. All rights reserved. 2.69. MaxRobSpeed - Maximum robot speed Usage MaxRobSpeed ( Maximum Robot Speed ) returns the maximum TCP speed for the used robot type. Basic examples Basic examples of the function MaxRobSpeed are illustrated below. Example 1 TPWrite "Max. TCP speed in mm/s for my robot="\Num:=MaxRobSpeed(); The message Max. TCP speed in mm/s for my robot = 5000 is written on the FlexPendant. Return value Data type: num Return the max. TCP speed in mm/s for the used robot type and normal practical TCP values. If extremely large TCP values are used in the tool frame, one should create his own speeddata with bigger TCP speed than returned by MaxRobSpeed . Syntax MaxRobSpeed ’(’ ’)’ A function with a return value of the data type num . Related information For information about See Definition of velocity speeddata - Speed data on page 1185 Definition of maximum velocity VelSet - Changes the programmed velocity on page 662 2 Functions 2.70. MirPos - Mirroring of a position RobotWare - OS 893 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.70. MirPos - Mirroring of a position Usage MirPos ( Mirror Position ) is used to mirror the translation and rotation parts of a position. Basic examples Basic examples of the function MirPos are illustrated below. CONST robtarget p1:= [...]; VAR robtarget p2; PERS wobjdata mirror:= [...]; ... p2 := MirPos(p1, mirror); p1 is a robtarget storing a position of the robot and an orientation of the tool. This position is mirrored in the xy-plane of the frame defined by mirror , relative to the world coordinate system. The result is new robtarget data, which is stored in p2 . Return value Data type: robtarget The new position which is the mirrored position of the input position. Arguments MirPos (Point MirPlane [\WObj] [\MirY]) Point Data type: robtarget The input robot position. The orientation part of this position defines the current orientation of the tool coordinate system. MirPlane Mirror Plane Data type: wobjdata The work object data defining the mirror plane. The mirror plane is the xy-plane of the object frame defined in MirPlane . The location of the object frame is defined relative to the user frame (also defined in MirPlane ) which in turn is defined relative to the world frame. [\WObj] Work Object Data type: wobjdata The work object data defining the object frame and user frame relative to which the input position Point is defined. If this argument is left out the position is defined relative to the World coordinate system. NOTE! If the position is created with an active work object, this work object must be referred to in the argument. Continues on next page 2 Functions 2.70. MirPos - Mirroring of a position RobotWare - OS 3HAC 16581-1 Revision: J 894 © Copyright 2004-2010 ABB. All rights reserved. [\MirY] Mirror Y Data type: switch If this switch is left out, which is the default behavior, the tool frame will be mirrored with regards to the x-axis and the z-axis. If the switch is specified the tool frame will be mirrored with regards to the y-axis and the z-axis. Limitations No recalculation is done of the robot configuration part of the input robtarget data. If a coordinate frame is used, the coordinated unit has to be situated in the same task as the robot. Syntax MirPos’(’ [ Point ’:=’ ] < expression ( IN ) of robtarget>’,’ [MirPlane’ :=’] <expression ( IN ) of wobjdata>’,’ [’\’WObj ’:=’ <expression ( IN ) of wobjdata> ] [’\’MirY ]’)’ A function with a return value of the data type robtarget . Related information For information about See Mathematical instructions and functions Technical reference manual - RAPID overview , section RAPID Summary - Mathematics Position data robtarget - Position data on page 1176 Work object data wobjdata - Work object data on page 1224 Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
896
2 Functions 2.70. MirPos - Mirroring of a position RobotWare - OS 893 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.70. MirPos - Mirroring of a position Usage MirPos ( Mirror Position ) is used to mirror the translation and rotation parts of a position. Basic examples Basic examples of the function MirPos are illustrated below. CONST robtarget p1:= [...]; VAR robtarget p2; PERS wobjdata mirror:= [...]; ... p2 := MirPos(p1, mirror); p1 is a robtarget storing a position of the robot and an orientation of the tool. This position is mirrored in the xy-plane of the frame defined by mirror , relative to the world coordinate system. The result is new robtarget data, which is stored in p2 . Return value Data type: robtarget The new position which is the mirrored position of the input position. Arguments MirPos (Point MirPlane [\WObj] [\MirY]) Point Data type: robtarget The input robot position. The orientation part of this position defines the current orientation of the tool coordinate system. MirPlane Mirror Plane Data type: wobjdata The work object data defining the mirror plane. The mirror plane is the xy-plane of the object frame defined in MirPlane . The location of the object frame is defined relative to the user frame (also defined in MirPlane ) which in turn is defined relative to the world frame. [\WObj] Work Object Data type: wobjdata The work object data defining the object frame and user frame relative to which the input position Point is defined. If this argument is left out the position is defined relative to the World coordinate system. NOTE! If the position is created with an active work object, this work object must be referred to in the argument. Continues on next page 2 Functions 2.70. MirPos - Mirroring of a position RobotWare - OS 3HAC 16581-1 Revision: J 894 © Copyright 2004-2010 ABB. All rights reserved. [\MirY] Mirror Y Data type: switch If this switch is left out, which is the default behavior, the tool frame will be mirrored with regards to the x-axis and the z-axis. If the switch is specified the tool frame will be mirrored with regards to the y-axis and the z-axis. Limitations No recalculation is done of the robot configuration part of the input robtarget data. If a coordinate frame is used, the coordinated unit has to be situated in the same task as the robot. Syntax MirPos’(’ [ Point ’:=’ ] < expression ( IN ) of robtarget>’,’ [MirPlane’ :=’] <expression ( IN ) of wobjdata>’,’ [’\’WObj ’:=’ <expression ( IN ) of wobjdata> ] [’\’MirY ]’)’ A function with a return value of the data type robtarget . Related information For information about See Mathematical instructions and functions Technical reference manual - RAPID overview , section RAPID Summary - Mathematics Position data robtarget - Position data on page 1176 Work object data wobjdata - Work object data on page 1224 Continued 2 Functions 2.71. ModExist - Check if program module exist RobotWare - OS 895 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.71. ModExist - Check if program module exist Usage ModExist ( Module Exist ) is used to check whether a given module exists or not in the program task. Searching is first done for loaded modules and afterward, if none is found, for installed modules. Basic examples Basic examples of the function ModExist are illustrated below. Example 1 VAR bool mod_exist; mod_exist:=ModExist ("MyModule"); If module MyModule exists within the task, the function will return TRUE . If not, the function will return FALSE . Return value Data type: bool TRUE if the module was found, FALSE if not. Arguments ModExist (ModuleName) ModuleName Data type: string Name of the module to search for. Syntax ModExist ‘(‘ [ ModuleName ‘:=’ ] < expression ( IN ) of string > ’)’ A function with a return value of the data type bool . Related information For information about See Find modify time for loaded module ModTime - Get file modify time for the loaded module on page 896
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
897
2 Functions 2.70. MirPos - Mirroring of a position RobotWare - OS 3HAC 16581-1 Revision: J 894 © Copyright 2004-2010 ABB. All rights reserved. [\MirY] Mirror Y Data type: switch If this switch is left out, which is the default behavior, the tool frame will be mirrored with regards to the x-axis and the z-axis. If the switch is specified the tool frame will be mirrored with regards to the y-axis and the z-axis. Limitations No recalculation is done of the robot configuration part of the input robtarget data. If a coordinate frame is used, the coordinated unit has to be situated in the same task as the robot. Syntax MirPos’(’ [ Point ’:=’ ] < expression ( IN ) of robtarget>’,’ [MirPlane’ :=’] <expression ( IN ) of wobjdata>’,’ [’\’WObj ’:=’ <expression ( IN ) of wobjdata> ] [’\’MirY ]’)’ A function with a return value of the data type robtarget . Related information For information about See Mathematical instructions and functions Technical reference manual - RAPID overview , section RAPID Summary - Mathematics Position data robtarget - Position data on page 1176 Work object data wobjdata - Work object data on page 1224 Continued 2 Functions 2.71. ModExist - Check if program module exist RobotWare - OS 895 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.71. ModExist - Check if program module exist Usage ModExist ( Module Exist ) is used to check whether a given module exists or not in the program task. Searching is first done for loaded modules and afterward, if none is found, for installed modules. Basic examples Basic examples of the function ModExist are illustrated below. Example 1 VAR bool mod_exist; mod_exist:=ModExist ("MyModule"); If module MyModule exists within the task, the function will return TRUE . If not, the function will return FALSE . Return value Data type: bool TRUE if the module was found, FALSE if not. Arguments ModExist (ModuleName) ModuleName Data type: string Name of the module to search for. Syntax ModExist ‘(‘ [ ModuleName ‘:=’ ] < expression ( IN ) of string > ’)’ A function with a return value of the data type bool . Related information For information about See Find modify time for loaded module ModTime - Get file modify time for the loaded module on page 896 2 Functions 2.72. ModTime - Get file modify time for the loaded module RobotWare - OS 3HAC 16581-1 Revision: J 896 © Copyright 2004-2010 ABB. All rights reserved. 2.72. ModTime - Get file modify time for the loaded module Usage ModTime ( Modify Time ) is used to retrieve the last file modification time for the loaded module. The module is specified by its name and must be in the task memory. The time is measured in seconds since 00:00:00 GMT, Jan. 1 1970. The time is returned as a num and optionally also as a stringdig . Basic examples Basic examples of the function ModTime are illustrated below. See also More examples on page 897 . Example 1 MODULE mymod VAR num mytime; PROC printMyTime() mytime := ModTime("mymod"); TPWrite "My time is "+NumToStr(mytime,0); ENDPROC ENDMODULE Return value Data type: num The time measured in seconds since 00:00:00 GMT, Jan. 1 1970. Arguments ModTime ( Object [\StrDig] ) Object Data type: string The name of the module. [\StrDig] String Digit Data type: stringdig To get the mod loading time in a stringdig representation. Further use in StrDigCmp can handle positive integers above 8388608 with exact representation. Program execution This function returns a numeric value that specifies the last time a file was modified before it was loaded as a program module in 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
898
2 Functions 2.71. ModExist - Check if program module exist RobotWare - OS 895 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.71. ModExist - Check if program module exist Usage ModExist ( Module Exist ) is used to check whether a given module exists or not in the program task. Searching is first done for loaded modules and afterward, if none is found, for installed modules. Basic examples Basic examples of the function ModExist are illustrated below. Example 1 VAR bool mod_exist; mod_exist:=ModExist ("MyModule"); If module MyModule exists within the task, the function will return TRUE . If not, the function will return FALSE . Return value Data type: bool TRUE if the module was found, FALSE if not. Arguments ModExist (ModuleName) ModuleName Data type: string Name of the module to search for. Syntax ModExist ‘(‘ [ ModuleName ‘:=’ ] < expression ( IN ) of string > ’)’ A function with a return value of the data type bool . Related information For information about See Find modify time for loaded module ModTime - Get file modify time for the loaded module on page 896 2 Functions 2.72. ModTime - Get file modify time for the loaded module RobotWare - OS 3HAC 16581-1 Revision: J 896 © Copyright 2004-2010 ABB. All rights reserved. 2.72. ModTime - Get file modify time for the loaded module Usage ModTime ( Modify Time ) is used to retrieve the last file modification time for the loaded module. The module is specified by its name and must be in the task memory. The time is measured in seconds since 00:00:00 GMT, Jan. 1 1970. The time is returned as a num and optionally also as a stringdig . Basic examples Basic examples of the function ModTime are illustrated below. See also More examples on page 897 . Example 1 MODULE mymod VAR num mytime; PROC printMyTime() mytime := ModTime("mymod"); TPWrite "My time is "+NumToStr(mytime,0); ENDPROC ENDMODULE Return value Data type: num The time measured in seconds since 00:00:00 GMT, Jan. 1 1970. Arguments ModTime ( Object [\StrDig] ) Object Data type: string The name of the module. [\StrDig] String Digit Data type: stringdig To get the mod loading time in a stringdig representation. Further use in StrDigCmp can handle positive integers above 8388608 with exact representation. Program execution This function returns a numeric value that specifies the last time a file was modified before it was loaded as a program module in the system. Continues on next page 2 Functions 2.72. ModTime - Get file modify time for the loaded module RobotWare - OS 897 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. More examples More examples of the function ModTime are illustrated below. Example 1 IF FileTime ("HOME:/mymod.mod" \ModifyTime) > ModTime ("mymod") THEN UnLoad "HOME:/mymod.mod"; Load \Dynamic, "HOME:/mymod.mod"; ENDIF This program reloads a module if the source file is newer. It uses the ModTime to retrieve the latest modify time for the specified module, and compares it to the FileTime\ModifyTime at the source. Then, if the source is newer, the program unloads and loads the module again. Limitation in this example: The data type num can’t handle positive integers above 8388608 seconds with exact representation. To get better dissolution, see example in function StrDigCmp . Error handling If no module with specified name is in the program task, the system variable ERRNO is set to ERR_MOD_NOT_LOADED. This error can then be handled in the error handler. Limitations This function will always return 0 if used on a module that is encoded or installed shared. Syntax ModTime ’(’ [ Object ’:=’ ] < expression ( IN ) of string> [ '\' StrDig’ :=’ < variable ( VAR ) of stringdig> ] ’)’ A function with a return value of the data type num . Related information For information about See Retrieve time information about a file FileTime - Retrieve time information about a file on page 845 String with only digits stringdig - String with only digits on page 1197 Compare two strings with only digits StrDigCmp - Compare two strings with only digits on page 991 Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
899
2 Functions 2.72. ModTime - Get file modify time for the loaded module RobotWare - OS 3HAC 16581-1 Revision: J 896 © Copyright 2004-2010 ABB. All rights reserved. 2.72. ModTime - Get file modify time for the loaded module Usage ModTime ( Modify Time ) is used to retrieve the last file modification time for the loaded module. The module is specified by its name and must be in the task memory. The time is measured in seconds since 00:00:00 GMT, Jan. 1 1970. The time is returned as a num and optionally also as a stringdig . Basic examples Basic examples of the function ModTime are illustrated below. See also More examples on page 897 . Example 1 MODULE mymod VAR num mytime; PROC printMyTime() mytime := ModTime("mymod"); TPWrite "My time is "+NumToStr(mytime,0); ENDPROC ENDMODULE Return value Data type: num The time measured in seconds since 00:00:00 GMT, Jan. 1 1970. Arguments ModTime ( Object [\StrDig] ) Object Data type: string The name of the module. [\StrDig] String Digit Data type: stringdig To get the mod loading time in a stringdig representation. Further use in StrDigCmp can handle positive integers above 8388608 with exact representation. Program execution This function returns a numeric value that specifies the last time a file was modified before it was loaded as a program module in the system. Continues on next page 2 Functions 2.72. ModTime - Get file modify time for the loaded module RobotWare - OS 897 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. More examples More examples of the function ModTime are illustrated below. Example 1 IF FileTime ("HOME:/mymod.mod" \ModifyTime) > ModTime ("mymod") THEN UnLoad "HOME:/mymod.mod"; Load \Dynamic, "HOME:/mymod.mod"; ENDIF This program reloads a module if the source file is newer. It uses the ModTime to retrieve the latest modify time for the specified module, and compares it to the FileTime\ModifyTime at the source. Then, if the source is newer, the program unloads and loads the module again. Limitation in this example: The data type num can’t handle positive integers above 8388608 seconds with exact representation. To get better dissolution, see example in function StrDigCmp . Error handling If no module with specified name is in the program task, the system variable ERRNO is set to ERR_MOD_NOT_LOADED. This error can then be handled in the error handler. Limitations This function will always return 0 if used on a module that is encoded or installed shared. Syntax ModTime ’(’ [ Object ’:=’ ] < expression ( IN ) of string> [ '\' StrDig’ :=’ < variable ( VAR ) of stringdig> ] ’)’ A function with a return value of the data type num . Related information For information about See Retrieve time information about a file FileTime - Retrieve time information about a file on page 845 String with only digits stringdig - String with only digits on page 1197 Compare two strings with only digits StrDigCmp - Compare two strings with only digits on page 991 Continued 2 Functions 2.73. MotionPlannerNo - Get connected motion planner number RobotWare - OS 3HAC 16581-1 Revision: J 898 © Copyright 2004-2010 ABB. All rights reserved. 2.73. MotionPlannerNo - Get connected motion planner number Usage MotionPlannerNo returns the connected motion planner number. If executing MotionPlannerNo in a motion task, it returns its planner number. Else if executing MotionPlannerNo in a non-motion task it returns the connected motion planner number according to the setup in the system parameters. Basic examples Basic examples of the function MotionPlannerNo are illustrated below. Example 1 !Motion task T_ROB1 PERS string buffer{6} := [stEmpty, stEmpty, stEmpty, stEmpty, stEmpty, stEmpty]; VAR num motion_planner; PROC main() ... MoveL point, v1000, fine, tcp1; motion_planner := MotionPlannerNo(); buffer[motion_planner] := "READY"; ... ENDPROC !Background task BCK1 PERS string buffer{6}; VAR num motion_planner; VAR string status; PROC main() ... motion_planner := MotionPlannerNo(); status := buffer[motion_planner]; ... ENDPROC !Motion T_ROB2 PERS string buffer{6}; VAR num motion_planner; PROC main() ... MoveL point, v1000, fine, tcp1; motion_planner := MotionPlannerNo(); buffer[motion_planner] := "READY"; ... ENDPROC Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
900
2 Functions 2.72. ModTime - Get file modify time for the loaded module RobotWare - OS 897 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. More examples More examples of the function ModTime are illustrated below. Example 1 IF FileTime ("HOME:/mymod.mod" \ModifyTime) > ModTime ("mymod") THEN UnLoad "HOME:/mymod.mod"; Load \Dynamic, "HOME:/mymod.mod"; ENDIF This program reloads a module if the source file is newer. It uses the ModTime to retrieve the latest modify time for the specified module, and compares it to the FileTime\ModifyTime at the source. Then, if the source is newer, the program unloads and loads the module again. Limitation in this example: The data type num can’t handle positive integers above 8388608 seconds with exact representation. To get better dissolution, see example in function StrDigCmp . Error handling If no module with specified name is in the program task, the system variable ERRNO is set to ERR_MOD_NOT_LOADED. This error can then be handled in the error handler. Limitations This function will always return 0 if used on a module that is encoded or installed shared. Syntax ModTime ’(’ [ Object ’:=’ ] < expression ( IN ) of string> [ '\' StrDig’ :=’ < variable ( VAR ) of stringdig> ] ’)’ A function with a return value of the data type num . Related information For information about See Retrieve time information about a file FileTime - Retrieve time information about a file on page 845 String with only digits stringdig - String with only digits on page 1197 Compare two strings with only digits StrDigCmp - Compare two strings with only digits on page 991 Continued 2 Functions 2.73. MotionPlannerNo - Get connected motion planner number RobotWare - OS 3HAC 16581-1 Revision: J 898 © Copyright 2004-2010 ABB. All rights reserved. 2.73. MotionPlannerNo - Get connected motion planner number Usage MotionPlannerNo returns the connected motion planner number. If executing MotionPlannerNo in a motion task, it returns its planner number. Else if executing MotionPlannerNo in a non-motion task it returns the connected motion planner number according to the setup in the system parameters. Basic examples Basic examples of the function MotionPlannerNo are illustrated below. Example 1 !Motion task T_ROB1 PERS string buffer{6} := [stEmpty, stEmpty, stEmpty, stEmpty, stEmpty, stEmpty]; VAR num motion_planner; PROC main() ... MoveL point, v1000, fine, tcp1; motion_planner := MotionPlannerNo(); buffer[motion_planner] := "READY"; ... ENDPROC !Background task BCK1 PERS string buffer{6}; VAR num motion_planner; VAR string status; PROC main() ... motion_planner := MotionPlannerNo(); status := buffer[motion_planner]; ... ENDPROC !Motion T_ROB2 PERS string buffer{6}; VAR num motion_planner; PROC main() ... MoveL point, v1000, fine, tcp1; motion_planner := MotionPlannerNo(); buffer[motion_planner] := "READY"; ... ENDPROC Continues on next page 2 Functions 2.73. MotionPlannerNo - Get connected motion planner number RobotWare - OS 899 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. !Background task BCK2 PERS string buffer{6}; VAR num motion_planner; VAR string status; PROC main() ... motion_planner := MotionPlannerNo(); status := buffer[motion_planner]; ... ENDPROC Use the function MotionPlannerNo to find out which motion planner number is connected to the task. The exact same code can by implemented in all motion tasks and background tasks. Then each background task can check the status for their connected motion task. Return value Data type: num The number of the connected motion planner. For non-motion tasks, the motion planner number of the associated mechanical unit will be returned. The return value range is 1 ... 6. Syntax MotionPlannerNo’(’ ’)’ A function with a return value of the data type num . Related information For information about See Specify cooperated program tasks Technical reference manual - System parameters , section Controller - Task Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
901
2 Functions 2.73. MotionPlannerNo - Get connected motion planner number RobotWare - OS 3HAC 16581-1 Revision: J 898 © Copyright 2004-2010 ABB. All rights reserved. 2.73. MotionPlannerNo - Get connected motion planner number Usage MotionPlannerNo returns the connected motion planner number. If executing MotionPlannerNo in a motion task, it returns its planner number. Else if executing MotionPlannerNo in a non-motion task it returns the connected motion planner number according to the setup in the system parameters. Basic examples Basic examples of the function MotionPlannerNo are illustrated below. Example 1 !Motion task T_ROB1 PERS string buffer{6} := [stEmpty, stEmpty, stEmpty, stEmpty, stEmpty, stEmpty]; VAR num motion_planner; PROC main() ... MoveL point, v1000, fine, tcp1; motion_planner := MotionPlannerNo(); buffer[motion_planner] := "READY"; ... ENDPROC !Background task BCK1 PERS string buffer{6}; VAR num motion_planner; VAR string status; PROC main() ... motion_planner := MotionPlannerNo(); status := buffer[motion_planner]; ... ENDPROC !Motion T_ROB2 PERS string buffer{6}; VAR num motion_planner; PROC main() ... MoveL point, v1000, fine, tcp1; motion_planner := MotionPlannerNo(); buffer[motion_planner] := "READY"; ... ENDPROC Continues on next page 2 Functions 2.73. MotionPlannerNo - Get connected motion planner number RobotWare - OS 899 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. !Background task BCK2 PERS string buffer{6}; VAR num motion_planner; VAR string status; PROC main() ... motion_planner := MotionPlannerNo(); status := buffer[motion_planner]; ... ENDPROC Use the function MotionPlannerNo to find out which motion planner number is connected to the task. The exact same code can by implemented in all motion tasks and background tasks. Then each background task can check the status for their connected motion task. Return value Data type: num The number of the connected motion planner. For non-motion tasks, the motion planner number of the associated mechanical unit will be returned. The return value range is 1 ... 6. Syntax MotionPlannerNo’(’ ’)’ A function with a return value of the data type num . Related information For information about See Specify cooperated program tasks Technical reference manual - System parameters , section Controller - Task Continued 2 Functions 2.74. NonMotionMode - Read the Non-Motion execution mode RobotWare - OS 3HAC 16581-1 Revision: J 900 © Copyright 2004-2010 ABB. All rights reserved. 2.74. NonMotionMode - Read the Non-Motion execution mode Usage NonMotionMode ( Non-Motion Execution Mode ) is used to read the current Non-Motion execution mode of the program task. Non-motion execution mode is selected or removed from the FlexPendant under the menu ABB\Control Panel\Supervision . Basic examples Basic examples of the function NonMotionMode are illustrated below. Example 1 IF NonMotionMode() =TRUE THEN ... ENDIF The program section is executed only if the robot is in Non-Motion execution mode. Return value Data type: bool The current Non-motion mode as defined in the table below. Arguments NonMotionMode ( [ \Main] ) [ \Main ] Data type: switch Return current running mode for connected motion task. Used in a multi-tasking system to get the current running mode for the actual task, if it is a motion task or connected motion task, if function NonMotionMode is executed in a nonmotion task. If this argument is omitted, the return value always mirrors the current running mode for the program task that executes the function NonMotionMode . Note that the execution mode is connected to the system and not any task. This means that all tasks in a system will give the same return value from NonMotionMode . Syntax NonMotionMode ’(’ [’\’Main]’)’ A function with a return value of the data type bool . Related information Return value Symbolic constant Comment 0 FALSE Non-Motion execution is not used 1 TRUE Non-Motion execution is used For information about See Reading operating mode OpMode - Read the operating mode on page 908
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
902
2 Functions 2.73. MotionPlannerNo - Get connected motion planner number RobotWare - OS 899 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. !Background task BCK2 PERS string buffer{6}; VAR num motion_planner; VAR string status; PROC main() ... motion_planner := MotionPlannerNo(); status := buffer[motion_planner]; ... ENDPROC Use the function MotionPlannerNo to find out which motion planner number is connected to the task. The exact same code can by implemented in all motion tasks and background tasks. Then each background task can check the status for their connected motion task. Return value Data type: num The number of the connected motion planner. For non-motion tasks, the motion planner number of the associated mechanical unit will be returned. The return value range is 1 ... 6. Syntax MotionPlannerNo’(’ ’)’ A function with a return value of the data type num . Related information For information about See Specify cooperated program tasks Technical reference manual - System parameters , section Controller - Task Continued 2 Functions 2.74. NonMotionMode - Read the Non-Motion execution mode RobotWare - OS 3HAC 16581-1 Revision: J 900 © Copyright 2004-2010 ABB. All rights reserved. 2.74. NonMotionMode - Read the Non-Motion execution mode Usage NonMotionMode ( Non-Motion Execution Mode ) is used to read the current Non-Motion execution mode of the program task. Non-motion execution mode is selected or removed from the FlexPendant under the menu ABB\Control Panel\Supervision . Basic examples Basic examples of the function NonMotionMode are illustrated below. Example 1 IF NonMotionMode() =TRUE THEN ... ENDIF The program section is executed only if the robot is in Non-Motion execution mode. Return value Data type: bool The current Non-motion mode as defined in the table below. Arguments NonMotionMode ( [ \Main] ) [ \Main ] Data type: switch Return current running mode for connected motion task. Used in a multi-tasking system to get the current running mode for the actual task, if it is a motion task or connected motion task, if function NonMotionMode is executed in a nonmotion task. If this argument is omitted, the return value always mirrors the current running mode for the program task that executes the function NonMotionMode . Note that the execution mode is connected to the system and not any task. This means that all tasks in a system will give the same return value from NonMotionMode . Syntax NonMotionMode ’(’ [’\’Main]’)’ A function with a return value of the data type bool . Related information Return value Symbolic constant Comment 0 FALSE Non-Motion execution is not used 1 TRUE Non-Motion execution is used For information about See Reading operating mode OpMode - Read the operating mode on page 908 2 Functions 2.75. NOrient - Normalize orientation RobotWare - OS 901 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.75. NOrient - Normalize orientation Usage NOrient ( Normalize Orientation ) is used to normalize un-normalized orientation (quaternion). Description An orientation must be normalized, i.e. the sum of the squares must equal 1: . If the orientation is slightly un-normalized, it is possible to normalize it. The normalization error is the absolute value of the sum of the squares of the orientation components. The orientation is considered to be slightly un-normalized if the normalization error is greater then 0.00001 and less then 0.1. If the normalization error is greater then 0.1 the orient is unusable. . normerr > 0.1 Unusable normerr > 0.00001 AND normerr <= 0.1 Slightly un-normalized normerr <= 0.00001 Normalized Basic examples Basic examples of the function NOrient are illustrated below. Example 1 We have a slightly un-normalized position (0.707170, 0, 0, 0.707170) . VAR orient unnormorient := [0.707170, 0, 0, 0.707170]; VAR orient normorient; ... ... normorient := NOrient(unnormorient); The normalization of the orientation ( 0.707170, 0, 0, 0.707170 ) becomes (0.707107, 0, 0, 0.707107). Return value Data type: orient The normalized orientation. Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
903
2 Functions 2.74. NonMotionMode - Read the Non-Motion execution mode RobotWare - OS 3HAC 16581-1 Revision: J 900 © Copyright 2004-2010 ABB. All rights reserved. 2.74. NonMotionMode - Read the Non-Motion execution mode Usage NonMotionMode ( Non-Motion Execution Mode ) is used to read the current Non-Motion execution mode of the program task. Non-motion execution mode is selected or removed from the FlexPendant under the menu ABB\Control Panel\Supervision . Basic examples Basic examples of the function NonMotionMode are illustrated below. Example 1 IF NonMotionMode() =TRUE THEN ... ENDIF The program section is executed only if the robot is in Non-Motion execution mode. Return value Data type: bool The current Non-motion mode as defined in the table below. Arguments NonMotionMode ( [ \Main] ) [ \Main ] Data type: switch Return current running mode for connected motion task. Used in a multi-tasking system to get the current running mode for the actual task, if it is a motion task or connected motion task, if function NonMotionMode is executed in a nonmotion task. If this argument is omitted, the return value always mirrors the current running mode for the program task that executes the function NonMotionMode . Note that the execution mode is connected to the system and not any task. This means that all tasks in a system will give the same return value from NonMotionMode . Syntax NonMotionMode ’(’ [’\’Main]’)’ A function with a return value of the data type bool . Related information Return value Symbolic constant Comment 0 FALSE Non-Motion execution is not used 1 TRUE Non-Motion execution is used For information about See Reading operating mode OpMode - Read the operating mode on page 908 2 Functions 2.75. NOrient - Normalize orientation RobotWare - OS 901 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.75. NOrient - Normalize orientation Usage NOrient ( Normalize Orientation ) is used to normalize un-normalized orientation (quaternion). Description An orientation must be normalized, i.e. the sum of the squares must equal 1: . If the orientation is slightly un-normalized, it is possible to normalize it. The normalization error is the absolute value of the sum of the squares of the orientation components. The orientation is considered to be slightly un-normalized if the normalization error is greater then 0.00001 and less then 0.1. If the normalization error is greater then 0.1 the orient is unusable. . normerr > 0.1 Unusable normerr > 0.00001 AND normerr <= 0.1 Slightly un-normalized normerr <= 0.00001 Normalized Basic examples Basic examples of the function NOrient are illustrated below. Example 1 We have a slightly un-normalized position (0.707170, 0, 0, 0.707170) . VAR orient unnormorient := [0.707170, 0, 0, 0.707170]; VAR orient normorient; ... ... normorient := NOrient(unnormorient); The normalization of the orientation ( 0.707170, 0, 0, 0.707170 ) becomes (0.707107, 0, 0, 0.707107). Return value Data type: orient The normalized orientation. Continues on next page 2 Functions 2.75. NOrient - Normalize orientation RobotWare - OS 3HAC 16581-1 Revision: J 902 © Copyright 2004-2010 ABB. All rights reserved. Arguments NOrient (Rotation) Rotation Data type: orient The orientation to be normalized. Syntax NOrient’(’ [Rotation ’:=’] <expression ( IN ) of orient> ’)’ A function with a return value of the data type orient . 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
904
2 Functions 2.75. NOrient - Normalize orientation RobotWare - OS 901 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.75. NOrient - Normalize orientation Usage NOrient ( Normalize Orientation ) is used to normalize un-normalized orientation (quaternion). Description An orientation must be normalized, i.e. the sum of the squares must equal 1: . If the orientation is slightly un-normalized, it is possible to normalize it. The normalization error is the absolute value of the sum of the squares of the orientation components. The orientation is considered to be slightly un-normalized if the normalization error is greater then 0.00001 and less then 0.1. If the normalization error is greater then 0.1 the orient is unusable. . normerr > 0.1 Unusable normerr > 0.00001 AND normerr <= 0.1 Slightly un-normalized normerr <= 0.00001 Normalized Basic examples Basic examples of the function NOrient are illustrated below. Example 1 We have a slightly un-normalized position (0.707170, 0, 0, 0.707170) . VAR orient unnormorient := [0.707170, 0, 0, 0.707170]; VAR orient normorient; ... ... normorient := NOrient(unnormorient); The normalization of the orientation ( 0.707170, 0, 0, 0.707170 ) becomes (0.707107, 0, 0, 0.707107). Return value Data type: orient The normalized orientation. Continues on next page 2 Functions 2.75. NOrient - Normalize orientation RobotWare - OS 3HAC 16581-1 Revision: J 902 © Copyright 2004-2010 ABB. All rights reserved. Arguments NOrient (Rotation) Rotation Data type: orient The orientation to be normalized. Syntax NOrient’(’ [Rotation ’:=’] <expression ( IN ) of orient> ’)’ A function with a return value of the data type orient . Related information For information about See Mathematical instructions and functions Technical reference manual - RAPID overview , section RAPID summary - Mathematics Continued 2 Functions 2.76. NumToDnum - Converts num to dnum RobotWare - OS 903 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.76. NumToDnum - Converts num to dnum Usage NumToDnum converts a num to a dnum . Basic examples A basic example of the function NumToDnum is illustrated below. Example 1 VAR num mynum:=55; VAR dnum mydnum:=0; mydnum:=NumToDnum(mynum); The num value 55 is returned by the function as the dnum value 55. Return value Data type: dnum The return value of type dnum will have the same value as the input value of type num . Arguments NumToDnum (Value) Value Data type: num The numeric value to be converted. Syntax NumToDnum [ Value ’:=’ ] < expression ( IN ) of num > ’;’ A function with a return value of the data type dnum . Related information For information about See Num data type num - Numeric values on page 1146 Dnum data type dnum - Double numeric values on page 1104
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
905
2 Functions 2.75. NOrient - Normalize orientation RobotWare - OS 3HAC 16581-1 Revision: J 902 © Copyright 2004-2010 ABB. All rights reserved. Arguments NOrient (Rotation) Rotation Data type: orient The orientation to be normalized. Syntax NOrient’(’ [Rotation ’:=’] <expression ( IN ) of orient> ’)’ A function with a return value of the data type orient . Related information For information about See Mathematical instructions and functions Technical reference manual - RAPID overview , section RAPID summary - Mathematics Continued 2 Functions 2.76. NumToDnum - Converts num to dnum RobotWare - OS 903 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.76. NumToDnum - Converts num to dnum Usage NumToDnum converts a num to a dnum . Basic examples A basic example of the function NumToDnum is illustrated below. Example 1 VAR num mynum:=55; VAR dnum mydnum:=0; mydnum:=NumToDnum(mynum); The num value 55 is returned by the function as the dnum value 55. Return value Data type: dnum The return value of type dnum will have the same value as the input value of type num . Arguments NumToDnum (Value) Value Data type: num The numeric value to be converted. Syntax NumToDnum [ Value ’:=’ ] < expression ( IN ) of num > ’;’ A function with a return value of the data type dnum . Related information For information about See Num data type num - Numeric values on page 1146 Dnum data type dnum - Double numeric values on page 1104 2 Functions 2.77. NumToStr - Converts numeric value to string RobotWare - OS 3HAC 16581-1 Revision: J 904 © Copyright 2004-2010 ABB. All rights reserved. 2.77. NumToStr - Converts numeric value to string Usage NumToStr ( Numeric To String ) is used to convert a numeric value to a string. Basic examples Basic examples of the function NumToStr are illustrated below. Example 1 VAR string str; str := NumToStr(0.38521,3); The variable str is given the value "0.385" . Example 2 reg1 := 0.38521; str := NumToStr(reg1, 2\Exp); The variable str is given the value "3.85E-01" . Example 3 VAR dnum ex3 := 1234567890.123456; str := NumToStr(ex3, 15\Exp); The variable str is given the value "1.234567890123456E+09" . Return value Data type: string The numeric value converted to a string with the specified number of decimals, with exponent if so requested. The numeric value is rounded if necessary. The decimal point is suppressed if no decimals are included. Arguments NumToStr (Val | Dval Dec [\Exp]) Val Value Data type: num The numeric value to be converted. Dval Value Data type: dnum The numeric value to be converted. Dec Decimals Data type: num Number of decimals. The number of decimals must not be negative or greater than the available precision for numeric values. Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
906
2 Functions 2.76. NumToDnum - Converts num to dnum RobotWare - OS 903 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 2.76. NumToDnum - Converts num to dnum Usage NumToDnum converts a num to a dnum . Basic examples A basic example of the function NumToDnum is illustrated below. Example 1 VAR num mynum:=55; VAR dnum mydnum:=0; mydnum:=NumToDnum(mynum); The num value 55 is returned by the function as the dnum value 55. Return value Data type: dnum The return value of type dnum will have the same value as the input value of type num . Arguments NumToDnum (Value) Value Data type: num The numeric value to be converted. Syntax NumToDnum [ Value ’:=’ ] < expression ( IN ) of num > ’;’ A function with a return value of the data type dnum . Related information For information about See Num data type num - Numeric values on page 1146 Dnum data type dnum - Double numeric values on page 1104 2 Functions 2.77. NumToStr - Converts numeric value to string RobotWare - OS 3HAC 16581-1 Revision: J 904 © Copyright 2004-2010 ABB. All rights reserved. 2.77. NumToStr - Converts numeric value to string Usage NumToStr ( Numeric To String ) is used to convert a numeric value to a string. Basic examples Basic examples of the function NumToStr are illustrated below. Example 1 VAR string str; str := NumToStr(0.38521,3); The variable str is given the value "0.385" . Example 2 reg1 := 0.38521; str := NumToStr(reg1, 2\Exp); The variable str is given the value "3.85E-01" . Example 3 VAR dnum ex3 := 1234567890.123456; str := NumToStr(ex3, 15\Exp); The variable str is given the value "1.234567890123456E+09" . Return value Data type: string The numeric value converted to a string with the specified number of decimals, with exponent if so requested. The numeric value is rounded if necessary. The decimal point is suppressed if no decimals are included. Arguments NumToStr (Val | Dval Dec [\Exp]) Val Value Data type: num The numeric value to be converted. Dval Value Data type: dnum The numeric value to be converted. Dec Decimals Data type: num Number of decimals. The number of decimals must not be negative or greater than the available precision for numeric values. Continues on next page 2 Functions 2.77. NumToStr - Converts numeric value to string RobotWare - OS 905 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. [\Exp] Exponent Data type: switch To use exponent in return value. Syntax NumToStr’(’ [ Val ’:=’ ] <expression ( IN ) of num> | [ Dval ’:=’ ] <expression ( IN ) of dnum> ’,’ [ Dec ’:=’ ] <expression ( IN ) of num> [ \Exp ] ’)’ A function with a return value of the data type string . Related information For information about See String functions Technical reference manual - RAPID overview , section RAPID summary - String functions Definition of string string - Strings on page 1195 String values Technical reference manual - RAPID overview , section Basic characteristics - Basic elements Continued