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
407
1 Instructions 1.146. SearchC - Searches circularly using the robot RobotWare - OS 3HAC 16581-1 Revision: J 404 © Copyright 2004-2010 ABB. All rights reserved. [ \Sup ] Supervision Data type: switch The search instruction is sensitive to signal activation during the complete movement (flying search), i.e. even after the first signal change has been reported. If more than one match occurs during a search then a recoverable error is generated with the robot in the ToPoint . If the argument \Stop , \PStop , \SStop , or \Sup is omitted (no switch used at all): • the movement continues (flying search) to the position specified in the ToPoint argument (same as with argument \Sup ) • error is reported for none search hit but is not reported for more than one search hit (first search hit is returned as the SearchPoint ) Signal Data type: signaldi The name of the signal to supervise. [ \Flanks ] Data type: switch The positive and the negative edge of the signal is valid for a search hit. If the argument \Flanks is omitted then only the positive edge of the signal is valid for a search hit, and a signal supervision will be activated at the beginning of a search process. This means that if the signal has a positive value already at the beginning of the search process or the communication with the signal is lost, then the robot movement is stopped as quickly as possible, while keeping the TCP on the path (soft stop). However, the robot is moved a small distance before it stops and is not moved back to the start position. A user recovery error (ERR_SIGSUPSEARCH) will be generated and can be dealt with by the error handler. SearchPoint Data type: robtarget The position of the TCP and external axes when the search signal has been triggered. The position is specified in the outermost coordinate system taking the specified tool, work object, and active ProgDisp/ExtOffs coordinate system into consideration. CirPoint Data type: robtarget The circle point of the robot. See the instruction MoveC for a more detailed description of circular movement. The circle point is defined as a named position or stored directly in the instruction (marked with an * in the instruction). ToPoint Data type: robtarget The destination point of the robot and external axes. It is defined as a named position or stored directly in the instruction (marked with an * in the instruction). SearchC always uses a stop point as zone data for the destination. Continued Continues on next page 1 Instructions 1.146. SearchC - Searches circularly using the robot RobotWare - OS 405 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. [ \ID ] Synchronization id Data type: identno This argument must be used in a MultiMove System if it is a coordinated synchronized movement, and is not allowed in any other cases. The specified ID number must be the same in all cooperating program tasks. The ID number gives a guarantee that the movements are not mixed up at runtime. Speed Data type: speeddata The speed data that applies to movements. Speed data defines the velocity of the tool center point, the external axes and the tool reorientation. [ \V ] Velocity Data type: num This argument is used to specify the velocity of the TCP in mm/s directly in the instruction. It is then substituted for the corresponding velocity specified in the speed data. [ \T ] Time Data type: num This argument is used to specify the total time in seconds during which the robot moves. It is then substituted for the corresponding speed data. Tool Data type: tooldata The tool in use when the robot moves. The tool center point is the point that is moved to the specified destination position. [ \WObj ] Work Object Data type: wobjdata The work object (coordinate system) to which the robot positions in the instruction are related. This argument can be omitted and if so then the position is related to the world coordinate system. If, on the other hand, a stationary TCP or coordinated external axes are used then this argument must be specified for a linear movement relative to the work object to be performed. [ \Corr ] Correction Data type: switch When this argument is present the correction data written to a corrections entry by the instruction CorrWrite will be added to the path and destination position. Continued Continues on next page 1 Instructions 1.146. SearchC - Searches circularly using the robot RobotWare - OS 3HAC 16581-1 Revision: J 406 © Copyright 2004-2010 ABB. All rights reserved. Program execution See the instruction MoveC for information about circular movement. The movement is always ended with a stop point, i.e. the robot stops at the destination point. When a flying search is used, i.e. the \Sup argument is specified or none switch at all is specified, the robot movement always continues to the programmed destination point. When a search is made using the switch \Stop , \PStop , or \SStop the robot movement stops when the first search hit is detected. The SearchC instruction returns the position of the TCP when the value of the digital signal changes to the requested one, as illustrated in figure below. The figure shows how flank-triggered signal detection is used (the position is stored when the signal is changed the first time only). xx0500002237 More examples More examples of how to use the instruction SearchC are illustrated below. Example 1 SearchC \Sup, di1\Flanks, sp, cirpoint, p10, v100, probe; The TCP of the probe is moved circularly towards the position p10 . When the value of the signal di1 changes to active or passive the position is stored in sp . If the value of the signal changes twice then program generates an error. Limitations General limitations according to instruction MoveC . Zone data for the positioning instruction that precedes SearchC must be used carefully. The start of the search, i.e. when the I/O signal is ready to react, is not, in this case, the programmed destination point of the previous positioning instruction but a point along the real robot path. The figure below illustrates an example of something that may go wrong when zone data other than fine is used. The instruction SearchC should never be restarted after the circle point has been passed. Otherwise the robot will not take the programmed path (positioning around the circular path in another direction compared to that which is programmed). 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
408
1 Instructions 1.146. SearchC - Searches circularly using the robot RobotWare - OS 405 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. [ \ID ] Synchronization id Data type: identno This argument must be used in a MultiMove System if it is a coordinated synchronized movement, and is not allowed in any other cases. The specified ID number must be the same in all cooperating program tasks. The ID number gives a guarantee that the movements are not mixed up at runtime. Speed Data type: speeddata The speed data that applies to movements. Speed data defines the velocity of the tool center point, the external axes and the tool reorientation. [ \V ] Velocity Data type: num This argument is used to specify the velocity of the TCP in mm/s directly in the instruction. It is then substituted for the corresponding velocity specified in the speed data. [ \T ] Time Data type: num This argument is used to specify the total time in seconds during which the robot moves. It is then substituted for the corresponding speed data. Tool Data type: tooldata The tool in use when the robot moves. The tool center point is the point that is moved to the specified destination position. [ \WObj ] Work Object Data type: wobjdata The work object (coordinate system) to which the robot positions in the instruction are related. This argument can be omitted and if so then the position is related to the world coordinate system. If, on the other hand, a stationary TCP or coordinated external axes are used then this argument must be specified for a linear movement relative to the work object to be performed. [ \Corr ] Correction Data type: switch When this argument is present the correction data written to a corrections entry by the instruction CorrWrite will be added to the path and destination position. Continued Continues on next page 1 Instructions 1.146. SearchC - Searches circularly using the robot RobotWare - OS 3HAC 16581-1 Revision: J 406 © Copyright 2004-2010 ABB. All rights reserved. Program execution See the instruction MoveC for information about circular movement. The movement is always ended with a stop point, i.e. the robot stops at the destination point. When a flying search is used, i.e. the \Sup argument is specified or none switch at all is specified, the robot movement always continues to the programmed destination point. When a search is made using the switch \Stop , \PStop , or \SStop the robot movement stops when the first search hit is detected. The SearchC instruction returns the position of the TCP when the value of the digital signal changes to the requested one, as illustrated in figure below. The figure shows how flank-triggered signal detection is used (the position is stored when the signal is changed the first time only). xx0500002237 More examples More examples of how to use the instruction SearchC are illustrated below. Example 1 SearchC \Sup, di1\Flanks, sp, cirpoint, p10, v100, probe; The TCP of the probe is moved circularly towards the position p10 . When the value of the signal di1 changes to active or passive the position is stored in sp . If the value of the signal changes twice then program generates an error. Limitations General limitations according to instruction MoveC . Zone data for the positioning instruction that precedes SearchC must be used carefully. The start of the search, i.e. when the I/O signal is ready to react, is not, in this case, the programmed destination point of the previous positioning instruction but a point along the real robot path. The figure below illustrates an example of something that may go wrong when zone data other than fine is used. The instruction SearchC should never be restarted after the circle point has been passed. Otherwise the robot will not take the programmed path (positioning around the circular path in another direction compared to that which is programmed). Continued Continues on next page 1 Instructions 1.146. SearchC - Searches circularly using the robot RobotWare - OS 407 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. The figure shows how a match is made on the wrong side of the object because the wrong zone data was used. xx0500002238 WARNING! Limitations for searching if coordinated synchronized movements: • If using SearchL , SearchC or SearchExtJ for one program task and some other move instruction in other program task, it is only possible to use flying search with switch \Sup . Besides that, only possible to do error recovery with TRYNEXT . • It’s possible to use all searching functionality, if using some of the instructions SearchL , SearchC or SearchExtJ in all involved program tasks with coordinated synchronized movements and generate search hit from same digital input signal. This will generate search hit synchronously in all search instructions. Any error recovery must also be the same in all involved program tasks. While searching is active, it isn’t possible to store current path with instruction StorePath . Repetition accuracy for search hit position with TCP speed 20 - 1000 mm/s 0.1 - 0.3 mm. Typical stop distance using a search velocity of 50 mm/s: • without TCP on path (switch \Stop ) 1-3 mm • with TCP on path (switch \PStop ) 15-25 mm • with TCP near path (switch \SStop ) 4-8 mm Limitations for searching on a conveyor: • a search will stop the robot when hit or if the search fails, so make the search in the same direction as the conveyor moves and continue after the search-stop with a move to a safe position. Use error handling to move to a safe position when search fails. • the repetition accuracy for the search hit position will be poorer when searching on a conveyor and depends on the speed of the conveyor and how stabil the speed is. 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
409
1 Instructions 1.146. SearchC - Searches circularly using the robot RobotWare - OS 3HAC 16581-1 Revision: J 406 © Copyright 2004-2010 ABB. All rights reserved. Program execution See the instruction MoveC for information about circular movement. The movement is always ended with a stop point, i.e. the robot stops at the destination point. When a flying search is used, i.e. the \Sup argument is specified or none switch at all is specified, the robot movement always continues to the programmed destination point. When a search is made using the switch \Stop , \PStop , or \SStop the robot movement stops when the first search hit is detected. The SearchC instruction returns the position of the TCP when the value of the digital signal changes to the requested one, as illustrated in figure below. The figure shows how flank-triggered signal detection is used (the position is stored when the signal is changed the first time only). xx0500002237 More examples More examples of how to use the instruction SearchC are illustrated below. Example 1 SearchC \Sup, di1\Flanks, sp, cirpoint, p10, v100, probe; The TCP of the probe is moved circularly towards the position p10 . When the value of the signal di1 changes to active or passive the position is stored in sp . If the value of the signal changes twice then program generates an error. Limitations General limitations according to instruction MoveC . Zone data for the positioning instruction that precedes SearchC must be used carefully. The start of the search, i.e. when the I/O signal is ready to react, is not, in this case, the programmed destination point of the previous positioning instruction but a point along the real robot path. The figure below illustrates an example of something that may go wrong when zone data other than fine is used. The instruction SearchC should never be restarted after the circle point has been passed. Otherwise the robot will not take the programmed path (positioning around the circular path in another direction compared to that which is programmed). Continued Continues on next page 1 Instructions 1.146. SearchC - Searches circularly using the robot RobotWare - OS 407 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. The figure shows how a match is made on the wrong side of the object because the wrong zone data was used. xx0500002238 WARNING! Limitations for searching if coordinated synchronized movements: • If using SearchL , SearchC or SearchExtJ for one program task and some other move instruction in other program task, it is only possible to use flying search with switch \Sup . Besides that, only possible to do error recovery with TRYNEXT . • It’s possible to use all searching functionality, if using some of the instructions SearchL , SearchC or SearchExtJ in all involved program tasks with coordinated synchronized movements and generate search hit from same digital input signal. This will generate search hit synchronously in all search instructions. Any error recovery must also be the same in all involved program tasks. While searching is active, it isn’t possible to store current path with instruction StorePath . Repetition accuracy for search hit position with TCP speed 20 - 1000 mm/s 0.1 - 0.3 mm. Typical stop distance using a search velocity of 50 mm/s: • without TCP on path (switch \Stop ) 1-3 mm • with TCP on path (switch \PStop ) 15-25 mm • with TCP near path (switch \SStop ) 4-8 mm Limitations for searching on a conveyor: • a search will stop the robot when hit or if the search fails, so make the search in the same direction as the conveyor moves and continue after the search-stop with a move to a safe position. Use error handling to move to a safe position when search fails. • the repetition accuracy for the search hit position will be poorer when searching on a conveyor and depends on the speed of the conveyor and how stabil the speed is. Continued Continues on next page 1 Instructions 1.146. SearchC - Searches circularly using the robot RobotWare - OS 3HAC 16581-1 Revision: J 408 © Copyright 2004-2010 ABB. All rights reserved. Error handling An error is reported during a search when: • no signal detection occurred - this generates the error ERR_WHLSEARCH. • more than one signal detection occurred – this generates the error ERR_WHLSEARCH only if the \Sup argument is used. • the signal already has a positive value at the beginning of the search process or the communication with the signal is lost. This generates the error ERR_SIGSUPSEARCH only if the \Flanks argument is omitted. Errors can be handled in different ways depending on the selected running mode: • Continuous forward / Instruction forward / ERR_WHLSEARCH: No position is returned and the movement always continues to the programmed destination point. The system variable ERRNO is set to ERR_WHLSEARCH and the error can be handled in the error handler of the routine. • Continuous forward / Instruction forward / ERR_SIGSUPSEARCH: No position is returned and the movement always stops as quickly as possible at the beginning of the search path. The system variable ERRNO is set to ERR_SIGSUPSEARCH and the error can be handled in the error handler of the routine. • Instruction backward : During backward execution the instruction carries out the movement without any signal supervision. Syntax SearchC [ ’\’ Stop’,’ ] | [ ’\’ PStop ’,’] | [ ’\’ SStop ’,’ ] | [ ’\’ Sup ’,’ ] [ Signal’:=’ ] < variable ( VAR ) of signaldi > [‘\’ Flanks]’,’ [ SearchPoint’:=’ ] < var or pers ( INOUT ) of robtarget > ’,’ [ CirPoint’:=’ ] < expression ( IN ) of robtarget > ’,’ [ ToPoint’:=’ ] < expression ( IN ) of robtarget > ’,’ [ ’\’ ID ’:=’ < expression ( IN ) of identno >]’,’ [ Speed’:=’ ] < expression ( IN ) of speeddata > [ ’\’ V ’:=’ < expression ( IN ) of num > ]| [ ’\’ T ’:=’ < expression ( IN ) of num > ] ’,’ [ Tool ’:=’ ] < persistent ( PERS ) of tooldata > [ ’\’ WObj’:=’ < persistent ( PERS ) of wobjdata > ] [ ’\’ Corr ]’;’ 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
410
1 Instructions 1.146. SearchC - Searches circularly using the robot RobotWare - OS 407 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. The figure shows how a match is made on the wrong side of the object because the wrong zone data was used. xx0500002238 WARNING! Limitations for searching if coordinated synchronized movements: • If using SearchL , SearchC or SearchExtJ for one program task and some other move instruction in other program task, it is only possible to use flying search with switch \Sup . Besides that, only possible to do error recovery with TRYNEXT . • It’s possible to use all searching functionality, if using some of the instructions SearchL , SearchC or SearchExtJ in all involved program tasks with coordinated synchronized movements and generate search hit from same digital input signal. This will generate search hit synchronously in all search instructions. Any error recovery must also be the same in all involved program tasks. While searching is active, it isn’t possible to store current path with instruction StorePath . Repetition accuracy for search hit position with TCP speed 20 - 1000 mm/s 0.1 - 0.3 mm. Typical stop distance using a search velocity of 50 mm/s: • without TCP on path (switch \Stop ) 1-3 mm • with TCP on path (switch \PStop ) 15-25 mm • with TCP near path (switch \SStop ) 4-8 mm Limitations for searching on a conveyor: • a search will stop the robot when hit or if the search fails, so make the search in the same direction as the conveyor moves and continue after the search-stop with a move to a safe position. Use error handling to move to a safe position when search fails. • the repetition accuracy for the search hit position will be poorer when searching on a conveyor and depends on the speed of the conveyor and how stabil the speed is. Continued Continues on next page 1 Instructions 1.146. SearchC - Searches circularly using the robot RobotWare - OS 3HAC 16581-1 Revision: J 408 © Copyright 2004-2010 ABB. All rights reserved. Error handling An error is reported during a search when: • no signal detection occurred - this generates the error ERR_WHLSEARCH. • more than one signal detection occurred – this generates the error ERR_WHLSEARCH only if the \Sup argument is used. • the signal already has a positive value at the beginning of the search process or the communication with the signal is lost. This generates the error ERR_SIGSUPSEARCH only if the \Flanks argument is omitted. Errors can be handled in different ways depending on the selected running mode: • Continuous forward / Instruction forward / ERR_WHLSEARCH: No position is returned and the movement always continues to the programmed destination point. The system variable ERRNO is set to ERR_WHLSEARCH and the error can be handled in the error handler of the routine. • Continuous forward / Instruction forward / ERR_SIGSUPSEARCH: No position is returned and the movement always stops as quickly as possible at the beginning of the search path. The system variable ERRNO is set to ERR_SIGSUPSEARCH and the error can be handled in the error handler of the routine. • Instruction backward : During backward execution the instruction carries out the movement without any signal supervision. Syntax SearchC [ ’\’ Stop’,’ ] | [ ’\’ PStop ’,’] | [ ’\’ SStop ’,’ ] | [ ’\’ Sup ’,’ ] [ Signal’:=’ ] < variable ( VAR ) of signaldi > [‘\’ Flanks]’,’ [ SearchPoint’:=’ ] < var or pers ( INOUT ) of robtarget > ’,’ [ CirPoint’:=’ ] < expression ( IN ) of robtarget > ’,’ [ ToPoint’:=’ ] < expression ( IN ) of robtarget > ’,’ [ ’\’ ID ’:=’ < expression ( IN ) of identno >]’,’ [ Speed’:=’ ] < expression ( IN ) of speeddata > [ ’\’ V ’:=’ < expression ( IN ) of num > ]| [ ’\’ T ’:=’ < expression ( IN ) of num > ] ’,’ [ Tool ’:=’ ] < persistent ( PERS ) of tooldata > [ ’\’ WObj’:=’ < persistent ( PERS ) of wobjdata > ] [ ’\’ Corr ]’;’ Continued Continues on next page 1 Instructions 1.146. SearchC - Searches circularly using the robot RobotWare - OS 409 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Linear searches SearchL - Searches linearly using the robot on page 416 Writes to a corrections entry CorrWrite - Writes to a correction generator on page 77 Moves the robot circularly MoveC - Moves the robot circularly on page 236 Circular movement Technical reference manual - RAPID overview , section Motion and I/O principles - Positioning during program execution Definition of velocity speeddata - Speed data on page 1185 Definition of tools tooldata - Tool data on page 1207 Definition of work objects wobjdata - Work object data on page 1224 Using error handlers Technical reference manual - RAPID overview , section RAPID summary - Error recovery Motion in general Technical reference manual - RAPID overview , section Motion and I/O principles Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
411
1 Instructions 1.146. SearchC - Searches circularly using the robot RobotWare - OS 3HAC 16581-1 Revision: J 408 © Copyright 2004-2010 ABB. All rights reserved. Error handling An error is reported during a search when: • no signal detection occurred - this generates the error ERR_WHLSEARCH. • more than one signal detection occurred – this generates the error ERR_WHLSEARCH only if the \Sup argument is used. • the signal already has a positive value at the beginning of the search process or the communication with the signal is lost. This generates the error ERR_SIGSUPSEARCH only if the \Flanks argument is omitted. Errors can be handled in different ways depending on the selected running mode: • Continuous forward / Instruction forward / ERR_WHLSEARCH: No position is returned and the movement always continues to the programmed destination point. The system variable ERRNO is set to ERR_WHLSEARCH and the error can be handled in the error handler of the routine. • Continuous forward / Instruction forward / ERR_SIGSUPSEARCH: No position is returned and the movement always stops as quickly as possible at the beginning of the search path. The system variable ERRNO is set to ERR_SIGSUPSEARCH and the error can be handled in the error handler of the routine. • Instruction backward : During backward execution the instruction carries out the movement without any signal supervision. Syntax SearchC [ ’\’ Stop’,’ ] | [ ’\’ PStop ’,’] | [ ’\’ SStop ’,’ ] | [ ’\’ Sup ’,’ ] [ Signal’:=’ ] < variable ( VAR ) of signaldi > [‘\’ Flanks]’,’ [ SearchPoint’:=’ ] < var or pers ( INOUT ) of robtarget > ’,’ [ CirPoint’:=’ ] < expression ( IN ) of robtarget > ’,’ [ ToPoint’:=’ ] < expression ( IN ) of robtarget > ’,’ [ ’\’ ID ’:=’ < expression ( IN ) of identno >]’,’ [ Speed’:=’ ] < expression ( IN ) of speeddata > [ ’\’ V ’:=’ < expression ( IN ) of num > ]| [ ’\’ T ’:=’ < expression ( IN ) of num > ] ’,’ [ Tool ’:=’ ] < persistent ( PERS ) of tooldata > [ ’\’ WObj’:=’ < persistent ( PERS ) of wobjdata > ] [ ’\’ Corr ]’;’ Continued Continues on next page 1 Instructions 1.146. SearchC - Searches circularly using the robot RobotWare - OS 409 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Linear searches SearchL - Searches linearly using the robot on page 416 Writes to a corrections entry CorrWrite - Writes to a correction generator on page 77 Moves the robot circularly MoveC - Moves the robot circularly on page 236 Circular movement Technical reference manual - RAPID overview , section Motion and I/O principles - Positioning during program execution Definition of velocity speeddata - Speed data on page 1185 Definition of tools tooldata - Tool data on page 1207 Definition of work objects wobjdata - Work object data on page 1224 Using error handlers Technical reference manual - RAPID overview , section RAPID summary - Error recovery Motion in general Technical reference manual - RAPID overview , section Motion and I/O principles Continued 1 Instructions 1.147. SearchExtJ - Search with one or several mechanical units without TCP RobotWare - OS 3HAC 16581-1 Revision: J 410 © Copyright 2004-2010 ABB. All rights reserved. 1.147. SearchExtJ - Search with one or several mechanical units without TCP Usage SearchExtJ ( Search External Joints ) is used to search for an external axes position when moving only linear or rotating external axes. The external axes can belong to one or several mechanical units without TCP. During the movement the system supervises a digital input signal. When the value of the signal changes to the requested one the system immediately reads the current position. This instruction can only be used if: • The actual program task is defined as a Motion Task • The task controls one or several mechanical units without TCP When using search instructions it is important to configure the I/O system to have a very short time delay from setting the physical signal until the system gets the information about the setting (use I/O unit with interrupt control, not poll control). How to do this can differ between fieldbuses. If using DeviceNet, the ABB units DSQC 651 (AD Combi I/O) and DSQC 652 (Digital I/O) will give a short time delay since they are using the connection type Change of State. If using other fieldbuses, make sure the network is properly configured in order to get the correct conditions. Basic examples Basic examples of the instruction SearchExtJ are illustrated below. See also More examples on page 413 . Example 1 SearchExtJ di1, searchp, jpos10, vrot20; The mec. unit with rotational axes is moved towards the position jpos10 at a speed of vrot20 . When the value of the signal di1 changes to active, the position is stored in searchp . Example 2 SearchExJ \Stop, di2, posx, jpos20, vlin50; The mec. unit with linear axis is moved towards the position jpos20 . When the value of the signal di2 changes to active, the position is stored in posx and the ongoing movement is stopped immediately. Arguments SearchExtJ [\Stop] | [\PStop] | [\SStop] | [\Sup] Signal [\Flanks] SearchJointPos ToJointPos [\ID] [\UseEOffs] Speed [\T] [ \Stop ] Stiff Stop Data type: switch The movement is stopped as quickly as possible with hard stop when the value of the search signal changes to active. However, the external axes are moved a small distance before they stop and are not moved back to the searched position, i.e. to the position where the signal changed. Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
412
1 Instructions 1.146. SearchC - Searches circularly using the robot RobotWare - OS 409 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Linear searches SearchL - Searches linearly using the robot on page 416 Writes to a corrections entry CorrWrite - Writes to a correction generator on page 77 Moves the robot circularly MoveC - Moves the robot circularly on page 236 Circular movement Technical reference manual - RAPID overview , section Motion and I/O principles - Positioning during program execution Definition of velocity speeddata - Speed data on page 1185 Definition of tools tooldata - Tool data on page 1207 Definition of work objects wobjdata - Work object data on page 1224 Using error handlers Technical reference manual - RAPID overview , section RAPID summary - Error recovery Motion in general Technical reference manual - RAPID overview , section Motion and I/O principles Continued 1 Instructions 1.147. SearchExtJ - Search with one or several mechanical units without TCP RobotWare - OS 3HAC 16581-1 Revision: J 410 © Copyright 2004-2010 ABB. All rights reserved. 1.147. SearchExtJ - Search with one or several mechanical units without TCP Usage SearchExtJ ( Search External Joints ) is used to search for an external axes position when moving only linear or rotating external axes. The external axes can belong to one or several mechanical units without TCP. During the movement the system supervises a digital input signal. When the value of the signal changes to the requested one the system immediately reads the current position. This instruction can only be used if: • The actual program task is defined as a Motion Task • The task controls one or several mechanical units without TCP When using search instructions it is important to configure the I/O system to have a very short time delay from setting the physical signal until the system gets the information about the setting (use I/O unit with interrupt control, not poll control). How to do this can differ between fieldbuses. If using DeviceNet, the ABB units DSQC 651 (AD Combi I/O) and DSQC 652 (Digital I/O) will give a short time delay since they are using the connection type Change of State. If using other fieldbuses, make sure the network is properly configured in order to get the correct conditions. Basic examples Basic examples of the instruction SearchExtJ are illustrated below. See also More examples on page 413 . Example 1 SearchExtJ di1, searchp, jpos10, vrot20; The mec. unit with rotational axes is moved towards the position jpos10 at a speed of vrot20 . When the value of the signal di1 changes to active, the position is stored in searchp . Example 2 SearchExJ \Stop, di2, posx, jpos20, vlin50; The mec. unit with linear axis is moved towards the position jpos20 . When the value of the signal di2 changes to active, the position is stored in posx and the ongoing movement is stopped immediately. Arguments SearchExtJ [\Stop] | [\PStop] | [\SStop] | [\Sup] Signal [\Flanks] SearchJointPos ToJointPos [\ID] [\UseEOffs] Speed [\T] [ \Stop ] Stiff Stop Data type: switch The movement is stopped as quickly as possible with hard stop when the value of the search signal changes to active. However, the external axes are moved a small distance before they stop and are not moved back to the searched position, i.e. to the position where the signal changed. Continues on next page 1 Instructions 1.147. SearchExtJ - Search with one or several mechanical units without TCP RobotWare - OS 411 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. [ \PStop ] Path Stop Data type: switch The movement is stopped with path stop (Program Stop) when the value of the search signal changes to active. However, the external axes are moved a rather long distance before they stop and are not moved back to the searched position, i.e. to the position where the signal changed. [ \SStop ] Soft Stop Data type: switch The movement is stopped as quickly as possible with fast soft stop when the value of the search signal changes to active. However, the external axes are moved only a small distance before they stop and are not moved back to the searched position, i.e. to the position where the signal changed. Stop is faster compare to SStop . SStop is faster compare to PStop. [ \Sup ] Supervision Data type: switch The search instruction is sensitive to signal activation during the complete movement (flying search), i.e. even after the first signal change has been reported. If more than one match occurs during a search a recoverable error is generated with the mec. units in the ToJointPos. If the argument \Stop , \PStop , \SStop or \Sup is omitted (no switch used at all): • The movement continues (flying search) to the position specified in the ToJointPos argument (same as with argument \Sup ) • An error is reported for one search hit but is not reported for more than one search hit (the first search hit is returned as the SearchJointPos ) Signal Data type: signaldi The name of the signal to supervise. [ \Flanks ] Data type: switch The positive and the negative edge of the signal is valid for a search hit. If the argument \Flanks is omitted, only the positive edge of the signal is valid for a search hit and a signal supervision will be activated at the beginning of a search process. This means that if the signal already has the positive value at the beginning of a search process or the communication with the signal is lost, the movement is stopped as quickly as possible with soft stop. A user recovery error (ERR_SIGSUPSEARCH) will be generated and can be handled in the error handler. Continued Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
413
1 Instructions 1.147. SearchExtJ - Search with one or several mechanical units without TCP RobotWare - OS 3HAC 16581-1 Revision: J 410 © Copyright 2004-2010 ABB. All rights reserved. 1.147. SearchExtJ - Search with one or several mechanical units without TCP Usage SearchExtJ ( Search External Joints ) is used to search for an external axes position when moving only linear or rotating external axes. The external axes can belong to one or several mechanical units without TCP. During the movement the system supervises a digital input signal. When the value of the signal changes to the requested one the system immediately reads the current position. This instruction can only be used if: • The actual program task is defined as a Motion Task • The task controls one or several mechanical units without TCP When using search instructions it is important to configure the I/O system to have a very short time delay from setting the physical signal until the system gets the information about the setting (use I/O unit with interrupt control, not poll control). How to do this can differ between fieldbuses. If using DeviceNet, the ABB units DSQC 651 (AD Combi I/O) and DSQC 652 (Digital I/O) will give a short time delay since they are using the connection type Change of State. If using other fieldbuses, make sure the network is properly configured in order to get the correct conditions. Basic examples Basic examples of the instruction SearchExtJ are illustrated below. See also More examples on page 413 . Example 1 SearchExtJ di1, searchp, jpos10, vrot20; The mec. unit with rotational axes is moved towards the position jpos10 at a speed of vrot20 . When the value of the signal di1 changes to active, the position is stored in searchp . Example 2 SearchExJ \Stop, di2, posx, jpos20, vlin50; The mec. unit with linear axis is moved towards the position jpos20 . When the value of the signal di2 changes to active, the position is stored in posx and the ongoing movement is stopped immediately. Arguments SearchExtJ [\Stop] | [\PStop] | [\SStop] | [\Sup] Signal [\Flanks] SearchJointPos ToJointPos [\ID] [\UseEOffs] Speed [\T] [ \Stop ] Stiff Stop Data type: switch The movement is stopped as quickly as possible with hard stop when the value of the search signal changes to active. However, the external axes are moved a small distance before they stop and are not moved back to the searched position, i.e. to the position where the signal changed. Continues on next page 1 Instructions 1.147. SearchExtJ - Search with one or several mechanical units without TCP RobotWare - OS 411 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. [ \PStop ] Path Stop Data type: switch The movement is stopped with path stop (Program Stop) when the value of the search signal changes to active. However, the external axes are moved a rather long distance before they stop and are not moved back to the searched position, i.e. to the position where the signal changed. [ \SStop ] Soft Stop Data type: switch The movement is stopped as quickly as possible with fast soft stop when the value of the search signal changes to active. However, the external axes are moved only a small distance before they stop and are not moved back to the searched position, i.e. to the position where the signal changed. Stop is faster compare to SStop . SStop is faster compare to PStop. [ \Sup ] Supervision Data type: switch The search instruction is sensitive to signal activation during the complete movement (flying search), i.e. even after the first signal change has been reported. If more than one match occurs during a search a recoverable error is generated with the mec. units in the ToJointPos. If the argument \Stop , \PStop , \SStop or \Sup is omitted (no switch used at all): • The movement continues (flying search) to the position specified in the ToJointPos argument (same as with argument \Sup ) • An error is reported for one search hit but is not reported for more than one search hit (the first search hit is returned as the SearchJointPos ) Signal Data type: signaldi The name of the signal to supervise. [ \Flanks ] Data type: switch The positive and the negative edge of the signal is valid for a search hit. If the argument \Flanks is omitted, only the positive edge of the signal is valid for a search hit and a signal supervision will be activated at the beginning of a search process. This means that if the signal already has the positive value at the beginning of a search process or the communication with the signal is lost, the movement is stopped as quickly as possible with soft stop. A user recovery error (ERR_SIGSUPSEARCH) will be generated and can be handled in the error handler. Continued Continues on next page 1 Instructions 1.147. SearchExtJ - Search with one or several mechanical units without TCP RobotWare - OS 3HAC 16581-1 Revision: J 412 © Copyright 2004-2010 ABB. All rights reserved. SearchJointPos Data type: jointtarget The position of the external axes when the search signal has been triggered. The position takes any active ExtOffs into consideration. ToJointPos Data type: jointtarget The destination point for the external axes. It is defined as a named position or stored directly in the instruction (marked with an * in the instruction). SearchExtJ always uses a stop point as zone data for the destination. [ \ID ] Synchronization id Data type: identno This argument must be used in a MultiMove system, if coordinated synchronized movement, and is not allowed in any other cases. The specified ID number must be the same in all cooperating program tasks. The ID number gives a guarantee that the movements are not mixed up at runtime. [ \UseEOffs ] Use External Offset Data type: switch The offset for external axes, setup by instruction EOffsSet , is activated for SearchExtJ instruction when the argument UseEOffs is used. See instruction EOffsSet for more information about external offset. Speed Data type: speeddata The speed data that applies to movements. Speed data defines the velocity of the linear or rotating external axis. [ \T ] Time Data type: num This argument is used to specify the total time in seconds during which the mec. units move. It is then substituted for the corresponding speed data. 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
414
1 Instructions 1.147. SearchExtJ - Search with one or several mechanical units without TCP RobotWare - OS 411 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. [ \PStop ] Path Stop Data type: switch The movement is stopped with path stop (Program Stop) when the value of the search signal changes to active. However, the external axes are moved a rather long distance before they stop and are not moved back to the searched position, i.e. to the position where the signal changed. [ \SStop ] Soft Stop Data type: switch The movement is stopped as quickly as possible with fast soft stop when the value of the search signal changes to active. However, the external axes are moved only a small distance before they stop and are not moved back to the searched position, i.e. to the position where the signal changed. Stop is faster compare to SStop . SStop is faster compare to PStop. [ \Sup ] Supervision Data type: switch The search instruction is sensitive to signal activation during the complete movement (flying search), i.e. even after the first signal change has been reported. If more than one match occurs during a search a recoverable error is generated with the mec. units in the ToJointPos. If the argument \Stop , \PStop , \SStop or \Sup is omitted (no switch used at all): • The movement continues (flying search) to the position specified in the ToJointPos argument (same as with argument \Sup ) • An error is reported for one search hit but is not reported for more than one search hit (the first search hit is returned as the SearchJointPos ) Signal Data type: signaldi The name of the signal to supervise. [ \Flanks ] Data type: switch The positive and the negative edge of the signal is valid for a search hit. If the argument \Flanks is omitted, only the positive edge of the signal is valid for a search hit and a signal supervision will be activated at the beginning of a search process. This means that if the signal already has the positive value at the beginning of a search process or the communication with the signal is lost, the movement is stopped as quickly as possible with soft stop. A user recovery error (ERR_SIGSUPSEARCH) will be generated and can be handled in the error handler. Continued Continues on next page 1 Instructions 1.147. SearchExtJ - Search with one or several mechanical units without TCP RobotWare - OS 3HAC 16581-1 Revision: J 412 © Copyright 2004-2010 ABB. All rights reserved. SearchJointPos Data type: jointtarget The position of the external axes when the search signal has been triggered. The position takes any active ExtOffs into consideration. ToJointPos Data type: jointtarget The destination point for the external axes. It is defined as a named position or stored directly in the instruction (marked with an * in the instruction). SearchExtJ always uses a stop point as zone data for the destination. [ \ID ] Synchronization id Data type: identno This argument must be used in a MultiMove system, if coordinated synchronized movement, and is not allowed in any other cases. The specified ID number must be the same in all cooperating program tasks. The ID number gives a guarantee that the movements are not mixed up at runtime. [ \UseEOffs ] Use External Offset Data type: switch The offset for external axes, setup by instruction EOffsSet , is activated for SearchExtJ instruction when the argument UseEOffs is used. See instruction EOffsSet for more information about external offset. Speed Data type: speeddata The speed data that applies to movements. Speed data defines the velocity of the linear or rotating external axis. [ \T ] Time Data type: num This argument is used to specify the total time in seconds during which the mec. units move. It is then substituted for the corresponding speed data. Continued Continues on next page 1 Instructions 1.147. SearchExtJ - Search with one or several mechanical units without TCP RobotWare - OS 413 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Program execution See the instruction MoveExtJ for information about movement of mechanical units without TCP. The movement always ends with a stop point, i.e. the external axes stop at the destination point. If a flying search is used, that is, the \Sup argument is specified or no switch is specified the movement always continues to the programmed destination point. If a search is made using the switch \Stop , \PStop or \SStop , the movement stops when the first search hit is detected. The SearchExtJ instruction stores the position of the external axes when the value of the digital signal changes to the requested one, as illustrated in figure below. The figure shows how flank-triggered signal detection is used (the position is only stored when the signal is changed the first time). xx0500002243 More examples More examples of how to use the instruction SearchExtJ are illustrated below. Example 1 SearchExtJ \Sup, di1\Flanks, searchp,jpos10, vrot20; The mec. unit is moved towards the position jpos10 . When the value of the signal di1 changes to active or passive, the position is stored in searchp . If the value of the signal changes twice, the program generates an error after the search process is finished. Example 2 SearchExtJ \Stop, di1, sp, jpos20, vlin50; MoveExtJ sp, vlin50, fine \Inpos := inpos50; A check on the signal dil will be made at the beginning of the search process and if the signal already has a positive value or the communication with the signal is lost, the movement stops. Otherwise the mec. unit is moved towards the position jpos20 . When the value of the signal di1 changes to active, the position is stored in sp. The mec. unit is moved back to this point using an accurately defined stop point. 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
415
1 Instructions 1.147. SearchExtJ - Search with one or several mechanical units without TCP RobotWare - OS 3HAC 16581-1 Revision: J 412 © Copyright 2004-2010 ABB. All rights reserved. SearchJointPos Data type: jointtarget The position of the external axes when the search signal has been triggered. The position takes any active ExtOffs into consideration. ToJointPos Data type: jointtarget The destination point for the external axes. It is defined as a named position or stored directly in the instruction (marked with an * in the instruction). SearchExtJ always uses a stop point as zone data for the destination. [ \ID ] Synchronization id Data type: identno This argument must be used in a MultiMove system, if coordinated synchronized movement, and is not allowed in any other cases. The specified ID number must be the same in all cooperating program tasks. The ID number gives a guarantee that the movements are not mixed up at runtime. [ \UseEOffs ] Use External Offset Data type: switch The offset for external axes, setup by instruction EOffsSet , is activated for SearchExtJ instruction when the argument UseEOffs is used. See instruction EOffsSet for more information about external offset. Speed Data type: speeddata The speed data that applies to movements. Speed data defines the velocity of the linear or rotating external axis. [ \T ] Time Data type: num This argument is used to specify the total time in seconds during which the mec. units move. It is then substituted for the corresponding speed data. Continued Continues on next page 1 Instructions 1.147. SearchExtJ - Search with one or several mechanical units without TCP RobotWare - OS 413 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Program execution See the instruction MoveExtJ for information about movement of mechanical units without TCP. The movement always ends with a stop point, i.e. the external axes stop at the destination point. If a flying search is used, that is, the \Sup argument is specified or no switch is specified the movement always continues to the programmed destination point. If a search is made using the switch \Stop , \PStop or \SStop , the movement stops when the first search hit is detected. The SearchExtJ instruction stores the position of the external axes when the value of the digital signal changes to the requested one, as illustrated in figure below. The figure shows how flank-triggered signal detection is used (the position is only stored when the signal is changed the first time). xx0500002243 More examples More examples of how to use the instruction SearchExtJ are illustrated below. Example 1 SearchExtJ \Sup, di1\Flanks, searchp,jpos10, vrot20; The mec. unit is moved towards the position jpos10 . When the value of the signal di1 changes to active or passive, the position is stored in searchp . If the value of the signal changes twice, the program generates an error after the search process is finished. Example 2 SearchExtJ \Stop, di1, sp, jpos20, vlin50; MoveExtJ sp, vlin50, fine \Inpos := inpos50; A check on the signal dil will be made at the beginning of the search process and if the signal already has a positive value or the communication with the signal is lost, the movement stops. Otherwise the mec. unit is moved towards the position jpos20 . When the value of the signal di1 changes to active, the position is stored in sp. The mec. unit is moved back to this point using an accurately defined stop point. Continued Continues on next page 1 Instructions 1.147. SearchExtJ - Search with one or several mechanical units without TCP RobotWare - OS 3HAC 16581-1 Revision: J 414 © Copyright 2004-2010 ABB. All rights reserved. Error handling An error is reported during a search when: • No signal detection occurred - this generates the error ERR_WHLSEARCH. • More than one signal detection occurred – this generates the error ERR_WHLSEARCH, but only if the \Sup argument is used. • The signal already has a positive value at the beginning of the search process or the communication with the signal is lost - this generates the error ERR_SIGSUPSEARCH, but only if the \Flanks argument is omitted. Errors can be handled in different ways depending on the selected running mode: • Continuous forward / Instruction forward / ERR_WHLSEARCH: No position is returned and the movement always continues to the programmed destination point. The system variable ERRNO is set to ERR_WHLSEARCH and the error can be handled in the error handler of the routine. • Continuous forward / Instruction forward / ERR_SIGSUPSEARCH: No position is returned and the movement always stops as quickly as possible at the beginning of the search movement. The system variable ERRNO is set to ERR_SIGSUPSEARCH and the error can be handled in the error handler of the routine. • Instruction backward : During backward execution, the instruction just carries out the movement without any signal supervision. Example VAR num fk; ... MoveExtJ jpos10, vrot100, fine; SearchExtJ \Stop, di1, sp, jpos20, vrot5; ... ERROR IF ERRNO=ERR_WHLSEARCH THEN StorePath; MoveExtJ jpos10, vrot50, fine; RestoPath; RETRY; ELSEIF ERRNO=ERR_SIGSUPSEARCH THEN TPWrite "The signal of the SearchExtJ instruction is already high!"; TPReadFK fk,"Try again after manual reset of signal ?","YES","stEmpty","stEmpty","stEmpty","NO"; IF fk = 1 THEN MoveExtJ jpos10, vrot50, fine; RETRY; ELSE Stop; ENDIF ENDIF Continued Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
416
1 Instructions 1.147. SearchExtJ - Search with one or several mechanical units without TCP RobotWare - OS 413 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Program execution See the instruction MoveExtJ for information about movement of mechanical units without TCP. The movement always ends with a stop point, i.e. the external axes stop at the destination point. If a flying search is used, that is, the \Sup argument is specified or no switch is specified the movement always continues to the programmed destination point. If a search is made using the switch \Stop , \PStop or \SStop , the movement stops when the first search hit is detected. The SearchExtJ instruction stores the position of the external axes when the value of the digital signal changes to the requested one, as illustrated in figure below. The figure shows how flank-triggered signal detection is used (the position is only stored when the signal is changed the first time). xx0500002243 More examples More examples of how to use the instruction SearchExtJ are illustrated below. Example 1 SearchExtJ \Sup, di1\Flanks, searchp,jpos10, vrot20; The mec. unit is moved towards the position jpos10 . When the value of the signal di1 changes to active or passive, the position is stored in searchp . If the value of the signal changes twice, the program generates an error after the search process is finished. Example 2 SearchExtJ \Stop, di1, sp, jpos20, vlin50; MoveExtJ sp, vlin50, fine \Inpos := inpos50; A check on the signal dil will be made at the beginning of the search process and if the signal already has a positive value or the communication with the signal is lost, the movement stops. Otherwise the mec. unit is moved towards the position jpos20 . When the value of the signal di1 changes to active, the position is stored in sp. The mec. unit is moved back to this point using an accurately defined stop point. Continued Continues on next page 1 Instructions 1.147. SearchExtJ - Search with one or several mechanical units without TCP RobotWare - OS 3HAC 16581-1 Revision: J 414 © Copyright 2004-2010 ABB. All rights reserved. Error handling An error is reported during a search when: • No signal detection occurred - this generates the error ERR_WHLSEARCH. • More than one signal detection occurred – this generates the error ERR_WHLSEARCH, but only if the \Sup argument is used. • The signal already has a positive value at the beginning of the search process or the communication with the signal is lost - this generates the error ERR_SIGSUPSEARCH, but only if the \Flanks argument is omitted. Errors can be handled in different ways depending on the selected running mode: • Continuous forward / Instruction forward / ERR_WHLSEARCH: No position is returned and the movement always continues to the programmed destination point. The system variable ERRNO is set to ERR_WHLSEARCH and the error can be handled in the error handler of the routine. • Continuous forward / Instruction forward / ERR_SIGSUPSEARCH: No position is returned and the movement always stops as quickly as possible at the beginning of the search movement. The system variable ERRNO is set to ERR_SIGSUPSEARCH and the error can be handled in the error handler of the routine. • Instruction backward : During backward execution, the instruction just carries out the movement without any signal supervision. Example VAR num fk; ... MoveExtJ jpos10, vrot100, fine; SearchExtJ \Stop, di1, sp, jpos20, vrot5; ... ERROR IF ERRNO=ERR_WHLSEARCH THEN StorePath; MoveExtJ jpos10, vrot50, fine; RestoPath; RETRY; ELSEIF ERRNO=ERR_SIGSUPSEARCH THEN TPWrite "The signal of the SearchExtJ instruction is already high!"; TPReadFK fk,"Try again after manual reset of signal ?","YES","stEmpty","stEmpty","stEmpty","NO"; IF fk = 1 THEN MoveExtJ jpos10, vrot50, fine; RETRY; ELSE Stop; ENDIF ENDIF Continued Continues on next page 1 Instructions 1.147. SearchExtJ - Search with one or several mechanical units without TCP RobotWare - OS 415 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. If the signal is already active at the beginning of the search process or the communication with the signal is lost, a user dialog will be activated ( TPReadFK ...; ). Reset the signal and push YES on the user dialog and the mec. unit moves back to jpos10 and tries once more. Otherwise program execution will stop. If the signal is passive at the beginning of the search process, the mec. unit searches from position jpos10 to jpos20 . If no signal detection occurs, the robot moves back to jpos10 and tries once more. Limitations Limitations for searching if coordinated synchronized movements: • If using SearchL , SearchC or SearchExtJ for one program task and some other move instruction in another program task, it is only possible to use flying search with switch \Sup . Besides that, it is only possible to do error recovery with TRYNEXT . • It is possible to use all searching functions if using some of the instructions SearchL , SearchC or SearchExtJ in all involved program tasks with coordinated synchronized movements and generate search hits from the same digital input signal. This will generate search hits synchronously in all search instructions. Any error recovery must also be the same in all involved program tasks. • While searching is active, it isn’t possible to store current path with instruction StorePath . Syntax SearchExtJ [ ’\’ Stop ’,’ ] | [ ’\’ PStop ’,’] | [ ’\’ SStop ’,’] | [ ’\’ Sup ’,’ ] [ Signal ’:=’ ] < variable ( VAR ) of signaldi > [‘\’ Flanks]’,’ [ SearchJointPos’ :=’ ] < var or pers ( INOUT ) of jointtarget > ’,’ [ ToJointPos’ :=’ ] < expression ( IN ) of jointtarget > [ ’\’ ID ’:=’ < expression ( IN ) of identno >]’,’ [ ’\’ UseEOffs’ ,’ ] [ Speed ’:=’ ] < expression ( IN ) of speeddata > [ ’\’ T ’:=’ < expression ( IN ) of num > ] ’;’ Related information For information about See Move mec. units without TCP MoveExtJ - Move one or several mechanical units without TCP on page 250 Definition of jointtarget jointtarget - Joint position data on page 1129 Definition of velocity speeddata - Speed data on page 1185 Using error handlers Technical reference manual - RAPID overview , section RAPID summary - Error recovery Motion in general Technical reference manual - RAPID overview , section Motion and I/O principles Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
417
1 Instructions 1.147. SearchExtJ - Search with one or several mechanical units without TCP RobotWare - OS 3HAC 16581-1 Revision: J 414 © Copyright 2004-2010 ABB. All rights reserved. Error handling An error is reported during a search when: • No signal detection occurred - this generates the error ERR_WHLSEARCH. • More than one signal detection occurred – this generates the error ERR_WHLSEARCH, but only if the \Sup argument is used. • The signal already has a positive value at the beginning of the search process or the communication with the signal is lost - this generates the error ERR_SIGSUPSEARCH, but only if the \Flanks argument is omitted. Errors can be handled in different ways depending on the selected running mode: • Continuous forward / Instruction forward / ERR_WHLSEARCH: No position is returned and the movement always continues to the programmed destination point. The system variable ERRNO is set to ERR_WHLSEARCH and the error can be handled in the error handler of the routine. • Continuous forward / Instruction forward / ERR_SIGSUPSEARCH: No position is returned and the movement always stops as quickly as possible at the beginning of the search movement. The system variable ERRNO is set to ERR_SIGSUPSEARCH and the error can be handled in the error handler of the routine. • Instruction backward : During backward execution, the instruction just carries out the movement without any signal supervision. Example VAR num fk; ... MoveExtJ jpos10, vrot100, fine; SearchExtJ \Stop, di1, sp, jpos20, vrot5; ... ERROR IF ERRNO=ERR_WHLSEARCH THEN StorePath; MoveExtJ jpos10, vrot50, fine; RestoPath; RETRY; ELSEIF ERRNO=ERR_SIGSUPSEARCH THEN TPWrite "The signal of the SearchExtJ instruction is already high!"; TPReadFK fk,"Try again after manual reset of signal ?","YES","stEmpty","stEmpty","stEmpty","NO"; IF fk = 1 THEN MoveExtJ jpos10, vrot50, fine; RETRY; ELSE Stop; ENDIF ENDIF Continued Continues on next page 1 Instructions 1.147. SearchExtJ - Search with one or several mechanical units without TCP RobotWare - OS 415 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. If the signal is already active at the beginning of the search process or the communication with the signal is lost, a user dialog will be activated ( TPReadFK ...; ). Reset the signal and push YES on the user dialog and the mec. unit moves back to jpos10 and tries once more. Otherwise program execution will stop. If the signal is passive at the beginning of the search process, the mec. unit searches from position jpos10 to jpos20 . If no signal detection occurs, the robot moves back to jpos10 and tries once more. Limitations Limitations for searching if coordinated synchronized movements: • If using SearchL , SearchC or SearchExtJ for one program task and some other move instruction in another program task, it is only possible to use flying search with switch \Sup . Besides that, it is only possible to do error recovery with TRYNEXT . • It is possible to use all searching functions if using some of the instructions SearchL , SearchC or SearchExtJ in all involved program tasks with coordinated synchronized movements and generate search hits from the same digital input signal. This will generate search hits synchronously in all search instructions. Any error recovery must also be the same in all involved program tasks. • While searching is active, it isn’t possible to store current path with instruction StorePath . Syntax SearchExtJ [ ’\’ Stop ’,’ ] | [ ’\’ PStop ’,’] | [ ’\’ SStop ’,’] | [ ’\’ Sup ’,’ ] [ Signal ’:=’ ] < variable ( VAR ) of signaldi > [‘\’ Flanks]’,’ [ SearchJointPos’ :=’ ] < var or pers ( INOUT ) of jointtarget > ’,’ [ ToJointPos’ :=’ ] < expression ( IN ) of jointtarget > [ ’\’ ID ’:=’ < expression ( IN ) of identno >]’,’ [ ’\’ UseEOffs’ ,’ ] [ Speed ’:=’ ] < expression ( IN ) of speeddata > [ ’\’ T ’:=’ < expression ( IN ) of num > ] ’;’ Related information For information about See Move mec. units without TCP MoveExtJ - Move one or several mechanical units without TCP on page 250 Definition of jointtarget jointtarget - Joint position data on page 1129 Definition of velocity speeddata - Speed data on page 1185 Using error handlers Technical reference manual - RAPID overview , section RAPID summary - Error recovery Motion in general Technical reference manual - RAPID overview , section Motion and I/O principles Continued 1 Instructions 1.148. SearchL - Searches linearly using the robot RobotWare - OS 3HAC 16581-1 Revision: J 416 © Copyright 2004-2010 ABB. All rights reserved. 1.148. SearchL - Searches linearly using the robot Usage SearchL ( Search Linear ) is used to search for a position when moving the tool center point (TCP) linearly. During the movement the robot supervises a digital input signal. When the value of the signal changes to the requested one the robot immediately reads the current position. This instruction can typically be used when the tool held by the robot is a probe for surface detection. Using the SearchL instruction the outline coordinates of a work object can be obtained. This instruction can only be used in the main task T_ROB1 or, if in a MultiMove system, in Motion tasks. When using search instructions it is important to configure the I/O system to have a very short time from setting the physical signal to the system to getting the information regarding the setting (use I/O unit with interrupt control, not poll control). How to do this can differ between fieldbuses. If using DeviceNet the ABB units DSQC 651 (AD Combi I/O) and DSQC 652 (Digital I/O) will give short times since they are using connection type Change of State. If using other fieldbuses make sure to configure the network in a proper way to get right conditions. Basic examples Basic examples of the instruction SearchL are illustrated below. See also More examples on page 420 . Example 1 SearchL di1, sp, p10, v100, probe; The TCP of the probe is moved linearly towards the position p10 at a speed of v100 . When the value of the signal di1 changes to active the position is stored in sp . Example 2 SearchL \Stop, di2, sp, p10, v100, probe; The TCP of the probe is moved linearly towards the position p10 . When the value of the signal di2 changes to active the position is stored in sp and the robot stops immediately. Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
418
1 Instructions 1.147. SearchExtJ - Search with one or several mechanical units without TCP RobotWare - OS 415 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. If the signal is already active at the beginning of the search process or the communication with the signal is lost, a user dialog will be activated ( TPReadFK ...; ). Reset the signal and push YES on the user dialog and the mec. unit moves back to jpos10 and tries once more. Otherwise program execution will stop. If the signal is passive at the beginning of the search process, the mec. unit searches from position jpos10 to jpos20 . If no signal detection occurs, the robot moves back to jpos10 and tries once more. Limitations Limitations for searching if coordinated synchronized movements: • If using SearchL , SearchC or SearchExtJ for one program task and some other move instruction in another program task, it is only possible to use flying search with switch \Sup . Besides that, it is only possible to do error recovery with TRYNEXT . • It is possible to use all searching functions if using some of the instructions SearchL , SearchC or SearchExtJ in all involved program tasks with coordinated synchronized movements and generate search hits from the same digital input signal. This will generate search hits synchronously in all search instructions. Any error recovery must also be the same in all involved program tasks. • While searching is active, it isn’t possible to store current path with instruction StorePath . Syntax SearchExtJ [ ’\’ Stop ’,’ ] | [ ’\’ PStop ’,’] | [ ’\’ SStop ’,’] | [ ’\’ Sup ’,’ ] [ Signal ’:=’ ] < variable ( VAR ) of signaldi > [‘\’ Flanks]’,’ [ SearchJointPos’ :=’ ] < var or pers ( INOUT ) of jointtarget > ’,’ [ ToJointPos’ :=’ ] < expression ( IN ) of jointtarget > [ ’\’ ID ’:=’ < expression ( IN ) of identno >]’,’ [ ’\’ UseEOffs’ ,’ ] [ Speed ’:=’ ] < expression ( IN ) of speeddata > [ ’\’ T ’:=’ < expression ( IN ) of num > ] ’;’ Related information For information about See Move mec. units without TCP MoveExtJ - Move one or several mechanical units without TCP on page 250 Definition of jointtarget jointtarget - Joint position data on page 1129 Definition of velocity speeddata - Speed data on page 1185 Using error handlers Technical reference manual - RAPID overview , section RAPID summary - Error recovery Motion in general Technical reference manual - RAPID overview , section Motion and I/O principles Continued 1 Instructions 1.148. SearchL - Searches linearly using the robot RobotWare - OS 3HAC 16581-1 Revision: J 416 © Copyright 2004-2010 ABB. All rights reserved. 1.148. SearchL - Searches linearly using the robot Usage SearchL ( Search Linear ) is used to search for a position when moving the tool center point (TCP) linearly. During the movement the robot supervises a digital input signal. When the value of the signal changes to the requested one the robot immediately reads the current position. This instruction can typically be used when the tool held by the robot is a probe for surface detection. Using the SearchL instruction the outline coordinates of a work object can be obtained. This instruction can only be used in the main task T_ROB1 or, if in a MultiMove system, in Motion tasks. When using search instructions it is important to configure the I/O system to have a very short time from setting the physical signal to the system to getting the information regarding the setting (use I/O unit with interrupt control, not poll control). How to do this can differ between fieldbuses. If using DeviceNet the ABB units DSQC 651 (AD Combi I/O) and DSQC 652 (Digital I/O) will give short times since they are using connection type Change of State. If using other fieldbuses make sure to configure the network in a proper way to get right conditions. Basic examples Basic examples of the instruction SearchL are illustrated below. See also More examples on page 420 . Example 1 SearchL di1, sp, p10, v100, probe; The TCP of the probe is moved linearly towards the position p10 at a speed of v100 . When the value of the signal di1 changes to active the position is stored in sp . Example 2 SearchL \Stop, di2, sp, p10, v100, probe; The TCP of the probe is moved linearly towards the position p10 . When the value of the signal di2 changes to active the position is stored in sp and the robot stops immediately. Continues on next page 1 Instructions 1.148. SearchL - Searches linearly using the robot RobotWare - OS 417 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Arguments SearchL [\Stop] | [\PStop] | [\SStop] | [\Sup] Signal [\Flanks] SearchPoint ToPoint [\ID] Speed [\V] | [\T] Tool [\WObj] [\Corr] [ \Stop ] Stiff Stop Data type: switch The robot movement is stopped as quickly as possible without keeping the TCP on the path (hard stop) when the value of the search signal changes to active. However, the robot is moved a small distance before it stops and is not moved back to the searched position, i.e. to the position where the signal changed. - WARNING! To stop the searching with stiff stop (switch \Stop ) is only allowed if the TCP-speed is lower than 100 mm/s. At a stiff stop with higher speeds some axes can move in unpredictable directions. [ \PStop ] Path Stop Data type: switch The robot movement is stopped as quickly as possible while keeping the TCP on the path (soft stop) when the value of the search signal changes to active. However, the robot is moved a distance before it stops and is not moved back to the searched position, i.e. to the position where the signal changed. [ \SStop ] Soft Stop Data type: switch The robot movement is stopped as quickly as possible while keeping the TCP close to or on the path (soft stop) when the value of the search signal changes to active. However, the robot is only moved a small distance before it stops and is not moved back to the searched position, i.e. to the position where the signal changed. SStop is faster than PStop . But when the robot is running faster than 100 mm/s it stops in the direction of the tangent of the movement which causes it to marginally slide off the path. Continued Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
419
1 Instructions 1.148. SearchL - Searches linearly using the robot RobotWare - OS 3HAC 16581-1 Revision: J 416 © Copyright 2004-2010 ABB. All rights reserved. 1.148. SearchL - Searches linearly using the robot Usage SearchL ( Search Linear ) is used to search for a position when moving the tool center point (TCP) linearly. During the movement the robot supervises a digital input signal. When the value of the signal changes to the requested one the robot immediately reads the current position. This instruction can typically be used when the tool held by the robot is a probe for surface detection. Using the SearchL instruction the outline coordinates of a work object can be obtained. This instruction can only be used in the main task T_ROB1 or, if in a MultiMove system, in Motion tasks. When using search instructions it is important to configure the I/O system to have a very short time from setting the physical signal to the system to getting the information regarding the setting (use I/O unit with interrupt control, not poll control). How to do this can differ between fieldbuses. If using DeviceNet the ABB units DSQC 651 (AD Combi I/O) and DSQC 652 (Digital I/O) will give short times since they are using connection type Change of State. If using other fieldbuses make sure to configure the network in a proper way to get right conditions. Basic examples Basic examples of the instruction SearchL are illustrated below. See also More examples on page 420 . Example 1 SearchL di1, sp, p10, v100, probe; The TCP of the probe is moved linearly towards the position p10 at a speed of v100 . When the value of the signal di1 changes to active the position is stored in sp . Example 2 SearchL \Stop, di2, sp, p10, v100, probe; The TCP of the probe is moved linearly towards the position p10 . When the value of the signal di2 changes to active the position is stored in sp and the robot stops immediately. Continues on next page 1 Instructions 1.148. SearchL - Searches linearly using the robot RobotWare - OS 417 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Arguments SearchL [\Stop] | [\PStop] | [\SStop] | [\Sup] Signal [\Flanks] SearchPoint ToPoint [\ID] Speed [\V] | [\T] Tool [\WObj] [\Corr] [ \Stop ] Stiff Stop Data type: switch The robot movement is stopped as quickly as possible without keeping the TCP on the path (hard stop) when the value of the search signal changes to active. However, the robot is moved a small distance before it stops and is not moved back to the searched position, i.e. to the position where the signal changed. - WARNING! To stop the searching with stiff stop (switch \Stop ) is only allowed if the TCP-speed is lower than 100 mm/s. At a stiff stop with higher speeds some axes can move in unpredictable directions. [ \PStop ] Path Stop Data type: switch The robot movement is stopped as quickly as possible while keeping the TCP on the path (soft stop) when the value of the search signal changes to active. However, the robot is moved a distance before it stops and is not moved back to the searched position, i.e. to the position where the signal changed. [ \SStop ] Soft Stop Data type: switch The robot movement is stopped as quickly as possible while keeping the TCP close to or on the path (soft stop) when the value of the search signal changes to active. However, the robot is only moved a small distance before it stops and is not moved back to the searched position, i.e. to the position where the signal changed. SStop is faster than PStop . But when the robot is running faster than 100 mm/s it stops in the direction of the tangent of the movement which causes it to marginally slide off the path. Continued Continues on next page 1 Instructions 1.148. SearchL - Searches linearly using the robot RobotWare - OS 3HAC 16581-1 Revision: J 418 © Copyright 2004-2010 ABB. All rights reserved. [ \Sup ] Supervision Data type: switch The search instruction is sensitive to signal activation during the complete movement (flying search), i.e. even after the first signal change has been reported. If more than one match occurs during a search then a recoverable error is generated with the robot in the ToPoint . If the argument \Stop , \PStop , \SStop , or \Sup is omitted then (no switch used at all): • the movement continues (flying search) to the position specified in the ToPoint argument (same as with argument \Sup ) • error is reported for none search hit but is not reported for more than one search hit (first search hit is returned as the SearchPoint ) Signal Data type: signaldi The name of the signal to supervise. [ \Flanks ] Data type: switch The positive and the negative edge of the signal is valid for a search hit. If the argument \Flanks is omitted, only the positive edge of the signal is valid for a search hit and a signal supervision will be activated at the beginning of a search process. This means that if the signal has the positive value already at the beginning of a search process or the communication with the signal is lost then the robot movement is stopped as quickly as possible, while keeping the TCP on the path (soft stop). A user recovery error (ERR_SIGSUPSEARCH) will be generated and can be handled in the error handler. SearchPoint Data type: robtarget The position of the TCP and external axes when the search signal has been triggered. The position is specified in the outermost coordinate system taking the specified tool, work object, and active ProgDisp/ExtOffs coordinate system into consideration. ToPoint Data type: robtarget The destination point of the robot and external axes. It is defined as a named position or stored directly in the instruction (marked with an * in the instruction). SearchL always uses a stop point as zone data for the destination. [ \ID ] Synchronization id Data type: identno This argument must be used in a MultiMove system if it is a coordinated synchronized movement, and is not allowed in any other cases. The specified ID number must be the same in all cooperating program tasks. The ID number gives a guarantee that the movements are not mixed up at runtime. 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
420
1 Instructions 1.148. SearchL - Searches linearly using the robot RobotWare - OS 417 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Arguments SearchL [\Stop] | [\PStop] | [\SStop] | [\Sup] Signal [\Flanks] SearchPoint ToPoint [\ID] Speed [\V] | [\T] Tool [\WObj] [\Corr] [ \Stop ] Stiff Stop Data type: switch The robot movement is stopped as quickly as possible without keeping the TCP on the path (hard stop) when the value of the search signal changes to active. However, the robot is moved a small distance before it stops and is not moved back to the searched position, i.e. to the position where the signal changed. - WARNING! To stop the searching with stiff stop (switch \Stop ) is only allowed if the TCP-speed is lower than 100 mm/s. At a stiff stop with higher speeds some axes can move in unpredictable directions. [ \PStop ] Path Stop Data type: switch The robot movement is stopped as quickly as possible while keeping the TCP on the path (soft stop) when the value of the search signal changes to active. However, the robot is moved a distance before it stops and is not moved back to the searched position, i.e. to the position where the signal changed. [ \SStop ] Soft Stop Data type: switch The robot movement is stopped as quickly as possible while keeping the TCP close to or on the path (soft stop) when the value of the search signal changes to active. However, the robot is only moved a small distance before it stops and is not moved back to the searched position, i.e. to the position where the signal changed. SStop is faster than PStop . But when the robot is running faster than 100 mm/s it stops in the direction of the tangent of the movement which causes it to marginally slide off the path. Continued Continues on next page 1 Instructions 1.148. SearchL - Searches linearly using the robot RobotWare - OS 3HAC 16581-1 Revision: J 418 © Copyright 2004-2010 ABB. All rights reserved. [ \Sup ] Supervision Data type: switch The search instruction is sensitive to signal activation during the complete movement (flying search), i.e. even after the first signal change has been reported. If more than one match occurs during a search then a recoverable error is generated with the robot in the ToPoint . If the argument \Stop , \PStop , \SStop , or \Sup is omitted then (no switch used at all): • the movement continues (flying search) to the position specified in the ToPoint argument (same as with argument \Sup ) • error is reported for none search hit but is not reported for more than one search hit (first search hit is returned as the SearchPoint ) Signal Data type: signaldi The name of the signal to supervise. [ \Flanks ] Data type: switch The positive and the negative edge of the signal is valid for a search hit. If the argument \Flanks is omitted, only the positive edge of the signal is valid for a search hit and a signal supervision will be activated at the beginning of a search process. This means that if the signal has the positive value already at the beginning of a search process or the communication with the signal is lost then the robot movement is stopped as quickly as possible, while keeping the TCP on the path (soft stop). A user recovery error (ERR_SIGSUPSEARCH) will be generated and can be handled in the error handler. SearchPoint Data type: robtarget The position of the TCP and external axes when the search signal has been triggered. The position is specified in the outermost coordinate system taking the specified tool, work object, and active ProgDisp/ExtOffs coordinate system into consideration. ToPoint Data type: robtarget The destination point of the robot and external axes. It is defined as a named position or stored directly in the instruction (marked with an * in the instruction). SearchL always uses a stop point as zone data for the destination. [ \ID ] Synchronization id Data type: identno This argument must be used in a MultiMove system if it is a coordinated synchronized movement, and is not allowed in any other cases. The specified ID number must be the same in all cooperating program tasks. The ID number gives a guarantee that the movements are not mixed up at runtime. Continued Continues on next page 1 Instructions 1.148. SearchL - Searches linearly using the robot RobotWare - OS 419 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Speed Data type: speeddata The speed data that applies to movements. Speed data defines the velocity of the tool center point, the external axes, and the tool reorientation. [ \V ] Velocity Data type: num This argument is used to specify the velocity of the TCP in mm/s directly in the instruction. It is then substituted for the corresponding velocity specified in the speed data. [ \T ] Time Data type: num This argument is used to specify the total time in seconds during which the robot moves. It is then substituted for the corresponding speed data. Tool Data type: tooldata The tool in use when the robot moves. The tool center point is the point that is moved to the specified destination position. [ \WObj ] Work Object Data type: wobjdata The work object (coordinate system) to which the robot position in the instruction is related. This argument can be omitted and if so then the position is related to the world coordinate system. If, on the other hand, a stationary TCP or coordinated external axes are used then this argument must be specified for a linear movement relative to the work object to be performed. [ \Corr ] Correction Data type: switch Correction data written to a corrections entry by the instruction CorrWrite will be added to the path and destination position if this argument is present. 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
421
1 Instructions 1.148. SearchL - Searches linearly using the robot RobotWare - OS 3HAC 16581-1 Revision: J 418 © Copyright 2004-2010 ABB. All rights reserved. [ \Sup ] Supervision Data type: switch The search instruction is sensitive to signal activation during the complete movement (flying search), i.e. even after the first signal change has been reported. If more than one match occurs during a search then a recoverable error is generated with the robot in the ToPoint . If the argument \Stop , \PStop , \SStop , or \Sup is omitted then (no switch used at all): • the movement continues (flying search) to the position specified in the ToPoint argument (same as with argument \Sup ) • error is reported for none search hit but is not reported for more than one search hit (first search hit is returned as the SearchPoint ) Signal Data type: signaldi The name of the signal to supervise. [ \Flanks ] Data type: switch The positive and the negative edge of the signal is valid for a search hit. If the argument \Flanks is omitted, only the positive edge of the signal is valid for a search hit and a signal supervision will be activated at the beginning of a search process. This means that if the signal has the positive value already at the beginning of a search process or the communication with the signal is lost then the robot movement is stopped as quickly as possible, while keeping the TCP on the path (soft stop). A user recovery error (ERR_SIGSUPSEARCH) will be generated and can be handled in the error handler. SearchPoint Data type: robtarget The position of the TCP and external axes when the search signal has been triggered. The position is specified in the outermost coordinate system taking the specified tool, work object, and active ProgDisp/ExtOffs coordinate system into consideration. ToPoint Data type: robtarget The destination point of the robot and external axes. It is defined as a named position or stored directly in the instruction (marked with an * in the instruction). SearchL always uses a stop point as zone data for the destination. [ \ID ] Synchronization id Data type: identno This argument must be used in a MultiMove system if it is a coordinated synchronized movement, and is not allowed in any other cases. The specified ID number must be the same in all cooperating program tasks. The ID number gives a guarantee that the movements are not mixed up at runtime. Continued Continues on next page 1 Instructions 1.148. SearchL - Searches linearly using the robot RobotWare - OS 419 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Speed Data type: speeddata The speed data that applies to movements. Speed data defines the velocity of the tool center point, the external axes, and the tool reorientation. [ \V ] Velocity Data type: num This argument is used to specify the velocity of the TCP in mm/s directly in the instruction. It is then substituted for the corresponding velocity specified in the speed data. [ \T ] Time Data type: num This argument is used to specify the total time in seconds during which the robot moves. It is then substituted for the corresponding speed data. Tool Data type: tooldata The tool in use when the robot moves. The tool center point is the point that is moved to the specified destination position. [ \WObj ] Work Object Data type: wobjdata The work object (coordinate system) to which the robot position in the instruction is related. This argument can be omitted and if so then the position is related to the world coordinate system. If, on the other hand, a stationary TCP or coordinated external axes are used then this argument must be specified for a linear movement relative to the work object to be performed. [ \Corr ] Correction Data type: switch Correction data written to a corrections entry by the instruction CorrWrite will be added to the path and destination position if this argument is present. Continued Continues on next page 1 Instructions 1.148. SearchL - Searches linearly using the robot RobotWare - OS 3HAC 16581-1 Revision: J 420 © Copyright 2004-2010 ABB. All rights reserved. Program execution See the instruction MoveL for information about linear movement. The movement always ends with a stop point, i.e. the robot stops at the destination point. If a flying search is used, i.e. the \Sup argument is specified or none switch at all is specified then the robot movement always continues to the programmed destination point. If a search is made using the switch \Stop , \PStop , or \SStop the robot movement stops when the first search hit is detected. The SearchL instruction stores the position of the TCP when the value of the digital signal changes to the requested one, as illustrated in figure below. The figure shows how flank-triggered signal detection is used (the position is stored when the signal is changed the first time only). xx0500002243 More examples More examples of how to use the instruction SearchL are illustrated below. Example 1 SearchL \Sup, di1\Flanks, sp, p10, v100, probe; The TCP of the probe is moved linearly towards the position p10 . When the value of the signal di1 changes to active or passive the position is stored in sp . If the value of the signal changes twice then the program generates an error after the search process is finished. Example 2 SearchL \Stop, di1, sp, p10, v100, tool1; MoveL sp, v100, fine \Inpos := inpos50, tool1; PDispOn *, tool1; MoveL p100, v100, z10, tool1; MoveL p110, v100, z10, tool1; MoveL p120, v100, z10, tool1; PDispOff; At the beginning of the search process, a check on the signal di1 will be done and if the signal already has a positive value or the communication with the signal is lost, the robot stops. Otherwise the TCP of tool1 is moved linearly towards the position p10 . When the value of the signal di1 changes to active, the position is stored in sp. The robot is moved back to this point using an accurately defined stop point. Using program displacement, the robot then moves relative to the searched position, sp . 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
422
1 Instructions 1.148. SearchL - Searches linearly using the robot RobotWare - OS 419 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Speed Data type: speeddata The speed data that applies to movements. Speed data defines the velocity of the tool center point, the external axes, and the tool reorientation. [ \V ] Velocity Data type: num This argument is used to specify the velocity of the TCP in mm/s directly in the instruction. It is then substituted for the corresponding velocity specified in the speed data. [ \T ] Time Data type: num This argument is used to specify the total time in seconds during which the robot moves. It is then substituted for the corresponding speed data. Tool Data type: tooldata The tool in use when the robot moves. The tool center point is the point that is moved to the specified destination position. [ \WObj ] Work Object Data type: wobjdata The work object (coordinate system) to which the robot position in the instruction is related. This argument can be omitted and if so then the position is related to the world coordinate system. If, on the other hand, a stationary TCP or coordinated external axes are used then this argument must be specified for a linear movement relative to the work object to be performed. [ \Corr ] Correction Data type: switch Correction data written to a corrections entry by the instruction CorrWrite will be added to the path and destination position if this argument is present. Continued Continues on next page 1 Instructions 1.148. SearchL - Searches linearly using the robot RobotWare - OS 3HAC 16581-1 Revision: J 420 © Copyright 2004-2010 ABB. All rights reserved. Program execution See the instruction MoveL for information about linear movement. The movement always ends with a stop point, i.e. the robot stops at the destination point. If a flying search is used, i.e. the \Sup argument is specified or none switch at all is specified then the robot movement always continues to the programmed destination point. If a search is made using the switch \Stop , \PStop , or \SStop the robot movement stops when the first search hit is detected. The SearchL instruction stores the position of the TCP when the value of the digital signal changes to the requested one, as illustrated in figure below. The figure shows how flank-triggered signal detection is used (the position is stored when the signal is changed the first time only). xx0500002243 More examples More examples of how to use the instruction SearchL are illustrated below. Example 1 SearchL \Sup, di1\Flanks, sp, p10, v100, probe; The TCP of the probe is moved linearly towards the position p10 . When the value of the signal di1 changes to active or passive the position is stored in sp . If the value of the signal changes twice then the program generates an error after the search process is finished. Example 2 SearchL \Stop, di1, sp, p10, v100, tool1; MoveL sp, v100, fine \Inpos := inpos50, tool1; PDispOn *, tool1; MoveL p100, v100, z10, tool1; MoveL p110, v100, z10, tool1; MoveL p120, v100, z10, tool1; PDispOff; At the beginning of the search process, a check on the signal di1 will be done and if the signal already has a positive value or the communication with the signal is lost, the robot stops. Otherwise the TCP of tool1 is moved linearly towards the position p10 . When the value of the signal di1 changes to active, the position is stored in sp. The robot is moved back to this point using an accurately defined stop point. Using program displacement, the robot then moves relative to the searched position, sp . Continued Continues on next page 1 Instructions 1.148. SearchL - Searches linearly using the robot RobotWare - OS 421 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Limitations Zone data for the positioning instruction that precedes SearchL must be used carefully. The start of the search, i.e. when the I/O signal is ready to react, is not, in this case, the programmed destination point of the previous positioning instruction but a point along the real robot path. The figures below illustrate examples of things that may go wrong when zone data other than fine is used. The following figure shows that a match is made on the wrong side of the object because the wrong zone data was used. xx0500002244 The following figure shows that no match was detected because the wrong zone data was used. xx0500002245 The following figure shows that no match was detected because the wrong zone data was used. xx0500002246 Limitations for searching if coordinated synchronized movements: • If using SearchL , SearchC or SearchExtJ for one program task and some other move instruction in other program task, it is only possible to use flying search with switch \Sup . Besides that, only possible to do error recovery with TRYNEXT . • It’s possible to use all searching functionality, if using some of the instructions SearchL , SearchC or SearchExtJ in all involved program tasks with coordinated synchronized movements and generate search hit from same digital input signal. This will generate search hit synchronously in all search instructions. Any error recovery must also be the same in all involved program tasks. While searching is active, it isn’t allowed to store current path with instruction StorePath . Repetition accuracy for search hit position with TCP speed 20 - 1000 mm/s 0.1 - 0.3 mm. Typical stop distance using a search velocity of 50 mm/s: • without TCP on path (switch \Stop ) 1-3 mm • with TCP on path (switch \PStop ) 15-25 mm • with TCP near path (switch \SStop ) 4-8 mm 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
423
1 Instructions 1.148. SearchL - Searches linearly using the robot RobotWare - OS 3HAC 16581-1 Revision: J 420 © Copyright 2004-2010 ABB. All rights reserved. Program execution See the instruction MoveL for information about linear movement. The movement always ends with a stop point, i.e. the robot stops at the destination point. If a flying search is used, i.e. the \Sup argument is specified or none switch at all is specified then the robot movement always continues to the programmed destination point. If a search is made using the switch \Stop , \PStop , or \SStop the robot movement stops when the first search hit is detected. The SearchL instruction stores the position of the TCP when the value of the digital signal changes to the requested one, as illustrated in figure below. The figure shows how flank-triggered signal detection is used (the position is stored when the signal is changed the first time only). xx0500002243 More examples More examples of how to use the instruction SearchL are illustrated below. Example 1 SearchL \Sup, di1\Flanks, sp, p10, v100, probe; The TCP of the probe is moved linearly towards the position p10 . When the value of the signal di1 changes to active or passive the position is stored in sp . If the value of the signal changes twice then the program generates an error after the search process is finished. Example 2 SearchL \Stop, di1, sp, p10, v100, tool1; MoveL sp, v100, fine \Inpos := inpos50, tool1; PDispOn *, tool1; MoveL p100, v100, z10, tool1; MoveL p110, v100, z10, tool1; MoveL p120, v100, z10, tool1; PDispOff; At the beginning of the search process, a check on the signal di1 will be done and if the signal already has a positive value or the communication with the signal is lost, the robot stops. Otherwise the TCP of tool1 is moved linearly towards the position p10 . When the value of the signal di1 changes to active, the position is stored in sp. The robot is moved back to this point using an accurately defined stop point. Using program displacement, the robot then moves relative to the searched position, sp . Continued Continues on next page 1 Instructions 1.148. SearchL - Searches linearly using the robot RobotWare - OS 421 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Limitations Zone data for the positioning instruction that precedes SearchL must be used carefully. The start of the search, i.e. when the I/O signal is ready to react, is not, in this case, the programmed destination point of the previous positioning instruction but a point along the real robot path. The figures below illustrate examples of things that may go wrong when zone data other than fine is used. The following figure shows that a match is made on the wrong side of the object because the wrong zone data was used. xx0500002244 The following figure shows that no match was detected because the wrong zone data was used. xx0500002245 The following figure shows that no match was detected because the wrong zone data was used. xx0500002246 Limitations for searching if coordinated synchronized movements: • If using SearchL , SearchC or SearchExtJ for one program task and some other move instruction in other program task, it is only possible to use flying search with switch \Sup . Besides that, only possible to do error recovery with TRYNEXT . • It’s possible to use all searching functionality, if using some of the instructions SearchL , SearchC or SearchExtJ in all involved program tasks with coordinated synchronized movements and generate search hit from same digital input signal. This will generate search hit synchronously in all search instructions. Any error recovery must also be the same in all involved program tasks. While searching is active, it isn’t allowed to store current path with instruction StorePath . Repetition accuracy for search hit position with TCP speed 20 - 1000 mm/s 0.1 - 0.3 mm. Typical stop distance using a search velocity of 50 mm/s: • without TCP on path (switch \Stop ) 1-3 mm • with TCP on path (switch \PStop ) 15-25 mm • with TCP near path (switch \SStop ) 4-8 mm Continued Continues on next page 1 Instructions 1.148. SearchL - Searches linearly using the robot RobotWare - OS 3HAC 16581-1 Revision: J 422 © Copyright 2004-2010 ABB. All rights reserved. Limitations for searching on a conveyor: • a search will stop the robot when hit or if the search fails, so make the search in the same direction as the conveyor moves and continue after the search-stop with a move to a safe position. Use error handling to move to a safe position when search fails. • the repetition accuracy for the search hit position will be poorer when searching on a conveyor and depends on the speed of the conveyor and how stabil the speed is. Error handling An error is reported during a search when: • no signal detection occurred - this generates the error ERR_WHLSEARCH. • more than one signal detection occurred – this generates the error ERR_WHLSEARCH only if the \Sup argument is used. • the signal already has a positive value at the beginning of the search process or the communication with the signal is lost - this generates the error ERR_SIGSUPSEARCH only if the \Flanks argument is omitted. Errors can be handled in different ways depending on the selected running mode: • Continuous forward / Instruction forward / ERR_WHLSEARCH: No position is returned and the movement always continues to the programmed destination point. The system variable ERRNO is set to ERR_WHLSEARCH and the error can be handled in the error handler of the routine. • Continuous forward / Instruction forward / ERR_SIGSUPSEARCH No position is returned and the movement always stops as quickly as possible at the beginning of the search path. The system variable ERRNO is set to ERR_SIGSUPSEARCH and the error can be handled in the error handler of the routine. • Instruction backward : During backward execution the instruction carries out the movement without any signal supervision. Example VAR num fk; ... MoveL p10, v100, fine, tool1; SearchL \Stop, di1, sp, p20, v100, tool1; ... ERROR IF ERRNO=ERR_WHLSEARCH THEN StorePath; MoveL p10, v100, fine, tool1; RestoPath; RETRY; 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
424
1 Instructions 1.148. SearchL - Searches linearly using the robot RobotWare - OS 421 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Limitations Zone data for the positioning instruction that precedes SearchL must be used carefully. The start of the search, i.e. when the I/O signal is ready to react, is not, in this case, the programmed destination point of the previous positioning instruction but a point along the real robot path. The figures below illustrate examples of things that may go wrong when zone data other than fine is used. The following figure shows that a match is made on the wrong side of the object because the wrong zone data was used. xx0500002244 The following figure shows that no match was detected because the wrong zone data was used. xx0500002245 The following figure shows that no match was detected because the wrong zone data was used. xx0500002246 Limitations for searching if coordinated synchronized movements: • If using SearchL , SearchC or SearchExtJ for one program task and some other move instruction in other program task, it is only possible to use flying search with switch \Sup . Besides that, only possible to do error recovery with TRYNEXT . • It’s possible to use all searching functionality, if using some of the instructions SearchL , SearchC or SearchExtJ in all involved program tasks with coordinated synchronized movements and generate search hit from same digital input signal. This will generate search hit synchronously in all search instructions. Any error recovery must also be the same in all involved program tasks. While searching is active, it isn’t allowed to store current path with instruction StorePath . Repetition accuracy for search hit position with TCP speed 20 - 1000 mm/s 0.1 - 0.3 mm. Typical stop distance using a search velocity of 50 mm/s: • without TCP on path (switch \Stop ) 1-3 mm • with TCP on path (switch \PStop ) 15-25 mm • with TCP near path (switch \SStop ) 4-8 mm Continued Continues on next page 1 Instructions 1.148. SearchL - Searches linearly using the robot RobotWare - OS 3HAC 16581-1 Revision: J 422 © Copyright 2004-2010 ABB. All rights reserved. Limitations for searching on a conveyor: • a search will stop the robot when hit or if the search fails, so make the search in the same direction as the conveyor moves and continue after the search-stop with a move to a safe position. Use error handling to move to a safe position when search fails. • the repetition accuracy for the search hit position will be poorer when searching on a conveyor and depends on the speed of the conveyor and how stabil the speed is. Error handling An error is reported during a search when: • no signal detection occurred - this generates the error ERR_WHLSEARCH. • more than one signal detection occurred – this generates the error ERR_WHLSEARCH only if the \Sup argument is used. • the signal already has a positive value at the beginning of the search process or the communication with the signal is lost - this generates the error ERR_SIGSUPSEARCH only if the \Flanks argument is omitted. Errors can be handled in different ways depending on the selected running mode: • Continuous forward / Instruction forward / ERR_WHLSEARCH: No position is returned and the movement always continues to the programmed destination point. The system variable ERRNO is set to ERR_WHLSEARCH and the error can be handled in the error handler of the routine. • Continuous forward / Instruction forward / ERR_SIGSUPSEARCH No position is returned and the movement always stops as quickly as possible at the beginning of the search path. The system variable ERRNO is set to ERR_SIGSUPSEARCH and the error can be handled in the error handler of the routine. • Instruction backward : During backward execution the instruction carries out the movement without any signal supervision. Example VAR num fk; ... MoveL p10, v100, fine, tool1; SearchL \Stop, di1, sp, p20, v100, tool1; ... ERROR IF ERRNO=ERR_WHLSEARCH THEN StorePath; MoveL p10, v100, fine, tool1; RestoPath; RETRY; Continued Continues on next page 1 Instructions 1.148. SearchL - Searches linearly using the robot RobotWare - OS 423 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. ELSEIF ERRNO=ERR_SIGSUPSEARCH THEN TPWrite "The signal of the SearchL instruction is already high!"; TPReadFK fk,"Try again after manual reset of signal ?","YES","stEmpty","stEmpty","stEmpty","NO"; IF fk = 1 THEN MoveL p10, v100, fine, tool1; RETRY; ELSE Stop; ENDIF ENDIF If the signal is already active at the beginning of the search process or the communication with the signal is lost then a user dialog will be activated ( TPReadFK ...; ). Reset the signal and push YES on the user dialog, and the robot moves back to p10 and tries once more. Otherwise program execution will stop. If the signal is passive at the beginning of the search process then the robot searches from position p10 to p20 . If no signal detection occurs then the robot moves back to p10 and tries once more. Syntax SearchL [ ’\’ Stop ’,’ ] | [ ’\’ PStop ’,’] | [ ’\’ SStop ’,’] | [ ’\’ Sup ’,’ ] [ Signal ’:=’ ] < variable ( VAR ) of signaldi > [‘\’ Flanks]’,’ [ SearchPoint’ :=’ ] < var or pers ( INOUT ) of robtarget > ’,’ [ ToPoint’ :=’ ] < expression ( IN ) of robtarget > [ ’\’ ID ’:=’ < expression ( IN ) of identno >]’,’ [ Speed ’:=’ ] < expression ( IN ) of speeddata > [ ’\’ V ’:=’ < expression ( IN ) of num > ] | [ ’\’ T ’:=’ < expression ( IN ) of num > ] ’,’ [ Tool ´:=´ ] < persistent ( PERS ) of tooldata > [ ’\’ WObj’ :=’ < persistent ( PERS ) of wobjdata > ] [ ’\’ Corr ]’;’ Related information For information about See Circular searches SearchC - Searches circularly using the robot on page 402 Writes to a corrections entry CorrWrite - Writes to a correction generator on page 77 Moves the robot linearly MoveL - Moves the robot linearly on page 264 Linear movement Technical reference manual - RAPID overview , section Motion and I/O principles - Positioning during program execution Definition of velocity speeddata - Speed data on page 1185 Definition of tools tooldata - Tool data on page 1207 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
425
1 Instructions 1.148. SearchL - Searches linearly using the robot RobotWare - OS 3HAC 16581-1 Revision: J 422 © Copyright 2004-2010 ABB. All rights reserved. Limitations for searching on a conveyor: • a search will stop the robot when hit or if the search fails, so make the search in the same direction as the conveyor moves and continue after the search-stop with a move to a safe position. Use error handling to move to a safe position when search fails. • the repetition accuracy for the search hit position will be poorer when searching on a conveyor and depends on the speed of the conveyor and how stabil the speed is. Error handling An error is reported during a search when: • no signal detection occurred - this generates the error ERR_WHLSEARCH. • more than one signal detection occurred – this generates the error ERR_WHLSEARCH only if the \Sup argument is used. • the signal already has a positive value at the beginning of the search process or the communication with the signal is lost - this generates the error ERR_SIGSUPSEARCH only if the \Flanks argument is omitted. Errors can be handled in different ways depending on the selected running mode: • Continuous forward / Instruction forward / ERR_WHLSEARCH: No position is returned and the movement always continues to the programmed destination point. The system variable ERRNO is set to ERR_WHLSEARCH and the error can be handled in the error handler of the routine. • Continuous forward / Instruction forward / ERR_SIGSUPSEARCH No position is returned and the movement always stops as quickly as possible at the beginning of the search path. The system variable ERRNO is set to ERR_SIGSUPSEARCH and the error can be handled in the error handler of the routine. • Instruction backward : During backward execution the instruction carries out the movement without any signal supervision. Example VAR num fk; ... MoveL p10, v100, fine, tool1; SearchL \Stop, di1, sp, p20, v100, tool1; ... ERROR IF ERRNO=ERR_WHLSEARCH THEN StorePath; MoveL p10, v100, fine, tool1; RestoPath; RETRY; Continued Continues on next page 1 Instructions 1.148. SearchL - Searches linearly using the robot RobotWare - OS 423 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. ELSEIF ERRNO=ERR_SIGSUPSEARCH THEN TPWrite "The signal of the SearchL instruction is already high!"; TPReadFK fk,"Try again after manual reset of signal ?","YES","stEmpty","stEmpty","stEmpty","NO"; IF fk = 1 THEN MoveL p10, v100, fine, tool1; RETRY; ELSE Stop; ENDIF ENDIF If the signal is already active at the beginning of the search process or the communication with the signal is lost then a user dialog will be activated ( TPReadFK ...; ). Reset the signal and push YES on the user dialog, and the robot moves back to p10 and tries once more. Otherwise program execution will stop. If the signal is passive at the beginning of the search process then the robot searches from position p10 to p20 . If no signal detection occurs then the robot moves back to p10 and tries once more. Syntax SearchL [ ’\’ Stop ’,’ ] | [ ’\’ PStop ’,’] | [ ’\’ SStop ’,’] | [ ’\’ Sup ’,’ ] [ Signal ’:=’ ] < variable ( VAR ) of signaldi > [‘\’ Flanks]’,’ [ SearchPoint’ :=’ ] < var or pers ( INOUT ) of robtarget > ’,’ [ ToPoint’ :=’ ] < expression ( IN ) of robtarget > [ ’\’ ID ’:=’ < expression ( IN ) of identno >]’,’ [ Speed ’:=’ ] < expression ( IN ) of speeddata > [ ’\’ V ’:=’ < expression ( IN ) of num > ] | [ ’\’ T ’:=’ < expression ( IN ) of num > ] ’,’ [ Tool ´:=´ ] < persistent ( PERS ) of tooldata > [ ’\’ WObj’ :=’ < persistent ( PERS ) of wobjdata > ] [ ’\’ Corr ]’;’ Related information For information about See Circular searches SearchC - Searches circularly using the robot on page 402 Writes to a corrections entry CorrWrite - Writes to a correction generator on page 77 Moves the robot linearly MoveL - Moves the robot linearly on page 264 Linear movement Technical reference manual - RAPID overview , section Motion and I/O principles - Positioning during program execution Definition of velocity speeddata - Speed data on page 1185 Definition of tools tooldata - Tool data on page 1207 Continued Continues on next page 1 Instructions 1.148. SearchL - Searches linearly using the robot RobotWare - OS 3HAC 16581-1 Revision: J 424 © Copyright 2004-2010 ABB. All rights reserved. Definition of work objects wobjdata - Work object data on page 1224 Using error handlers Technical reference manual - RAPID overview , section RAPID summary - Error recovery Motion in general Technical reference manual - RAPID overview , section Motion and I/O principles For information about See Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
426
1 Instructions 1.148. SearchL - Searches linearly using the robot RobotWare - OS 423 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. ELSEIF ERRNO=ERR_SIGSUPSEARCH THEN TPWrite "The signal of the SearchL instruction is already high!"; TPReadFK fk,"Try again after manual reset of signal ?","YES","stEmpty","stEmpty","stEmpty","NO"; IF fk = 1 THEN MoveL p10, v100, fine, tool1; RETRY; ELSE Stop; ENDIF ENDIF If the signal is already active at the beginning of the search process or the communication with the signal is lost then a user dialog will be activated ( TPReadFK ...; ). Reset the signal and push YES on the user dialog, and the robot moves back to p10 and tries once more. Otherwise program execution will stop. If the signal is passive at the beginning of the search process then the robot searches from position p10 to p20 . If no signal detection occurs then the robot moves back to p10 and tries once more. Syntax SearchL [ ’\’ Stop ’,’ ] | [ ’\’ PStop ’,’] | [ ’\’ SStop ’,’] | [ ’\’ Sup ’,’ ] [ Signal ’:=’ ] < variable ( VAR ) of signaldi > [‘\’ Flanks]’,’ [ SearchPoint’ :=’ ] < var or pers ( INOUT ) of robtarget > ’,’ [ ToPoint’ :=’ ] < expression ( IN ) of robtarget > [ ’\’ ID ’:=’ < expression ( IN ) of identno >]’,’ [ Speed ’:=’ ] < expression ( IN ) of speeddata > [ ’\’ V ’:=’ < expression ( IN ) of num > ] | [ ’\’ T ’:=’ < expression ( IN ) of num > ] ’,’ [ Tool ´:=´ ] < persistent ( PERS ) of tooldata > [ ’\’ WObj’ :=’ < persistent ( PERS ) of wobjdata > ] [ ’\’ Corr ]’;’ Related information For information about See Circular searches SearchC - Searches circularly using the robot on page 402 Writes to a corrections entry CorrWrite - Writes to a correction generator on page 77 Moves the robot linearly MoveL - Moves the robot linearly on page 264 Linear movement Technical reference manual - RAPID overview , section Motion and I/O principles - Positioning during program execution Definition of velocity speeddata - Speed data on page 1185 Definition of tools tooldata - Tool data on page 1207 Continued Continues on next page 1 Instructions 1.148. SearchL - Searches linearly using the robot RobotWare - OS 3HAC 16581-1 Revision: J 424 © Copyright 2004-2010 ABB. All rights reserved. Definition of work objects wobjdata - Work object data on page 1224 Using error handlers Technical reference manual - RAPID overview , section RAPID summary - Error recovery Motion in general Technical reference manual - RAPID overview , section Motion and I/O principles For information about See Continued 1 Instructions 1.149. SenDevice - connect to a sensor device Sensor Interface 425 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.149. SenDevice - connect to a sensor device Usage SenDevice is used to connect to a sensor device connected to the serial sensor interface. The sensor interface communicates with sensors over serial channels using the RTP1 transport protocol. This is an example of a sensor channel configuration. COM_PHY_CHANNEL: • Name “COM1:” • Connector “COM1” • Baudrate 19200 COM_TRP: • Name “sen1:” • Type “RTP1” • PhyChannel “COM1” Basic examples Basic examples of the instruction SenDevice are illustrated below. Example 1 ! Define variable numbers CONST num SensorOn := 6; CONST num XCoord := 8; CONST num YCoord := 9; CONST num ZCoord := 10; VAR pos SensorPos; ! Connect to the sensor device“ sen1:” (defined in sio.cfg). SenDevice "sen1:"; ! Request start of sensor meassurements WriteVar "sen1:", SensorOn, 1; ! Read a cartesian position from the sensor. SensorPos.x := ReadVar "sen1:", XCoord; SensorPos.y := ReadVar "sen1:", YCoord; SensorPos.z := ReadVar "sen1:", ZCoord; ! Stop sensor WriteVar "sen1:", SensorOn, 0; Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
427
1 Instructions 1.148. SearchL - Searches linearly using the robot RobotWare - OS 3HAC 16581-1 Revision: J 424 © Copyright 2004-2010 ABB. All rights reserved. Definition of work objects wobjdata - Work object data on page 1224 Using error handlers Technical reference manual - RAPID overview , section RAPID summary - Error recovery Motion in general Technical reference manual - RAPID overview , section Motion and I/O principles For information about See Continued 1 Instructions 1.149. SenDevice - connect to a sensor device Sensor Interface 425 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.149. SenDevice - connect to a sensor device Usage SenDevice is used to connect to a sensor device connected to the serial sensor interface. The sensor interface communicates with sensors over serial channels using the RTP1 transport protocol. This is an example of a sensor channel configuration. COM_PHY_CHANNEL: • Name “COM1:” • Connector “COM1” • Baudrate 19200 COM_TRP: • Name “sen1:” • Type “RTP1” • PhyChannel “COM1” Basic examples Basic examples of the instruction SenDevice are illustrated below. Example 1 ! Define variable numbers CONST num SensorOn := 6; CONST num XCoord := 8; CONST num YCoord := 9; CONST num ZCoord := 10; VAR pos SensorPos; ! Connect to the sensor device“ sen1:” (defined in sio.cfg). SenDevice "sen1:"; ! Request start of sensor meassurements WriteVar "sen1:", SensorOn, 1; ! Read a cartesian position from the sensor. SensorPos.x := ReadVar "sen1:", XCoord; SensorPos.y := ReadVar "sen1:", YCoord; SensorPos.z := ReadVar "sen1:", ZCoord; ! Stop sensor WriteVar "sen1:", SensorOn, 0; Continues on next page 1 Instructions 1.149. SenDevice - connect to a sensor device Sensor Interface 3HAC 16581-1 Revision: J 426 © Copyright 2004-2010 ABB. All rights reserved. Arguments SenDevice device device Data type: string The I/O device name configured in sio.cfg for the sensor used. Syntax ReadBlock [ device‘ :=’ ] < expression( IN ) of string>’,’ [ BlockNo’ :=’ ] < expression ( IN ) of num > ‘,’ [ FileName’ :=’ ] < expression ( IN ) of string > ‘;’ Related information For information about See Write a sensor variable WriteVar - write variable on page 729 Read a sensor variable ReadVar - Read variable from a device on page 958 Write a sensor data block WriteBlock - write block of data to device on page 719 Configuration of sensor com- munication Technical reference manual - System parameters , section Communication Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
428
1 Instructions 1.149. SenDevice - connect to a sensor device Sensor Interface 425 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.149. SenDevice - connect to a sensor device Usage SenDevice is used to connect to a sensor device connected to the serial sensor interface. The sensor interface communicates with sensors over serial channels using the RTP1 transport protocol. This is an example of a sensor channel configuration. COM_PHY_CHANNEL: • Name “COM1:” • Connector “COM1” • Baudrate 19200 COM_TRP: • Name “sen1:” • Type “RTP1” • PhyChannel “COM1” Basic examples Basic examples of the instruction SenDevice are illustrated below. Example 1 ! Define variable numbers CONST num SensorOn := 6; CONST num XCoord := 8; CONST num YCoord := 9; CONST num ZCoord := 10; VAR pos SensorPos; ! Connect to the sensor device“ sen1:” (defined in sio.cfg). SenDevice "sen1:"; ! Request start of sensor meassurements WriteVar "sen1:", SensorOn, 1; ! Read a cartesian position from the sensor. SensorPos.x := ReadVar "sen1:", XCoord; SensorPos.y := ReadVar "sen1:", YCoord; SensorPos.z := ReadVar "sen1:", ZCoord; ! Stop sensor WriteVar "sen1:", SensorOn, 0; Continues on next page 1 Instructions 1.149. SenDevice - connect to a sensor device Sensor Interface 3HAC 16581-1 Revision: J 426 © Copyright 2004-2010 ABB. All rights reserved. Arguments SenDevice device device Data type: string The I/O device name configured in sio.cfg for the sensor used. Syntax ReadBlock [ device‘ :=’ ] < expression( IN ) of string>’,’ [ BlockNo’ :=’ ] < expression ( IN ) of num > ‘,’ [ FileName’ :=’ ] < expression ( IN ) of string > ‘;’ Related information For information about See Write a sensor variable WriteVar - write variable on page 729 Read a sensor variable ReadVar - Read variable from a device on page 958 Write a sensor data block WriteBlock - write block of data to device on page 719 Configuration of sensor com- munication Technical reference manual - System parameters , section Communication Continued 1 Instructions 1.150. Set - Sets a digital output signal RobotWare - OS 427 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.150. Set - Sets a digital output signal Usage Set is used to set the value of a digital output signal to one. Basic examples Basic examples of the instruction Set are illustrated below. Example 1 Set do15; The signal do15 is set to 1. Example 2 Set weldon; The signal weldon is set to 1. Arguments Set Signal Signal Data type: signaldo The name of the signal to be set to one. Program execution There is a short delay before the signal physically gets its new value. If you do not want the program execution to continue until the signal has got its new value then you can use the instruction SetDO with the optional parameter \Sync . The true value depends on the configuration of the signal. If the signal is inverted in the system parameters then this instruction causes the physical channel to be set to zero. Error handling The following recoverable error can be generated. The error can be handled in an error handler. The system variable ERRNO will be set to: ERR_NORUNUNIT if there is no contact with the unit. Syntax Set [ Signal ’:=’ ] < variable ( VAR ) of signaldo > ’;’ Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
429
1 Instructions 1.149. SenDevice - connect to a sensor device Sensor Interface 3HAC 16581-1 Revision: J 426 © Copyright 2004-2010 ABB. All rights reserved. Arguments SenDevice device device Data type: string The I/O device name configured in sio.cfg for the sensor used. Syntax ReadBlock [ device‘ :=’ ] < expression( IN ) of string>’,’ [ BlockNo’ :=’ ] < expression ( IN ) of num > ‘,’ [ FileName’ :=’ ] < expression ( IN ) of string > ‘;’ Related information For information about See Write a sensor variable WriteVar - write variable on page 729 Read a sensor variable ReadVar - Read variable from a device on page 958 Write a sensor data block WriteBlock - write block of data to device on page 719 Configuration of sensor com- munication Technical reference manual - System parameters , section Communication Continued 1 Instructions 1.150. Set - Sets a digital output signal RobotWare - OS 427 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.150. Set - Sets a digital output signal Usage Set is used to set the value of a digital output signal to one. Basic examples Basic examples of the instruction Set are illustrated below. Example 1 Set do15; The signal do15 is set to 1. Example 2 Set weldon; The signal weldon is set to 1. Arguments Set Signal Signal Data type: signaldo The name of the signal to be set to one. Program execution There is a short delay before the signal physically gets its new value. If you do not want the program execution to continue until the signal has got its new value then you can use the instruction SetDO with the optional parameter \Sync . The true value depends on the configuration of the signal. If the signal is inverted in the system parameters then this instruction causes the physical channel to be set to zero. Error handling The following recoverable error can be generated. The error can be handled in an error handler. The system variable ERRNO will be set to: ERR_NORUNUNIT if there is no contact with the unit. Syntax Set [ Signal ’:=’ ] < variable ( VAR ) of signaldo > ’;’ Continues on next page 1 Instructions 1.150. Set - Sets a digital output signal RobotWare - OS 3HAC 16581-1 Revision: J 428 © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Setting a digital output signal to zero Reset - Resets a digital output signal on page 359 Change the value of 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
430
1 Instructions 1.150. Set - Sets a digital output signal RobotWare - OS 427 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.150. Set - Sets a digital output signal Usage Set is used to set the value of a digital output signal to one. Basic examples Basic examples of the instruction Set are illustrated below. Example 1 Set do15; The signal do15 is set to 1. Example 2 Set weldon; The signal weldon is set to 1. Arguments Set Signal Signal Data type: signaldo The name of the signal to be set to one. Program execution There is a short delay before the signal physically gets its new value. If you do not want the program execution to continue until the signal has got its new value then you can use the instruction SetDO with the optional parameter \Sync . The true value depends on the configuration of the signal. If the signal is inverted in the system parameters then this instruction causes the physical channel to be set to zero. Error handling The following recoverable error can be generated. The error can be handled in an error handler. The system variable ERRNO will be set to: ERR_NORUNUNIT if there is no contact with the unit. Syntax Set [ Signal ’:=’ ] < variable ( VAR ) of signaldo > ’;’ Continues on next page 1 Instructions 1.150. Set - Sets a digital output signal RobotWare - OS 3HAC 16581-1 Revision: J 428 © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Setting a digital output signal to zero Reset - Resets a digital output signal on page 359 Change the value of 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 1 Instructions 1.151. SetAllDataVal - Set a value to all data objects in a defined set RobotWare - OS 429 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.151. SetAllDataVal - Set a value to all data objects in a defined set Usage SetAllDataVal ( Set All Data Value ) makes it possible to set a new value to all data objects of a certain type that match the given grammar. Basic examples Basic examples of the instruction SetAllDataVal are illustrated below. VAR mydata mydata0:=0; ... SetAllDataVal "mydata"\TypeMod:="mytypes"\Hidden,mydata0; This will set all data objects of data type mydata in the system to the same value that the variable mydata0 has (in the example to 0 ). The user defined data type mydata is defined in the module mytypes . Arguments SetAllDataVal Type [\TypeMod] [\Object] [\Hidden] Value Type Data type: string The type name of the data objects to be set. [ \TypeMod ] Type Module Data type: string The module name where the data type is defined if using user defined data types. [ \Object ] Data type: string The default behavior is to set all data object of the data type above but this option makes it possible to name one or several objects with a regular expression. (see also instruction SetDataSearch ) [ \Hidden ] Data type: switch This also matches data objects that are in routines (routine data or parameters) hidden by some routine in the call chain. Value Data type: anytype Variable which holds the new value to be set. The data type must be the same as the data type for the object to be set. Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
431
1 Instructions 1.150. Set - Sets a digital output signal RobotWare - OS 3HAC 16581-1 Revision: J 428 © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Setting a digital output signal to zero Reset - Resets a digital output signal on page 359 Change the value of 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 1 Instructions 1.151. SetAllDataVal - Set a value to all data objects in a defined set RobotWare - OS 429 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.151. SetAllDataVal - Set a value to all data objects in a defined set Usage SetAllDataVal ( Set All Data Value ) makes it possible to set a new value to all data objects of a certain type that match the given grammar. Basic examples Basic examples of the instruction SetAllDataVal are illustrated below. VAR mydata mydata0:=0; ... SetAllDataVal "mydata"\TypeMod:="mytypes"\Hidden,mydata0; This will set all data objects of data type mydata in the system to the same value that the variable mydata0 has (in the example to 0 ). The user defined data type mydata is defined in the module mytypes . Arguments SetAllDataVal Type [\TypeMod] [\Object] [\Hidden] Value Type Data type: string The type name of the data objects to be set. [ \TypeMod ] Type Module Data type: string The module name where the data type is defined if using user defined data types. [ \Object ] Data type: string The default behavior is to set all data object of the data type above but this option makes it possible to name one or several objects with a regular expression. (see also instruction SetDataSearch ) [ \Hidden ] Data type: switch This also matches data objects that are in routines (routine data or parameters) hidden by some routine in the call chain. Value Data type: anytype Variable which holds the new value to be set. The data type must be the same as the data type for the object to be set. Continues on next page 1 Instructions 1.151. SetAllDataVal - Set a value to all data objects in a defined set RobotWare - OS 3HAC 16581-1 Revision: J 430 © Copyright 2004-2010 ABB. All rights reserved. Program running The instruction will fail if the specification for Type or TypeMod is wrong. If the matching data object is an array then all elements of the array will be set to the specified value. If the matching data object is read-only data then the value will not be changed. If the system doesn’t have any matching data objects then the instruction will accept it and return successfully. Limitations For a semivalue data type it is not possible to search for the associated value data type. E.g. if searching for dionum then there are no search hits for signal signaldi and if searching for num then there are no search hits for signals signalgi or signalai . It is not possible to set a value to a variable declared as LOCAL in a built in RAPID module. Syntax SetAllDataVal [ Type ’:=’ ] < expression ( IN ) of string > [’\’TypeMod’ :=’<expression ( IN ) of string>] [’\’Object’ :=’<expression ( IN ) of string>] [’\’Hidden ] ’,’ [ Value ’:=’] <variable ( VAR ) of anytype>’;’ 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 next matching symbol GetNextSym - Get next matching symbol on page 855 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 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
432
1 Instructions 1.151. SetAllDataVal - Set a value to all data objects in a defined set RobotWare - OS 429 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.151. SetAllDataVal - Set a value to all data objects in a defined set Usage SetAllDataVal ( Set All Data Value ) makes it possible to set a new value to all data objects of a certain type that match the given grammar. Basic examples Basic examples of the instruction SetAllDataVal are illustrated below. VAR mydata mydata0:=0; ... SetAllDataVal "mydata"\TypeMod:="mytypes"\Hidden,mydata0; This will set all data objects of data type mydata in the system to the same value that the variable mydata0 has (in the example to 0 ). The user defined data type mydata is defined in the module mytypes . Arguments SetAllDataVal Type [\TypeMod] [\Object] [\Hidden] Value Type Data type: string The type name of the data objects to be set. [ \TypeMod ] Type Module Data type: string The module name where the data type is defined if using user defined data types. [ \Object ] Data type: string The default behavior is to set all data object of the data type above but this option makes it possible to name one or several objects with a regular expression. (see also instruction SetDataSearch ) [ \Hidden ] Data type: switch This also matches data objects that are in routines (routine data or parameters) hidden by some routine in the call chain. Value Data type: anytype Variable which holds the new value to be set. The data type must be the same as the data type for the object to be set. Continues on next page 1 Instructions 1.151. SetAllDataVal - Set a value to all data objects in a defined set RobotWare - OS 3HAC 16581-1 Revision: J 430 © Copyright 2004-2010 ABB. All rights reserved. Program running The instruction will fail if the specification for Type or TypeMod is wrong. If the matching data object is an array then all elements of the array will be set to the specified value. If the matching data object is read-only data then the value will not be changed. If the system doesn’t have any matching data objects then the instruction will accept it and return successfully. Limitations For a semivalue data type it is not possible to search for the associated value data type. E.g. if searching for dionum then there are no search hits for signal signaldi and if searching for num then there are no search hits for signals signalgi or signalai . It is not possible to set a value to a variable declared as LOCAL in a built in RAPID module. Syntax SetAllDataVal [ Type ’:=’ ] < expression ( IN ) of string > [’\’TypeMod’ :=’<expression ( IN ) of string>] [’\’Object’ :=’<expression ( IN ) of string>] [’\’Hidden ] ’,’ [ Value ’:=’] <variable ( VAR ) of anytype>’;’ 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 next matching symbol GetNextSym - Get next matching symbol on page 855 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 The related data type datapos datapos - Enclosing block for a data object on page 1101 Continued 1 Instructions 1.152. SetAO - Changes the value of an analog output signal RobotWare - OS 431 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.152. SetAO - Changes the value of an analog output signal Usage SetAO is used to change the value of an analog output signal. Basic examples Basic examples of the instruction SetAO are illustrated below. See also More examples on page 432 . Example 1 SetAO ao2, 5.5; The signal ao2 is set to 5.5. Arguments SetAO Signal Value Signal Data type: signalao The name of the analog output signal to be changed. Value Data type: num The desired value of the signal. Program execution The programmed value is scaled (in accordance with the system parameters) before it is sent on the physical channel. A diagram of how analog signal values are scaled is shown in the figure below. xx0500002408 Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
433
1 Instructions 1.151. SetAllDataVal - Set a value to all data objects in a defined set RobotWare - OS 3HAC 16581-1 Revision: J 430 © Copyright 2004-2010 ABB. All rights reserved. Program running The instruction will fail if the specification for Type or TypeMod is wrong. If the matching data object is an array then all elements of the array will be set to the specified value. If the matching data object is read-only data then the value will not be changed. If the system doesn’t have any matching data objects then the instruction will accept it and return successfully. Limitations For a semivalue data type it is not possible to search for the associated value data type. E.g. if searching for dionum then there are no search hits for signal signaldi and if searching for num then there are no search hits for signals signalgi or signalai . It is not possible to set a value to a variable declared as LOCAL in a built in RAPID module. Syntax SetAllDataVal [ Type ’:=’ ] < expression ( IN ) of string > [’\’TypeMod’ :=’<expression ( IN ) of string>] [’\’Object’ :=’<expression ( IN ) of string>] [’\’Hidden ] ’,’ [ Value ’:=’] <variable ( VAR ) of anytype>’;’ 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 next matching symbol GetNextSym - Get next matching symbol on page 855 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 The related data type datapos datapos - Enclosing block for a data object on page 1101 Continued 1 Instructions 1.152. SetAO - Changes the value of an analog output signal RobotWare - OS 431 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.152. SetAO - Changes the value of an analog output signal Usage SetAO is used to change the value of an analog output signal. Basic examples Basic examples of the instruction SetAO are illustrated below. See also More examples on page 432 . Example 1 SetAO ao2, 5.5; The signal ao2 is set to 5.5. Arguments SetAO Signal Value Signal Data type: signalao The name of the analog output signal to be changed. Value Data type: num The desired value of the signal. Program execution The programmed value is scaled (in accordance with the system parameters) before it is sent on the physical channel. A diagram of how analog signal values are scaled is shown in the figure below. xx0500002408 Continues on next page 1 Instructions 1.152. SetAO - Changes the value of an analog output signal RobotWare - OS 3HAC 16581-1 Revision: J 432 © Copyright 2004-2010 ABB. All rights reserved. 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. ERR_AO_LIM if the programmed Value argument for the specified analog output signal Signal is outside limits. More examples More examples of the instruction SetAO are illustrated below. Example 1 SetAO weldcurr, curr_outp; The signal weldcurr is set to the same value as the current value of the variable curr_outp . Syntax SetAO [ Signal ’:=’ ] < variable ( VAR ) of signalao > ’,’ [ Value ’:=’ ] < expression ( IN ) of num > ’;’ Related information For information about See Input/Output instructions Technical reference manual - RAPID overview , section RAPID Summary - Input and output signals Input/Output functionality in general Technical reference manual - RAPID overview , section Motion and I/O Principles - I/O principles Configuration of I/O Technical reference manual - System parameters Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
434
1 Instructions 1.152. SetAO - Changes the value of an analog output signal RobotWare - OS 431 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.152. SetAO - Changes the value of an analog output signal Usage SetAO is used to change the value of an analog output signal. Basic examples Basic examples of the instruction SetAO are illustrated below. See also More examples on page 432 . Example 1 SetAO ao2, 5.5; The signal ao2 is set to 5.5. Arguments SetAO Signal Value Signal Data type: signalao The name of the analog output signal to be changed. Value Data type: num The desired value of the signal. Program execution The programmed value is scaled (in accordance with the system parameters) before it is sent on the physical channel. A diagram of how analog signal values are scaled is shown in the figure below. xx0500002408 Continues on next page 1 Instructions 1.152. SetAO - Changes the value of an analog output signal RobotWare - OS 3HAC 16581-1 Revision: J 432 © Copyright 2004-2010 ABB. All rights reserved. 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. ERR_AO_LIM if the programmed Value argument for the specified analog output signal Signal is outside limits. More examples More examples of the instruction SetAO are illustrated below. Example 1 SetAO weldcurr, curr_outp; The signal weldcurr is set to the same value as the current value of the variable curr_outp . Syntax SetAO [ Signal ’:=’ ] < variable ( VAR ) of signalao > ’,’ [ Value ’:=’ ] < expression ( IN ) of num > ’;’ Related information For information about See Input/Output instructions Technical reference manual - RAPID overview , section RAPID Summary - Input and output signals Input/Output functionality in general Technical reference manual - RAPID overview , section Motion and I/O Principles - I/O principles Configuration of I/O Technical reference manual - System parameters Continued 1 Instructions 1.153. SetDataSearch - Define the symbol set in a search sequence RobotWare - OS 433 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.153. SetDataSearch - Define the symbol set in a search sequence Usage SetDataSearch is used together with function GetNextSym to retrieve data objects from the system. Basic examples Basic examples of the instruction SetDataSearch are illustrated below. Example 1 VAR datapos block; VAR string name; ... SetDataSearch "robtarget"\InTask; WHILE GetNextSym(name,block \Recursive) DO ... This session will find all robtarget ’s object in the task. Arguments SetDataSearch Type [\TypeMod] [\Object] [\PersSym] [\VarSym][\ConstSym] [\InTask] | [\InMod] [\InRout][\GlobalSym] | [\LocalSym] Type Data type: string The data type name of the data objects to be retrieved. [ \TypeMod ] Type Module Data type: string The module name where the data type is defined, if using user defined data types. [ \Object ] Data type: string The default behavior is to set all data objects of the data type above, but this option makes it possible to name one or several data objects with a regular expression. A regular expression is a powerful mechanism to specify a grammar to match the data object names. The string could consist of either ordinary characters and meta characters. A meta character is a special operator used to represent one or more ordinary characters in the string with the purpose to extend the search. It is possible to see if a string matches a specified pattern as a whole or search within a string for a substring matching a specified pattern. Within a regular expression all alphanumeric characters match themselves. That is to say that the pattern "abc" will only match a data object named "abc". To match all data object names containing the character sequence "abc" it is necessary to add some meta characters. The regular expression for this is ".*abc.*". Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
435
1 Instructions 1.152. SetAO - Changes the value of an analog output signal RobotWare - OS 3HAC 16581-1 Revision: J 432 © Copyright 2004-2010 ABB. All rights reserved. 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. ERR_AO_LIM if the programmed Value argument for the specified analog output signal Signal is outside limits. More examples More examples of the instruction SetAO are illustrated below. Example 1 SetAO weldcurr, curr_outp; The signal weldcurr is set to the same value as the current value of the variable curr_outp . Syntax SetAO [ Signal ’:=’ ] < variable ( VAR ) of signalao > ’,’ [ Value ’:=’ ] < expression ( IN ) of num > ’;’ Related information For information about See Input/Output instructions Technical reference manual - RAPID overview , section RAPID Summary - Input and output signals Input/Output functionality in general Technical reference manual - RAPID overview , section Motion and I/O Principles - I/O principles Configuration of I/O Technical reference manual - System parameters Continued 1 Instructions 1.153. SetDataSearch - Define the symbol set in a search sequence RobotWare - OS 433 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.153. SetDataSearch - Define the symbol set in a search sequence Usage SetDataSearch is used together with function GetNextSym to retrieve data objects from the system. Basic examples Basic examples of the instruction SetDataSearch are illustrated below. Example 1 VAR datapos block; VAR string name; ... SetDataSearch "robtarget"\InTask; WHILE GetNextSym(name,block \Recursive) DO ... This session will find all robtarget ’s object in the task. Arguments SetDataSearch Type [\TypeMod] [\Object] [\PersSym] [\VarSym][\ConstSym] [\InTask] | [\InMod] [\InRout][\GlobalSym] | [\LocalSym] Type Data type: string The data type name of the data objects to be retrieved. [ \TypeMod ] Type Module Data type: string The module name where the data type is defined, if using user defined data types. [ \Object ] Data type: string The default behavior is to set all data objects of the data type above, but this option makes it possible to name one or several data objects with a regular expression. A regular expression is a powerful mechanism to specify a grammar to match the data object names. The string could consist of either ordinary characters and meta characters. A meta character is a special operator used to represent one or more ordinary characters in the string with the purpose to extend the search. It is possible to see if a string matches a specified pattern as a whole or search within a string for a substring matching a specified pattern. Within a regular expression all alphanumeric characters match themselves. That is to say that the pattern "abc" will only match a data object named "abc". To match all data object names containing the character sequence "abc" it is necessary to add some meta characters. The regular expression for this is ".*abc.*". Continues on next page 1 Instructions 1.153. SetDataSearch - Define the symbol set in a search sequence RobotWare - OS 3HAC 16581-1 Revision: J 434 © Copyright 2004-2010 ABB. All rights reserved. The available meta character set is shown below. The default behavior is to accept any symbols but if one or several of following PersSym , VarSym , or ConstSym is specified then only symbols that match the specification are accepted: [ \PersSym ] Persistent Symbols Data type: switch Accept persistent variable ( PERS ) symbols. [ \VarSym ] Variable Symbols Data type: switch Accept variable ( VAR ) symbols. [ \ConstSym ] Constant Symbols Data type: switch Accept constant ( CONST ) symbols. If not one of the flags \ InTask or \ InMod are specified then the search is started at system level. The system level is the root to all other symbol definitions in the symbol tree. At the system level all build- in symbols are located plus the handle to the task level. At the task level all loaded global symbols are located plus the handle to the modules level. If the \ Recursive flag is set in GetNextSym then the search session will enter all loaded modules and routines below the system level. Expression Meaning . Any single character. [s] Any single character in the non-empty set s, where s is a sequence of characters. Ranges may be specified as c-c. [^s] Any single character not in the set s. r* Zero or more occurrences of the regular expression r. r+ One or more occurrences of the regular expression r r? Zero or one occurrence of the regular expression r. (r) The regular expression r. Used for separate that regular expression from another. r | r’ The regular expressions r or r’. .* Any character sequence (zero, one, or several characters). 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
436
1 Instructions 1.153. SetDataSearch - Define the symbol set in a search sequence RobotWare - OS 433 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.153. SetDataSearch - Define the symbol set in a search sequence Usage SetDataSearch is used together with function GetNextSym to retrieve data objects from the system. Basic examples Basic examples of the instruction SetDataSearch are illustrated below. Example 1 VAR datapos block; VAR string name; ... SetDataSearch "robtarget"\InTask; WHILE GetNextSym(name,block \Recursive) DO ... This session will find all robtarget ’s object in the task. Arguments SetDataSearch Type [\TypeMod] [\Object] [\PersSym] [\VarSym][\ConstSym] [\InTask] | [\InMod] [\InRout][\GlobalSym] | [\LocalSym] Type Data type: string The data type name of the data objects to be retrieved. [ \TypeMod ] Type Module Data type: string The module name where the data type is defined, if using user defined data types. [ \Object ] Data type: string The default behavior is to set all data objects of the data type above, but this option makes it possible to name one or several data objects with a regular expression. A regular expression is a powerful mechanism to specify a grammar to match the data object names. The string could consist of either ordinary characters and meta characters. A meta character is a special operator used to represent one or more ordinary characters in the string with the purpose to extend the search. It is possible to see if a string matches a specified pattern as a whole or search within a string for a substring matching a specified pattern. Within a regular expression all alphanumeric characters match themselves. That is to say that the pattern "abc" will only match a data object named "abc". To match all data object names containing the character sequence "abc" it is necessary to add some meta characters. The regular expression for this is ".*abc.*". Continues on next page 1 Instructions 1.153. SetDataSearch - Define the symbol set in a search sequence RobotWare - OS 3HAC 16581-1 Revision: J 434 © Copyright 2004-2010 ABB. All rights reserved. The available meta character set is shown below. The default behavior is to accept any symbols but if one or several of following PersSym , VarSym , or ConstSym is specified then only symbols that match the specification are accepted: [ \PersSym ] Persistent Symbols Data type: switch Accept persistent variable ( PERS ) symbols. [ \VarSym ] Variable Symbols Data type: switch Accept variable ( VAR ) symbols. [ \ConstSym ] Constant Symbols Data type: switch Accept constant ( CONST ) symbols. If not one of the flags \ InTask or \ InMod are specified then the search is started at system level. The system level is the root to all other symbol definitions in the symbol tree. At the system level all build- in symbols are located plus the handle to the task level. At the task level all loaded global symbols are located plus the handle to the modules level. If the \ Recursive flag is set in GetNextSym then the search session will enter all loaded modules and routines below the system level. Expression Meaning . Any single character. [s] Any single character in the non-empty set s, where s is a sequence of characters. Ranges may be specified as c-c. [^s] Any single character not in the set s. r* Zero or more occurrences of the regular expression r. r+ One or more occurrences of the regular expression r r? Zero or one occurrence of the regular expression r. (r) The regular expression r. Used for separate that regular expression from another. r | r’ The regular expressions r or r’. .* Any character sequence (zero, one, or several characters). Continued Continues on next page 1 Instructions 1.153. SetDataSearch - Define the symbol set in a search sequence RobotWare - OS 435 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. [ \InTask ] In Task Data type: switch Start the search at the task level. At the task level all loaded global symbols are located plus the handle to the modules level. If the \ Recursive flag is set in GetNextSym then the search session will enter all loaded modules and routines below the task level. [ \InMod ] In Module Data type: string Start the search at the specified module level. At the module level all loaded global and local symbols declared in the specified module are located plus the handle to the routines level. If the \ Recursive flag is set in GetNextSym then the search session will enter all loaded routines below the specified module level (declared in the specified module). [ \InRout ] In Routine Data type: string Search only at the specified routine level. The module name for the routine must be specified in the argument \ InMod. The default behavior is to match both local and global module symbols, but if one of following \ GlobalSym or \ LocalSym is specified then only symbols that match the specification are accepted: [ \GlobalSym ] Global Symbols Data type: switch Skip local module symbols. [ \LocalSym ] Local Symbols Data type: switch Skip global module symbols. Program running The instruction will fail if the specification for one of Type , TypeMod , InMod , or InRout is wrong. If the system doesn’t have any matching objects the instruction will accept it and return successfully but the first GetNextSym will return FALSE . Continued Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
437
1 Instructions 1.153. SetDataSearch - Define the symbol set in a search sequence RobotWare - OS 3HAC 16581-1 Revision: J 434 © Copyright 2004-2010 ABB. All rights reserved. The available meta character set is shown below. The default behavior is to accept any symbols but if one or several of following PersSym , VarSym , or ConstSym is specified then only symbols that match the specification are accepted: [ \PersSym ] Persistent Symbols Data type: switch Accept persistent variable ( PERS ) symbols. [ \VarSym ] Variable Symbols Data type: switch Accept variable ( VAR ) symbols. [ \ConstSym ] Constant Symbols Data type: switch Accept constant ( CONST ) symbols. If not one of the flags \ InTask or \ InMod are specified then the search is started at system level. The system level is the root to all other symbol definitions in the symbol tree. At the system level all build- in symbols are located plus the handle to the task level. At the task level all loaded global symbols are located plus the handle to the modules level. If the \ Recursive flag is set in GetNextSym then the search session will enter all loaded modules and routines below the system level. Expression Meaning . Any single character. [s] Any single character in the non-empty set s, where s is a sequence of characters. Ranges may be specified as c-c. [^s] Any single character not in the set s. r* Zero or more occurrences of the regular expression r. r+ One or more occurrences of the regular expression r r? Zero or one occurrence of the regular expression r. (r) The regular expression r. Used for separate that regular expression from another. r | r’ The regular expressions r or r’. .* Any character sequence (zero, one, or several characters). Continued Continues on next page 1 Instructions 1.153. SetDataSearch - Define the symbol set in a search sequence RobotWare - OS 435 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. [ \InTask ] In Task Data type: switch Start the search at the task level. At the task level all loaded global symbols are located plus the handle to the modules level. If the \ Recursive flag is set in GetNextSym then the search session will enter all loaded modules and routines below the task level. [ \InMod ] In Module Data type: string Start the search at the specified module level. At the module level all loaded global and local symbols declared in the specified module are located plus the handle to the routines level. If the \ Recursive flag is set in GetNextSym then the search session will enter all loaded routines below the specified module level (declared in the specified module). [ \InRout ] In Routine Data type: string Search only at the specified routine level. The module name for the routine must be specified in the argument \ InMod. The default behavior is to match both local and global module symbols, but if one of following \ GlobalSym or \ LocalSym is specified then only symbols that match the specification are accepted: [ \GlobalSym ] Global Symbols Data type: switch Skip local module symbols. [ \LocalSym ] Local Symbols Data type: switch Skip global module symbols. Program running The instruction will fail if the specification for one of Type , TypeMod , InMod , or InRout is wrong. If the system doesn’t have any matching objects the instruction will accept it and return successfully but the first GetNextSym will return FALSE . Continued Continues on next page 1 Instructions 1.153. SetDataSearch - Define the symbol set in a search sequence RobotWare - OS 3HAC 16581-1 Revision: J 436 © Copyright 2004-2010 ABB. All rights reserved. Limitations Array data objects cannot be defined in the symbol search set and cannot be found in a search sequence. For a semivalue data type it is not possible to search for the associated value data type. E.g. if searching for dionum then there are no search hits for signal signaldi and if searching for num then there are no search hits for signals signalgi or signalai . Installed built-in symbols declared as LOCAL will never be found, irrespective of use of argument \GlobalSym , \LocalSym or none of these. Installed built-in symbols declared as global or as TASK will always be found, irrespective of use of argument \GlobalSym , \LocalSym or none of these. It is not possible to use SetDataSearch for searching for data of some ALIAS data type defined with RAPID code. No limitation for predefined ALIAS data type. Syntax SetDataSearch [ Type ’:=’ ] < expression ( IN ) of string > [’\’TypeMod ’:=’<expression ( IN ) of string>] [’\’Object ’:=’<expression ( IN ) of string>] [’\’PersSym ] [’\’VarSym ] [’\’ConstSym ] [’\’InTask ] | [’\’InMod’ :=’<expression ( IN ) of string>] [’\’InRout ’:=’<expression ( IN ) of string>] [’\’GlobalSym ] | [’\’LocalSym]’ ;’ Related information For information about See Get next matching symbol GetNextSym - Get next matching symbol on page 855 Get the value of a data object GetDataVal - Get the value of a data object on page 110 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
438
1 Instructions 1.153. SetDataSearch - Define the symbol set in a search sequence RobotWare - OS 435 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. [ \InTask ] In Task Data type: switch Start the search at the task level. At the task level all loaded global symbols are located plus the handle to the modules level. If the \ Recursive flag is set in GetNextSym then the search session will enter all loaded modules and routines below the task level. [ \InMod ] In Module Data type: string Start the search at the specified module level. At the module level all loaded global and local symbols declared in the specified module are located plus the handle to the routines level. If the \ Recursive flag is set in GetNextSym then the search session will enter all loaded routines below the specified module level (declared in the specified module). [ \InRout ] In Routine Data type: string Search only at the specified routine level. The module name for the routine must be specified in the argument \ InMod. The default behavior is to match both local and global module symbols, but if one of following \ GlobalSym or \ LocalSym is specified then only symbols that match the specification are accepted: [ \GlobalSym ] Global Symbols Data type: switch Skip local module symbols. [ \LocalSym ] Local Symbols Data type: switch Skip global module symbols. Program running The instruction will fail if the specification for one of Type , TypeMod , InMod , or InRout is wrong. If the system doesn’t have any matching objects the instruction will accept it and return successfully but the first GetNextSym will return FALSE . Continued Continues on next page 1 Instructions 1.153. SetDataSearch - Define the symbol set in a search sequence RobotWare - OS 3HAC 16581-1 Revision: J 436 © Copyright 2004-2010 ABB. All rights reserved. Limitations Array data objects cannot be defined in the symbol search set and cannot be found in a search sequence. For a semivalue data type it is not possible to search for the associated value data type. E.g. if searching for dionum then there are no search hits for signal signaldi and if searching for num then there are no search hits for signals signalgi or signalai . Installed built-in symbols declared as LOCAL will never be found, irrespective of use of argument \GlobalSym , \LocalSym or none of these. Installed built-in symbols declared as global or as TASK will always be found, irrespective of use of argument \GlobalSym , \LocalSym or none of these. It is not possible to use SetDataSearch for searching for data of some ALIAS data type defined with RAPID code. No limitation for predefined ALIAS data type. Syntax SetDataSearch [ Type ’:=’ ] < expression ( IN ) of string > [’\’TypeMod ’:=’<expression ( IN ) of string>] [’\’Object ’:=’<expression ( IN ) of string>] [’\’PersSym ] [’\’VarSym ] [’\’ConstSym ] [’\’InTask ] | [’\’InMod’ :=’<expression ( IN ) of string>] [’\’InRout ’:=’<expression ( IN ) of string>] [’\’GlobalSym ] | [’\’LocalSym]’ ;’ Related information For information about See Get next matching symbol GetNextSym - Get next matching symbol on page 855 Get the value of a data object GetDataVal - Get the value of a data object on page 110 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 1 Instructions 1.154. SetDataVal - Set the value of a data object RobotWare - OS 437 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.154. SetDataVal - Set the value of a data object Usage SetDataVal ( Set Data Value ) makes it possible to set a value for a data object that is specified with a string variable. Basic examples Basic examples of the instruction SetDataVal are illustrated below. Example 1 VAR num value:=3; ... SetDataVal "reg"+ValToStr(ReadNum(mycom)),value; This will set the value 3 to a register with a number that is received from the serial channel mycom . Example 2 VAR datapos block; 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 that begin with my in the module mymod to TRUE . Example 3 VAR string StringArrVar_copy{2}; ... StringArrVar_copy{1} := "test1"; StringArrVar_copy{2} := "test2"; SetDataVal "StringArrVar", StringArrVar_copy; This session will set the array StringArrVar to contain the two strings test1 and test2. Arguments SetDataVal Object [\Block]|[\TaskRef]|[\TaskName] Value Object Data type: string The name of the data object. [ \Block ] Data type: datapos The enclosed block to the data object. This can only be fetched with the GetNextSym function. If this argument is omitted then the value of the visible data object in the current program execution scope will be set. Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
439
1 Instructions 1.153. SetDataSearch - Define the symbol set in a search sequence RobotWare - OS 3HAC 16581-1 Revision: J 436 © Copyright 2004-2010 ABB. All rights reserved. Limitations Array data objects cannot be defined in the symbol search set and cannot be found in a search sequence. For a semivalue data type it is not possible to search for the associated value data type. E.g. if searching for dionum then there are no search hits for signal signaldi and if searching for num then there are no search hits for signals signalgi or signalai . Installed built-in symbols declared as LOCAL will never be found, irrespective of use of argument \GlobalSym , \LocalSym or none of these. Installed built-in symbols declared as global or as TASK will always be found, irrespective of use of argument \GlobalSym , \LocalSym or none of these. It is not possible to use SetDataSearch for searching for data of some ALIAS data type defined with RAPID code. No limitation for predefined ALIAS data type. Syntax SetDataSearch [ Type ’:=’ ] < expression ( IN ) of string > [’\’TypeMod ’:=’<expression ( IN ) of string>] [’\’Object ’:=’<expression ( IN ) of string>] [’\’PersSym ] [’\’VarSym ] [’\’ConstSym ] [’\’InTask ] | [’\’InMod’ :=’<expression ( IN ) of string>] [’\’InRout ’:=’<expression ( IN ) of string>] [’\’GlobalSym ] | [’\’LocalSym]’ ;’ Related information For information about See Get next matching symbol GetNextSym - Get next matching symbol on page 855 Get the value of a data object GetDataVal - Get the value of a data object on page 110 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 1 Instructions 1.154. SetDataVal - Set the value of a data object RobotWare - OS 437 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.154. SetDataVal - Set the value of a data object Usage SetDataVal ( Set Data Value ) makes it possible to set a value for a data object that is specified with a string variable. Basic examples Basic examples of the instruction SetDataVal are illustrated below. Example 1 VAR num value:=3; ... SetDataVal "reg"+ValToStr(ReadNum(mycom)),value; This will set the value 3 to a register with a number that is received from the serial channel mycom . Example 2 VAR datapos block; 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 that begin with my in the module mymod to TRUE . Example 3 VAR string StringArrVar_copy{2}; ... StringArrVar_copy{1} := "test1"; StringArrVar_copy{2} := "test2"; SetDataVal "StringArrVar", StringArrVar_copy; This session will set the array StringArrVar to contain the two strings test1 and test2. Arguments SetDataVal Object [\Block]|[\TaskRef]|[\TaskName] Value Object Data type: string The name of the data object. [ \Block ] Data type: datapos The enclosed block to the data object. This can only be fetched with the GetNextSym function. If this argument is omitted then the value of the visible data object in the current program execution scope will be set. Continues on next page 1 Instructions 1.154. SetDataVal - Set the value of a data object RobotWare - OS 3HAC 16581-1 Revision: J 438 © Copyright 2004-2010 ABB. All rights reserved. [\TaskRef] Task Reference Data type: taskid The program task identity in which to search for the data object specified. When using this argument, you may search for PERS or TASK PERS declarations in other tasks, any other declarations will result in an error. For all program tasks in the system the predefined variables of the data type taskid will be available. The variable identity will be "taskname"+"Id", e.g. for the T_ROB1 task the variable identity will be T_ROB1Id . [\TaskName] Data type: string The program task name in which to search for the data object specified. When using this argument, you may search for PERS or TASK PERS declarations in other tasks, any other declarations will result in an error. Value Data type: anytype Variable which holds the new value to be set. The data type must be the same as the data type for the data object to be set. The set value must be fetched from a variable but can be stored in a variable or persistent. Error handling The system variable ERRNO is set to ERR_SYM_ACCESS if: • the data object is non-existent • the data object is read-only data • the data object is routine data or routine parameter and not located in the current active routine • searching in other tasks for other declarations then PERS or TASK PERS When using the arguments TaskRef or TaskName you may search for PERS or TASK PERS declarations in other tasks, any other declarations will result in an error and the system variable ERRNO is set to ERR_SYM_ACCESS . Searching for a PERS declared as LOCAL in other tasks will also result in an error and the system variable ERRNO is set to ERR_SYM_ACCESS . The system variable ERRNO is set to ERR_INVDIM if the data object and the variable used in argument Value have different dimensions. The error can be handled in the error handler of the routine. Limitations For a semivalue data type it is not possible to search for the associated value data type. E.g. if searching for dionum then no search hit for signal signaldi will be obtained and if searching for num then no search hit for signals signalgi or signalai will be obtained. It is not possible to set a value to a variable declared as LOCAL in a built-in RAPID module. 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
440
1 Instructions 1.154. SetDataVal - Set the value of a data object RobotWare - OS 437 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.154. SetDataVal - Set the value of a data object Usage SetDataVal ( Set Data Value ) makes it possible to set a value for a data object that is specified with a string variable. Basic examples Basic examples of the instruction SetDataVal are illustrated below. Example 1 VAR num value:=3; ... SetDataVal "reg"+ValToStr(ReadNum(mycom)),value; This will set the value 3 to a register with a number that is received from the serial channel mycom . Example 2 VAR datapos block; 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 that begin with my in the module mymod to TRUE . Example 3 VAR string StringArrVar_copy{2}; ... StringArrVar_copy{1} := "test1"; StringArrVar_copy{2} := "test2"; SetDataVal "StringArrVar", StringArrVar_copy; This session will set the array StringArrVar to contain the two strings test1 and test2. Arguments SetDataVal Object [\Block]|[\TaskRef]|[\TaskName] Value Object Data type: string The name of the data object. [ \Block ] Data type: datapos The enclosed block to the data object. This can only be fetched with the GetNextSym function. If this argument is omitted then the value of the visible data object in the current program execution scope will be set. Continues on next page 1 Instructions 1.154. SetDataVal - Set the value of a data object RobotWare - OS 3HAC 16581-1 Revision: J 438 © Copyright 2004-2010 ABB. All rights reserved. [\TaskRef] Task Reference Data type: taskid The program task identity in which to search for the data object specified. When using this argument, you may search for PERS or TASK PERS declarations in other tasks, any other declarations will result in an error. For all program tasks in the system the predefined variables of the data type taskid will be available. The variable identity will be "taskname"+"Id", e.g. for the T_ROB1 task the variable identity will be T_ROB1Id . [\TaskName] Data type: string The program task name in which to search for the data object specified. When using this argument, you may search for PERS or TASK PERS declarations in other tasks, any other declarations will result in an error. Value Data type: anytype Variable which holds the new value to be set. The data type must be the same as the data type for the data object to be set. The set value must be fetched from a variable but can be stored in a variable or persistent. Error handling The system variable ERRNO is set to ERR_SYM_ACCESS if: • the data object is non-existent • the data object is read-only data • the data object is routine data or routine parameter and not located in the current active routine • searching in other tasks for other declarations then PERS or TASK PERS When using the arguments TaskRef or TaskName you may search for PERS or TASK PERS declarations in other tasks, any other declarations will result in an error and the system variable ERRNO is set to ERR_SYM_ACCESS . Searching for a PERS declared as LOCAL in other tasks will also result in an error and the system variable ERRNO is set to ERR_SYM_ACCESS . The system variable ERRNO is set to ERR_INVDIM if the data object and the variable used in argument Value have different dimensions. The error can be handled in the error handler of the routine. Limitations For a semivalue data type it is not possible to search for the associated value data type. E.g. if searching for dionum then no search hit for signal signaldi will be obtained and if searching for num then no search hit for signals signalgi or signalai will be obtained. It is not possible to set a value to a variable declared as LOCAL in a built-in RAPID module. Continued Continues on next page 1 Instructions 1.154. SetDataVal - Set the value of a data object RobotWare - OS 439 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Syntax SetDataVal [ Object ’:=’ ] < expression ( IN) of string > [’\’Block’ :=’<variable ( VAR ) of datapos>] |[ ’\’TaskRef’ :=’ <variable ( VAR ) of taskid>] |[ ’\’TaskName’ :=’ <expression ( IN ) of string>] ’,’] [ Value ’:=’ ] <variable ( VAR ) of anytype>]’;’ 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 next matching symbol GetNextSym - Get next matching symbol on page 855 Get the value of a data object GetDataVal - Get the value of a data object on page 110 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
441
1 Instructions 1.154. SetDataVal - Set the value of a data object RobotWare - OS 3HAC 16581-1 Revision: J 438 © Copyright 2004-2010 ABB. All rights reserved. [\TaskRef] Task Reference Data type: taskid The program task identity in which to search for the data object specified. When using this argument, you may search for PERS or TASK PERS declarations in other tasks, any other declarations will result in an error. For all program tasks in the system the predefined variables of the data type taskid will be available. The variable identity will be "taskname"+"Id", e.g. for the T_ROB1 task the variable identity will be T_ROB1Id . [\TaskName] Data type: string The program task name in which to search for the data object specified. When using this argument, you may search for PERS or TASK PERS declarations in other tasks, any other declarations will result in an error. Value Data type: anytype Variable which holds the new value to be set. The data type must be the same as the data type for the data object to be set. The set value must be fetched from a variable but can be stored in a variable or persistent. Error handling The system variable ERRNO is set to ERR_SYM_ACCESS if: • the data object is non-existent • the data object is read-only data • the data object is routine data or routine parameter and not located in the current active routine • searching in other tasks for other declarations then PERS or TASK PERS When using the arguments TaskRef or TaskName you may search for PERS or TASK PERS declarations in other tasks, any other declarations will result in an error and the system variable ERRNO is set to ERR_SYM_ACCESS . Searching for a PERS declared as LOCAL in other tasks will also result in an error and the system variable ERRNO is set to ERR_SYM_ACCESS . The system variable ERRNO is set to ERR_INVDIM if the data object and the variable used in argument Value have different dimensions. The error can be handled in the error handler of the routine. Limitations For a semivalue data type it is not possible to search for the associated value data type. E.g. if searching for dionum then no search hit for signal signaldi will be obtained and if searching for num then no search hit for signals signalgi or signalai will be obtained. It is not possible to set a value to a variable declared as LOCAL in a built-in RAPID module. Continued Continues on next page 1 Instructions 1.154. SetDataVal - Set the value of a data object RobotWare - OS 439 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Syntax SetDataVal [ Object ’:=’ ] < expression ( IN) of string > [’\’Block’ :=’<variable ( VAR ) of datapos>] |[ ’\’TaskRef’ :=’ <variable ( VAR ) of taskid>] |[ ’\’TaskName’ :=’ <expression ( IN ) of string>] ’,’] [ Value ’:=’ ] <variable ( VAR ) of anytype>]’;’ 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 next matching symbol GetNextSym - Get next matching symbol on page 855 Get the value of a data object GetDataVal - Get the value of a data object on page 110 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 1 Instructions 1.155. SetDO - Changes the value of a digital output signal RobotWare - OS 3HAC 16581-1 Revision: J 440 © Copyright 2004-2010 ABB. All rights reserved. 1.155. SetDO - Changes the value of a digital output signal Usage SetDO is used to change the value of a digital output signal, with or without a time delay or synchronization. Basic examples Basic examples of the instruction SetDO are illustrated below. Example 1 SetDO do15, 1; The signal do15 is set to 1. Example 2 SetDO weld, off; The signal weld is set to off. Example 3 SetDO \SDelay := 0.2, weld, high; The signal weld is set to high with a delay of 0.2 s. However, program execution continues with the next instruction. Example 4 SetDO \Sync ,do1, 0; The signal do1 is set to 0 . Program execution waits until the signal is physically set to the specified value. Arguments SetDO [ \SDelay ]|[ \Sync ] Signal Value [ \SDelay ] Signal Delay Data type: num Delays the change for the amount of time given in seconds (max. 2000 s). Program execution continues directly with the next instruction. After the given time delay the signal is changed without the rest of the program execution being affected. [ \Sync ] Synchronization Data type: switch If this argument is used then the program execution will wait until the signal is physically set to the specified value. Signal Data type: signaldo The name of the signal to be changed. Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
442
1 Instructions 1.154. SetDataVal - Set the value of a data object RobotWare - OS 439 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Syntax SetDataVal [ Object ’:=’ ] < expression ( IN) of string > [’\’Block’ :=’<variable ( VAR ) of datapos>] |[ ’\’TaskRef’ :=’ <variable ( VAR ) of taskid>] |[ ’\’TaskName’ :=’ <expression ( IN ) of string>] ’,’] [ Value ’:=’ ] <variable ( VAR ) of anytype>]’;’ 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 next matching symbol GetNextSym - Get next matching symbol on page 855 Get the value of a data object GetDataVal - Get the value of a data object on page 110 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 1 Instructions 1.155. SetDO - Changes the value of a digital output signal RobotWare - OS 3HAC 16581-1 Revision: J 440 © Copyright 2004-2010 ABB. All rights reserved. 1.155. SetDO - Changes the value of a digital output signal Usage SetDO is used to change the value of a digital output signal, with or without a time delay or synchronization. Basic examples Basic examples of the instruction SetDO are illustrated below. Example 1 SetDO do15, 1; The signal do15 is set to 1. Example 2 SetDO weld, off; The signal weld is set to off. Example 3 SetDO \SDelay := 0.2, weld, high; The signal weld is set to high with a delay of 0.2 s. However, program execution continues with the next instruction. Example 4 SetDO \Sync ,do1, 0; The signal do1 is set to 0 . Program execution waits until the signal is physically set to the specified value. Arguments SetDO [ \SDelay ]|[ \Sync ] Signal Value [ \SDelay ] Signal Delay Data type: num Delays the change for the amount of time given in seconds (max. 2000 s). Program execution continues directly with the next instruction. After the given time delay the signal is changed without the rest of the program execution being affected. [ \Sync ] Synchronization Data type: switch If this argument is used then the program execution will wait until the signal is physically set to the specified value. Signal Data type: signaldo The name of the signal to be changed. Continues on next page 1 Instructions 1.155. SetDO - Changes the value of a digital output signal RobotWare - OS 441 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Value Data type: dionum The desired value of the signal 0 or 1. Program execution The true value depends on the configuration of the signal. If the signal is inverted in the system parameters then the value of the physical channel is the opposite. If neither of the arguments \SDelay or \Sync are used then the signal will be set as fast as possible, and the next instruction will be executed at once without waiting for the signal to be physically set. Limitations If a SetDO with a \SDelay argument is followed by a new SetDO on the same signal, with or without \SDelay argument, then the first SetDO will be cancelled if the second SetDO is executed before the delay time of the first SetDO have expired. 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. ERR_ARGVALERR if the value for the SDelay argument exceeds the maximum value allowed (2000 s). Syntax SetDO [ ’\’ SDelay ’:=’ < expression ( IN ) of num > ’,’ ] |[ ’\’ Sync ’,’ ] [ Signal ’:=’ ] < variable ( VAR ) of signaldo > ’,’ [ Value ’:=’ ] < expression ( IN ) of dionum > ’;’ Related information Specified Value Set digital output to 0 0 Any value except 0 1 For information about See Input/Output instructions Technical reference manual - RAPID overview , section RAPID Summary - input and output signals Input/Output functionality in general Technical reference manual - RAPID overview , section Motion and I/O Principles - I/O Principles Configuration of I/O Technical reference manual - System parameters Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
443
1 Instructions 1.155. SetDO - Changes the value of a digital output signal RobotWare - OS 3HAC 16581-1 Revision: J 440 © Copyright 2004-2010 ABB. All rights reserved. 1.155. SetDO - Changes the value of a digital output signal Usage SetDO is used to change the value of a digital output signal, with or without a time delay or synchronization. Basic examples Basic examples of the instruction SetDO are illustrated below. Example 1 SetDO do15, 1; The signal do15 is set to 1. Example 2 SetDO weld, off; The signal weld is set to off. Example 3 SetDO \SDelay := 0.2, weld, high; The signal weld is set to high with a delay of 0.2 s. However, program execution continues with the next instruction. Example 4 SetDO \Sync ,do1, 0; The signal do1 is set to 0 . Program execution waits until the signal is physically set to the specified value. Arguments SetDO [ \SDelay ]|[ \Sync ] Signal Value [ \SDelay ] Signal Delay Data type: num Delays the change for the amount of time given in seconds (max. 2000 s). Program execution continues directly with the next instruction. After the given time delay the signal is changed without the rest of the program execution being affected. [ \Sync ] Synchronization Data type: switch If this argument is used then the program execution will wait until the signal is physically set to the specified value. Signal Data type: signaldo The name of the signal to be changed. Continues on next page 1 Instructions 1.155. SetDO - Changes the value of a digital output signal RobotWare - OS 441 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Value Data type: dionum The desired value of the signal 0 or 1. Program execution The true value depends on the configuration of the signal. If the signal is inverted in the system parameters then the value of the physical channel is the opposite. If neither of the arguments \SDelay or \Sync are used then the signal will be set as fast as possible, and the next instruction will be executed at once without waiting for the signal to be physically set. Limitations If a SetDO with a \SDelay argument is followed by a new SetDO on the same signal, with or without \SDelay argument, then the first SetDO will be cancelled if the second SetDO is executed before the delay time of the first SetDO have expired. 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. ERR_ARGVALERR if the value for the SDelay argument exceeds the maximum value allowed (2000 s). Syntax SetDO [ ’\’ SDelay ’:=’ < expression ( IN ) of num > ’,’ ] |[ ’\’ Sync ’,’ ] [ Signal ’:=’ ] < variable ( VAR ) of signaldo > ’,’ [ Value ’:=’ ] < expression ( IN ) of dionum > ’;’ Related information Specified Value Set digital output to 0 0 Any value except 0 1 For information about See Input/Output instructions Technical reference manual - RAPID overview , section RAPID Summary - input and output signals Input/Output functionality in general Technical reference manual - RAPID overview , section Motion and I/O Principles - I/O Principles Configuration of I/O Technical reference manual - System parameters Continued 1 Instructions 1.156. SetGO - Changes the value of a group of digital output signals RobotWare - OS 3HAC 16581-1 Revision: J 442 © Copyright 2004-2010 ABB. All rights reserved. 1.156. SetGO - Changes the value of a group of digital output signals Usage SetGO is used to change the value of a group of digital output signals with or without a time delay. Basic examples Basic examples of the instruction SetGO are illustrated below. Example 1 SetGO go2, 12; The signal go2 is set to 12 . If go2 comprises 4 signals, e.g. outputs 6-9, then outputs 6 and 7 are set to zero while outputs 8 and 9 are set to one. Example 2 SetGO \SDelay := 0.4, go2, 10; The signal go2 is set to 10 . If go2 comprises 4 signals, e.g. outputs 6-9, then outputs 6 and 8 are set to zero while outputs 7 and 9 are set to one with a delay of 0.4 s. However program execution continues with the next instruction. Example 3 SetGO go32, 4294967295; The signal go32 is set to 4294967295 . go32 comprises 32 signals, which are all set to one. Arguments SetGO [ \SDelay ] Signal Value | Dvalue [ \SDelay ] Signal Delay Data type: num Delays the change for the period of time stated in seconds (max. 2000 s). Program execution continues directly with the next instruction. After the specified time delay the value of the signals is changed without the rest of the program execution being affected. If the argument is omitted then the signal values are changed directly. Signal Data type: signalgo The name of the signal group to be changed. Value Data type: num The desired value of the signal group (a positive integer) is shown in the table below. The permitted value is dependent on the number of signals in the group. A num datatype can hold the value for a group of 23 signals or less. Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
444
1 Instructions 1.155. SetDO - Changes the value of a digital output signal RobotWare - OS 441 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Value Data type: dionum The desired value of the signal 0 or 1. Program execution The true value depends on the configuration of the signal. If the signal is inverted in the system parameters then the value of the physical channel is the opposite. If neither of the arguments \SDelay or \Sync are used then the signal will be set as fast as possible, and the next instruction will be executed at once without waiting for the signal to be physically set. Limitations If a SetDO with a \SDelay argument is followed by a new SetDO on the same signal, with or without \SDelay argument, then the first SetDO will be cancelled if the second SetDO is executed before the delay time of the first SetDO have expired. 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. ERR_ARGVALERR if the value for the SDelay argument exceeds the maximum value allowed (2000 s). Syntax SetDO [ ’\’ SDelay ’:=’ < expression ( IN ) of num > ’,’ ] |[ ’\’ Sync ’,’ ] [ Signal ’:=’ ] < variable ( VAR ) of signaldo > ’,’ [ Value ’:=’ ] < expression ( IN ) of dionum > ’;’ Related information Specified Value Set digital output to 0 0 Any value except 0 1 For information about See Input/Output instructions Technical reference manual - RAPID overview , section RAPID Summary - input and output signals Input/Output functionality in general Technical reference manual - RAPID overview , section Motion and I/O Principles - I/O Principles Configuration of I/O Technical reference manual - System parameters Continued 1 Instructions 1.156. SetGO - Changes the value of a group of digital output signals RobotWare - OS 3HAC 16581-1 Revision: J 442 © Copyright 2004-2010 ABB. All rights reserved. 1.156. SetGO - Changes the value of a group of digital output signals Usage SetGO is used to change the value of a group of digital output signals with or without a time delay. Basic examples Basic examples of the instruction SetGO are illustrated below. Example 1 SetGO go2, 12; The signal go2 is set to 12 . If go2 comprises 4 signals, e.g. outputs 6-9, then outputs 6 and 7 are set to zero while outputs 8 and 9 are set to one. Example 2 SetGO \SDelay := 0.4, go2, 10; The signal go2 is set to 10 . If go2 comprises 4 signals, e.g. outputs 6-9, then outputs 6 and 8 are set to zero while outputs 7 and 9 are set to one with a delay of 0.4 s. However program execution continues with the next instruction. Example 3 SetGO go32, 4294967295; The signal go32 is set to 4294967295 . go32 comprises 32 signals, which are all set to one. Arguments SetGO [ \SDelay ] Signal Value | Dvalue [ \SDelay ] Signal Delay Data type: num Delays the change for the period of time stated in seconds (max. 2000 s). Program execution continues directly with the next instruction. After the specified time delay the value of the signals is changed without the rest of the program execution being affected. If the argument is omitted then the signal values are changed directly. Signal Data type: signalgo The name of the signal group to be changed. Value Data type: num The desired value of the signal group (a positive integer) is shown in the table below. The permitted value is dependent on the number of signals in the group. A num datatype can hold the value for a group of 23 signals or less. Continues on next page 1 Instructions 1.156. SetGO - Changes the value of a group of digital output signals RobotWare - OS 443 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Dvalue Data type: dnum The desired value of the signal group (a positive integer) is shown in the table below. The permitted value is dependent on the number of signals in the group. A dnum datatype can hold the value for a group of 32 signals or less. *) The Value argument of type num can only hold up to 23 signals compared to the Dvalue argument of type dnum that can hold up to 32 signals. No. of signals Permitted Value Permitted Dvalue 1 0-1 0-1 2 0-3 0-3 3 0-7 0-7 4 0-15 0-15 5 0-31 0-31 6 0-63 0-63 7 0-127 0-127 8 0-255 0-255 9 0-511 0-511 10 0-1023 0-1023 11 0-2047 0-2047 12 0-4095 0-4095 13 0-8191 0-8191 14 0-16383 0-16383 15 0-32767 0-32767 16 0-65535 0-65535 17 0-131071 0-131071 18 0-262143 0-262143 19 0-524287 0-524287 20 0-1048575 0-1048575 21 0-2097151 0-2097151 22 0-4194303 0-4194303 23 0-8388607 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 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
445
1 Instructions 1.156. SetGO - Changes the value of a group of digital output signals RobotWare - OS 3HAC 16581-1 Revision: J 442 © Copyright 2004-2010 ABB. All rights reserved. 1.156. SetGO - Changes the value of a group of digital output signals Usage SetGO is used to change the value of a group of digital output signals with or without a time delay. Basic examples Basic examples of the instruction SetGO are illustrated below. Example 1 SetGO go2, 12; The signal go2 is set to 12 . If go2 comprises 4 signals, e.g. outputs 6-9, then outputs 6 and 7 are set to zero while outputs 8 and 9 are set to one. Example 2 SetGO \SDelay := 0.4, go2, 10; The signal go2 is set to 10 . If go2 comprises 4 signals, e.g. outputs 6-9, then outputs 6 and 8 are set to zero while outputs 7 and 9 are set to one with a delay of 0.4 s. However program execution continues with the next instruction. Example 3 SetGO go32, 4294967295; The signal go32 is set to 4294967295 . go32 comprises 32 signals, which are all set to one. Arguments SetGO [ \SDelay ] Signal Value | Dvalue [ \SDelay ] Signal Delay Data type: num Delays the change for the period of time stated in seconds (max. 2000 s). Program execution continues directly with the next instruction. After the specified time delay the value of the signals is changed without the rest of the program execution being affected. If the argument is omitted then the signal values are changed directly. Signal Data type: signalgo The name of the signal group to be changed. Value Data type: num The desired value of the signal group (a positive integer) is shown in the table below. The permitted value is dependent on the number of signals in the group. A num datatype can hold the value for a group of 23 signals or less. Continues on next page 1 Instructions 1.156. SetGO - Changes the value of a group of digital output signals RobotWare - OS 443 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Dvalue Data type: dnum The desired value of the signal group (a positive integer) is shown in the table below. The permitted value is dependent on the number of signals in the group. A dnum datatype can hold the value for a group of 32 signals or less. *) The Value argument of type num can only hold up to 23 signals compared to the Dvalue argument of type dnum that can hold up to 32 signals. No. of signals Permitted Value Permitted Dvalue 1 0-1 0-1 2 0-3 0-3 3 0-7 0-7 4 0-15 0-15 5 0-31 0-31 6 0-63 0-63 7 0-127 0-127 8 0-255 0-255 9 0-511 0-511 10 0-1023 0-1023 11 0-2047 0-2047 12 0-4095 0-4095 13 0-8191 0-8191 14 0-16383 0-16383 15 0-32767 0-32767 16 0-65535 0-65535 17 0-131071 0-131071 18 0-262143 0-262143 19 0-524287 0-524287 20 0-1048575 0-1048575 21 0-2097151 0-2097151 22 0-4194303 0-4194303 23 0-8388607 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 Continued Continues on next page 1 Instructions 1.156. SetGO - Changes the value of a group of digital output signals RobotWare - OS 3HAC 16581-1 Revision: J 444 © Copyright 2004-2010 ABB. All rights reserved. Program execution The programmed value is converted to an unsigned binary number. This binary number is sent on the signal group with the result that individual signals in the group are set to 0 or 1. Due to internal delays the value of the signal may be undefined for a short period of time. Limitations Maximum number of signals that can be used for a group is 23 if argument Value is used and 32 if argument Dvalue is used. This limitation is valid for all instructions and functions using group signals. 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. ERR_ARGVALERR if the value for the SDelay argument exceeds the maximum value allowed (2000 s). ERR_GO_LIM if the programmed Value or Dvalue argument for the specified digital group output signal Signal is outside limits. Syntax SetGO [ ’\’ SDelay ’:=’ < expression ( IN ) of num > ’,’ ] [ Signal ’:=’ ] < variable ( VAR ) of signalgo > ’,’ [ Value ’:=’ ] < expression ( IN ) of num > | [ Dvalue’ :=’ ] < expression ( IN ) of dnum > ’;’ Related information For information about See Other 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 (system parameters) 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
446
1 Instructions 1.156. SetGO - Changes the value of a group of digital output signals RobotWare - OS 443 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Dvalue Data type: dnum The desired value of the signal group (a positive integer) is shown in the table below. The permitted value is dependent on the number of signals in the group. A dnum datatype can hold the value for a group of 32 signals or less. *) The Value argument of type num can only hold up to 23 signals compared to the Dvalue argument of type dnum that can hold up to 32 signals. No. of signals Permitted Value Permitted Dvalue 1 0-1 0-1 2 0-3 0-3 3 0-7 0-7 4 0-15 0-15 5 0-31 0-31 6 0-63 0-63 7 0-127 0-127 8 0-255 0-255 9 0-511 0-511 10 0-1023 0-1023 11 0-2047 0-2047 12 0-4095 0-4095 13 0-8191 0-8191 14 0-16383 0-16383 15 0-32767 0-32767 16 0-65535 0-65535 17 0-131071 0-131071 18 0-262143 0-262143 19 0-524287 0-524287 20 0-1048575 0-1048575 21 0-2097151 0-2097151 22 0-4194303 0-4194303 23 0-8388607 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 Continued Continues on next page 1 Instructions 1.156. SetGO - Changes the value of a group of digital output signals RobotWare - OS 3HAC 16581-1 Revision: J 444 © Copyright 2004-2010 ABB. All rights reserved. Program execution The programmed value is converted to an unsigned binary number. This binary number is sent on the signal group with the result that individual signals in the group are set to 0 or 1. Due to internal delays the value of the signal may be undefined for a short period of time. Limitations Maximum number of signals that can be used for a group is 23 if argument Value is used and 32 if argument Dvalue is used. This limitation is valid for all instructions and functions using group signals. 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. ERR_ARGVALERR if the value for the SDelay argument exceeds the maximum value allowed (2000 s). ERR_GO_LIM if the programmed Value or Dvalue argument for the specified digital group output signal Signal is outside limits. Syntax SetGO [ ’\’ SDelay ’:=’ < expression ( IN ) of num > ’,’ ] [ Signal ’:=’ ] < variable ( VAR ) of signalgo > ’,’ [ Value ’:=’ ] < expression ( IN ) of num > | [ Dvalue’ :=’ ] < expression ( IN ) of dnum > ’;’ Related information For information about See Other 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 (system parameters) Technical reference manual - System parameters Continued 1 Instructions 1.157. SetSysData - Set system data RobotWare - OS 445 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.157. SetSysData - Set system data Usage SetSysData activates the specified system data name for the specified data type. With this instruction it is possible to change the current active Tool, Work Object, or PayLoad for the robot in actual or connected motion task. Basic examples Basic examples of the instruction SetSysData are illustrated below. Example 1 SetSysData tool5; The tool tool5 is activated. SetSysData tool0 \ObjectName := "tool6"; The tool tool6 is activated. SetSysData anytool \ObjectName := "tool2"; The tool tool2 is activated. Arguments SetSysData SourceObject [\ObjectName] SourceObject Data type: anytype Persistent variable that should be active as current system data. The data type of this argument also specifies the type of system data to be activated for the robot in actual or connected motion task. Entire array or record component can not be used. [ \ObjectName ] Data type: string If this optional argument is specified then it specifies the name of the data object to be active (overrides name specified in argument SourceObject ). The data type of the data object to be active is always fetched from the argument SourceObject . Program execution The current active system data object for the Tool, Work Object, or PayLoad is set according to the arguments. Note that this instruction only activates a new data object (or the same as before) and never changes the value of any data object. Data type Type of system data tooldata Tool wobjdata Work Object loaddata Payload Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
447
1 Instructions 1.156. SetGO - Changes the value of a group of digital output signals RobotWare - OS 3HAC 16581-1 Revision: J 444 © Copyright 2004-2010 ABB. All rights reserved. Program execution The programmed value is converted to an unsigned binary number. This binary number is sent on the signal group with the result that individual signals in the group are set to 0 or 1. Due to internal delays the value of the signal may be undefined for a short period of time. Limitations Maximum number of signals that can be used for a group is 23 if argument Value is used and 32 if argument Dvalue is used. This limitation is valid for all instructions and functions using group signals. 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. ERR_ARGVALERR if the value for the SDelay argument exceeds the maximum value allowed (2000 s). ERR_GO_LIM if the programmed Value or Dvalue argument for the specified digital group output signal Signal is outside limits. Syntax SetGO [ ’\’ SDelay ’:=’ < expression ( IN ) of num > ’,’ ] [ Signal ’:=’ ] < variable ( VAR ) of signalgo > ’,’ [ Value ’:=’ ] < expression ( IN ) of num > | [ Dvalue’ :=’ ] < expression ( IN ) of dnum > ’;’ Related information For information about See Other 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 (system parameters) Technical reference manual - System parameters Continued 1 Instructions 1.157. SetSysData - Set system data RobotWare - OS 445 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.157. SetSysData - Set system data Usage SetSysData activates the specified system data name for the specified data type. With this instruction it is possible to change the current active Tool, Work Object, or PayLoad for the robot in actual or connected motion task. Basic examples Basic examples of the instruction SetSysData are illustrated below. Example 1 SetSysData tool5; The tool tool5 is activated. SetSysData tool0 \ObjectName := "tool6"; The tool tool6 is activated. SetSysData anytool \ObjectName := "tool2"; The tool tool2 is activated. Arguments SetSysData SourceObject [\ObjectName] SourceObject Data type: anytype Persistent variable that should be active as current system data. The data type of this argument also specifies the type of system data to be activated for the robot in actual or connected motion task. Entire array or record component can not be used. [ \ObjectName ] Data type: string If this optional argument is specified then it specifies the name of the data object to be active (overrides name specified in argument SourceObject ). The data type of the data object to be active is always fetched from the argument SourceObject . Program execution The current active system data object for the Tool, Work Object, or PayLoad is set according to the arguments. Note that this instruction only activates a new data object (or the same as before) and never changes the value of any data object. Data type Type of system data tooldata Tool wobjdata Work Object loaddata Payload Continues on next page 1 Instructions 1.157. SetSysData - Set system data RobotWare - OS 3HAC 16581-1 Revision: J 446 © Copyright 2004-2010 ABB. All rights reserved. Syntax SetSysData [ SourceObject’:=’] < persistent( PERS ) of anytype> [’\’ObjectName’:=’ < expression ( IN ) of string> ] ’;’ Related information For information about See Definition of tools tooldata - Tool data on page 1207 Definition of work objects wobjdata - Work object data on page 1224 Definition of payload loaddata - Load data on page 1132 Get system data GetSysData - Get system data on page 113 Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
448
1 Instructions 1.157. SetSysData - Set system data RobotWare - OS 445 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.157. SetSysData - Set system data Usage SetSysData activates the specified system data name for the specified data type. With this instruction it is possible to change the current active Tool, Work Object, or PayLoad for the robot in actual or connected motion task. Basic examples Basic examples of the instruction SetSysData are illustrated below. Example 1 SetSysData tool5; The tool tool5 is activated. SetSysData tool0 \ObjectName := "tool6"; The tool tool6 is activated. SetSysData anytool \ObjectName := "tool2"; The tool tool2 is activated. Arguments SetSysData SourceObject [\ObjectName] SourceObject Data type: anytype Persistent variable that should be active as current system data. The data type of this argument also specifies the type of system data to be activated for the robot in actual or connected motion task. Entire array or record component can not be used. [ \ObjectName ] Data type: string If this optional argument is specified then it specifies the name of the data object to be active (overrides name specified in argument SourceObject ). The data type of the data object to be active is always fetched from the argument SourceObject . Program execution The current active system data object for the Tool, Work Object, or PayLoad is set according to the arguments. Note that this instruction only activates a new data object (or the same as before) and never changes the value of any data object. Data type Type of system data tooldata Tool wobjdata Work Object loaddata Payload Continues on next page 1 Instructions 1.157. SetSysData - Set system data RobotWare - OS 3HAC 16581-1 Revision: J 446 © Copyright 2004-2010 ABB. All rights reserved. Syntax SetSysData [ SourceObject’:=’] < persistent( PERS ) of anytype> [’\’ObjectName’:=’ < expression ( IN ) of string> ] ’;’ Related information For information about See Definition of tools tooldata - Tool data on page 1207 Definition of work objects wobjdata - Work object data on page 1224 Definition of payload loaddata - Load data on page 1132 Get system data GetSysData - Get system data on page 113 Continued 1 Instructions 1.158. SingArea - Defines interpolation around singular points RobotWare - OS 447 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.158. SingArea - Defines interpolation around singular points Usage SingArea is used to define how the robot is to move in the proximity of singular points. SingArea is also used to define linear and circular interpolation for robots with less than six axes. This instruction can only be used in the main task T_ROB1 or, if in a MultiMove system, in Motion tasks. Basic examples Basic examples of the instruction SingArea are illustrated below. Example 1 SingArea \Wrist; The orientation of the tool may be changed slightly in order to pass a singular point (axes 4 and 6 in line). Robots with less than six axes may not be able to reach an interpolated tool orientation. By using SingArea \Wrist the robot can achieve the movement but the orientation of the tool will be slightly changed. Example 2 SingArea \Off; The tool orientation is not allowed to differ from the programmed orientation. If a singular point is passed then one or more axes may perform a sweeping movement resulting in a reduction in velocity. Robots with less than six axes may not be able to reach a programmed tool orientation. As a result the robot will stop. Arguments SingArea [\Wrist]|[\Off] [ \Wrist ] Data type: switch The tool orientation is allowed to differ somewhat in order to avoid wrist singularity. Used when axes 4 and 6 are parallel (axis 5 at 0 degrees). Also used for linear and circular interpolation of robots with less than six axes where the tool orientation is allowed to differ. [ \Off ] Data type: switch The tool orientation is not allowed to differ. Used when no singular points are passed or when the orientation is not permitted to be changed. If none of the arguments are specified the system will be set to \Off . Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
449
1 Instructions 1.157. SetSysData - Set system data RobotWare - OS 3HAC 16581-1 Revision: J 446 © Copyright 2004-2010 ABB. All rights reserved. Syntax SetSysData [ SourceObject’:=’] < persistent( PERS ) of anytype> [’\’ObjectName’:=’ < expression ( IN ) of string> ] ’;’ Related information For information about See Definition of tools tooldata - Tool data on page 1207 Definition of work objects wobjdata - Work object data on page 1224 Definition of payload loaddata - Load data on page 1132 Get system data GetSysData - Get system data on page 113 Continued 1 Instructions 1.158. SingArea - Defines interpolation around singular points RobotWare - OS 447 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.158. SingArea - Defines interpolation around singular points Usage SingArea is used to define how the robot is to move in the proximity of singular points. SingArea is also used to define linear and circular interpolation for robots with less than six axes. This instruction can only be used in the main task T_ROB1 or, if in a MultiMove system, in Motion tasks. Basic examples Basic examples of the instruction SingArea are illustrated below. Example 1 SingArea \Wrist; The orientation of the tool may be changed slightly in order to pass a singular point (axes 4 and 6 in line). Robots with less than six axes may not be able to reach an interpolated tool orientation. By using SingArea \Wrist the robot can achieve the movement but the orientation of the tool will be slightly changed. Example 2 SingArea \Off; The tool orientation is not allowed to differ from the programmed orientation. If a singular point is passed then one or more axes may perform a sweeping movement resulting in a reduction in velocity. Robots with less than six axes may not be able to reach a programmed tool orientation. As a result the robot will stop. Arguments SingArea [\Wrist]|[\Off] [ \Wrist ] Data type: switch The tool orientation is allowed to differ somewhat in order to avoid wrist singularity. Used when axes 4 and 6 are parallel (axis 5 at 0 degrees). Also used for linear and circular interpolation of robots with less than six axes where the tool orientation is allowed to differ. [ \Off ] Data type: switch The tool orientation is not allowed to differ. Used when no singular points are passed or when the orientation is not permitted to be changed. If none of the arguments are specified the system will be set to \Off . Continues on next page 1 Instructions 1.158. SingArea - Defines interpolation around singular points RobotWare - OS 3HAC 16581-1 Revision: J 448 © Copyright 2004-2010 ABB. All rights reserved. Program execution If the arguments \Wrist is specified then the orientation is joint-interpolated to avoid singular points. In this way the TCP follows the correct path, but the orientation of the tool deviates somewhat. This will also happen when a singular point is not passed. The specified interpolation applies to all subsequent movements until a new SingArea instruction is executed. The movement is only affected on execution of linear or circular interpolation. By default, program execution automatically uses the Off argument for robots with six axes. Robots with less than six axes may use either the Off argument or the /Wrist argument by default. This is automatically set in event routine SYS_RESET . • at a cold start-up. • when a new program is loaded. • when starting program execution from the beginning. Syntax SingArea [ ’\’ Wrist ] | [’\’ Off ] ’;’ Related information For information about See Singularity Technical reference manual - RAPID overview , section Motion and I/O principles - Singularities Interpolation Technical reference manual - RAPID overview , section Motion and I/O principles - Positioning during program execution Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
450
1 Instructions 1.158. SingArea - Defines interpolation around singular points RobotWare - OS 447 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.158. SingArea - Defines interpolation around singular points Usage SingArea is used to define how the robot is to move in the proximity of singular points. SingArea is also used to define linear and circular interpolation for robots with less than six axes. This instruction can only be used in the main task T_ROB1 or, if in a MultiMove system, in Motion tasks. Basic examples Basic examples of the instruction SingArea are illustrated below. Example 1 SingArea \Wrist; The orientation of the tool may be changed slightly in order to pass a singular point (axes 4 and 6 in line). Robots with less than six axes may not be able to reach an interpolated tool orientation. By using SingArea \Wrist the robot can achieve the movement but the orientation of the tool will be slightly changed. Example 2 SingArea \Off; The tool orientation is not allowed to differ from the programmed orientation. If a singular point is passed then one or more axes may perform a sweeping movement resulting in a reduction in velocity. Robots with less than six axes may not be able to reach a programmed tool orientation. As a result the robot will stop. Arguments SingArea [\Wrist]|[\Off] [ \Wrist ] Data type: switch The tool orientation is allowed to differ somewhat in order to avoid wrist singularity. Used when axes 4 and 6 are parallel (axis 5 at 0 degrees). Also used for linear and circular interpolation of robots with less than six axes where the tool orientation is allowed to differ. [ \Off ] Data type: switch The tool orientation is not allowed to differ. Used when no singular points are passed or when the orientation is not permitted to be changed. If none of the arguments are specified the system will be set to \Off . Continues on next page 1 Instructions 1.158. SingArea - Defines interpolation around singular points RobotWare - OS 3HAC 16581-1 Revision: J 448 © Copyright 2004-2010 ABB. All rights reserved. Program execution If the arguments \Wrist is specified then the orientation is joint-interpolated to avoid singular points. In this way the TCP follows the correct path, but the orientation of the tool deviates somewhat. This will also happen when a singular point is not passed. The specified interpolation applies to all subsequent movements until a new SingArea instruction is executed. The movement is only affected on execution of linear or circular interpolation. By default, program execution automatically uses the Off argument for robots with six axes. Robots with less than six axes may use either the Off argument or the /Wrist argument by default. This is automatically set in event routine SYS_RESET . • at a cold start-up. • when a new program is loaded. • when starting program execution from the beginning. Syntax SingArea [ ’\’ Wrist ] | [’\’ Off ] ’;’ Related information For information about See Singularity Technical reference manual - RAPID overview , section Motion and I/O principles - Singularities Interpolation Technical reference manual - RAPID overview , section Motion and I/O principles - Positioning during program execution Continued 1 Instructions 1.159. SkipWarn - Skip the latest warning RobotWare-OS 449 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.159. SkipWarn - Skip the latest warning Usage SkipWarn ( Skip Warning ) is used to skip the latest generated warning message to be stored in the Event Log during execution in running mode continuously or cycle (no warnings skipped in FWD or BWD step). With SkipWarn it is possible to repeatedly do error recovery in RAPID without filling the Event Log with only warning messages. Basic examples Basic examples of the instruction SkipWarn are illustrated below. Example 1 %"notexistingproc"%; nextinstruction; ERROR IF ERRNO = ERR_REFUNKPRC THEN SkipWarn; TRYNEXT; ENDIF ENDPROC The program will execute the nextinstruction and no warning message will be stored in the Event Log. Syntax SkipWarn ’;’ Related information For information about See Error recovery Technical reference manual - RAPID overview , section RAPID Summary - Error Recovery Technical reference manual - RAPID overview , section Basic Characteristics - Error Recovery Error number errnum - Error number on page 1108
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
451
1 Instructions 1.158. SingArea - Defines interpolation around singular points RobotWare - OS 3HAC 16581-1 Revision: J 448 © Copyright 2004-2010 ABB. All rights reserved. Program execution If the arguments \Wrist is specified then the orientation is joint-interpolated to avoid singular points. In this way the TCP follows the correct path, but the orientation of the tool deviates somewhat. This will also happen when a singular point is not passed. The specified interpolation applies to all subsequent movements until a new SingArea instruction is executed. The movement is only affected on execution of linear or circular interpolation. By default, program execution automatically uses the Off argument for robots with six axes. Robots with less than six axes may use either the Off argument or the /Wrist argument by default. This is automatically set in event routine SYS_RESET . • at a cold start-up. • when a new program is loaded. • when starting program execution from the beginning. Syntax SingArea [ ’\’ Wrist ] | [’\’ Off ] ’;’ Related information For information about See Singularity Technical reference manual - RAPID overview , section Motion and I/O principles - Singularities Interpolation Technical reference manual - RAPID overview , section Motion and I/O principles - Positioning during program execution Continued 1 Instructions 1.159. SkipWarn - Skip the latest warning RobotWare-OS 449 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.159. SkipWarn - Skip the latest warning Usage SkipWarn ( Skip Warning ) is used to skip the latest generated warning message to be stored in the Event Log during execution in running mode continuously or cycle (no warnings skipped in FWD or BWD step). With SkipWarn it is possible to repeatedly do error recovery in RAPID without filling the Event Log with only warning messages. Basic examples Basic examples of the instruction SkipWarn are illustrated below. Example 1 %"notexistingproc"%; nextinstruction; ERROR IF ERRNO = ERR_REFUNKPRC THEN SkipWarn; TRYNEXT; ENDIF ENDPROC The program will execute the nextinstruction and no warning message will be stored in the Event Log. Syntax SkipWarn ’;’ Related information For information about See Error recovery Technical reference manual - RAPID overview , section RAPID Summary - Error Recovery Technical reference manual - RAPID overview , section Basic Characteristics - Error Recovery Error number errnum - Error number on page 1108 1 Instructions 1.160. SocketAccept - Accept an incoming connection Socket Messaging 3HAC 16581-1 Revision: J 450 © Copyright 2004-2010 ABB. All rights reserved. 1.160. SocketAccept - Accept an incoming connection Usage SocketAccept is used to accept incoming connection requests. SocketAccept can only be used for server applications. Basic examples Basic examples of the instruction SocketAccept are illustrated below. See also More examples on page 451 . Example 1 VAR socketdev server_socket; VAR socketdev client_socket; ... SocketCreate server_socket; SocketBind server_socket,"192.168.0.1", 1025; SocketListen server_socket; SocketAccept server_socket, client_socket; A server socket is created and bound to port 1025 on the controller network address 192.168.0.1 . After execution of SocketListen the server socket starts to listen for incoming connections on this port and address. SocketAccept waits for any incoming connections, accepts the connection request, and returns a client socket for the established connection. Arguments SocketAccept Socket ClientSocket [\ClientAddress] [ \Time ] Socket Data type: socketdev The server sockets that are waiting for incoming connections. The socket must already be created, bounded, and ready for listening. ClientSocket Data type: socketdev The returned new client socket that will be updated with the accepted incoming connection request. [\ClientAddress] Data type: string The variable that will be updated with the IP-address of the accepted incoming connection request. Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
452
1 Instructions 1.159. SkipWarn - Skip the latest warning RobotWare-OS 449 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.159. SkipWarn - Skip the latest warning Usage SkipWarn ( Skip Warning ) is used to skip the latest generated warning message to be stored in the Event Log during execution in running mode continuously or cycle (no warnings skipped in FWD or BWD step). With SkipWarn it is possible to repeatedly do error recovery in RAPID without filling the Event Log with only warning messages. Basic examples Basic examples of the instruction SkipWarn are illustrated below. Example 1 %"notexistingproc"%; nextinstruction; ERROR IF ERRNO = ERR_REFUNKPRC THEN SkipWarn; TRYNEXT; ENDIF ENDPROC The program will execute the nextinstruction and no warning message will be stored in the Event Log. Syntax SkipWarn ’;’ Related information For information about See Error recovery Technical reference manual - RAPID overview , section RAPID Summary - Error Recovery Technical reference manual - RAPID overview , section Basic Characteristics - Error Recovery Error number errnum - Error number on page 1108 1 Instructions 1.160. SocketAccept - Accept an incoming connection Socket Messaging 3HAC 16581-1 Revision: J 450 © Copyright 2004-2010 ABB. All rights reserved. 1.160. SocketAccept - Accept an incoming connection Usage SocketAccept is used to accept incoming connection requests. SocketAccept can only be used for server applications. Basic examples Basic examples of the instruction SocketAccept are illustrated below. See also More examples on page 451 . Example 1 VAR socketdev server_socket; VAR socketdev client_socket; ... SocketCreate server_socket; SocketBind server_socket,"192.168.0.1", 1025; SocketListen server_socket; SocketAccept server_socket, client_socket; A server socket is created and bound to port 1025 on the controller network address 192.168.0.1 . After execution of SocketListen the server socket starts to listen for incoming connections on this port and address. SocketAccept waits for any incoming connections, accepts the connection request, and returns a client socket for the established connection. Arguments SocketAccept Socket ClientSocket [\ClientAddress] [ \Time ] Socket Data type: socketdev The server sockets that are waiting for incoming connections. The socket must already be created, bounded, and ready for listening. ClientSocket Data type: socketdev The returned new client socket that will be updated with the accepted incoming connection request. [\ClientAddress] Data type: string The variable that will be updated with the IP-address of the accepted incoming connection request. Continues on next page 1 Instructions 1.160. SocketAccept - Accept an incoming connection Socket Messaging 451 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. [\Time] Data type: num The maximum amount of time [s] that program execution waits for incoming connections. If this time runs out before any incoming connection then the error handler will be called, if there is one, with the error code ERR_SOCK_TIMEOUT . If there is no error handler then the execution will be stopped. If parameter \Time is not used then the waiting time is 60 s. To wait forever, use the predefined constant WAIT_MAX . Program execution The server socket will wait for any incoming connection requests. When accepting the incoming connection request the instruction is ready and the returned client socket is by default connected and can be used in SocketSend and SocketReceive instructions. More examples More examples of the instruction SocketAccept are illustrated below. Example 1 VAR socketdev server_socket; VAR socketdev client_socket; VAR string receive_string; VAR string client_ip; ... SocketCreate server_socket; SocketBind server_socket, "192.168.0.1", 1025; SocketListen server_socket; WHILE TRUE DO SocketAccept server_socket, client_socket \ClientAddress:=client_ip; SocketReceive client_socket \Str := receive_string; SocketSend client_socket \Str := "Hello client with ip-address " +client_ip; ! Wait for client acknowledge ... SocketClose client_socket; ENDWHILE ERROR RETRY; UNDO SocketClose server_socket; SocketClose client_socket; A server socket is created and bound to port 1025 on the controller network address 192.168.0.1 . After execution of SocketListen the server socket starts to listen for incoming connections on this port and address. SocketAccept will accept the incoming connection from some client and store the client address in the string client_ip . Then the server receives a string message from the client and stores the message in receive_string . Then the server responds with the message " Hello client with ip-address xxx.xxx.x.x" and closes the client connection. 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
453
1 Instructions 1.160. SocketAccept - Accept an incoming connection Socket Messaging 3HAC 16581-1 Revision: J 450 © Copyright 2004-2010 ABB. All rights reserved. 1.160. SocketAccept - Accept an incoming connection Usage SocketAccept is used to accept incoming connection requests. SocketAccept can only be used for server applications. Basic examples Basic examples of the instruction SocketAccept are illustrated below. See also More examples on page 451 . Example 1 VAR socketdev server_socket; VAR socketdev client_socket; ... SocketCreate server_socket; SocketBind server_socket,"192.168.0.1", 1025; SocketListen server_socket; SocketAccept server_socket, client_socket; A server socket is created and bound to port 1025 on the controller network address 192.168.0.1 . After execution of SocketListen the server socket starts to listen for incoming connections on this port and address. SocketAccept waits for any incoming connections, accepts the connection request, and returns a client socket for the established connection. Arguments SocketAccept Socket ClientSocket [\ClientAddress] [ \Time ] Socket Data type: socketdev The server sockets that are waiting for incoming connections. The socket must already be created, bounded, and ready for listening. ClientSocket Data type: socketdev The returned new client socket that will be updated with the accepted incoming connection request. [\ClientAddress] Data type: string The variable that will be updated with the IP-address of the accepted incoming connection request. Continues on next page 1 Instructions 1.160. SocketAccept - Accept an incoming connection Socket Messaging 451 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. [\Time] Data type: num The maximum amount of time [s] that program execution waits for incoming connections. If this time runs out before any incoming connection then the error handler will be called, if there is one, with the error code ERR_SOCK_TIMEOUT . If there is no error handler then the execution will be stopped. If parameter \Time is not used then the waiting time is 60 s. To wait forever, use the predefined constant WAIT_MAX . Program execution The server socket will wait for any incoming connection requests. When accepting the incoming connection request the instruction is ready and the returned client socket is by default connected and can be used in SocketSend and SocketReceive instructions. More examples More examples of the instruction SocketAccept are illustrated below. Example 1 VAR socketdev server_socket; VAR socketdev client_socket; VAR string receive_string; VAR string client_ip; ... SocketCreate server_socket; SocketBind server_socket, "192.168.0.1", 1025; SocketListen server_socket; WHILE TRUE DO SocketAccept server_socket, client_socket \ClientAddress:=client_ip; SocketReceive client_socket \Str := receive_string; SocketSend client_socket \Str := "Hello client with ip-address " +client_ip; ! Wait for client acknowledge ... SocketClose client_socket; ENDWHILE ERROR RETRY; UNDO SocketClose server_socket; SocketClose client_socket; A server socket is created and bound to port 1025 on the controller network address 192.168.0.1 . After execution of SocketListen the server socket starts to listen for incoming connections on this port and address. SocketAccept will accept the incoming connection from some client and store the client address in the string client_ip . Then the server receives a string message from the client and stores the message in receive_string . Then the server responds with the message " Hello client with ip-address xxx.xxx.x.x" and closes the client connection. Continued Continues on next page 1 Instructions 1.160. SocketAccept - Accept an incoming connection Socket Messaging 3HAC 16581-1 Revision: J 452 © Copyright 2004-2010 ABB. All rights reserved. After that the server is ready for a connection from the same or some other client in the WHILE loop. If PP is moved to main in the program then all open sockets are closed ( SocketClose can always be done even if the socket is not created). 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 SocketAccept [ Socket ´:=´ ] < variable ( VAR ) of socketdev > ’,’ [ ClientSocket ´:=´ ] < variable ( VAR ) of socketdev > [ ’\’ ClientAddress ´:=´ < variable ( VAR ) of string> ] [ ’\’ Time ´:=´ < expression ( IN ) of num > ] ’;’ Related information ERR_SOCK_CLOSED The socket is closed (has been closed or is not created). Use SocketCreate to create a new socket. ERR_SOCK_TIMEOUT The connection was not established within the time out time For information about See Socket communication in general Application manual - Robot communication and I/ O control , section Socket Messaging Create a new socket SocketCreate - Create a new socket on page 460 Connect to remote computer (only client) SocketConnect - Connect to a remote computer on page 457 Send data to remote computer SocketSend - Send data to remote computer on page 469 Receive data from remote computer SocketReceive - Receive data from remote computer on page 464 Close the socket SocketClose - Close a socket on page 455 Bind a socket (only server) SocketBind - Bind a socket to my IP-address and port on page 453 Listening connections (only server) SocketListen - Listen for incoming connections on page 462 Get current socket state SocketGetStatus - Get current socket state on page 973 Example client socket application SocketSend - Send data to remote computer on page 469 Example of server socket application SocketReceive - Receive data from remote computer on page 464 Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
454
1 Instructions 1.160. SocketAccept - Accept an incoming connection Socket Messaging 451 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. [\Time] Data type: num The maximum amount of time [s] that program execution waits for incoming connections. If this time runs out before any incoming connection then the error handler will be called, if there is one, with the error code ERR_SOCK_TIMEOUT . If there is no error handler then the execution will be stopped. If parameter \Time is not used then the waiting time is 60 s. To wait forever, use the predefined constant WAIT_MAX . Program execution The server socket will wait for any incoming connection requests. When accepting the incoming connection request the instruction is ready and the returned client socket is by default connected and can be used in SocketSend and SocketReceive instructions. More examples More examples of the instruction SocketAccept are illustrated below. Example 1 VAR socketdev server_socket; VAR socketdev client_socket; VAR string receive_string; VAR string client_ip; ... SocketCreate server_socket; SocketBind server_socket, "192.168.0.1", 1025; SocketListen server_socket; WHILE TRUE DO SocketAccept server_socket, client_socket \ClientAddress:=client_ip; SocketReceive client_socket \Str := receive_string; SocketSend client_socket \Str := "Hello client with ip-address " +client_ip; ! Wait for client acknowledge ... SocketClose client_socket; ENDWHILE ERROR RETRY; UNDO SocketClose server_socket; SocketClose client_socket; A server socket is created and bound to port 1025 on the controller network address 192.168.0.1 . After execution of SocketListen the server socket starts to listen for incoming connections on this port and address. SocketAccept will accept the incoming connection from some client and store the client address in the string client_ip . Then the server receives a string message from the client and stores the message in receive_string . Then the server responds with the message " Hello client with ip-address xxx.xxx.x.x" and closes the client connection. Continued Continues on next page 1 Instructions 1.160. SocketAccept - Accept an incoming connection Socket Messaging 3HAC 16581-1 Revision: J 452 © Copyright 2004-2010 ABB. All rights reserved. After that the server is ready for a connection from the same or some other client in the WHILE loop. If PP is moved to main in the program then all open sockets are closed ( SocketClose can always be done even if the socket is not created). 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 SocketAccept [ Socket ´:=´ ] < variable ( VAR ) of socketdev > ’,’ [ ClientSocket ´:=´ ] < variable ( VAR ) of socketdev > [ ’\’ ClientAddress ´:=´ < variable ( VAR ) of string> ] [ ’\’ Time ´:=´ < expression ( IN ) of num > ] ’;’ Related information ERR_SOCK_CLOSED The socket is closed (has been closed or is not created). Use SocketCreate to create a new socket. ERR_SOCK_TIMEOUT The connection was not established within the time out time For information about See Socket communication in general Application manual - Robot communication and I/ O control , section Socket Messaging Create a new socket SocketCreate - Create a new socket on page 460 Connect to remote computer (only client) SocketConnect - Connect to a remote computer on page 457 Send data to remote computer SocketSend - Send data to remote computer on page 469 Receive data from remote computer SocketReceive - Receive data from remote computer on page 464 Close the socket SocketClose - Close a socket on page 455 Bind a socket (only server) SocketBind - Bind a socket to my IP-address and port on page 453 Listening connections (only server) SocketListen - Listen for incoming connections on page 462 Get current socket state SocketGetStatus - Get current socket state on page 973 Example client socket application SocketSend - Send data to remote computer on page 469 Example of server socket application SocketReceive - Receive data from remote computer on page 464 Continued 1 Instructions 1.161. SocketBind - Bind a socket to my IP-address and port Socket Messaging 453 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.161. SocketBind - Bind a socket to my IP-address and port Usage SocketBind is used to bind a socket to the specified server IP-address and port number. SocketBind can only be used for server applications. Basic examples Basic examples of the instruction SocketBind are illustrated below. Example 1 VAR socketdev server_socket; SocketCreate server_socket; SocketBind server_socket, "192.168.0.1", 1025; A server socket is created and bound to port 1025 on the controller network address 192.168.0.1 . The server socket can now be used in an SocketListen instruction to listen for incoming connections on this port and address. Arguments SocketBind Socket LocalAddress LocalPort Socket Data type: socketdev The server socket to bind. The socket must be created but not already bound. LocalAddress Data type: string The server network address to bind the socket to. The only valid addresses are any public LAN addresses or the controller service port address 192.168.125.1. LocalPort Data type: num The server port number to bind the socket to. Generally ports 1025-4999 are free to use. Ports below 1025 can already be taken. Program execution The server socked is bound to the specified server port and IP-address. An error is generated if the specified port is already in use. Use the SocketBind and SocketListen instructions in the startup of the program to associate a local address with a socket and then listen for incoming connections on the specified port. This is recommended to do only once for each socket and port that 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
455
1 Instructions 1.160. SocketAccept - Accept an incoming connection Socket Messaging 3HAC 16581-1 Revision: J 452 © Copyright 2004-2010 ABB. All rights reserved. After that the server is ready for a connection from the same or some other client in the WHILE loop. If PP is moved to main in the program then all open sockets are closed ( SocketClose can always be done even if the socket is not created). 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 SocketAccept [ Socket ´:=´ ] < variable ( VAR ) of socketdev > ’,’ [ ClientSocket ´:=´ ] < variable ( VAR ) of socketdev > [ ’\’ ClientAddress ´:=´ < variable ( VAR ) of string> ] [ ’\’ Time ´:=´ < expression ( IN ) of num > ] ’;’ Related information ERR_SOCK_CLOSED The socket is closed (has been closed or is not created). Use SocketCreate to create a new socket. ERR_SOCK_TIMEOUT The connection was not established within the time out time For information about See Socket communication in general Application manual - Robot communication and I/ O control , section Socket Messaging Create a new socket SocketCreate - Create a new socket on page 460 Connect to remote computer (only client) SocketConnect - Connect to a remote computer on page 457 Send data to remote computer SocketSend - Send data to remote computer on page 469 Receive data from remote computer SocketReceive - Receive data from remote computer on page 464 Close the socket SocketClose - Close a socket on page 455 Bind a socket (only server) SocketBind - Bind a socket to my IP-address and port on page 453 Listening connections (only server) SocketListen - Listen for incoming connections on page 462 Get current socket state SocketGetStatus - Get current socket state on page 973 Example client socket application SocketSend - Send data to remote computer on page 469 Example of server socket application SocketReceive - Receive data from remote computer on page 464 Continued 1 Instructions 1.161. SocketBind - Bind a socket to my IP-address and port Socket Messaging 453 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.161. SocketBind - Bind a socket to my IP-address and port Usage SocketBind is used to bind a socket to the specified server IP-address and port number. SocketBind can only be used for server applications. Basic examples Basic examples of the instruction SocketBind are illustrated below. Example 1 VAR socketdev server_socket; SocketCreate server_socket; SocketBind server_socket, "192.168.0.1", 1025; A server socket is created and bound to port 1025 on the controller network address 192.168.0.1 . The server socket can now be used in an SocketListen instruction to listen for incoming connections on this port and address. Arguments SocketBind Socket LocalAddress LocalPort Socket Data type: socketdev The server socket to bind. The socket must be created but not already bound. LocalAddress Data type: string The server network address to bind the socket to. The only valid addresses are any public LAN addresses or the controller service port address 192.168.125.1. LocalPort Data type: num The server port number to bind the socket to. Generally ports 1025-4999 are free to use. Ports below 1025 can already be taken. Program execution The server socked is bound to the specified server port and IP-address. An error is generated if the specified port is already in use. Use the SocketBind and SocketListen instructions in the startup of the program to associate a local address with a socket and then listen for incoming connections on the specified port. This is recommended to do only once for each socket and port that is used. Continues on next page 1 Instructions 1.161. SocketBind - Bind a socket to my IP-address and port Socket Messaging 3HAC 16581-1 Revision: J 454 © 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 SocketBind [ Socket ´:=´ ] < variable ( VAR ) of socketdev > ’,’ [ LocalAddress ´:=´ ] < expression ( IN ) of string > ’,’ [ LocalPort ´:=´ ] < expression ( IN ) of num > ’;’ Related information ERR_SOCK_CLOSED The socket is closed (has been closed or is not created) Use SocketCreate to create a new socket. ERR_SOCK_ADDR_INUSE The address and port is already in use and can not be used again. Use a different port number.. For information about See Socket communication in general Application manual - Robot communication and I/ O control , section Socket Messaging Create a new socket SocketCreate - Create a new socket on page 460 Connect to remote computer (only client) SocketConnect - Connect to a remote computer on page 457 Send data to remote computer SocketSend - Send data to remote computer on page 469 Receive data from remote computer SocketReceive - Receive data from remote computer on page 464 Close the socket SocketClose - Close a socket on page 455 Listening connections (only server) SocketListen - Listen for incoming connections on page 462 Accept connections (only server) SocketAccept - Accept an incoming connection on page 450 Get current socket state SocketGetStatus - Get current socket state on page 973 Example client socket application SocketSend - Send data to remote computer on page 469 Example server socket application SocketReceive - Receive data from remote computer on page 464 Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
456
1 Instructions 1.161. SocketBind - Bind a socket to my IP-address and port Socket Messaging 453 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.161. SocketBind - Bind a socket to my IP-address and port Usage SocketBind is used to bind a socket to the specified server IP-address and port number. SocketBind can only be used for server applications. Basic examples Basic examples of the instruction SocketBind are illustrated below. Example 1 VAR socketdev server_socket; SocketCreate server_socket; SocketBind server_socket, "192.168.0.1", 1025; A server socket is created and bound to port 1025 on the controller network address 192.168.0.1 . The server socket can now be used in an SocketListen instruction to listen for incoming connections on this port and address. Arguments SocketBind Socket LocalAddress LocalPort Socket Data type: socketdev The server socket to bind. The socket must be created but not already bound. LocalAddress Data type: string The server network address to bind the socket to. The only valid addresses are any public LAN addresses or the controller service port address 192.168.125.1. LocalPort Data type: num The server port number to bind the socket to. Generally ports 1025-4999 are free to use. Ports below 1025 can already be taken. Program execution The server socked is bound to the specified server port and IP-address. An error is generated if the specified port is already in use. Use the SocketBind and SocketListen instructions in the startup of the program to associate a local address with a socket and then listen for incoming connections on the specified port. This is recommended to do only once for each socket and port that is used. Continues on next page 1 Instructions 1.161. SocketBind - Bind a socket to my IP-address and port Socket Messaging 3HAC 16581-1 Revision: J 454 © 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 SocketBind [ Socket ´:=´ ] < variable ( VAR ) of socketdev > ’,’ [ LocalAddress ´:=´ ] < expression ( IN ) of string > ’,’ [ LocalPort ´:=´ ] < expression ( IN ) of num > ’;’ Related information ERR_SOCK_CLOSED The socket is closed (has been closed or is not created) Use SocketCreate to create a new socket. ERR_SOCK_ADDR_INUSE The address and port is already in use and can not be used again. Use a different port number.. For information about See Socket communication in general Application manual - Robot communication and I/ O control , section Socket Messaging Create a new socket SocketCreate - Create a new socket on page 460 Connect to remote computer (only client) SocketConnect - Connect to a remote computer on page 457 Send data to remote computer SocketSend - Send data to remote computer on page 469 Receive data from remote computer SocketReceive - Receive data from remote computer on page 464 Close the socket SocketClose - Close a socket on page 455 Listening connections (only server) SocketListen - Listen for incoming connections on page 462 Accept connections (only server) SocketAccept - Accept an incoming connection on page 450 Get current socket state SocketGetStatus - Get current socket state on page 973 Example client socket application SocketSend - Send data to remote computer on page 469 Example server socket application SocketReceive - Receive data from remote computer on page 464 Continued 1 Instructions 1.162. SocketClose - Close a socket Socket Messaging 455 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.162. SocketClose - Close a socket Usage SocketClose is used when a socket connection is no longer going to be used. After a socket has been closed it cannot be used in any socket call except SocketCreate . Basic examples Basic examples of the instruction SocketClose are illustrated below. Example 1 SocketClose socket1; The socket is closed and can not be used anymore. Arguments SocketClose Socket Socket Data type: socketdev The socket to be closed. Program execution The socket will be closed and its allocated resources will be released. Any socket can be closed at any time. The socket can not be used after closing. However it can be reused for a new connection after a call to SocketCreate . Limitations Closing the socket connection immediately after sending the data with SocketSend can lead to loss of sent data. This is because TCP/IP socket has built-in functionality to resend the data if there is some communication problem. To avoid such problems with loss of data, do the following before SocketClose : • handshake the shutdown or • WaitTime 2 Avoid fast loops with SocketCreate ... SocketClose , because the socket is not really closed until a certain time (TCP/IP functionality). Syntax SocketClose [ Socket ’:=’ ] < variable ( VAR ) of socketdev > ’;’ Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
457
1 Instructions 1.161. SocketBind - Bind a socket to my IP-address and port Socket Messaging 3HAC 16581-1 Revision: J 454 © 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 SocketBind [ Socket ´:=´ ] < variable ( VAR ) of socketdev > ’,’ [ LocalAddress ´:=´ ] < expression ( IN ) of string > ’,’ [ LocalPort ´:=´ ] < expression ( IN ) of num > ’;’ Related information ERR_SOCK_CLOSED The socket is closed (has been closed or is not created) Use SocketCreate to create a new socket. ERR_SOCK_ADDR_INUSE The address and port is already in use and can not be used again. Use a different port number.. For information about See Socket communication in general Application manual - Robot communication and I/ O control , section Socket Messaging Create a new socket SocketCreate - Create a new socket on page 460 Connect to remote computer (only client) SocketConnect - Connect to a remote computer on page 457 Send data to remote computer SocketSend - Send data to remote computer on page 469 Receive data from remote computer SocketReceive - Receive data from remote computer on page 464 Close the socket SocketClose - Close a socket on page 455 Listening connections (only server) SocketListen - Listen for incoming connections on page 462 Accept connections (only server) SocketAccept - Accept an incoming connection on page 450 Get current socket state SocketGetStatus - Get current socket state on page 973 Example client socket application SocketSend - Send data to remote computer on page 469 Example server socket application SocketReceive - Receive data from remote computer on page 464 Continued 1 Instructions 1.162. SocketClose - Close a socket Socket Messaging 455 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.162. SocketClose - Close a socket Usage SocketClose is used when a socket connection is no longer going to be used. After a socket has been closed it cannot be used in any socket call except SocketCreate . Basic examples Basic examples of the instruction SocketClose are illustrated below. Example 1 SocketClose socket1; The socket is closed and can not be used anymore. Arguments SocketClose Socket Socket Data type: socketdev The socket to be closed. Program execution The socket will be closed and its allocated resources will be released. Any socket can be closed at any time. The socket can not be used after closing. However it can be reused for a new connection after a call to SocketCreate . Limitations Closing the socket connection immediately after sending the data with SocketSend can lead to loss of sent data. This is because TCP/IP socket has built-in functionality to resend the data if there is some communication problem. To avoid such problems with loss of data, do the following before SocketClose : • handshake the shutdown or • WaitTime 2 Avoid fast loops with SocketCreate ... SocketClose , because the socket is not really closed until a certain time (TCP/IP functionality). Syntax SocketClose [ Socket ’:=’ ] < variable ( VAR ) of socketdev > ’;’ Continues on next page 1 Instructions 1.162. SocketClose - Close a socket Socket Messaging 3HAC 16581-1 Revision: J 456 © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Socket communication in general Application manual - Robot communication and I/ O control , section Socket Messaging Create a new socket SocketCreate - Create a new socket on page 460 Connect to a remote computer (only client) SocketConnect - Connect to a remote computer on page 457 Send data to remote computer SocketSend - Send data to remote computer on page 469 Receive data from remote computer SocketReceive - Receive data from remote computer on page 464 Bind a socket (only server) SocketBind - Bind a socket to my IP-address and port on page 453 Listening connections (only server) SocketListen - Listen for incoming connections on page 462 Accept connections (only server) SocketAccept - Accept an incoming connection on page 450 t Get current socket state SocketGetStatus - Get current socket state on page 973 Example client socket application SocketSend - Send data to remote computer on page 469 Example server socket application SocketReceive - Receive data from remote computer on page 464 Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
458
1 Instructions 1.162. SocketClose - Close a socket Socket Messaging 455 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.162. SocketClose - Close a socket Usage SocketClose is used when a socket connection is no longer going to be used. After a socket has been closed it cannot be used in any socket call except SocketCreate . Basic examples Basic examples of the instruction SocketClose are illustrated below. Example 1 SocketClose socket1; The socket is closed and can not be used anymore. Arguments SocketClose Socket Socket Data type: socketdev The socket to be closed. Program execution The socket will be closed and its allocated resources will be released. Any socket can be closed at any time. The socket can not be used after closing. However it can be reused for a new connection after a call to SocketCreate . Limitations Closing the socket connection immediately after sending the data with SocketSend can lead to loss of sent data. This is because TCP/IP socket has built-in functionality to resend the data if there is some communication problem. To avoid such problems with loss of data, do the following before SocketClose : • handshake the shutdown or • WaitTime 2 Avoid fast loops with SocketCreate ... SocketClose , because the socket is not really closed until a certain time (TCP/IP functionality). Syntax SocketClose [ Socket ’:=’ ] < variable ( VAR ) of socketdev > ’;’ Continues on next page 1 Instructions 1.162. SocketClose - Close a socket Socket Messaging 3HAC 16581-1 Revision: J 456 © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Socket communication in general Application manual - Robot communication and I/ O control , section Socket Messaging Create a new socket SocketCreate - Create a new socket on page 460 Connect to a remote computer (only client) SocketConnect - Connect to a remote computer on page 457 Send data to remote computer SocketSend - Send data to remote computer on page 469 Receive data from remote computer SocketReceive - Receive data from remote computer on page 464 Bind a socket (only server) SocketBind - Bind a socket to my IP-address and port on page 453 Listening connections (only server) SocketListen - Listen for incoming connections on page 462 Accept connections (only server) SocketAccept - Accept an incoming connection on page 450 t Get current socket state SocketGetStatus - Get current socket state on page 973 Example client socket application SocketSend - Send data to remote computer on page 469 Example server socket application SocketReceive - Receive data from remote computer on page 464 Continued 1 Instructions 1.163. SocketConnect - Connect to a remote computer Socket Messaging 457 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.163. SocketConnect - Connect to a remote computer Usage SocketConnect is used to connect the socket to a remote computer in a client application. Basic examples Basic examples of the instruction SocketConnect are illustrated below. See also More examples on page 458 . Example 1 SocketConnect socket1, "192.168.0.1", 1025; Trying to connect to a remote computer at ip-address 192.168.0.1 and port 1025 . Arguments SocketConnect Socket Address Port [\Time] Socket Data type: socketdev The client socket to connect. The socket must be created but not already connected. Address Data type: string The address of the remote computer. The remote computer must be specified as an IP address. It is not possible to use the name of the remote computer. Port Data type: num The port on the remote computer. Generally ports 1025-4999 are free to use. Ports below 1025 can already be taken. [ \Time ] Data type: num The maximum amount of time [s] that program execution waits for the connection to be accepted or denied. If this time runs out before the condition is met then the error handler will be called, if there is one, with the error code ERR_SOCK_TIMEOUT . If there is no error handler then the execution will be stopped. If parameter \Time is not used the waiting time is 60 s. To wait forever, use the predefined constant WAIT_MAX . Program execution The socket tries to connect to the remote computer on the specified address and port. The program execution will wait until the connection is established, failed, or a timeout occurs. Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
459
1 Instructions 1.162. SocketClose - Close a socket Socket Messaging 3HAC 16581-1 Revision: J 456 © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Socket communication in general Application manual - Robot communication and I/ O control , section Socket Messaging Create a new socket SocketCreate - Create a new socket on page 460 Connect to a remote computer (only client) SocketConnect - Connect to a remote computer on page 457 Send data to remote computer SocketSend - Send data to remote computer on page 469 Receive data from remote computer SocketReceive - Receive data from remote computer on page 464 Bind a socket (only server) SocketBind - Bind a socket to my IP-address and port on page 453 Listening connections (only server) SocketListen - Listen for incoming connections on page 462 Accept connections (only server) SocketAccept - Accept an incoming connection on page 450 t Get current socket state SocketGetStatus - Get current socket state on page 973 Example client socket application SocketSend - Send data to remote computer on page 469 Example server socket application SocketReceive - Receive data from remote computer on page 464 Continued 1 Instructions 1.163. SocketConnect - Connect to a remote computer Socket Messaging 457 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.163. SocketConnect - Connect to a remote computer Usage SocketConnect is used to connect the socket to a remote computer in a client application. Basic examples Basic examples of the instruction SocketConnect are illustrated below. See also More examples on page 458 . Example 1 SocketConnect socket1, "192.168.0.1", 1025; Trying to connect to a remote computer at ip-address 192.168.0.1 and port 1025 . Arguments SocketConnect Socket Address Port [\Time] Socket Data type: socketdev The client socket to connect. The socket must be created but not already connected. Address Data type: string The address of the remote computer. The remote computer must be specified as an IP address. It is not possible to use the name of the remote computer. Port Data type: num The port on the remote computer. Generally ports 1025-4999 are free to use. Ports below 1025 can already be taken. [ \Time ] Data type: num The maximum amount of time [s] that program execution waits for the connection to be accepted or denied. If this time runs out before the condition is met then the error handler will be called, if there is one, with the error code ERR_SOCK_TIMEOUT . If there is no error handler then the execution will be stopped. If parameter \Time is not used the waiting time is 60 s. To wait forever, use the predefined constant WAIT_MAX . Program execution The socket tries to connect to the remote computer on the specified address and port. The program execution will wait until the connection is established, failed, or a timeout occurs. Continues on next page 1 Instructions 1.163. SocketConnect - Connect to a remote computer Socket Messaging 3HAC 16581-1 Revision: J 458 © Copyright 2004-2010 ABB. All rights reserved. More examples More examples of the instruction SocketConnect are illustrated below. Example 1 VAR num retry_no := 0; VAR socketdev my_socket; ... SocketCreate my_socket; SocketConnect my_socket, "192.168.0.1", 1025; ... ERROR IF ERRNO = ERR_SOCK_TIMEOUT THEN IF retry_no < 5 THEN WaitTime 1; retry_no := retry_no + 1; RETRY; ELSE RAISE; ENDIF ENDIF A socket is created and tries to connect to a remote computer. If the connection is not established within the default time-out time, i.e. 60 seconds, then the error handler retries to connect. Four retries are attemped then the error is reported to the user. 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 SocketConnect [ Socket ´:=´ ] < variable ( VAR ) of socketdev > ’,’ [ Address ´:=´ ] < expression ( IN ) of string > ’,’ [ Port ´:=´ ] < expression ( IN ) of num > [ ’\’ Time ´:=´ < expression ( IN ) of num > ] ’;’ ERR_SOCK_CLOSED The socket is closed (has been closed or is not created). Use SocketCreate to create a new socket. ERR_SOCK_TIMEOUT The connection was not established within the time-out time. 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
460
1 Instructions 1.163. SocketConnect - Connect to a remote computer Socket Messaging 457 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.163. SocketConnect - Connect to a remote computer Usage SocketConnect is used to connect the socket to a remote computer in a client application. Basic examples Basic examples of the instruction SocketConnect are illustrated below. See also More examples on page 458 . Example 1 SocketConnect socket1, "192.168.0.1", 1025; Trying to connect to a remote computer at ip-address 192.168.0.1 and port 1025 . Arguments SocketConnect Socket Address Port [\Time] Socket Data type: socketdev The client socket to connect. The socket must be created but not already connected. Address Data type: string The address of the remote computer. The remote computer must be specified as an IP address. It is not possible to use the name of the remote computer. Port Data type: num The port on the remote computer. Generally ports 1025-4999 are free to use. Ports below 1025 can already be taken. [ \Time ] Data type: num The maximum amount of time [s] that program execution waits for the connection to be accepted or denied. If this time runs out before the condition is met then the error handler will be called, if there is one, with the error code ERR_SOCK_TIMEOUT . If there is no error handler then the execution will be stopped. If parameter \Time is not used the waiting time is 60 s. To wait forever, use the predefined constant WAIT_MAX . Program execution The socket tries to connect to the remote computer on the specified address and port. The program execution will wait until the connection is established, failed, or a timeout occurs. Continues on next page 1 Instructions 1.163. SocketConnect - Connect to a remote computer Socket Messaging 3HAC 16581-1 Revision: J 458 © Copyright 2004-2010 ABB. All rights reserved. More examples More examples of the instruction SocketConnect are illustrated below. Example 1 VAR num retry_no := 0; VAR socketdev my_socket; ... SocketCreate my_socket; SocketConnect my_socket, "192.168.0.1", 1025; ... ERROR IF ERRNO = ERR_SOCK_TIMEOUT THEN IF retry_no < 5 THEN WaitTime 1; retry_no := retry_no + 1; RETRY; ELSE RAISE; ENDIF ENDIF A socket is created and tries to connect to a remote computer. If the connection is not established within the default time-out time, i.e. 60 seconds, then the error handler retries to connect. Four retries are attemped then the error is reported to the user. 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 SocketConnect [ Socket ´:=´ ] < variable ( VAR ) of socketdev > ’,’ [ Address ´:=´ ] < expression ( IN ) of string > ’,’ [ Port ´:=´ ] < expression ( IN ) of num > [ ’\’ Time ´:=´ < expression ( IN ) of num > ] ’;’ ERR_SOCK_CLOSED The socket is closed (has been closed or is not created). Use SocketCreate to create a new socket. ERR_SOCK_TIMEOUT The connection was not established within the time-out time. Continued Continues on next page 1 Instructions 1.163. SocketConnect - Connect to a remote computer Socket Messaging 459 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Related information For information about Described in: Socket communication in general Application manual - Robot communication and I/O control Create a new socket SocketCreate - Create a new socket on page 460 Send data to remote computer SocketSend - Send data to remote computer on page 469 Receive data from remote computer SocketReceive - Receive data from remote computer on page 464 Bind a socket (only server) SocketBind - Bind a socket to my IP-address and port on page 453 Listening connections (only server) SocketListen - Listen for incoming connections on page 462 Accept connections (only server) SocketAccept - Accept an incoming connection on page 450 Get current socket state SocketGetStatus - Get current socket state on page 973 Example client socket application SocketSend - Send data to remote computer on page 469 Example server socket application SocketReceive - Receive data from remote computer on page 464 Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
461
1 Instructions 1.163. SocketConnect - Connect to a remote computer Socket Messaging 3HAC 16581-1 Revision: J 458 © Copyright 2004-2010 ABB. All rights reserved. More examples More examples of the instruction SocketConnect are illustrated below. Example 1 VAR num retry_no := 0; VAR socketdev my_socket; ... SocketCreate my_socket; SocketConnect my_socket, "192.168.0.1", 1025; ... ERROR IF ERRNO = ERR_SOCK_TIMEOUT THEN IF retry_no < 5 THEN WaitTime 1; retry_no := retry_no + 1; RETRY; ELSE RAISE; ENDIF ENDIF A socket is created and tries to connect to a remote computer. If the connection is not established within the default time-out time, i.e. 60 seconds, then the error handler retries to connect. Four retries are attemped then the error is reported to the user. 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 SocketConnect [ Socket ´:=´ ] < variable ( VAR ) of socketdev > ’,’ [ Address ´:=´ ] < expression ( IN ) of string > ’,’ [ Port ´:=´ ] < expression ( IN ) of num > [ ’\’ Time ´:=´ < expression ( IN ) of num > ] ’;’ ERR_SOCK_CLOSED The socket is closed (has been closed or is not created). Use SocketCreate to create a new socket. ERR_SOCK_TIMEOUT The connection was not established within the time-out time. Continued Continues on next page 1 Instructions 1.163. SocketConnect - Connect to a remote computer Socket Messaging 459 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Related information For information about Described in: Socket communication in general Application manual - Robot communication and I/O control Create a new socket SocketCreate - Create a new socket on page 460 Send data to remote computer SocketSend - Send data to remote computer on page 469 Receive data from remote computer SocketReceive - Receive data from remote computer on page 464 Bind a socket (only server) SocketBind - Bind a socket to my IP-address and port on page 453 Listening connections (only server) SocketListen - Listen for incoming connections on page 462 Accept connections (only server) SocketAccept - Accept an incoming connection on page 450 Get current socket state SocketGetStatus - Get current socket state on page 973 Example client socket application SocketSend - Send data to remote computer on page 469 Example server socket application SocketReceive - Receive data from remote computer on page 464 Continued 1 Instructions 1.164. SocketCreate - Create a new socket Socket Messaging 3HAC 16581-1 Revision: J 460 © Copyright 2004-2010 ABB. All rights reserved. 1.164. SocketCreate - Create a new socket Usage SocketCreate is used to create a new socket for connection based communication. The socket messaging is of stream type protocol TCP/IP with delivery guarantee. Both server and client application can be developed. Datagram protocol UDP/IP with broadcast is not supported. Basic examples Basic examples of the instruction SocketCreate are illustrated below. Example 1 VAR socketdev socket1; ... SocketCreate socket1; A new socket device is created and assigned into the variable socket1 . Arguments SocketCreate Socket Socket Data type: socketdev The variable for storage of the system’s internal socket data. Program execution The instruction creates a new socket device. The socket must not already be in use. The socket is in use between SocketCreate and SocketClose . Limitations Any number of sockets can be declared but it is only possible to use 8 sockets at the same time. Avoid fast loops with SocketCreate ... SocketClose , because the socket is not really closed until a certain time (TCP/IP functionality). Syntax SocketCreate [ Socket ’:=’ ] < variable ( VAR ) of socketdev > ’;’ Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
462
1 Instructions 1.163. SocketConnect - Connect to a remote computer Socket Messaging 459 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Related information For information about Described in: Socket communication in general Application manual - Robot communication and I/O control Create a new socket SocketCreate - Create a new socket on page 460 Send data to remote computer SocketSend - Send data to remote computer on page 469 Receive data from remote computer SocketReceive - Receive data from remote computer on page 464 Bind a socket (only server) SocketBind - Bind a socket to my IP-address and port on page 453 Listening connections (only server) SocketListen - Listen for incoming connections on page 462 Accept connections (only server) SocketAccept - Accept an incoming connection on page 450 Get current socket state SocketGetStatus - Get current socket state on page 973 Example client socket application SocketSend - Send data to remote computer on page 469 Example server socket application SocketReceive - Receive data from remote computer on page 464 Continued 1 Instructions 1.164. SocketCreate - Create a new socket Socket Messaging 3HAC 16581-1 Revision: J 460 © Copyright 2004-2010 ABB. All rights reserved. 1.164. SocketCreate - Create a new socket Usage SocketCreate is used to create a new socket for connection based communication. The socket messaging is of stream type protocol TCP/IP with delivery guarantee. Both server and client application can be developed. Datagram protocol UDP/IP with broadcast is not supported. Basic examples Basic examples of the instruction SocketCreate are illustrated below. Example 1 VAR socketdev socket1; ... SocketCreate socket1; A new socket device is created and assigned into the variable socket1 . Arguments SocketCreate Socket Socket Data type: socketdev The variable for storage of the system’s internal socket data. Program execution The instruction creates a new socket device. The socket must not already be in use. The socket is in use between SocketCreate and SocketClose . Limitations Any number of sockets can be declared but it is only possible to use 8 sockets at the same time. Avoid fast loops with SocketCreate ... SocketClose , because the socket is not really closed until a certain time (TCP/IP functionality). Syntax SocketCreate [ Socket ’:=’ ] < variable ( VAR ) of socketdev > ’;’ Continues on next page 1 Instructions 1.164. SocketCreate - Create a new socket Socket Messaging 461 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Socket communication in general Application manual - Robot communication and I/O control , section Socket Messaging Connect to remote computer (only client) SocketConnect - Connect to a remote computer on page 457 Send data to remote computer SocketSend - Send data to remote computer on page 469 Receive data from remote computer SocketReceive - Receive data from remote computer on page 464 Close the socket SocketClose - Close a socket on page 455 Bind a socket (only server) SocketBind - Bind a socket to my IP-address and port on page 453 Listening connections (only server) SocketListen - Listen for incoming connections on page 462 Accept connections (only server) SocketAccept - Accept an incoming connection on page 450 Get current socket state SocketGetStatus - Get current socket state on page 973 Example client socket application SocketSend - Send data to remote computer on page 469 Example server socket application SocketReceive - Receive data from remote computer on page 464 Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
463
1 Instructions 1.164. SocketCreate - Create a new socket Socket Messaging 3HAC 16581-1 Revision: J 460 © Copyright 2004-2010 ABB. All rights reserved. 1.164. SocketCreate - Create a new socket Usage SocketCreate is used to create a new socket for connection based communication. The socket messaging is of stream type protocol TCP/IP with delivery guarantee. Both server and client application can be developed. Datagram protocol UDP/IP with broadcast is not supported. Basic examples Basic examples of the instruction SocketCreate are illustrated below. Example 1 VAR socketdev socket1; ... SocketCreate socket1; A new socket device is created and assigned into the variable socket1 . Arguments SocketCreate Socket Socket Data type: socketdev The variable for storage of the system’s internal socket data. Program execution The instruction creates a new socket device. The socket must not already be in use. The socket is in use between SocketCreate and SocketClose . Limitations Any number of sockets can be declared but it is only possible to use 8 sockets at the same time. Avoid fast loops with SocketCreate ... SocketClose , because the socket is not really closed until a certain time (TCP/IP functionality). Syntax SocketCreate [ Socket ’:=’ ] < variable ( VAR ) of socketdev > ’;’ Continues on next page 1 Instructions 1.164. SocketCreate - Create a new socket Socket Messaging 461 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Socket communication in general Application manual - Robot communication and I/O control , section Socket Messaging Connect to remote computer (only client) SocketConnect - Connect to a remote computer on page 457 Send data to remote computer SocketSend - Send data to remote computer on page 469 Receive data from remote computer SocketReceive - Receive data from remote computer on page 464 Close the socket SocketClose - Close a socket on page 455 Bind a socket (only server) SocketBind - Bind a socket to my IP-address and port on page 453 Listening connections (only server) SocketListen - Listen for incoming connections on page 462 Accept connections (only server) SocketAccept - Accept an incoming connection on page 450 Get current socket state SocketGetStatus - Get current socket state on page 973 Example client socket application SocketSend - Send data to remote computer on page 469 Example server socket application SocketReceive - Receive data from remote computer on page 464 Continued 1 Instructions 1.165. SocketListen - Listen for incoming connections Socket Messaging 3HAC 16581-1 Revision: J 462 © Copyright 2004-2010 ABB. All rights reserved. 1.165. SocketListen - Listen for incoming connections Usage SocketListen is used to start listening for incoming connections, i.e. start acting as a server. SocketListen can only used for server applications. Basic examples Basic examples of the instruction SocketListen are illustrated below. Example 1 VAR socketdev server_socket; VAR socketdev client_socket; ... SocketCreate server_socket; SocketBind server_socket, "192.168.0.1", 1025; SocketListen server_socket; WHILE listening DO; ! Waiting for a connection request SocketAccept server_socket, client_socket; A server socket is created and bound to port 1025 on the controller network address 192.168.0.1 . After execution of SocketListen the server socket starts to listen for incoming connections on this port and address. Arguments SocketListen Socket Socket Data type: socketdev The server socket that should start listening for incoming connections. The socket must already be created and bound. Program execution The server socket start listening for incoming connections. When the instruction is ready the socket is ready to accept an incoming connection. Use the SocketBind and SocketListen instructions in the startup of the program to associate a local address with a socket and then listen for incoming connections on the specified port. This is recommended to do only once for each socket and port that is used. 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 SocketListen [ Socket ’:=’ ] < variable ( VAR ) of socketdev > ’;’ ERR_SOCK_CLOSED The socket is closed (has been closed or is not created). Use SocketCreate to create a new socket. Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
464
1 Instructions 1.164. SocketCreate - Create a new socket Socket Messaging 461 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Socket communication in general Application manual - Robot communication and I/O control , section Socket Messaging Connect to remote computer (only client) SocketConnect - Connect to a remote computer on page 457 Send data to remote computer SocketSend - Send data to remote computer on page 469 Receive data from remote computer SocketReceive - Receive data from remote computer on page 464 Close the socket SocketClose - Close a socket on page 455 Bind a socket (only server) SocketBind - Bind a socket to my IP-address and port on page 453 Listening connections (only server) SocketListen - Listen for incoming connections on page 462 Accept connections (only server) SocketAccept - Accept an incoming connection on page 450 Get current socket state SocketGetStatus - Get current socket state on page 973 Example client socket application SocketSend - Send data to remote computer on page 469 Example server socket application SocketReceive - Receive data from remote computer on page 464 Continued 1 Instructions 1.165. SocketListen - Listen for incoming connections Socket Messaging 3HAC 16581-1 Revision: J 462 © Copyright 2004-2010 ABB. All rights reserved. 1.165. SocketListen - Listen for incoming connections Usage SocketListen is used to start listening for incoming connections, i.e. start acting as a server. SocketListen can only used for server applications. Basic examples Basic examples of the instruction SocketListen are illustrated below. Example 1 VAR socketdev server_socket; VAR socketdev client_socket; ... SocketCreate server_socket; SocketBind server_socket, "192.168.0.1", 1025; SocketListen server_socket; WHILE listening DO; ! Waiting for a connection request SocketAccept server_socket, client_socket; A server socket is created and bound to port 1025 on the controller network address 192.168.0.1 . After execution of SocketListen the server socket starts to listen for incoming connections on this port and address. Arguments SocketListen Socket Socket Data type: socketdev The server socket that should start listening for incoming connections. The socket must already be created and bound. Program execution The server socket start listening for incoming connections. When the instruction is ready the socket is ready to accept an incoming connection. Use the SocketBind and SocketListen instructions in the startup of the program to associate a local address with a socket and then listen for incoming connections on the specified port. This is recommended to do only once for each socket and port that is used. 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 SocketListen [ Socket ’:=’ ] < variable ( VAR ) of socketdev > ’;’ ERR_SOCK_CLOSED The socket is closed (has been closed or is not created). Use SocketCreate to create a new socket. Continues on next page 1 Instructions 1.165. SocketListen - Listen for incoming connections Socket Messaging 463 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Socket communication in general Application manual - Robot communication and I/O control , section Socket Messaging Create a new socket SocketCreate - Create a new socket on page 460 Connect to remote computer (only client) SocketConnect - Connect to a remote computer on page 457 Send data to remote computer SocketSend - Send data to remote computer on page 469 Receive data from remote computer SocketReceive - Receive data from remote computer on page 464 Close the socket SocketClose - Close a socket on page 455 Bind a socket (only server) SocketBind - Bind a socket to my IP-address and port on page 453 Accept connections (only server) SocketAccept - Accept an incoming connection on page 450 Get current socket state SocketGetStatus - Get current socket state on page 973 Example client socket application SocketSend - Send data to remote computer on page 469 Example server socket application SocketReceive - Receive data from remote computer on page 464 Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
465
1 Instructions 1.165. SocketListen - Listen for incoming connections Socket Messaging 3HAC 16581-1 Revision: J 462 © Copyright 2004-2010 ABB. All rights reserved. 1.165. SocketListen - Listen for incoming connections Usage SocketListen is used to start listening for incoming connections, i.e. start acting as a server. SocketListen can only used for server applications. Basic examples Basic examples of the instruction SocketListen are illustrated below. Example 1 VAR socketdev server_socket; VAR socketdev client_socket; ... SocketCreate server_socket; SocketBind server_socket, "192.168.0.1", 1025; SocketListen server_socket; WHILE listening DO; ! Waiting for a connection request SocketAccept server_socket, client_socket; A server socket is created and bound to port 1025 on the controller network address 192.168.0.1 . After execution of SocketListen the server socket starts to listen for incoming connections on this port and address. Arguments SocketListen Socket Socket Data type: socketdev The server socket that should start listening for incoming connections. The socket must already be created and bound. Program execution The server socket start listening for incoming connections. When the instruction is ready the socket is ready to accept an incoming connection. Use the SocketBind and SocketListen instructions in the startup of the program to associate a local address with a socket and then listen for incoming connections on the specified port. This is recommended to do only once for each socket and port that is used. 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 SocketListen [ Socket ’:=’ ] < variable ( VAR ) of socketdev > ’;’ ERR_SOCK_CLOSED The socket is closed (has been closed or is not created). Use SocketCreate to create a new socket. Continues on next page 1 Instructions 1.165. SocketListen - Listen for incoming connections Socket Messaging 463 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Socket communication in general Application manual - Robot communication and I/O control , section Socket Messaging Create a new socket SocketCreate - Create a new socket on page 460 Connect to remote computer (only client) SocketConnect - Connect to a remote computer on page 457 Send data to remote computer SocketSend - Send data to remote computer on page 469 Receive data from remote computer SocketReceive - Receive data from remote computer on page 464 Close the socket SocketClose - Close a socket on page 455 Bind a socket (only server) SocketBind - Bind a socket to my IP-address and port on page 453 Accept connections (only server) SocketAccept - Accept an incoming connection on page 450 Get current socket state SocketGetStatus - Get current socket state on page 973 Example client socket application SocketSend - Send data to remote computer on page 469 Example server socket application SocketReceive - Receive data from remote computer on page 464 Continued 1 Instructions 1.166. SocketReceive - Receive data from remote computer Socket Messaging 3HAC 16581-1 Revision: J 464 © Copyright 2004-2010 ABB. All rights reserved. 1.166. SocketReceive - Receive data from remote computer Usage SocketReceive is used for receiving data from a remote computer. SocketReceive can be used both for client and server applications. Basic examples Basic examples of the instruction SocketReceive are illustrated below. See also More examples on page 466 . Example 1 VAR string str_data; ... SocketReceive socket1 \Str := str_data; Receive data from a remote computer and store it in the string variable str_data . Arguments SocketReceive Socket [ \Str ] | [ \RawData ] | [ \Data ] [\ReadNoOfBytes] [\NoRecBytes] [\Time] Socket Data type: socketdev In a client application where the socket receives the data, the socket must already be created and connected. In a server application where the socket receives the data, the socket must already be accepted. [ \Str ] Data type: string The variable in which the received string data should be stored. Max. number of characters 80 can be handled. [ \RawData ] Data type: rawbytes The variable in which the received rawbytes data should be stored. Max. number of rawbytes 1024 can be handled. [ \Data ] Data type: array of byte The variable in which the received byte data should be stored. Max. number of byte 1024 can be handled. Only one of the optional parameters \Str , \RawData , and \Data can be used at the same 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
466
1 Instructions 1.165. SocketListen - Listen for incoming connections Socket Messaging 463 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Socket communication in general Application manual - Robot communication and I/O control , section Socket Messaging Create a new socket SocketCreate - Create a new socket on page 460 Connect to remote computer (only client) SocketConnect - Connect to a remote computer on page 457 Send data to remote computer SocketSend - Send data to remote computer on page 469 Receive data from remote computer SocketReceive - Receive data from remote computer on page 464 Close the socket SocketClose - Close a socket on page 455 Bind a socket (only server) SocketBind - Bind a socket to my IP-address and port on page 453 Accept connections (only server) SocketAccept - Accept an incoming connection on page 450 Get current socket state SocketGetStatus - Get current socket state on page 973 Example client socket application SocketSend - Send data to remote computer on page 469 Example server socket application SocketReceive - Receive data from remote computer on page 464 Continued 1 Instructions 1.166. SocketReceive - Receive data from remote computer Socket Messaging 3HAC 16581-1 Revision: J 464 © Copyright 2004-2010 ABB. All rights reserved. 1.166. SocketReceive - Receive data from remote computer Usage SocketReceive is used for receiving data from a remote computer. SocketReceive can be used both for client and server applications. Basic examples Basic examples of the instruction SocketReceive are illustrated below. See also More examples on page 466 . Example 1 VAR string str_data; ... SocketReceive socket1 \Str := str_data; Receive data from a remote computer and store it in the string variable str_data . Arguments SocketReceive Socket [ \Str ] | [ \RawData ] | [ \Data ] [\ReadNoOfBytes] [\NoRecBytes] [\Time] Socket Data type: socketdev In a client application where the socket receives the data, the socket must already be created and connected. In a server application where the socket receives the data, the socket must already be accepted. [ \Str ] Data type: string The variable in which the received string data should be stored. Max. number of characters 80 can be handled. [ \RawData ] Data type: rawbytes The variable in which the received rawbytes data should be stored. Max. number of rawbytes 1024 can be handled. [ \Data ] Data type: array of byte The variable in which the received byte data should be stored. Max. number of byte 1024 can be handled. Only one of the optional parameters \Str , \RawData , and \Data can be used at the same time. Continues on next page 1 Instructions 1.166. SocketReceive - Receive data from remote computer Socket Messaging 465 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. [ \ReadNoOfBytes ] Read number of Bytes Data type: num The number of bytes to read. The minimum value of bytes to read is 1, and the maximum amount is the value of the size of the data type used, i.e. 80 bytes if using a variable of the data type string . If communicating with a client that always sends a fixed number of bytes, this optional parameter can be used to specify that the same amount of bytes should be read for each SocketReceive instruction. If the sender sends RawData, the receiver needs to specify that 4 bytes should be received for each rawbytes sent. [ \NoRecBytes ] Number Received Bytes Data type: num Variable for storage of the number of bytes needed from the specified socketdev . The same result can also be achieved with • function StrLen on varable in argument \Str • function RawBytesLen on variable in argument \RawData [ \Time ] Data type: num The maximum amount of time [s] that program execution waits for the data to be received. If this time runs out before the data is transferred then the error handler will be called, if there is one, with the error code ERR_SOCK_TIMEOUT . If there is no error handler then the execution will be stopped. If parameter \Time is not used then the waiting time is 60 s. To wait forever, use the predefined constant WAIT_MAX . Program execution The execution of SocketReceive will wait until the data is available or fail with a timeout error. The amount of bytes read is specified by the the data type used in the instruction. If using a string data type to receive data in, 80 bytes is received if there is 80 bytes that can be read. If using optional argument ReadNoOfBytes the user can specify how many bytes that should be received for each SocketReceive . The data that is transferred on the cable is always bytes, max. 1024 bytes in one message. No header is added by default to the message. The usage of any header is reserved for the actual application. Parameter Input data Cable data Output data \Str 1 char 1 byte (8 bits) 1 char \RawData 1 rawbytes 1 byte (8 bits) 1 rawbytes \Data 1 byte 1 byte (8 bits) 1 byte 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
467
1 Instructions 1.166. SocketReceive - Receive data from remote computer Socket Messaging 3HAC 16581-1 Revision: J 464 © Copyright 2004-2010 ABB. All rights reserved. 1.166. SocketReceive - Receive data from remote computer Usage SocketReceive is used for receiving data from a remote computer. SocketReceive can be used both for client and server applications. Basic examples Basic examples of the instruction SocketReceive are illustrated below. See also More examples on page 466 . Example 1 VAR string str_data; ... SocketReceive socket1 \Str := str_data; Receive data from a remote computer and store it in the string variable str_data . Arguments SocketReceive Socket [ \Str ] | [ \RawData ] | [ \Data ] [\ReadNoOfBytes] [\NoRecBytes] [\Time] Socket Data type: socketdev In a client application where the socket receives the data, the socket must already be created and connected. In a server application where the socket receives the data, the socket must already be accepted. [ \Str ] Data type: string The variable in which the received string data should be stored. Max. number of characters 80 can be handled. [ \RawData ] Data type: rawbytes The variable in which the received rawbytes data should be stored. Max. number of rawbytes 1024 can be handled. [ \Data ] Data type: array of byte The variable in which the received byte data should be stored. Max. number of byte 1024 can be handled. Only one of the optional parameters \Str , \RawData , and \Data can be used at the same time. Continues on next page 1 Instructions 1.166. SocketReceive - Receive data from remote computer Socket Messaging 465 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. [ \ReadNoOfBytes ] Read number of Bytes Data type: num The number of bytes to read. The minimum value of bytes to read is 1, and the maximum amount is the value of the size of the data type used, i.e. 80 bytes if using a variable of the data type string . If communicating with a client that always sends a fixed number of bytes, this optional parameter can be used to specify that the same amount of bytes should be read for each SocketReceive instruction. If the sender sends RawData, the receiver needs to specify that 4 bytes should be received for each rawbytes sent. [ \NoRecBytes ] Number Received Bytes Data type: num Variable for storage of the number of bytes needed from the specified socketdev . The same result can also be achieved with • function StrLen on varable in argument \Str • function RawBytesLen on variable in argument \RawData [ \Time ] Data type: num The maximum amount of time [s] that program execution waits for the data to be received. If this time runs out before the data is transferred then the error handler will be called, if there is one, with the error code ERR_SOCK_TIMEOUT . If there is no error handler then the execution will be stopped. If parameter \Time is not used then the waiting time is 60 s. To wait forever, use the predefined constant WAIT_MAX . Program execution The execution of SocketReceive will wait until the data is available or fail with a timeout error. The amount of bytes read is specified by the the data type used in the instruction. If using a string data type to receive data in, 80 bytes is received if there is 80 bytes that can be read. If using optional argument ReadNoOfBytes the user can specify how many bytes that should be received for each SocketReceive . The data that is transferred on the cable is always bytes, max. 1024 bytes in one message. No header is added by default to the message. The usage of any header is reserved for the actual application. Parameter Input data Cable data Output data \Str 1 char 1 byte (8 bits) 1 char \RawData 1 rawbytes 1 byte (8 bits) 1 rawbytes \Data 1 byte 1 byte (8 bits) 1 byte Continued Continues on next page 1 Instructions 1.166. SocketReceive - Receive data from remote computer Socket Messaging 3HAC 16581-1 Revision: J 466 © Copyright 2004-2010 ABB. All rights reserved. It is possible to mix the used data type ( string , rawbytes , or array of byte ) between SocketSend and SocketReceive . More examples More examples of the instruction SocketReceive are illustrated below. Example 1 VAR socketdev server_socket; VAR socketdev client_socket; VAR string client_ip; PROC server_messaging() VAR string receive_string; ... ! Create, bind, listen and accept of sockets in error handlers SocketReceive client_socket \Str := receive_string; SocketSend client_socket \Str := "Hello client with ip-address "+client_ip; ! Wait for acknowlegde from client ... SocketClose server_socket; SocketClose client_socket; ERROR IF ERRNO=ERR_SOCK_TIMEOUT THEN RETRY; ELSEIF ERRNO=SOCK_CLOSED THEN server_recover; RETRY; ELSE ! No error recovery handling ENDIF ENDPROC PROC server_recover() SocketClose server_socket; SocketClose client_socket; SocketCreate server_socket; SocketBind server_socket, "192.168.0.1", 1025; SocketListen server_socket; SocketAccept server_socket, client_socket\ClientAddress:=client_ip; ERROR IF ERRNO=ERR_SOCK_TIMEOUT THEN RETRY; ELSEIF ERRNO=ERR_SOCK_CLOSED THEN RETURN; ELSE ! No error recovery handling 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
468
1 Instructions 1.166. SocketReceive - Receive data from remote computer Socket Messaging 465 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. [ \ReadNoOfBytes ] Read number of Bytes Data type: num The number of bytes to read. The minimum value of bytes to read is 1, and the maximum amount is the value of the size of the data type used, i.e. 80 bytes if using a variable of the data type string . If communicating with a client that always sends a fixed number of bytes, this optional parameter can be used to specify that the same amount of bytes should be read for each SocketReceive instruction. If the sender sends RawData, the receiver needs to specify that 4 bytes should be received for each rawbytes sent. [ \NoRecBytes ] Number Received Bytes Data type: num Variable for storage of the number of bytes needed from the specified socketdev . The same result can also be achieved with • function StrLen on varable in argument \Str • function RawBytesLen on variable in argument \RawData [ \Time ] Data type: num The maximum amount of time [s] that program execution waits for the data to be received. If this time runs out before the data is transferred then the error handler will be called, if there is one, with the error code ERR_SOCK_TIMEOUT . If there is no error handler then the execution will be stopped. If parameter \Time is not used then the waiting time is 60 s. To wait forever, use the predefined constant WAIT_MAX . Program execution The execution of SocketReceive will wait until the data is available or fail with a timeout error. The amount of bytes read is specified by the the data type used in the instruction. If using a string data type to receive data in, 80 bytes is received if there is 80 bytes that can be read. If using optional argument ReadNoOfBytes the user can specify how many bytes that should be received for each SocketReceive . The data that is transferred on the cable is always bytes, max. 1024 bytes in one message. No header is added by default to the message. The usage of any header is reserved for the actual application. Parameter Input data Cable data Output data \Str 1 char 1 byte (8 bits) 1 char \RawData 1 rawbytes 1 byte (8 bits) 1 rawbytes \Data 1 byte 1 byte (8 bits) 1 byte Continued Continues on next page 1 Instructions 1.166. SocketReceive - Receive data from remote computer Socket Messaging 3HAC 16581-1 Revision: J 466 © Copyright 2004-2010 ABB. All rights reserved. It is possible to mix the used data type ( string , rawbytes , or array of byte ) between SocketSend and SocketReceive . More examples More examples of the instruction SocketReceive are illustrated below. Example 1 VAR socketdev server_socket; VAR socketdev client_socket; VAR string client_ip; PROC server_messaging() VAR string receive_string; ... ! Create, bind, listen and accept of sockets in error handlers SocketReceive client_socket \Str := receive_string; SocketSend client_socket \Str := "Hello client with ip-address "+client_ip; ! Wait for acknowlegde from client ... SocketClose server_socket; SocketClose client_socket; ERROR IF ERRNO=ERR_SOCK_TIMEOUT THEN RETRY; ELSEIF ERRNO=SOCK_CLOSED THEN server_recover; RETRY; ELSE ! No error recovery handling ENDIF ENDPROC PROC server_recover() SocketClose server_socket; SocketClose client_socket; SocketCreate server_socket; SocketBind server_socket, "192.168.0.1", 1025; SocketListen server_socket; SocketAccept server_socket, client_socket\ClientAddress:=client_ip; ERROR IF ERRNO=ERR_SOCK_TIMEOUT THEN RETRY; ELSEIF ERRNO=ERR_SOCK_CLOSED THEN RETURN; ELSE ! No error recovery handling Continued Continues on next page 1 Instructions 1.166. SocketReceive - Receive data from remote computer Socket Messaging 467 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. ENDIF ENDPROC This is an example of a server program with creation, binding, listening, and accepting of sockets in error handlers. In this way the program can handle power fail restart. In the procedure server_recover , a server socket is created and bound to port 1025 on the controller network address 192.168.0.1 . After execution of SocketListen the server socket starts to listen for incoming connections on this port and address. SocketAccept will accept the incoming connection from some client and store the client address in the string client_ip . In the communication procedure server_messaging the server receives a string message from the client and stores the message in receive_string . Then the server responds with the message "Hello client with ip-address xxx.xxx.x.x" . Error handling The following recoverable errors can be generated. The errors can be handled in an ERROR handler. The system variable ERRNO will be set to: Limitations There is no built-in synchronization mechanism in Socket Messaging to avoid received messages that are compounded of several sent messages. It is up to the programmer to handle the synchronization with “Ack” messages (one sequence of SocketSend - SocketReceive in the client or server program must be completed before next sequence of SocketSend - SocketReceive ). All sockets are closed after power fail restart. This problem can be handled by error recovery. See example above. Avoid fast loops with SocketCreate ... SocketClose because the socket is not really closed until a certain time (TCP/IP functionality). The maximum size of the data that can be received in one call is limited to 1024 bytes. Syntax SocketReceive [ Socket ’:=’ ] < variable ( VAR ) of socketdev > [ ’\’ Str’ :=’ < variable ( VAR ) of string > ] | [ ’\’ RawData ´:=´ < variable ( VAR ) of rawbytes > ] | [ ’\’ Data ´:=´ < array {*} ( VAR ) of byte > ] [ ’\’ ReadNoOfBytes’ :=’ < expression ( IN ) of num > ] [ ’\’ NoRecBytes’ :=’ < variable ( VAR ) of num > ] [ ’\’ Time ´:=´ < expression ( IN ) of num > ] ’;’ ERR_SOCK_CLOSED The socket is closed. Broken connection. ERR_SOCK_TIMEOUT No data was received within the time out time. 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
469
1 Instructions 1.166. SocketReceive - Receive data from remote computer Socket Messaging 3HAC 16581-1 Revision: J 466 © Copyright 2004-2010 ABB. All rights reserved. It is possible to mix the used data type ( string , rawbytes , or array of byte ) between SocketSend and SocketReceive . More examples More examples of the instruction SocketReceive are illustrated below. Example 1 VAR socketdev server_socket; VAR socketdev client_socket; VAR string client_ip; PROC server_messaging() VAR string receive_string; ... ! Create, bind, listen and accept of sockets in error handlers SocketReceive client_socket \Str := receive_string; SocketSend client_socket \Str := "Hello client with ip-address "+client_ip; ! Wait for acknowlegde from client ... SocketClose server_socket; SocketClose client_socket; ERROR IF ERRNO=ERR_SOCK_TIMEOUT THEN RETRY; ELSEIF ERRNO=SOCK_CLOSED THEN server_recover; RETRY; ELSE ! No error recovery handling ENDIF ENDPROC PROC server_recover() SocketClose server_socket; SocketClose client_socket; SocketCreate server_socket; SocketBind server_socket, "192.168.0.1", 1025; SocketListen server_socket; SocketAccept server_socket, client_socket\ClientAddress:=client_ip; ERROR IF ERRNO=ERR_SOCK_TIMEOUT THEN RETRY; ELSEIF ERRNO=ERR_SOCK_CLOSED THEN RETURN; ELSE ! No error recovery handling Continued Continues on next page 1 Instructions 1.166. SocketReceive - Receive data from remote computer Socket Messaging 467 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. ENDIF ENDPROC This is an example of a server program with creation, binding, listening, and accepting of sockets in error handlers. In this way the program can handle power fail restart. In the procedure server_recover , a server socket is created and bound to port 1025 on the controller network address 192.168.0.1 . After execution of SocketListen the server socket starts to listen for incoming connections on this port and address. SocketAccept will accept the incoming connection from some client and store the client address in the string client_ip . In the communication procedure server_messaging the server receives a string message from the client and stores the message in receive_string . Then the server responds with the message "Hello client with ip-address xxx.xxx.x.x" . Error handling The following recoverable errors can be generated. The errors can be handled in an ERROR handler. The system variable ERRNO will be set to: Limitations There is no built-in synchronization mechanism in Socket Messaging to avoid received messages that are compounded of several sent messages. It is up to the programmer to handle the synchronization with “Ack” messages (one sequence of SocketSend - SocketReceive in the client or server program must be completed before next sequence of SocketSend - SocketReceive ). All sockets are closed after power fail restart. This problem can be handled by error recovery. See example above. Avoid fast loops with SocketCreate ... SocketClose because the socket is not really closed until a certain time (TCP/IP functionality). The maximum size of the data that can be received in one call is limited to 1024 bytes. Syntax SocketReceive [ Socket ’:=’ ] < variable ( VAR ) of socketdev > [ ’\’ Str’ :=’ < variable ( VAR ) of string > ] | [ ’\’ RawData ´:=´ < variable ( VAR ) of rawbytes > ] | [ ’\’ Data ´:=´ < array {*} ( VAR ) of byte > ] [ ’\’ ReadNoOfBytes’ :=’ < expression ( IN ) of num > ] [ ’\’ NoRecBytes’ :=’ < variable ( VAR ) of num > ] [ ’\’ Time ´:=´ < expression ( IN ) of num > ] ’;’ ERR_SOCK_CLOSED The socket is closed. Broken connection. ERR_SOCK_TIMEOUT No data was received within the time out time. Continued Continues on next page 1 Instructions 1.166. SocketReceive - Receive data from remote computer Socket Messaging 3HAC 16581-1 Revision: J 468 © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Socket communication in general Application manual - Robot communication and I/ O control , section Socket Messaging Create a new socket SocketCreate - Create a new socket on page 460 Connect to remote computer (only client) SocketConnect - Connect to a remote computer on page 457 Send data to remote computer SocketSend - Send data to remote computer on page 469 Close the socket SocketClose - Close a socket on page 455 Bind a socket (only server) SocketBind - Bind a socket to my IP-address and port on page 453 Listening connections (only server) SocketListen - Listen for incoming connections on page 462 Accept connections (only server) SocketAccept - Accept an incoming connection on page 450 Get current socket state SocketGetStatus - Get current socket state on page 973 Example client socket application SocketSend - Send data to remote computer on page 469 Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
470
1 Instructions 1.166. SocketReceive - Receive data from remote computer Socket Messaging 467 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. ENDIF ENDPROC This is an example of a server program with creation, binding, listening, and accepting of sockets in error handlers. In this way the program can handle power fail restart. In the procedure server_recover , a server socket is created and bound to port 1025 on the controller network address 192.168.0.1 . After execution of SocketListen the server socket starts to listen for incoming connections on this port and address. SocketAccept will accept the incoming connection from some client and store the client address in the string client_ip . In the communication procedure server_messaging the server receives a string message from the client and stores the message in receive_string . Then the server responds with the message "Hello client with ip-address xxx.xxx.x.x" . Error handling The following recoverable errors can be generated. The errors can be handled in an ERROR handler. The system variable ERRNO will be set to: Limitations There is no built-in synchronization mechanism in Socket Messaging to avoid received messages that are compounded of several sent messages. It is up to the programmer to handle the synchronization with “Ack” messages (one sequence of SocketSend - SocketReceive in the client or server program must be completed before next sequence of SocketSend - SocketReceive ). All sockets are closed after power fail restart. This problem can be handled by error recovery. See example above. Avoid fast loops with SocketCreate ... SocketClose because the socket is not really closed until a certain time (TCP/IP functionality). The maximum size of the data that can be received in one call is limited to 1024 bytes. Syntax SocketReceive [ Socket ’:=’ ] < variable ( VAR ) of socketdev > [ ’\’ Str’ :=’ < variable ( VAR ) of string > ] | [ ’\’ RawData ´:=´ < variable ( VAR ) of rawbytes > ] | [ ’\’ Data ´:=´ < array {*} ( VAR ) of byte > ] [ ’\’ ReadNoOfBytes’ :=’ < expression ( IN ) of num > ] [ ’\’ NoRecBytes’ :=’ < variable ( VAR ) of num > ] [ ’\’ Time ´:=´ < expression ( IN ) of num > ] ’;’ ERR_SOCK_CLOSED The socket is closed. Broken connection. ERR_SOCK_TIMEOUT No data was received within the time out time. Continued Continues on next page 1 Instructions 1.166. SocketReceive - Receive data from remote computer Socket Messaging 3HAC 16581-1 Revision: J 468 © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Socket communication in general Application manual - Robot communication and I/ O control , section Socket Messaging Create a new socket SocketCreate - Create a new socket on page 460 Connect to remote computer (only client) SocketConnect - Connect to a remote computer on page 457 Send data to remote computer SocketSend - Send data to remote computer on page 469 Close the socket SocketClose - Close a socket on page 455 Bind a socket (only server) SocketBind - Bind a socket to my IP-address and port on page 453 Listening connections (only server) SocketListen - Listen for incoming connections on page 462 Accept connections (only server) SocketAccept - Accept an incoming connection on page 450 Get current socket state SocketGetStatus - Get current socket state on page 973 Example client socket application SocketSend - Send data to remote computer on page 469 Continued 1 Instructions 1.167. SocketSend - Send data to remote computer Socket Messaging 469 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.167. SocketSend - Send data to remote computer Usage SocketSend is used to send data to a remote computer. SocketSend can be used both for client and server applications. Basic examples Basic examples of the instruction SocketSend are illustrated below. See also More examples on page 470 . Example 1 SocketSend socket1 \Str := "Hello world"; Sends the message "Hello world" to the remote computer. Arguments SocketSend Socket [ \Str ] | [ \RawData ] | [ \Data] [ \NoOfBytes ] Socket Data type: socketdev In client application the socket to send from must already be created and connected. In server application the socket to send to must already be accepted. [ \Str ] Data type: string The string to send to the remote computer. [ \RawData ] Data type: rawbytes The rawbytes data to send to the remote computer. [ \Data ] Data type: array of byte The data in the byte array to send to the remote computer. Only one of the option parameters \Str , \RawData , or \Data can be used at the same time. [ \NoOfBytes ] Data type: num If this argument is specified only this number of bytes will be sent to the remote computer. The call to SocketSend will fail if \NoOfBytes is larger than the actual number of bytes in the data structure to send. If this argument is not specified then the whole data structure (valid part of rawbytes ) will be sent to the remote computer. Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
471
1 Instructions 1.166. SocketReceive - Receive data from remote computer Socket Messaging 3HAC 16581-1 Revision: J 468 © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Socket communication in general Application manual - Robot communication and I/ O control , section Socket Messaging Create a new socket SocketCreate - Create a new socket on page 460 Connect to remote computer (only client) SocketConnect - Connect to a remote computer on page 457 Send data to remote computer SocketSend - Send data to remote computer on page 469 Close the socket SocketClose - Close a socket on page 455 Bind a socket (only server) SocketBind - Bind a socket to my IP-address and port on page 453 Listening connections (only server) SocketListen - Listen for incoming connections on page 462 Accept connections (only server) SocketAccept - Accept an incoming connection on page 450 Get current socket state SocketGetStatus - Get current socket state on page 973 Example client socket application SocketSend - Send data to remote computer on page 469 Continued 1 Instructions 1.167. SocketSend - Send data to remote computer Socket Messaging 469 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.167. SocketSend - Send data to remote computer Usage SocketSend is used to send data to a remote computer. SocketSend can be used both for client and server applications. Basic examples Basic examples of the instruction SocketSend are illustrated below. See also More examples on page 470 . Example 1 SocketSend socket1 \Str := "Hello world"; Sends the message "Hello world" to the remote computer. Arguments SocketSend Socket [ \Str ] | [ \RawData ] | [ \Data] [ \NoOfBytes ] Socket Data type: socketdev In client application the socket to send from must already be created and connected. In server application the socket to send to must already be accepted. [ \Str ] Data type: string The string to send to the remote computer. [ \RawData ] Data type: rawbytes The rawbytes data to send to the remote computer. [ \Data ] Data type: array of byte The data in the byte array to send to the remote computer. Only one of the option parameters \Str , \RawData , or \Data can be used at the same time. [ \NoOfBytes ] Data type: num If this argument is specified only this number of bytes will be sent to the remote computer. The call to SocketSend will fail if \NoOfBytes is larger than the actual number of bytes in the data structure to send. If this argument is not specified then the whole data structure (valid part of rawbytes ) will be sent to the remote computer. Continues on next page 1 Instructions 1.167. SocketSend - Send data to remote computer Socket Messaging 3HAC 16581-1 Revision: J 470 © Copyright 2004-2010 ABB. All rights reserved. Program execution The specified data is sent to the remote computer. If the connection is broken an error is generated. The data that is transferred on the cable is always bytes, max. 1024 bytes in one message. No header is added by default to the message. The usage of any header is reserved for the actual application. It’s possible to mix the used data type ( string , rawbytes , or array of byte ) between SocketSend and SocketReceive . More examples More examples of the instruction SocketSend are illustrated below. Example 1 VAR socketdev client_socket; VAR string receive_string; PROC client_messaging() ... ! Create and connect the socket in error handlers SocketSend client_socket \Str := "Hello server"; SocketReceive client_socket \Str := receive_string; ... SocketClose client_socket; ERROR IF ERRNO=ERR_SOCK_TIMEOUT THEN RETRY; ELSEIF ERRNO=ERR_SOCK_CLOSED THEN client_recover; RETRY; ELSE ! No error recovery handling ENDIF ENDPROC PROC client_recover() SocketClose client_socket; SocketCreate client_socket; SocketConnect client_socket, "192.168.0.2", 1025; ERROR IF ERRNO=ERR_SOCK_TIMEOUT THEN RETRY; Parameter Input data Cable data Output data \Str 1 char 1 byte (8 bits) 1 char \RawData 1 rawbytes 1 byte (8 bits) 1 rawbytes \Data 1 byte 1 byte (8 bits) 1 byte 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
472
1 Instructions 1.167. SocketSend - Send data to remote computer Socket Messaging 469 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.167. SocketSend - Send data to remote computer Usage SocketSend is used to send data to a remote computer. SocketSend can be used both for client and server applications. Basic examples Basic examples of the instruction SocketSend are illustrated below. See also More examples on page 470 . Example 1 SocketSend socket1 \Str := "Hello world"; Sends the message "Hello world" to the remote computer. Arguments SocketSend Socket [ \Str ] | [ \RawData ] | [ \Data] [ \NoOfBytes ] Socket Data type: socketdev In client application the socket to send from must already be created and connected. In server application the socket to send to must already be accepted. [ \Str ] Data type: string The string to send to the remote computer. [ \RawData ] Data type: rawbytes The rawbytes data to send to the remote computer. [ \Data ] Data type: array of byte The data in the byte array to send to the remote computer. Only one of the option parameters \Str , \RawData , or \Data can be used at the same time. [ \NoOfBytes ] Data type: num If this argument is specified only this number of bytes will be sent to the remote computer. The call to SocketSend will fail if \NoOfBytes is larger than the actual number of bytes in the data structure to send. If this argument is not specified then the whole data structure (valid part of rawbytes ) will be sent to the remote computer. Continues on next page 1 Instructions 1.167. SocketSend - Send data to remote computer Socket Messaging 3HAC 16581-1 Revision: J 470 © Copyright 2004-2010 ABB. All rights reserved. Program execution The specified data is sent to the remote computer. If the connection is broken an error is generated. The data that is transferred on the cable is always bytes, max. 1024 bytes in one message. No header is added by default to the message. The usage of any header is reserved for the actual application. It’s possible to mix the used data type ( string , rawbytes , or array of byte ) between SocketSend and SocketReceive . More examples More examples of the instruction SocketSend are illustrated below. Example 1 VAR socketdev client_socket; VAR string receive_string; PROC client_messaging() ... ! Create and connect the socket in error handlers SocketSend client_socket \Str := "Hello server"; SocketReceive client_socket \Str := receive_string; ... SocketClose client_socket; ERROR IF ERRNO=ERR_SOCK_TIMEOUT THEN RETRY; ELSEIF ERRNO=ERR_SOCK_CLOSED THEN client_recover; RETRY; ELSE ! No error recovery handling ENDIF ENDPROC PROC client_recover() SocketClose client_socket; SocketCreate client_socket; SocketConnect client_socket, "192.168.0.2", 1025; ERROR IF ERRNO=ERR_SOCK_TIMEOUT THEN RETRY; Parameter Input data Cable data Output data \Str 1 char 1 byte (8 bits) 1 char \RawData 1 rawbytes 1 byte (8 bits) 1 rawbytes \Data 1 byte 1 byte (8 bits) 1 byte Continued Continues on next page 1 Instructions 1.167. SocketSend - Send data to remote computer Socket Messaging 471 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. ELSEIF ERRNO=ERR_SOCK_CLOSED THEN RETURN; ELSE ! No error recovery handling ENDIF ENDPROC This is an example of a client program with creation and connection of socket in error handlers. In this way the program can handle power fail restart. In the procedure client_recover the client socket is created and connected to a remote computer server with IP-address 192.168.0.2 on port 1025 . In the communication procedure client_messaging the client sends "Hello server" to the server and the server responds with "Hello client" to the client, which is stored in the variable receive_string . Example 2 VAR socketdev client_socket; VAR string receive_string; PROC client_messaging() ... ! Send cr and lf to the server SocketSend client_socket \Str := "\0D\0A"; ... ENDPROC This is an example of a client program that sends non printable characters (binary data) in a string. This can be useful if communicating with sensors or other clients that requires such characters. Error handling The following recoverable errors can be generated. The errors can be handled in an ERROR handler. The system variable ERRNO will be set to: Limitations There is no built-in synchronization mechanism in Socket Messaging to avoid received messages that are compounded of several sent messages. It’s up to the programmer to handle the synchronization with “Ack” messages (one sequence of SocketSend - SocketReceive in the client or server program must be completed before the next sequence of SocketSend - SocketReceive ). All sockets are closed after power fail restart. This problem can be handled by error recovery. See example above. Avoid fast loops with SocketCreate ... SocketClose because the socket is not really closed until a certain time (TCP/IP functionality). The size of the data to send is limited to 1024 bytes. ERR_SOCK_CLOSED The socket is closed. Broken connection. 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
473
1 Instructions 1.167. SocketSend - Send data to remote computer Socket Messaging 3HAC 16581-1 Revision: J 470 © Copyright 2004-2010 ABB. All rights reserved. Program execution The specified data is sent to the remote computer. If the connection is broken an error is generated. The data that is transferred on the cable is always bytes, max. 1024 bytes in one message. No header is added by default to the message. The usage of any header is reserved for the actual application. It’s possible to mix the used data type ( string , rawbytes , or array of byte ) between SocketSend and SocketReceive . More examples More examples of the instruction SocketSend are illustrated below. Example 1 VAR socketdev client_socket; VAR string receive_string; PROC client_messaging() ... ! Create and connect the socket in error handlers SocketSend client_socket \Str := "Hello server"; SocketReceive client_socket \Str := receive_string; ... SocketClose client_socket; ERROR IF ERRNO=ERR_SOCK_TIMEOUT THEN RETRY; ELSEIF ERRNO=ERR_SOCK_CLOSED THEN client_recover; RETRY; ELSE ! No error recovery handling ENDIF ENDPROC PROC client_recover() SocketClose client_socket; SocketCreate client_socket; SocketConnect client_socket, "192.168.0.2", 1025; ERROR IF ERRNO=ERR_SOCK_TIMEOUT THEN RETRY; Parameter Input data Cable data Output data \Str 1 char 1 byte (8 bits) 1 char \RawData 1 rawbytes 1 byte (8 bits) 1 rawbytes \Data 1 byte 1 byte (8 bits) 1 byte Continued Continues on next page 1 Instructions 1.167. SocketSend - Send data to remote computer Socket Messaging 471 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. ELSEIF ERRNO=ERR_SOCK_CLOSED THEN RETURN; ELSE ! No error recovery handling ENDIF ENDPROC This is an example of a client program with creation and connection of socket in error handlers. In this way the program can handle power fail restart. In the procedure client_recover the client socket is created and connected to a remote computer server with IP-address 192.168.0.2 on port 1025 . In the communication procedure client_messaging the client sends "Hello server" to the server and the server responds with "Hello client" to the client, which is stored in the variable receive_string . Example 2 VAR socketdev client_socket; VAR string receive_string; PROC client_messaging() ... ! Send cr and lf to the server SocketSend client_socket \Str := "\0D\0A"; ... ENDPROC This is an example of a client program that sends non printable characters (binary data) in a string. This can be useful if communicating with sensors or other clients that requires such characters. Error handling The following recoverable errors can be generated. The errors can be handled in an ERROR handler. The system variable ERRNO will be set to: Limitations There is no built-in synchronization mechanism in Socket Messaging to avoid received messages that are compounded of several sent messages. It’s up to the programmer to handle the synchronization with “Ack” messages (one sequence of SocketSend - SocketReceive in the client or server program must be completed before the next sequence of SocketSend - SocketReceive ). All sockets are closed after power fail restart. This problem can be handled by error recovery. See example above. Avoid fast loops with SocketCreate ... SocketClose because the socket is not really closed until a certain time (TCP/IP functionality). The size of the data to send is limited to 1024 bytes. ERR_SOCK_CLOSED The socket is closed. Broken connection. Continued Continues on next page 1 Instructions 1.167. SocketSend - Send data to remote computer Socket Messaging 3HAC 16581-1 Revision: J 472 © Copyright 2004-2010 ABB. All rights reserved. Syntax SocketSend [ Socket ´:=´ ] < variable ( VAR ) of socketdev > [ \Str ´:=´ < expression ( IN ) of string > ] | [ \RawData ´:=´ < variable ( VAR ) of rawdata > ] | [ \Data ´:=´ < array {*} ( IN ) of byte > ] [ ’\’ NoOfBytes ´:=´ < expression ( IN ) of num > ] ’;’ Related information For information about See Socket communication in general Application manual - Robot communication and I/O control , section Socket Messaging Create a new socket SocketCreate - Create a new socket on page 460 Connect to remote computer (only client) SocketConnect - Connect to a remote computer on page 457 Receive data from remote computer SocketReceive - Receive data from remote computer on page 464 Close the socket SocketClose - Close a socket on page 455 Bind a socket (only server) SocketBind - Bind a socket to my IP-address and port on page 453 Listening connections (only server) SocketListen - Listen for incoming connections on page 462 Accept connections (only server) SocketAccept - Accept an incoming connection on page 450 Get current socket state SocketGetStatus - Get current socket state on page 973 Example server socket application SocketReceive - Receive data from remote computer on page 464 Use of non printable characters (binary data) in string literals. Technical reference manual - RAPID kernel , section String literals Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
474
1 Instructions 1.167. SocketSend - Send data to remote computer Socket Messaging 471 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. ELSEIF ERRNO=ERR_SOCK_CLOSED THEN RETURN; ELSE ! No error recovery handling ENDIF ENDPROC This is an example of a client program with creation and connection of socket in error handlers. In this way the program can handle power fail restart. In the procedure client_recover the client socket is created and connected to a remote computer server with IP-address 192.168.0.2 on port 1025 . In the communication procedure client_messaging the client sends "Hello server" to the server and the server responds with "Hello client" to the client, which is stored in the variable receive_string . Example 2 VAR socketdev client_socket; VAR string receive_string; PROC client_messaging() ... ! Send cr and lf to the server SocketSend client_socket \Str := "\0D\0A"; ... ENDPROC This is an example of a client program that sends non printable characters (binary data) in a string. This can be useful if communicating with sensors or other clients that requires such characters. Error handling The following recoverable errors can be generated. The errors can be handled in an ERROR handler. The system variable ERRNO will be set to: Limitations There is no built-in synchronization mechanism in Socket Messaging to avoid received messages that are compounded of several sent messages. It’s up to the programmer to handle the synchronization with “Ack” messages (one sequence of SocketSend - SocketReceive in the client or server program must be completed before the next sequence of SocketSend - SocketReceive ). All sockets are closed after power fail restart. This problem can be handled by error recovery. See example above. Avoid fast loops with SocketCreate ... SocketClose because the socket is not really closed until a certain time (TCP/IP functionality). The size of the data to send is limited to 1024 bytes. ERR_SOCK_CLOSED The socket is closed. Broken connection. Continued Continues on next page 1 Instructions 1.167. SocketSend - Send data to remote computer Socket Messaging 3HAC 16581-1 Revision: J 472 © Copyright 2004-2010 ABB. All rights reserved. Syntax SocketSend [ Socket ´:=´ ] < variable ( VAR ) of socketdev > [ \Str ´:=´ < expression ( IN ) of string > ] | [ \RawData ´:=´ < variable ( VAR ) of rawdata > ] | [ \Data ´:=´ < array {*} ( IN ) of byte > ] [ ’\’ NoOfBytes ´:=´ < expression ( IN ) of num > ] ’;’ Related information For information about See Socket communication in general Application manual - Robot communication and I/O control , section Socket Messaging Create a new socket SocketCreate - Create a new socket on page 460 Connect to remote computer (only client) SocketConnect - Connect to a remote computer on page 457 Receive data from remote computer SocketReceive - Receive data from remote computer on page 464 Close the socket SocketClose - Close a socket on page 455 Bind a socket (only server) SocketBind - Bind a socket to my IP-address and port on page 453 Listening connections (only server) SocketListen - Listen for incoming connections on page 462 Accept connections (only server) SocketAccept - Accept an incoming connection on page 450 Get current socket state SocketGetStatus - Get current socket state on page 973 Example server socket application SocketReceive - Receive data from remote computer on page 464 Use of non printable characters (binary data) in string literals. Technical reference manual - RAPID kernel , section String literals Continued 1 Instructions 1.168. SoftAct - Activating the soft servo RobotWare - OS 473 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.168. SoftAct - Activating the soft servo Usage SoftAct ( Soft Servo Activate ) is used to activate the so called “soft” servo on any axis of the robot or external mechanical unit. This instruction can only be used in the main task T_ROB1 or, if in a MultiMove system, in any motion tasks. Basic examples Basic examples of the instruction SoftAct are illustrated below. Example 1 SoftAct 3, 20; Activation of soft servo on robot axis 3 with softness value 20% . Example 2 SoftAct 1, 90 \Ramp:=150; Activation of the soft servo on robot axis 1 with softness value 90% and ramp factor 150% . Example 3 SoftAct \MechUnit:=orbit1, 1, 40 \Ramp:=120; Activation of soft servo on axis 1 for the mechanical unit orbit1 with softness value 40% and ramp factor 120% . Arguments SoftAct[\MechUnit] Axis Softness [\Ramp] [ \MechUnit ] Mechanical Unit Data type: mecunit The name of the mechanical unit. If this argument is omitted then it means activation of the soft servo for specified robot axis in the current program task. Axis Data type: num Number of the robot or external axis to work with soft servo. Softness Data type: num Softness value in percent (0 - 100%). 0% denotes min. softness (max. stiffness), and 100% denotes max. softness. [ \Ramp ] Data type: num Ramp factor in percent (>= 100%). The ramp factor is used to control the engagement of the soft servo. A factor 100% denotes the normal value; with greater values the soft servo is engaged more slowly (longer ramp). The default value for ramp factor is 100 %. Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
475
1 Instructions 1.167. SocketSend - Send data to remote computer Socket Messaging 3HAC 16581-1 Revision: J 472 © Copyright 2004-2010 ABB. All rights reserved. Syntax SocketSend [ Socket ´:=´ ] < variable ( VAR ) of socketdev > [ \Str ´:=´ < expression ( IN ) of string > ] | [ \RawData ´:=´ < variable ( VAR ) of rawdata > ] | [ \Data ´:=´ < array {*} ( IN ) of byte > ] [ ’\’ NoOfBytes ´:=´ < expression ( IN ) of num > ] ’;’ Related information For information about See Socket communication in general Application manual - Robot communication and I/O control , section Socket Messaging Create a new socket SocketCreate - Create a new socket on page 460 Connect to remote computer (only client) SocketConnect - Connect to a remote computer on page 457 Receive data from remote computer SocketReceive - Receive data from remote computer on page 464 Close the socket SocketClose - Close a socket on page 455 Bind a socket (only server) SocketBind - Bind a socket to my IP-address and port on page 453 Listening connections (only server) SocketListen - Listen for incoming connections on page 462 Accept connections (only server) SocketAccept - Accept an incoming connection on page 450 Get current socket state SocketGetStatus - Get current socket state on page 973 Example server socket application SocketReceive - Receive data from remote computer on page 464 Use of non printable characters (binary data) in string literals. Technical reference manual - RAPID kernel , section String literals Continued 1 Instructions 1.168. SoftAct - Activating the soft servo RobotWare - OS 473 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.168. SoftAct - Activating the soft servo Usage SoftAct ( Soft Servo Activate ) is used to activate the so called “soft” servo on any axis of the robot or external mechanical unit. This instruction can only be used in the main task T_ROB1 or, if in a MultiMove system, in any motion tasks. Basic examples Basic examples of the instruction SoftAct are illustrated below. Example 1 SoftAct 3, 20; Activation of soft servo on robot axis 3 with softness value 20% . Example 2 SoftAct 1, 90 \Ramp:=150; Activation of the soft servo on robot axis 1 with softness value 90% and ramp factor 150% . Example 3 SoftAct \MechUnit:=orbit1, 1, 40 \Ramp:=120; Activation of soft servo on axis 1 for the mechanical unit orbit1 with softness value 40% and ramp factor 120% . Arguments SoftAct[\MechUnit] Axis Softness [\Ramp] [ \MechUnit ] Mechanical Unit Data type: mecunit The name of the mechanical unit. If this argument is omitted then it means activation of the soft servo for specified robot axis in the current program task. Axis Data type: num Number of the robot or external axis to work with soft servo. Softness Data type: num Softness value in percent (0 - 100%). 0% denotes min. softness (max. stiffness), and 100% denotes max. softness. [ \Ramp ] Data type: num Ramp factor in percent (>= 100%). The ramp factor is used to control the engagement of the soft servo. A factor 100% denotes the normal value; with greater values the soft servo is engaged more slowly (longer ramp). The default value for ramp factor is 100 %. Continues on next page 1 Instructions 1.168. SoftAct - Activating the soft servo RobotWare - OS 3HAC 16581-1 Revision: J 474 © Copyright 2004-2010 ABB. All rights reserved. Program execution Softness is activated at the value specified for the current axis. The softness value is valid for all movement until a new softness value is programmed for the current axis or until the soft servo is deactivated by the instruction SoftDeact . Limitations Soft servo for any robot or external axis is always deactivated when there is a power failure. This limitation can be handled in the user program when restarting after a power failure. The same axis must not be activated twice unless there is a moving instruction in between. Thus, the following program sequence should be avoided. Otherwise there will be a jerk in the robot movement: SoftAct n , x ; SoftAct n , y ; (n = robot axis n, x, and y softness values) Syntax SoftAct [’\’MechUnit ’:=’ < variable ( VAR ) of mecunit>´,´] [Axis ’:=’ ] < expression ( IN ) of num> ’,’ [Softness’:=’ ] < expression ( IN ) of num> ´,´ [ ’\’Ramp’:=’ < expression ( IN ) of num> ]’;’ Related information For information about See Deactivate soft servo SoftDeact - Deactivating the soft servo on page 475 Behavior with the soft servo engaged Technical reference manual - RAPID overview , section Motion and I/O principles - Positioning during program execution Configuration of external axes Application manual - Additional axes and stand alone controller , section Axes Configuration - Soft servo Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
476
1 Instructions 1.168. SoftAct - Activating the soft servo RobotWare - OS 473 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.168. SoftAct - Activating the soft servo Usage SoftAct ( Soft Servo Activate ) is used to activate the so called “soft” servo on any axis of the robot or external mechanical unit. This instruction can only be used in the main task T_ROB1 or, if in a MultiMove system, in any motion tasks. Basic examples Basic examples of the instruction SoftAct are illustrated below. Example 1 SoftAct 3, 20; Activation of soft servo on robot axis 3 with softness value 20% . Example 2 SoftAct 1, 90 \Ramp:=150; Activation of the soft servo on robot axis 1 with softness value 90% and ramp factor 150% . Example 3 SoftAct \MechUnit:=orbit1, 1, 40 \Ramp:=120; Activation of soft servo on axis 1 for the mechanical unit orbit1 with softness value 40% and ramp factor 120% . Arguments SoftAct[\MechUnit] Axis Softness [\Ramp] [ \MechUnit ] Mechanical Unit Data type: mecunit The name of the mechanical unit. If this argument is omitted then it means activation of the soft servo for specified robot axis in the current program task. Axis Data type: num Number of the robot or external axis to work with soft servo. Softness Data type: num Softness value in percent (0 - 100%). 0% denotes min. softness (max. stiffness), and 100% denotes max. softness. [ \Ramp ] Data type: num Ramp factor in percent (>= 100%). The ramp factor is used to control the engagement of the soft servo. A factor 100% denotes the normal value; with greater values the soft servo is engaged more slowly (longer ramp). The default value for ramp factor is 100 %. Continues on next page 1 Instructions 1.168. SoftAct - Activating the soft servo RobotWare - OS 3HAC 16581-1 Revision: J 474 © Copyright 2004-2010 ABB. All rights reserved. Program execution Softness is activated at the value specified for the current axis. The softness value is valid for all movement until a new softness value is programmed for the current axis or until the soft servo is deactivated by the instruction SoftDeact . Limitations Soft servo for any robot or external axis is always deactivated when there is a power failure. This limitation can be handled in the user program when restarting after a power failure. The same axis must not be activated twice unless there is a moving instruction in between. Thus, the following program sequence should be avoided. Otherwise there will be a jerk in the robot movement: SoftAct n , x ; SoftAct n , y ; (n = robot axis n, x, and y softness values) Syntax SoftAct [’\’MechUnit ’:=’ < variable ( VAR ) of mecunit>´,´] [Axis ’:=’ ] < expression ( IN ) of num> ’,’ [Softness’:=’ ] < expression ( IN ) of num> ´,´ [ ’\’Ramp’:=’ < expression ( IN ) of num> ]’;’ Related information For information about See Deactivate soft servo SoftDeact - Deactivating the soft servo on page 475 Behavior with the soft servo engaged Technical reference manual - RAPID overview , section Motion and I/O principles - Positioning during program execution Configuration of external axes Application manual - Additional axes and stand alone controller , section Axes Configuration - Soft servo Continued 1 Instructions 1.169. SoftDeact - Deactivating the soft servo RobotWare - OS 475 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.169. SoftDeact - Deactivating the soft servo Usage SoftDeact ( Soft Servo Deactivate ) is used to deactivate the so called “soft” servo. Basic examples Basic examples of the instruction SoftDeact are illustrated below. Example 1 SoftDeact; Deactivating the soft servo on all axes. Example 2 SoftDeact \Ramp:=150; Deactivating the soft servo on all axes, with ramp factor 150 %. Arguments SoftDeact [\Ramp] [ \Ramp ] Data type: num Ramp factor in percent (>= 100 %). The ramp factor is used to control the deactivating of the soft servo. A factor 100% denotes the normal value. With greater values the soft servo is deactivated more slowly (longer ramp). The default value for ramp factor is 100 %. Program execution The soft servo is deactivated for the mechanical units that are controlled from current program task. If SoftDeact is done from a non-motion task, the soft servo is deactivated for the mechanical unit controlled by the connected motion task. Executing a SoftDeact when in synchronized movement mode, soft servo will be deactivated for all mechanical units that are synchronized. When deactivating soft servo with SoftDeact the robot will move to the programmed position even if the robot has moved out of position during soft servo activation. Syntax SoftDeact [ ’\’Ramp ’:=’ < expression ( IN ) of num> ]’;’ Related information For information about See Activating the soft servo SoftAct - Activating the soft servo on page 473
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
477
1 Instructions 1.168. SoftAct - Activating the soft servo RobotWare - OS 3HAC 16581-1 Revision: J 474 © Copyright 2004-2010 ABB. All rights reserved. Program execution Softness is activated at the value specified for the current axis. The softness value is valid for all movement until a new softness value is programmed for the current axis or until the soft servo is deactivated by the instruction SoftDeact . Limitations Soft servo for any robot or external axis is always deactivated when there is a power failure. This limitation can be handled in the user program when restarting after a power failure. The same axis must not be activated twice unless there is a moving instruction in between. Thus, the following program sequence should be avoided. Otherwise there will be a jerk in the robot movement: SoftAct n , x ; SoftAct n , y ; (n = robot axis n, x, and y softness values) Syntax SoftAct [’\’MechUnit ’:=’ < variable ( VAR ) of mecunit>´,´] [Axis ’:=’ ] < expression ( IN ) of num> ’,’ [Softness’:=’ ] < expression ( IN ) of num> ´,´ [ ’\’Ramp’:=’ < expression ( IN ) of num> ]’;’ Related information For information about See Deactivate soft servo SoftDeact - Deactivating the soft servo on page 475 Behavior with the soft servo engaged Technical reference manual - RAPID overview , section Motion and I/O principles - Positioning during program execution Configuration of external axes Application manual - Additional axes and stand alone controller , section Axes Configuration - Soft servo Continued 1 Instructions 1.169. SoftDeact - Deactivating the soft servo RobotWare - OS 475 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.169. SoftDeact - Deactivating the soft servo Usage SoftDeact ( Soft Servo Deactivate ) is used to deactivate the so called “soft” servo. Basic examples Basic examples of the instruction SoftDeact are illustrated below. Example 1 SoftDeact; Deactivating the soft servo on all axes. Example 2 SoftDeact \Ramp:=150; Deactivating the soft servo on all axes, with ramp factor 150 %. Arguments SoftDeact [\Ramp] [ \Ramp ] Data type: num Ramp factor in percent (>= 100 %). The ramp factor is used to control the deactivating of the soft servo. A factor 100% denotes the normal value. With greater values the soft servo is deactivated more slowly (longer ramp). The default value for ramp factor is 100 %. Program execution The soft servo is deactivated for the mechanical units that are controlled from current program task. If SoftDeact is done from a non-motion task, the soft servo is deactivated for the mechanical unit controlled by the connected motion task. Executing a SoftDeact when in synchronized movement mode, soft servo will be deactivated for all mechanical units that are synchronized. When deactivating soft servo with SoftDeact the robot will move to the programmed position even if the robot has moved out of position during soft servo activation. Syntax SoftDeact [ ’\’Ramp ’:=’ < expression ( IN ) of num> ]’;’ Related information For information about See Activating the soft servo SoftAct - Activating the soft servo on page 473 1 Instructions 1.170. SpeedRefresh - Update speed override for ongoing movement RobotWare - OS 3HAC 16581-1 Revision: J 476 © Copyright 2004-2010 ABB. All rights reserved. 1.170. SpeedRefresh - Update speed override for ongoing movement Usage SpeedRefresh is used to change the movement speed for the ongoing robot movement in current motion program task. With this instruction it is possible to create some type of coarse speed adaptation from some sensor input. This instruction can only be used in the main task T_ROB1 or, if in a MultiMove system, in any Motion tasks. Basic examples Basic examples of the instruction SpeedRefresh are illustrated below. Example 1 VAR num change_speed:=70; SpeedRefresh change_speed; This will change the current speed override to 70%. Arguments SpeedRefresh Override Override Data type: num The speed override value within range 0 ... 100 %. Program execution The actual speed override value for the ongoing movements of robot and external units in current motion program task will be updated. All speed data components for any mechanical units in current motion task will be influenced. This speed override value generated with this instruction will replace any speed override value generated from FlexPendant for this motion task (no influence on other motion tasks). If the override speed used for the instruction SpeedRefresh exceeds the value set from the FlexPendant, the lowest value will be used. This means, that the speed can not be increased above the speed set from the FlexPendant. If a PP to main is done or if a new program is loaded, the speed that was set with SpeedRefresh will be resetted, and the speed set from the FlexPendant will be applied. Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
478
1 Instructions 1.169. SoftDeact - Deactivating the soft servo RobotWare - OS 475 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.169. SoftDeact - Deactivating the soft servo Usage SoftDeact ( Soft Servo Deactivate ) is used to deactivate the so called “soft” servo. Basic examples Basic examples of the instruction SoftDeact are illustrated below. Example 1 SoftDeact; Deactivating the soft servo on all axes. Example 2 SoftDeact \Ramp:=150; Deactivating the soft servo on all axes, with ramp factor 150 %. Arguments SoftDeact [\Ramp] [ \Ramp ] Data type: num Ramp factor in percent (>= 100 %). The ramp factor is used to control the deactivating of the soft servo. A factor 100% denotes the normal value. With greater values the soft servo is deactivated more slowly (longer ramp). The default value for ramp factor is 100 %. Program execution The soft servo is deactivated for the mechanical units that are controlled from current program task. If SoftDeact is done from a non-motion task, the soft servo is deactivated for the mechanical unit controlled by the connected motion task. Executing a SoftDeact when in synchronized movement mode, soft servo will be deactivated for all mechanical units that are synchronized. When deactivating soft servo with SoftDeact the robot will move to the programmed position even if the robot has moved out of position during soft servo activation. Syntax SoftDeact [ ’\’Ramp ’:=’ < expression ( IN ) of num> ]’;’ Related information For information about See Activating the soft servo SoftAct - Activating the soft servo on page 473 1 Instructions 1.170. SpeedRefresh - Update speed override for ongoing movement RobotWare - OS 3HAC 16581-1 Revision: J 476 © Copyright 2004-2010 ABB. All rights reserved. 1.170. SpeedRefresh - Update speed override for ongoing movement Usage SpeedRefresh is used to change the movement speed for the ongoing robot movement in current motion program task. With this instruction it is possible to create some type of coarse speed adaptation from some sensor input. This instruction can only be used in the main task T_ROB1 or, if in a MultiMove system, in any Motion tasks. Basic examples Basic examples of the instruction SpeedRefresh are illustrated below. Example 1 VAR num change_speed:=70; SpeedRefresh change_speed; This will change the current speed override to 70%. Arguments SpeedRefresh Override Override Data type: num The speed override value within range 0 ... 100 %. Program execution The actual speed override value for the ongoing movements of robot and external units in current motion program task will be updated. All speed data components for any mechanical units in current motion task will be influenced. This speed override value generated with this instruction will replace any speed override value generated from FlexPendant for this motion task (no influence on other motion tasks). If the override speed used for the instruction SpeedRefresh exceeds the value set from the FlexPendant, the lowest value will be used. This means, that the speed can not be increased above the speed set from the FlexPendant. If a PP to main is done or if a new program is loaded, the speed that was set with SpeedRefresh will be resetted, and the speed set from the FlexPendant will be applied. Continues on next page 1 Instructions 1.170. SpeedRefresh - Update speed override for ongoing movement RobotWare - OS 477 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. More examples More examples of the instruction SpeedRefresh are illustrated below. Example 1 VAR intnum time_int; VAR num override; ... CONNECT time_int WITH speed_refresh; ITimer 0.1, time_int; ISleep time_int; ... MoveL p1, v100, fine, tool2; ! Read current speed override set from FlexPendant override := CSpeedOverride (\CTask); IWatch time_int; MoveL p2, v100, fine, tool2; IDelete time_int; ! Reset to FlexPendant old speed override WaitTime 0.5; SpeedRefresh override; ... TRAP speed_refresh VAR speed_corr; ! Analog input signal value from sensor, value 0 ... 10 speed_corr := (ai_sensor * 10); SpeedRefresh speed_corr; ERROR IF ERRNO = ERR_SPEED_REFRESH_LIM THEN IF speed_corr > 100 speed_corr := 100; IF speed_corr < 0 speed_corr := 0; RETRY; ENDIF ENDTRAP During the robot movement from position p1 to p2 , the speed override value is updated every 0.1 s in the TRAP speed_refresh . The analog input signal ai_sensor is used for calculation of Overide value for the instruction SpeedRefresh . There is no TRAP execution before and after the robot movement between p1 and p2 . The manual speed override from FlexPendant is restored. After that the robot has to reach p2 . Error handling If Override has a value outside the range of 0 to 100 % then the ERRNO variable will be s et to ERR_SPEED_REFRESH_LIM . This error is recoverable and can be handled in the ERROR handler. Continued Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
479
1 Instructions 1.170. SpeedRefresh - Update speed override for ongoing movement RobotWare - OS 3HAC 16581-1 Revision: J 476 © Copyright 2004-2010 ABB. All rights reserved. 1.170. SpeedRefresh - Update speed override for ongoing movement Usage SpeedRefresh is used to change the movement speed for the ongoing robot movement in current motion program task. With this instruction it is possible to create some type of coarse speed adaptation from some sensor input. This instruction can only be used in the main task T_ROB1 or, if in a MultiMove system, in any Motion tasks. Basic examples Basic examples of the instruction SpeedRefresh are illustrated below. Example 1 VAR num change_speed:=70; SpeedRefresh change_speed; This will change the current speed override to 70%. Arguments SpeedRefresh Override Override Data type: num The speed override value within range 0 ... 100 %. Program execution The actual speed override value for the ongoing movements of robot and external units in current motion program task will be updated. All speed data components for any mechanical units in current motion task will be influenced. This speed override value generated with this instruction will replace any speed override value generated from FlexPendant for this motion task (no influence on other motion tasks). If the override speed used for the instruction SpeedRefresh exceeds the value set from the FlexPendant, the lowest value will be used. This means, that the speed can not be increased above the speed set from the FlexPendant. If a PP to main is done or if a new program is loaded, the speed that was set with SpeedRefresh will be resetted, and the speed set from the FlexPendant will be applied. Continues on next page 1 Instructions 1.170. SpeedRefresh - Update speed override for ongoing movement RobotWare - OS 477 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. More examples More examples of the instruction SpeedRefresh are illustrated below. Example 1 VAR intnum time_int; VAR num override; ... CONNECT time_int WITH speed_refresh; ITimer 0.1, time_int; ISleep time_int; ... MoveL p1, v100, fine, tool2; ! Read current speed override set from FlexPendant override := CSpeedOverride (\CTask); IWatch time_int; MoveL p2, v100, fine, tool2; IDelete time_int; ! Reset to FlexPendant old speed override WaitTime 0.5; SpeedRefresh override; ... TRAP speed_refresh VAR speed_corr; ! Analog input signal value from sensor, value 0 ... 10 speed_corr := (ai_sensor * 10); SpeedRefresh speed_corr; ERROR IF ERRNO = ERR_SPEED_REFRESH_LIM THEN IF speed_corr > 100 speed_corr := 100; IF speed_corr < 0 speed_corr := 0; RETRY; ENDIF ENDTRAP During the robot movement from position p1 to p2 , the speed override value is updated every 0.1 s in the TRAP speed_refresh . The analog input signal ai_sensor is used for calculation of Overide value for the instruction SpeedRefresh . There is no TRAP execution before and after the robot movement between p1 and p2 . The manual speed override from FlexPendant is restored. After that the robot has to reach p2 . Error handling If Override has a value outside the range of 0 to 100 % then the ERRNO variable will be s et to ERR_SPEED_REFRESH_LIM . This error is recoverable and can be handled in the ERROR handler. Continued Continues on next page 1 Instructions 1.170. SpeedRefresh - Update speed override for ongoing movement RobotWare - OS 3HAC 16581-1 Revision: J 478 © Copyright 2004-2010 ABB. All rights reserved. Limitations Note that with SpeedRefresh the speed override will not be done momentary. Instead there will be a lag of 0,3 - 0,5 seconds between order and influence on the physical robot. The user is responsible to reset the speed override value from the RAPID program after the SpeedRefresh sequence. The override speed can not be increased above the speed override set from the FlexPendant. If SpeedRefresh is used in the START or in the RESET event routine, the speed that is set is always the actual FlexPendant speed override. Syntax SpeedRefresh [ Override ’:=’ ] < expression ( IN ) of num > ’;’ Related information For information about See Positioning instructions Technical reference manual - RAPID overview , section RAPID summary - Motion Definition of velocity speeddata - Speed data on page 1185 Read current speed override CSpeedOverride - Reads the current override speed on page 810 Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
480
1 Instructions 1.170. SpeedRefresh - Update speed override for ongoing movement RobotWare - OS 477 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. More examples More examples of the instruction SpeedRefresh are illustrated below. Example 1 VAR intnum time_int; VAR num override; ... CONNECT time_int WITH speed_refresh; ITimer 0.1, time_int; ISleep time_int; ... MoveL p1, v100, fine, tool2; ! Read current speed override set from FlexPendant override := CSpeedOverride (\CTask); IWatch time_int; MoveL p2, v100, fine, tool2; IDelete time_int; ! Reset to FlexPendant old speed override WaitTime 0.5; SpeedRefresh override; ... TRAP speed_refresh VAR speed_corr; ! Analog input signal value from sensor, value 0 ... 10 speed_corr := (ai_sensor * 10); SpeedRefresh speed_corr; ERROR IF ERRNO = ERR_SPEED_REFRESH_LIM THEN IF speed_corr > 100 speed_corr := 100; IF speed_corr < 0 speed_corr := 0; RETRY; ENDIF ENDTRAP During the robot movement from position p1 to p2 , the speed override value is updated every 0.1 s in the TRAP speed_refresh . The analog input signal ai_sensor is used for calculation of Overide value for the instruction SpeedRefresh . There is no TRAP execution before and after the robot movement between p1 and p2 . The manual speed override from FlexPendant is restored. After that the robot has to reach p2 . Error handling If Override has a value outside the range of 0 to 100 % then the ERRNO variable will be s et to ERR_SPEED_REFRESH_LIM . This error is recoverable and can be handled in the ERROR handler. Continued Continues on next page 1 Instructions 1.170. SpeedRefresh - Update speed override for ongoing movement RobotWare - OS 3HAC 16581-1 Revision: J 478 © Copyright 2004-2010 ABB. All rights reserved. Limitations Note that with SpeedRefresh the speed override will not be done momentary. Instead there will be a lag of 0,3 - 0,5 seconds between order and influence on the physical robot. The user is responsible to reset the speed override value from the RAPID program after the SpeedRefresh sequence. The override speed can not be increased above the speed override set from the FlexPendant. If SpeedRefresh is used in the START or in the RESET event routine, the speed that is set is always the actual FlexPendant speed override. Syntax SpeedRefresh [ Override ’:=’ ] < expression ( IN ) of num > ’;’ Related information For information about See Positioning instructions Technical reference manual - RAPID overview , section RAPID summary - Motion Definition of velocity speeddata - Speed data on page 1185 Read current speed override CSpeedOverride - Reads the current override speed on page 810 Continued 1 Instructions 1.171. SpyStart - Start recording of execution time data RobotWare - OS 479 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.171. SpyStart - Start recording of execution time data Usage SpyStart is used to start the recording of instruction and time data during execution. The execution data will be stored in a file for later analysis. The stored data is intended for debugging RAPID programs, specifically for multi-tasking systems (only necessary to have SpyStart - SpyStop in one program task). Basic examples Basic examples of the instruction SpyStart are illustrated below. Example 1 SpyStart "HOME:/spy.log"; Starts recording the execution time data in the file spy.log on the HOME : disk. Arguments SpyStart File File Data type: string The file path and the file name to the file that will contain the execution data. Program execution The specified file is opened for writing and the execution time data begins recording in the file. Recording of execution time data is active until: • execution of instruction SpyStop • starting program execution from the beginning • loading a new program • next warm start-up Limitations Avoid using the floppy disk (option) for recording since writing to the floppy is very time consuming. Never use the spy function in production programs because the function increases the cycle time and consumes memory on the mass memory device in use. Error handling If the file in the SpyStart instruction can’t be opened then the system variable ERRNO is set to ERR_FILEOPEN (see "Data types - errnum "). This error can then be handled in the error handler. Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
481
1 Instructions 1.170. SpeedRefresh - Update speed override for ongoing movement RobotWare - OS 3HAC 16581-1 Revision: J 478 © Copyright 2004-2010 ABB. All rights reserved. Limitations Note that with SpeedRefresh the speed override will not be done momentary. Instead there will be a lag of 0,3 - 0,5 seconds between order and influence on the physical robot. The user is responsible to reset the speed override value from the RAPID program after the SpeedRefresh sequence. The override speed can not be increased above the speed override set from the FlexPendant. If SpeedRefresh is used in the START or in the RESET event routine, the speed that is set is always the actual FlexPendant speed override. Syntax SpeedRefresh [ Override ’:=’ ] < expression ( IN ) of num > ’;’ Related information For information about See Positioning instructions Technical reference manual - RAPID overview , section RAPID summary - Motion Definition of velocity speeddata - Speed data on page 1185 Read current speed override CSpeedOverride - Reads the current override speed on page 810 Continued 1 Instructions 1.171. SpyStart - Start recording of execution time data RobotWare - OS 479 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.171. SpyStart - Start recording of execution time data Usage SpyStart is used to start the recording of instruction and time data during execution. The execution data will be stored in a file for later analysis. The stored data is intended for debugging RAPID programs, specifically for multi-tasking systems (only necessary to have SpyStart - SpyStop in one program task). Basic examples Basic examples of the instruction SpyStart are illustrated below. Example 1 SpyStart "HOME:/spy.log"; Starts recording the execution time data in the file spy.log on the HOME : disk. Arguments SpyStart File File Data type: string The file path and the file name to the file that will contain the execution data. Program execution The specified file is opened for writing and the execution time data begins recording in the file. Recording of execution time data is active until: • execution of instruction SpyStop • starting program execution from the beginning • loading a new program • next warm start-up Limitations Avoid using the floppy disk (option) for recording since writing to the floppy is very time consuming. Never use the spy function in production programs because the function increases the cycle time and consumes memory on the mass memory device in use. Error handling If the file in the SpyStart instruction can’t be opened then the system variable ERRNO is set to ERR_FILEOPEN (see "Data types - errnum "). This error can then be handled in the error handler. Continues on next page 1 Instructions 1.171. SpyStart - Start recording of execution time data RobotWare - OS 3HAC 16581-1 Revision: J 480 © Copyright 2004-2010 ABB. All rights reserved. File format TASK column shows executed program task. INSTR column shows executed instruction in specified program task. IN column shows the time in ms when entering the executed instruction. CODE column shows if the instruction is READY or the instruction WAIT for completion at OUT time. OUT column shows the time in ms upon leaving the executed instruction. All times are given in ms (relative values). SYSTEM TRAP means that the system is doing something else than execution of RAPID instructions. If the procedure calls to some NOSTEPIN procedure (module) then the output list shows only the name of the called procedure. This is repeated for every executed instruction in the NOSTEPIN routine. Syntax SpyStart [File’:=’]<expression ( IN ) of string>’;’ Related information TASK INSTR IN CODE OUT MAIN FOR i FROM 1 TO 3 DO 0 READY 0 MAIN mynum:=mynum+i; 1 READY 1 MAIN ENDFOR 2 READY 2 MAIN mynum:=mynum+i; 2 READY 2 MAIN ENDFOR 2 READY 2 MAIN mynum:=mynum+i; 2 READY 2 MAIN ENDFOR 2 READY 3 MAIN SetDo1,1; 3 READY 3 MAIN IF di1=0 THEN 3 READY 4 MAIN MoveL p1, v1000, fine, tool0; 4 WAIT 14 SYSTEM TRAP MAIN MoveL p1, v1000, fine, tool0; 111 READY 111 MAIN ENDIF 108 READY 108 MAIN MoveL p2, v1000, fine, tool0; 111 WAIT 118 SYSTEM TRAP MAIN MoveL p2, v1000, fine, tool0; 326 READY 326 MAIN SpyStop; 326 READY For information about See Stop recording of execution data SpyStop - Stop recording of time execution data on page 481 Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
482
1 Instructions 1.171. SpyStart - Start recording of execution time data RobotWare - OS 479 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.171. SpyStart - Start recording of execution time data Usage SpyStart is used to start the recording of instruction and time data during execution. The execution data will be stored in a file for later analysis. The stored data is intended for debugging RAPID programs, specifically for multi-tasking systems (only necessary to have SpyStart - SpyStop in one program task). Basic examples Basic examples of the instruction SpyStart are illustrated below. Example 1 SpyStart "HOME:/spy.log"; Starts recording the execution time data in the file spy.log on the HOME : disk. Arguments SpyStart File File Data type: string The file path and the file name to the file that will contain the execution data. Program execution The specified file is opened for writing and the execution time data begins recording in the file. Recording of execution time data is active until: • execution of instruction SpyStop • starting program execution from the beginning • loading a new program • next warm start-up Limitations Avoid using the floppy disk (option) for recording since writing to the floppy is very time consuming. Never use the spy function in production programs because the function increases the cycle time and consumes memory on the mass memory device in use. Error handling If the file in the SpyStart instruction can’t be opened then the system variable ERRNO is set to ERR_FILEOPEN (see "Data types - errnum "). This error can then be handled in the error handler. Continues on next page 1 Instructions 1.171. SpyStart - Start recording of execution time data RobotWare - OS 3HAC 16581-1 Revision: J 480 © Copyright 2004-2010 ABB. All rights reserved. File format TASK column shows executed program task. INSTR column shows executed instruction in specified program task. IN column shows the time in ms when entering the executed instruction. CODE column shows if the instruction is READY or the instruction WAIT for completion at OUT time. OUT column shows the time in ms upon leaving the executed instruction. All times are given in ms (relative values). SYSTEM TRAP means that the system is doing something else than execution of RAPID instructions. If the procedure calls to some NOSTEPIN procedure (module) then the output list shows only the name of the called procedure. This is repeated for every executed instruction in the NOSTEPIN routine. Syntax SpyStart [File’:=’]<expression ( IN ) of string>’;’ Related information TASK INSTR IN CODE OUT MAIN FOR i FROM 1 TO 3 DO 0 READY 0 MAIN mynum:=mynum+i; 1 READY 1 MAIN ENDFOR 2 READY 2 MAIN mynum:=mynum+i; 2 READY 2 MAIN ENDFOR 2 READY 2 MAIN mynum:=mynum+i; 2 READY 2 MAIN ENDFOR 2 READY 3 MAIN SetDo1,1; 3 READY 3 MAIN IF di1=0 THEN 3 READY 4 MAIN MoveL p1, v1000, fine, tool0; 4 WAIT 14 SYSTEM TRAP MAIN MoveL p1, v1000, fine, tool0; 111 READY 111 MAIN ENDIF 108 READY 108 MAIN MoveL p2, v1000, fine, tool0; 111 WAIT 118 SYSTEM TRAP MAIN MoveL p2, v1000, fine, tool0; 326 READY 326 MAIN SpyStop; 326 READY For information about See Stop recording of execution data SpyStop - Stop recording of time execution data on page 481 Continued 1 Instructions 1.172. SpyStop - Stop recording of time execution data RobotWare - OS 481 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.172. SpyStop - Stop recording of time execution data Usage SpyStop is used to stop the recording of time data during execution. The data, which can be useful for optimizing the execution cycle time, is stored in a file for later analysis. Basic examples Basic examples of the instruction SpyStop are illustrated below. See also More examples on page 481 . Example 1 SpyStop; Stops recording the execution time data in the file specified by the previous SpyStart instruction. Program execution The execution data recording is stopped and the file specified by the previous SpyStart instruction is closed. If no SpyStart instruction has been executed before then the SpyStop instruction is ignored. More examples More examples of the instruction SpyStop are illustrated below. Example 1 IF debug = TRUE SpyStart "HOME:/spy.log"; produce_sheets; IF debug = TRUE SpyStop; If the debug flag is true then start recording execution data in the file spy.log on the HOME : disk. Perform actual production; stop recording, and close the file spy.log . Limitations Avoid using the floppy disk (option) for recording since writing to the floppy is very time consuming. Never use the spy function in production programs because the function increases the cycle time and consumes memory on the mass memory device in use. Syntax SpyStop’;’ Related information For information about See Start recording of execution data SpyStart - Start recording of execution time data on page 479
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
483
1 Instructions 1.171. SpyStart - Start recording of execution time data RobotWare - OS 3HAC 16581-1 Revision: J 480 © Copyright 2004-2010 ABB. All rights reserved. File format TASK column shows executed program task. INSTR column shows executed instruction in specified program task. IN column shows the time in ms when entering the executed instruction. CODE column shows if the instruction is READY or the instruction WAIT for completion at OUT time. OUT column shows the time in ms upon leaving the executed instruction. All times are given in ms (relative values). SYSTEM TRAP means that the system is doing something else than execution of RAPID instructions. If the procedure calls to some NOSTEPIN procedure (module) then the output list shows only the name of the called procedure. This is repeated for every executed instruction in the NOSTEPIN routine. Syntax SpyStart [File’:=’]<expression ( IN ) of string>’;’ Related information TASK INSTR IN CODE OUT MAIN FOR i FROM 1 TO 3 DO 0 READY 0 MAIN mynum:=mynum+i; 1 READY 1 MAIN ENDFOR 2 READY 2 MAIN mynum:=mynum+i; 2 READY 2 MAIN ENDFOR 2 READY 2 MAIN mynum:=mynum+i; 2 READY 2 MAIN ENDFOR 2 READY 3 MAIN SetDo1,1; 3 READY 3 MAIN IF di1=0 THEN 3 READY 4 MAIN MoveL p1, v1000, fine, tool0; 4 WAIT 14 SYSTEM TRAP MAIN MoveL p1, v1000, fine, tool0; 111 READY 111 MAIN ENDIF 108 READY 108 MAIN MoveL p2, v1000, fine, tool0; 111 WAIT 118 SYSTEM TRAP MAIN MoveL p2, v1000, fine, tool0; 326 READY 326 MAIN SpyStop; 326 READY For information about See Stop recording of execution data SpyStop - Stop recording of time execution data on page 481 Continued 1 Instructions 1.172. SpyStop - Stop recording of time execution data RobotWare - OS 481 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.172. SpyStop - Stop recording of time execution data Usage SpyStop is used to stop the recording of time data during execution. The data, which can be useful for optimizing the execution cycle time, is stored in a file for later analysis. Basic examples Basic examples of the instruction SpyStop are illustrated below. See also More examples on page 481 . Example 1 SpyStop; Stops recording the execution time data in the file specified by the previous SpyStart instruction. Program execution The execution data recording is stopped and the file specified by the previous SpyStart instruction is closed. If no SpyStart instruction has been executed before then the SpyStop instruction is ignored. More examples More examples of the instruction SpyStop are illustrated below. Example 1 IF debug = TRUE SpyStart "HOME:/spy.log"; produce_sheets; IF debug = TRUE SpyStop; If the debug flag is true then start recording execution data in the file spy.log on the HOME : disk. Perform actual production; stop recording, and close the file spy.log . Limitations Avoid using the floppy disk (option) for recording since writing to the floppy is very time consuming. Never use the spy function in production programs because the function increases the cycle time and consumes memory on the mass memory device in use. Syntax SpyStop’;’ Related information For information about See Start recording of execution data SpyStart - Start recording of execution time data on page 479 1 Instructions 1.173. StartLoad - Load a program module during execution RobotWare - OS 3HAC 16581-1 Revision: J 482 © Copyright 2004-2010 ABB. All rights reserved. 1.173. StartLoad - Load a program module during execution Usage StartLoad is used to start the loading of a program module into the program memory during execution. When loading is in progress other instructions can be executed in parallel. The loaded module must be connected to the program task with the instruction WaitLoad before any of its symbols/routines can be used. The loaded program module will be added to the modules already existing in the program memory. A program or system module can be loaded in static (default) or dynamic mode. Depending on the used mode, some operations will unload the module or not affect the module at all. Static mode The following table shows how two different operations affect a static loaded program or system modules. Dynamic mode The following table shows how two different operations affect a dynamic loaded program or system modules. Both static and dynamic loaded modules can be unloaded by the instruction UnLoad . Set PP to main from TP Open new RAPID program Program Module Not affected Unloaded System Module Not affected Not affected Set PP to main from TP Open new RAPID program Program Module Unloaded Unloaded System Module Unloaded Unloaded Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
484
1 Instructions 1.172. SpyStop - Stop recording of time execution data RobotWare - OS 481 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.172. SpyStop - Stop recording of time execution data Usage SpyStop is used to stop the recording of time data during execution. The data, which can be useful for optimizing the execution cycle time, is stored in a file for later analysis. Basic examples Basic examples of the instruction SpyStop are illustrated below. See also More examples on page 481 . Example 1 SpyStop; Stops recording the execution time data in the file specified by the previous SpyStart instruction. Program execution The execution data recording is stopped and the file specified by the previous SpyStart instruction is closed. If no SpyStart instruction has been executed before then the SpyStop instruction is ignored. More examples More examples of the instruction SpyStop are illustrated below. Example 1 IF debug = TRUE SpyStart "HOME:/spy.log"; produce_sheets; IF debug = TRUE SpyStop; If the debug flag is true then start recording execution data in the file spy.log on the HOME : disk. Perform actual production; stop recording, and close the file spy.log . Limitations Avoid using the floppy disk (option) for recording since writing to the floppy is very time consuming. Never use the spy function in production programs because the function increases the cycle time and consumes memory on the mass memory device in use. Syntax SpyStop’;’ Related information For information about See Start recording of execution data SpyStart - Start recording of execution time data on page 479 1 Instructions 1.173. StartLoad - Load a program module during execution RobotWare - OS 3HAC 16581-1 Revision: J 482 © Copyright 2004-2010 ABB. All rights reserved. 1.173. StartLoad - Load a program module during execution Usage StartLoad is used to start the loading of a program module into the program memory during execution. When loading is in progress other instructions can be executed in parallel. The loaded module must be connected to the program task with the instruction WaitLoad before any of its symbols/routines can be used. The loaded program module will be added to the modules already existing in the program memory. A program or system module can be loaded in static (default) or dynamic mode. Depending on the used mode, some operations will unload the module or not affect the module at all. Static mode The following table shows how two different operations affect a static loaded program or system modules. Dynamic mode The following table shows how two different operations affect a dynamic loaded program or system modules. Both static and dynamic loaded modules can be unloaded by the instruction UnLoad . Set PP to main from TP Open new RAPID program Program Module Not affected Unloaded System Module Not affected Not affected Set PP to main from TP Open new RAPID program Program Module Unloaded Unloaded System Module Unloaded Unloaded Continues on next page 1 Instructions 1.173. StartLoad - Load a program module during execution RobotWare - OS 483 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Basic examples Basic examples of the instruction StartLoad are illustrated below. See also More examples on page 484 . Example 1 VAR loadsession load1; ! Start loading of new program module PART_B containing routine routine_b in dynamic mode StartLoad \Dynamic, diskhome \File:="PART_B.MOD", load1; ! Executing in parallel in old module PART_A containing routine_a %"routine_a"%; ! Unload of old program module PART_A UnLoad diskhome \File:="PART_A.MOD"; ! Wait until loading and linking of new program module PART_B is ready WaitLoad load1; ! Execution in new program module PART_B %"routine_b"%; Starts the loading of program module PART_B.MOD from diskhome into the program memory with instruction StartLoad . In parallel with the loading the program executes routine_a in module PART_A.MOD . Then instruction WaitLoad waits until the loading and linking is finished. The module is loaded in dynamic mode. Variable load1 holds the identity of the load session updated by StartLoad and referenced by WaitLoad . To save linking time the instruction UnLoad and WaitLoad can be combined in the instruction WaitLoad by using the option argument \UnLoadPath. Arguments StartLoad [\Dynamic] FilePath [\File] LoadNo [\Dynamic] Data type: switch The switch enables loading of a program module in dynamic mode. Otherwise the loading is in static mode. FilePath Data type: string The file path and the file name to the file that will be loaded into the program memory. The file name shall be excluded when the argument \File is used. [\File] Data type: string When the file name is excluded in the argument FilePath it must be defined with this argument. 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
485
1 Instructions 1.173. StartLoad - Load a program module during execution RobotWare - OS 3HAC 16581-1 Revision: J 482 © Copyright 2004-2010 ABB. All rights reserved. 1.173. StartLoad - Load a program module during execution Usage StartLoad is used to start the loading of a program module into the program memory during execution. When loading is in progress other instructions can be executed in parallel. The loaded module must be connected to the program task with the instruction WaitLoad before any of its symbols/routines can be used. The loaded program module will be added to the modules already existing in the program memory. A program or system module can be loaded in static (default) or dynamic mode. Depending on the used mode, some operations will unload the module or not affect the module at all. Static mode The following table shows how two different operations affect a static loaded program or system modules. Dynamic mode The following table shows how two different operations affect a dynamic loaded program or system modules. Both static and dynamic loaded modules can be unloaded by the instruction UnLoad . Set PP to main from TP Open new RAPID program Program Module Not affected Unloaded System Module Not affected Not affected Set PP to main from TP Open new RAPID program Program Module Unloaded Unloaded System Module Unloaded Unloaded Continues on next page 1 Instructions 1.173. StartLoad - Load a program module during execution RobotWare - OS 483 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Basic examples Basic examples of the instruction StartLoad are illustrated below. See also More examples on page 484 . Example 1 VAR loadsession load1; ! Start loading of new program module PART_B containing routine routine_b in dynamic mode StartLoad \Dynamic, diskhome \File:="PART_B.MOD", load1; ! Executing in parallel in old module PART_A containing routine_a %"routine_a"%; ! Unload of old program module PART_A UnLoad diskhome \File:="PART_A.MOD"; ! Wait until loading and linking of new program module PART_B is ready WaitLoad load1; ! Execution in new program module PART_B %"routine_b"%; Starts the loading of program module PART_B.MOD from diskhome into the program memory with instruction StartLoad . In parallel with the loading the program executes routine_a in module PART_A.MOD . Then instruction WaitLoad waits until the loading and linking is finished. The module is loaded in dynamic mode. Variable load1 holds the identity of the load session updated by StartLoad and referenced by WaitLoad . To save linking time the instruction UnLoad and WaitLoad can be combined in the instruction WaitLoad by using the option argument \UnLoadPath. Arguments StartLoad [\Dynamic] FilePath [\File] LoadNo [\Dynamic] Data type: switch The switch enables loading of a program module in dynamic mode. Otherwise the loading is in static mode. FilePath Data type: string The file path and the file name to the file that will be loaded into the program memory. The file name shall be excluded when the argument \File is used. [\File] Data type: string When the file name is excluded in the argument FilePath it must be defined with this argument. Continued Continues on next page 1 Instructions 1.173. StartLoad - Load a program module during execution RobotWare - OS 3HAC 16581-1 Revision: J 484 © Copyright 2004-2010 ABB. All rights reserved. LoadNo Data type: loadsession This is a reference to the load session that should be used in the instruction WaitLoad to connect the loaded program module to the program task. Program execution Execution of StartLoad will only order the loading and then proceed directly with the next instruction without waiting for the loading to be completed. The instruction WaitLoad will then wait at first for the loading to be completed if it is not already finished, and then it will be linked and initialized. The initiation of the loaded module sets all variables at module level to their initial values. Unresolved references will default be accepted for this loading operation StartLoad - WaitLoad , but it will be a run time error on execution of an unresolved reference. To obtain a good program structure that is easy to understand and maintain, all loading and unloading of program modules should be done from the main module, which is always present in the program memory during execution. For loading of program that contains a main procedure to a main program (with another main procedure), see instruction Load . More examples More examples of how to use the instruction StartLoad are illustrated below. Example 1 StartLoad \Dynamic, "HOME:/DOORDIR/DOOR1.MOD", load1; Loads the program module DOOR1.MOD from the HOME: at the directory DOORDIR into the program memory. The program module is loaded in dynamic mode. Example 2 StartLoad \Dynamic, "HOME:" \File:="/DOORDIR/DOOR1.MOD", load1; Same as in example 1 but with another syntax. Example 3 StartLoad "HOME:" \File:="/DOORDIR/DOOR1.MOD", load1; Same as in examples 1 and 2 above but the module is loaded in static mode. Example 4 StartLoad \Dynamic, "HOME:" \File:="/DOORDIR/DOOR1.MOD", load1; WaitLoad load1; is the same as Load \Dynamic, "HOME:" \File:="/DOORDIR/DOOR1.MOD"; Error handling If the file specified in the instruction cannot be found then the system variable ERRNO is set to ERR_FILNOTFND . This error can then be handled in the error handler. If the variable specified in argument LoadNo is already in use then the system variable ERRNO is set to ERR_LOADNO_INUSE . This error can then be handled in the error handler. Continued Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
486
1 Instructions 1.173. StartLoad - Load a program module during execution RobotWare - OS 483 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Basic examples Basic examples of the instruction StartLoad are illustrated below. See also More examples on page 484 . Example 1 VAR loadsession load1; ! Start loading of new program module PART_B containing routine routine_b in dynamic mode StartLoad \Dynamic, diskhome \File:="PART_B.MOD", load1; ! Executing in parallel in old module PART_A containing routine_a %"routine_a"%; ! Unload of old program module PART_A UnLoad diskhome \File:="PART_A.MOD"; ! Wait until loading and linking of new program module PART_B is ready WaitLoad load1; ! Execution in new program module PART_B %"routine_b"%; Starts the loading of program module PART_B.MOD from diskhome into the program memory with instruction StartLoad . In parallel with the loading the program executes routine_a in module PART_A.MOD . Then instruction WaitLoad waits until the loading and linking is finished. The module is loaded in dynamic mode. Variable load1 holds the identity of the load session updated by StartLoad and referenced by WaitLoad . To save linking time the instruction UnLoad and WaitLoad can be combined in the instruction WaitLoad by using the option argument \UnLoadPath. Arguments StartLoad [\Dynamic] FilePath [\File] LoadNo [\Dynamic] Data type: switch The switch enables loading of a program module in dynamic mode. Otherwise the loading is in static mode. FilePath Data type: string The file path and the file name to the file that will be loaded into the program memory. The file name shall be excluded when the argument \File is used. [\File] Data type: string When the file name is excluded in the argument FilePath it must be defined with this argument. Continued Continues on next page 1 Instructions 1.173. StartLoad - Load a program module during execution RobotWare - OS 3HAC 16581-1 Revision: J 484 © Copyright 2004-2010 ABB. All rights reserved. LoadNo Data type: loadsession This is a reference to the load session that should be used in the instruction WaitLoad to connect the loaded program module to the program task. Program execution Execution of StartLoad will only order the loading and then proceed directly with the next instruction without waiting for the loading to be completed. The instruction WaitLoad will then wait at first for the loading to be completed if it is not already finished, and then it will be linked and initialized. The initiation of the loaded module sets all variables at module level to their initial values. Unresolved references will default be accepted for this loading operation StartLoad - WaitLoad , but it will be a run time error on execution of an unresolved reference. To obtain a good program structure that is easy to understand and maintain, all loading and unloading of program modules should be done from the main module, which is always present in the program memory during execution. For loading of program that contains a main procedure to a main program (with another main procedure), see instruction Load . More examples More examples of how to use the instruction StartLoad are illustrated below. Example 1 StartLoad \Dynamic, "HOME:/DOORDIR/DOOR1.MOD", load1; Loads the program module DOOR1.MOD from the HOME: at the directory DOORDIR into the program memory. The program module is loaded in dynamic mode. Example 2 StartLoad \Dynamic, "HOME:" \File:="/DOORDIR/DOOR1.MOD", load1; Same as in example 1 but with another syntax. Example 3 StartLoad "HOME:" \File:="/DOORDIR/DOOR1.MOD", load1; Same as in examples 1 and 2 above but the module is loaded in static mode. Example 4 StartLoad \Dynamic, "HOME:" \File:="/DOORDIR/DOOR1.MOD", load1; WaitLoad load1; is the same as Load \Dynamic, "HOME:" \File:="/DOORDIR/DOOR1.MOD"; Error handling If the file specified in the instruction cannot be found then the system variable ERRNO is set to ERR_FILNOTFND . This error can then be handled in the error handler. If the variable specified in argument LoadNo is already in use then the system variable ERRNO is set to ERR_LOADNO_INUSE . This error can then be handled in the error handler. Continued Continues on next page 1 Instructions 1.173. StartLoad - Load a program module during execution RobotWare - OS 485 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Syntax StartLoad [´\´Dynamic ´,´] [FilePath’ :=’] <expression ( IN ) of string> [’\’File ’:=’ <expression ( IN ) of string> ] ’,’ [LoadNo ’:=’] <variable ( VAR ) of loadsession>’;’ Related information For information about See Connect the loaded module to the task WaitLoad - Connect the loaded module to the task on page 682 Load session loadsession - Program load session on page 1138 Load a program module Load - Load a program module during execution on page 208 Unload a program module UnLoad - UnLoad a program module during execution on page 655 Cancel loading of a program module CancelLoad - Cancel loading of a module on page 35 Procedure call with Late binding Technical reference manual - RAPID overview , section Basic characteristics - Routines - Procedure call Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
487
1 Instructions 1.173. StartLoad - Load a program module during execution RobotWare - OS 3HAC 16581-1 Revision: J 484 © Copyright 2004-2010 ABB. All rights reserved. LoadNo Data type: loadsession This is a reference to the load session that should be used in the instruction WaitLoad to connect the loaded program module to the program task. Program execution Execution of StartLoad will only order the loading and then proceed directly with the next instruction without waiting for the loading to be completed. The instruction WaitLoad will then wait at first for the loading to be completed if it is not already finished, and then it will be linked and initialized. The initiation of the loaded module sets all variables at module level to their initial values. Unresolved references will default be accepted for this loading operation StartLoad - WaitLoad , but it will be a run time error on execution of an unresolved reference. To obtain a good program structure that is easy to understand and maintain, all loading and unloading of program modules should be done from the main module, which is always present in the program memory during execution. For loading of program that contains a main procedure to a main program (with another main procedure), see instruction Load . More examples More examples of how to use the instruction StartLoad are illustrated below. Example 1 StartLoad \Dynamic, "HOME:/DOORDIR/DOOR1.MOD", load1; Loads the program module DOOR1.MOD from the HOME: at the directory DOORDIR into the program memory. The program module is loaded in dynamic mode. Example 2 StartLoad \Dynamic, "HOME:" \File:="/DOORDIR/DOOR1.MOD", load1; Same as in example 1 but with another syntax. Example 3 StartLoad "HOME:" \File:="/DOORDIR/DOOR1.MOD", load1; Same as in examples 1 and 2 above but the module is loaded in static mode. Example 4 StartLoad \Dynamic, "HOME:" \File:="/DOORDIR/DOOR1.MOD", load1; WaitLoad load1; is the same as Load \Dynamic, "HOME:" \File:="/DOORDIR/DOOR1.MOD"; Error handling If the file specified in the instruction cannot be found then the system variable ERRNO is set to ERR_FILNOTFND . This error can then be handled in the error handler. If the variable specified in argument LoadNo is already in use then the system variable ERRNO is set to ERR_LOADNO_INUSE . This error can then be handled in the error handler. Continued Continues on next page 1 Instructions 1.173. StartLoad - Load a program module during execution RobotWare - OS 485 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Syntax StartLoad [´\´Dynamic ´,´] [FilePath’ :=’] <expression ( IN ) of string> [’\’File ’:=’ <expression ( IN ) of string> ] ’,’ [LoadNo ’:=’] <variable ( VAR ) of loadsession>’;’ Related information For information about See Connect the loaded module to the task WaitLoad - Connect the loaded module to the task on page 682 Load session loadsession - Program load session on page 1138 Load a program module Load - Load a program module during execution on page 208 Unload a program module UnLoad - UnLoad a program module during execution on page 655 Cancel loading of a program module CancelLoad - Cancel loading of a module on page 35 Procedure call with Late binding Technical reference manual - RAPID overview , section Basic characteristics - Routines - Procedure call Continued 1 Instructions 1.174. StartMove - Restarts robot movement RobotWare - OS 3HAC 16581-1 Revision: J 486 © Copyright 2004-2010 ABB. All rights reserved. 1.174. StartMove - Restarts robot movement Usage StartMove is used to resume robot, external axes movement and belonging process after the movement has been stopped • by the instruction StopMove . • after execution of StorePath ... RestoPath sequence. • after asynchronously raised movements errors, such as ERR_PATH_STOP or specific process error after handling in the ERROR handler. For base system it is possible to use this instruction in the following type of program tasks: • main task T_ROB1 for restart of the movement in that task. • any other task for restart of the movements in the main task. For MultiMove system it is possible to use this instruction in the following type of program tasks: • motion task, for restart of the movement in that task. • non motion task, for restart of the movement in the connected motion task. Besides that, if movement is restarted in one connected motion task belonging to a coordinated synchronized task group, the movement is restarted in all the cooperating tasks. Basic examples Basic examples of the instruction StartMove are illustrated below. Example 1 StopMove; WaitDI ready_input,1; StartMove; The robot starts to move again when the input ready_input is set. Example 2 ... MoveL p100, v100, z10, tool1; StorePath; p:= CRobT(\Tool:=tool1); ! New temporary movement MoveL p1, v100, fine, tool1; ... MoveL p, v100, fine, tool1; RestoPath; StartMove; ... After moving back to a stopped position p (in this example equal to p100 ), the robot starts to move again on the basic path level. Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
488
1 Instructions 1.173. StartLoad - Load a program module during execution RobotWare - OS 485 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Syntax StartLoad [´\´Dynamic ´,´] [FilePath’ :=’] <expression ( IN ) of string> [’\’File ’:=’ <expression ( IN ) of string> ] ’,’ [LoadNo ’:=’] <variable ( VAR ) of loadsession>’;’ Related information For information about See Connect the loaded module to the task WaitLoad - Connect the loaded module to the task on page 682 Load session loadsession - Program load session on page 1138 Load a program module Load - Load a program module during execution on page 208 Unload a program module UnLoad - UnLoad a program module during execution on page 655 Cancel loading of a program module CancelLoad - Cancel loading of a module on page 35 Procedure call with Late binding Technical reference manual - RAPID overview , section Basic characteristics - Routines - Procedure call Continued 1 Instructions 1.174. StartMove - Restarts robot movement RobotWare - OS 3HAC 16581-1 Revision: J 486 © Copyright 2004-2010 ABB. All rights reserved. 1.174. StartMove - Restarts robot movement Usage StartMove is used to resume robot, external axes movement and belonging process after the movement has been stopped • by the instruction StopMove . • after execution of StorePath ... RestoPath sequence. • after asynchronously raised movements errors, such as ERR_PATH_STOP or specific process error after handling in the ERROR handler. For base system it is possible to use this instruction in the following type of program tasks: • main task T_ROB1 for restart of the movement in that task. • any other task for restart of the movements in the main task. For MultiMove system it is possible to use this instruction in the following type of program tasks: • motion task, for restart of the movement in that task. • non motion task, for restart of the movement in the connected motion task. Besides that, if movement is restarted in one connected motion task belonging to a coordinated synchronized task group, the movement is restarted in all the cooperating tasks. Basic examples Basic examples of the instruction StartMove are illustrated below. Example 1 StopMove; WaitDI ready_input,1; StartMove; The robot starts to move again when the input ready_input is set. Example 2 ... MoveL p100, v100, z10, tool1; StorePath; p:= CRobT(\Tool:=tool1); ! New temporary movement MoveL p1, v100, fine, tool1; ... MoveL p, v100, fine, tool1; RestoPath; StartMove; ... After moving back to a stopped position p (in this example equal to p100 ), the robot starts to move again on the basic path level. Continues on next page 1 Instructions 1.174. StartMove - Restarts robot movement RobotWare - OS 487 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Arguments StartMove [\AllMotionTasks] [\AllMotionTasks] Data type: switch Restart the movement of all mechanical units in the system. The switch [\AllMotionTasks] can only be used from a non-motion program task. Program execution Any processes associated with the stopped movement are restarted at the same time that the motion resumes. To restart a MultiMove application in synchronized coordinated mode, StartMove must be executed in all motion tasks that are involved in coordination. With the switch \AllMotionTasks (only allowed from non-motion program task) the movements for all mechanical units in the system are restarted. In a base system without the switch \AllMotionTasks , the movements for following mechanical units are restarted: • always the mechanical units in the main task, independent of which task executes the StartMove instruction. In a MultiMove system without the switch \AllMotionTasks the movements for the following mechanical units are restarted: • the mechanical units in the motion task executing StartMove . • the mechanical units in the motion task that are connected to the non motion task executing StartMove . Besides that, if mechanical units are restarted in one connected motion task belonging to a coordinated synchronized task group then the mechanical units are restarted in all the cooperated tasks. Error handling If the robot is too far from the path (more than 10 mm or 20 degrees) to perform a restart of the interrupted movement then the system variable ERRNO is set to ERR_PATHDIST . If the robot is in a hold state at the time StartMove is executed then the system variable ERRNO is set to ERR_STARTMOVE If the program execution is stopped several times while regaining path movement with StartMove then the system variable ERRNO is set to ERR_PROGSTOP If the robot is moving at the time StartMove is executed then the system variable ERRNO is set to ERR_ALRDY_MOVING . These errors can then be handled in the error handler: • at ERR_PATHDIST move the robot closer to the path before attempting RETRY . • at ERR_STARTMOVE , ERR_PROGSTOP , or ERR_ALRDY_MOVING wait some time before attempting RETRY . 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
489
1 Instructions 1.174. StartMove - Restarts robot movement RobotWare - OS 3HAC 16581-1 Revision: J 486 © Copyright 2004-2010 ABB. All rights reserved. 1.174. StartMove - Restarts robot movement Usage StartMove is used to resume robot, external axes movement and belonging process after the movement has been stopped • by the instruction StopMove . • after execution of StorePath ... RestoPath sequence. • after asynchronously raised movements errors, such as ERR_PATH_STOP or specific process error after handling in the ERROR handler. For base system it is possible to use this instruction in the following type of program tasks: • main task T_ROB1 for restart of the movement in that task. • any other task for restart of the movements in the main task. For MultiMove system it is possible to use this instruction in the following type of program tasks: • motion task, for restart of the movement in that task. • non motion task, for restart of the movement in the connected motion task. Besides that, if movement is restarted in one connected motion task belonging to a coordinated synchronized task group, the movement is restarted in all the cooperating tasks. Basic examples Basic examples of the instruction StartMove are illustrated below. Example 1 StopMove; WaitDI ready_input,1; StartMove; The robot starts to move again when the input ready_input is set. Example 2 ... MoveL p100, v100, z10, tool1; StorePath; p:= CRobT(\Tool:=tool1); ! New temporary movement MoveL p1, v100, fine, tool1; ... MoveL p, v100, fine, tool1; RestoPath; StartMove; ... After moving back to a stopped position p (in this example equal to p100 ), the robot starts to move again on the basic path level. Continues on next page 1 Instructions 1.174. StartMove - Restarts robot movement RobotWare - OS 487 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Arguments StartMove [\AllMotionTasks] [\AllMotionTasks] Data type: switch Restart the movement of all mechanical units in the system. The switch [\AllMotionTasks] can only be used from a non-motion program task. Program execution Any processes associated with the stopped movement are restarted at the same time that the motion resumes. To restart a MultiMove application in synchronized coordinated mode, StartMove must be executed in all motion tasks that are involved in coordination. With the switch \AllMotionTasks (only allowed from non-motion program task) the movements for all mechanical units in the system are restarted. In a base system without the switch \AllMotionTasks , the movements for following mechanical units are restarted: • always the mechanical units in the main task, independent of which task executes the StartMove instruction. In a MultiMove system without the switch \AllMotionTasks the movements for the following mechanical units are restarted: • the mechanical units in the motion task executing StartMove . • the mechanical units in the motion task that are connected to the non motion task executing StartMove . Besides that, if mechanical units are restarted in one connected motion task belonging to a coordinated synchronized task group then the mechanical units are restarted in all the cooperated tasks. Error handling If the robot is too far from the path (more than 10 mm or 20 degrees) to perform a restart of the interrupted movement then the system variable ERRNO is set to ERR_PATHDIST . If the robot is in a hold state at the time StartMove is executed then the system variable ERRNO is set to ERR_STARTMOVE If the program execution is stopped several times while regaining path movement with StartMove then the system variable ERRNO is set to ERR_PROGSTOP If the robot is moving at the time StartMove is executed then the system variable ERRNO is set to ERR_ALRDY_MOVING . These errors can then be handled in the error handler: • at ERR_PATHDIST move the robot closer to the path before attempting RETRY . • at ERR_STARTMOVE , ERR_PROGSTOP , or ERR_ALRDY_MOVING wait some time before attempting RETRY . Continued Continues on next page 1 Instructions 1.174. StartMove - Restarts robot movement RobotWare - OS 3HAC 16581-1 Revision: J 488 © Copyright 2004-2010 ABB. All rights reserved. Limitations Only one of several non-motion tasks is allowed at the same time to do StopMove - StartMove sequence against some motion task. It is not possible to do any error recovery if StartMove is executed in any error handler. Syntax StartMove [’\’AllMotionTasks]’;’ Related information For information about See Stopping movements StopMove - Stops robot movement on page 515 Continuing a movement StartMoveRetry - Restarts robot movement and execution on page 489 More examples StorePath - Stores the path when an interrupt occurs on page 521 RestoPath - Restores the path after an interrupt on page 362 Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
490
1 Instructions 1.174. StartMove - Restarts robot movement RobotWare - OS 487 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Arguments StartMove [\AllMotionTasks] [\AllMotionTasks] Data type: switch Restart the movement of all mechanical units in the system. The switch [\AllMotionTasks] can only be used from a non-motion program task. Program execution Any processes associated with the stopped movement are restarted at the same time that the motion resumes. To restart a MultiMove application in synchronized coordinated mode, StartMove must be executed in all motion tasks that are involved in coordination. With the switch \AllMotionTasks (only allowed from non-motion program task) the movements for all mechanical units in the system are restarted. In a base system without the switch \AllMotionTasks , the movements for following mechanical units are restarted: • always the mechanical units in the main task, independent of which task executes the StartMove instruction. In a MultiMove system without the switch \AllMotionTasks the movements for the following mechanical units are restarted: • the mechanical units in the motion task executing StartMove . • the mechanical units in the motion task that are connected to the non motion task executing StartMove . Besides that, if mechanical units are restarted in one connected motion task belonging to a coordinated synchronized task group then the mechanical units are restarted in all the cooperated tasks. Error handling If the robot is too far from the path (more than 10 mm or 20 degrees) to perform a restart of the interrupted movement then the system variable ERRNO is set to ERR_PATHDIST . If the robot is in a hold state at the time StartMove is executed then the system variable ERRNO is set to ERR_STARTMOVE If the program execution is stopped several times while regaining path movement with StartMove then the system variable ERRNO is set to ERR_PROGSTOP If the robot is moving at the time StartMove is executed then the system variable ERRNO is set to ERR_ALRDY_MOVING . These errors can then be handled in the error handler: • at ERR_PATHDIST move the robot closer to the path before attempting RETRY . • at ERR_STARTMOVE , ERR_PROGSTOP , or ERR_ALRDY_MOVING wait some time before attempting RETRY . Continued Continues on next page 1 Instructions 1.174. StartMove - Restarts robot movement RobotWare - OS 3HAC 16581-1 Revision: J 488 © Copyright 2004-2010 ABB. All rights reserved. Limitations Only one of several non-motion tasks is allowed at the same time to do StopMove - StartMove sequence against some motion task. It is not possible to do any error recovery if StartMove is executed in any error handler. Syntax StartMove [’\’AllMotionTasks]’;’ Related information For information about See Stopping movements StopMove - Stops robot movement on page 515 Continuing a movement StartMoveRetry - Restarts robot movement and execution on page 489 More examples StorePath - Stores the path when an interrupt occurs on page 521 RestoPath - Restores the path after an interrupt on page 362 Continued 1 Instructions 1.175. StartMoveRetry - Restarts robot movement and execution RobotWare - OS 489 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.175. StartMoveRetry - Restarts robot movement and execution Usage StartMoveRetry is used to resume robot and external axes movements and belonging processes and also retry the execution from an ERROR handler. This instruction can be used in an ERROR handler in the following types of program tasks: • main task T_ROB1 in a base system • any motion task in a MultiMove system Basic examples Basic examples of the instruction StartMoveRetry are illustrated below. Example 1 VAR robtarget p_err; ... MoveL p1\ID:=50, v1000, z30, tool1 \WObj:=stn1; ... ERROR IF ERRNO = ERR_PATH_STOP THEN StorePath; p_err := CRobT(\Tool:= tool1 \WObj:=wobj0); ! Fix the problem MoveL p_err, v100, fine, tool1; RestoPath; StartMoveRetry; ENDIF ENDPROC This is an example from a MultiMove system with coordinated synchronized movements (two robots working on some rotated work object). During the movement to position p1 , the other cooperated robot gets some process error so that the coordinated synchronized movements stops. This robots then gets the error ERR_PATH_STOP , and the execution is transferred to the ERROR handler. In the ERROR handler, do the following: • StorePath stores the original path, goes to a new path level, and sets the MultiMove system in independent mode. • If there are problems with the robot then initiate movements on the new path level. • Before RestoPath go back to the error position. • RestoPath goes back to the original path level and sets the MultiMove system back to synchronized mode again. • StartMoveRetry restarts the interrupted movement and any process. It also transfers the execution back to resume the normal execution. Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
491
1 Instructions 1.174. StartMove - Restarts robot movement RobotWare - OS 3HAC 16581-1 Revision: J 488 © Copyright 2004-2010 ABB. All rights reserved. Limitations Only one of several non-motion tasks is allowed at the same time to do StopMove - StartMove sequence against some motion task. It is not possible to do any error recovery if StartMove is executed in any error handler. Syntax StartMove [’\’AllMotionTasks]’;’ Related information For information about See Stopping movements StopMove - Stops robot movement on page 515 Continuing a movement StartMoveRetry - Restarts robot movement and execution on page 489 More examples StorePath - Stores the path when an interrupt occurs on page 521 RestoPath - Restores the path after an interrupt on page 362 Continued 1 Instructions 1.175. StartMoveRetry - Restarts robot movement and execution RobotWare - OS 489 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.175. StartMoveRetry - Restarts robot movement and execution Usage StartMoveRetry is used to resume robot and external axes movements and belonging processes and also retry the execution from an ERROR handler. This instruction can be used in an ERROR handler in the following types of program tasks: • main task T_ROB1 in a base system • any motion task in a MultiMove system Basic examples Basic examples of the instruction StartMoveRetry are illustrated below. Example 1 VAR robtarget p_err; ... MoveL p1\ID:=50, v1000, z30, tool1 \WObj:=stn1; ... ERROR IF ERRNO = ERR_PATH_STOP THEN StorePath; p_err := CRobT(\Tool:= tool1 \WObj:=wobj0); ! Fix the problem MoveL p_err, v100, fine, tool1; RestoPath; StartMoveRetry; ENDIF ENDPROC This is an example from a MultiMove system with coordinated synchronized movements (two robots working on some rotated work object). During the movement to position p1 , the other cooperated robot gets some process error so that the coordinated synchronized movements stops. This robots then gets the error ERR_PATH_STOP , and the execution is transferred to the ERROR handler. In the ERROR handler, do the following: • StorePath stores the original path, goes to a new path level, and sets the MultiMove system in independent mode. • If there are problems with the robot then initiate movements on the new path level. • Before RestoPath go back to the error position. • RestoPath goes back to the original path level and sets the MultiMove system back to synchronized mode again. • StartMoveRetry restarts the interrupted movement and any process. It also transfers the execution back to resume the normal execution. Continues on next page 1 Instructions 1.175. StartMoveRetry - Restarts robot movement and execution RobotWare - OS 3HAC 16581-1 Revision: J 490 © Copyright 2004-2010 ABB. All rights reserved. Program execution StartMoveRetry does the following sequence: • regain to path • restart any processes associated with the stopped movement • restart the interrupted movement • RETRY of the program execution StartMoveRetry does the same as StartMove and RETRY together in one indivisible operation. Only the mechanical units in the program task that execute StartMoveRetry are restarted. Limitations Can only be used in an ERROR handler in a motion task. In a MultiMove system executing coordinated synchronized movements the following programming rules must be followed in the ERROR handler: • StartMoveRetry must be used in all cooperated program tasks. • If need movement is needed in any ERROR handler then the instructions StorePath ... RestoPath must be used in all cooperated program tasks. • The program must move the robot back to the error position before RestoPath is executed if the robot was moved on the StorePath level. Error handling If the robot is too far from the path (more than 10 mm or 20 degrees) to perform a restart of the interrupted movement then the system variable ERRNO is set to ERR_PATHDIST . If the robot is in hold state at the time StartMoveRetry is executed then the system variable ERRNO is set to ERR_STARTMOVE . If the program execution is stopped several times during the regain to path movement with StartMoveRetry then the system variable ERRNO is set to ERR_PROGSTOP . If the robot is moving at the time StartMoveRetry is executed then the system variable ERRNO is set to ERR_ALRDY_MOVING . It is not possible to do any error recovery from these errors because StartMoveRetry can only be executed in some error handler. Syntax StartMoveRetry ’;’ 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
492
1 Instructions 1.175. StartMoveRetry - Restarts robot movement and execution RobotWare - OS 489 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.175. StartMoveRetry - Restarts robot movement and execution Usage StartMoveRetry is used to resume robot and external axes movements and belonging processes and also retry the execution from an ERROR handler. This instruction can be used in an ERROR handler in the following types of program tasks: • main task T_ROB1 in a base system • any motion task in a MultiMove system Basic examples Basic examples of the instruction StartMoveRetry are illustrated below. Example 1 VAR robtarget p_err; ... MoveL p1\ID:=50, v1000, z30, tool1 \WObj:=stn1; ... ERROR IF ERRNO = ERR_PATH_STOP THEN StorePath; p_err := CRobT(\Tool:= tool1 \WObj:=wobj0); ! Fix the problem MoveL p_err, v100, fine, tool1; RestoPath; StartMoveRetry; ENDIF ENDPROC This is an example from a MultiMove system with coordinated synchronized movements (two robots working on some rotated work object). During the movement to position p1 , the other cooperated robot gets some process error so that the coordinated synchronized movements stops. This robots then gets the error ERR_PATH_STOP , and the execution is transferred to the ERROR handler. In the ERROR handler, do the following: • StorePath stores the original path, goes to a new path level, and sets the MultiMove system in independent mode. • If there are problems with the robot then initiate movements on the new path level. • Before RestoPath go back to the error position. • RestoPath goes back to the original path level and sets the MultiMove system back to synchronized mode again. • StartMoveRetry restarts the interrupted movement and any process. It also transfers the execution back to resume the normal execution. Continues on next page 1 Instructions 1.175. StartMoveRetry - Restarts robot movement and execution RobotWare - OS 3HAC 16581-1 Revision: J 490 © Copyright 2004-2010 ABB. All rights reserved. Program execution StartMoveRetry does the following sequence: • regain to path • restart any processes associated with the stopped movement • restart the interrupted movement • RETRY of the program execution StartMoveRetry does the same as StartMove and RETRY together in one indivisible operation. Only the mechanical units in the program task that execute StartMoveRetry are restarted. Limitations Can only be used in an ERROR handler in a motion task. In a MultiMove system executing coordinated synchronized movements the following programming rules must be followed in the ERROR handler: • StartMoveRetry must be used in all cooperated program tasks. • If need movement is needed in any ERROR handler then the instructions StorePath ... RestoPath must be used in all cooperated program tasks. • The program must move the robot back to the error position before RestoPath is executed if the robot was moved on the StorePath level. Error handling If the robot is too far from the path (more than 10 mm or 20 degrees) to perform a restart of the interrupted movement then the system variable ERRNO is set to ERR_PATHDIST . If the robot is in hold state at the time StartMoveRetry is executed then the system variable ERRNO is set to ERR_STARTMOVE . If the program execution is stopped several times during the regain to path movement with StartMoveRetry then the system variable ERRNO is set to ERR_PROGSTOP . If the robot is moving at the time StartMoveRetry is executed then the system variable ERRNO is set to ERR_ALRDY_MOVING . It is not possible to do any error recovery from these errors because StartMoveRetry can only be executed in some error handler. Syntax StartMoveRetry ’;’ Continued Continues on next page 1 Instructions 1.175. StartMoveRetry - Restarts robot movement and execution RobotWare - OS 491 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Stopping movements StopMove - Stops robot movement on page 515 Continuing a movement StartMove - Restarts robot movement on page 486 Resume execution after an error RETRY - Resume execution after an error on page 364 Store/restore path StorePath - Stores the path when an interrupt occurs on page 521 RestoPath - Restores the path after an interrupt on page 362 Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
493
1 Instructions 1.175. StartMoveRetry - Restarts robot movement and execution RobotWare - OS 3HAC 16581-1 Revision: J 490 © Copyright 2004-2010 ABB. All rights reserved. Program execution StartMoveRetry does the following sequence: • regain to path • restart any processes associated with the stopped movement • restart the interrupted movement • RETRY of the program execution StartMoveRetry does the same as StartMove and RETRY together in one indivisible operation. Only the mechanical units in the program task that execute StartMoveRetry are restarted. Limitations Can only be used in an ERROR handler in a motion task. In a MultiMove system executing coordinated synchronized movements the following programming rules must be followed in the ERROR handler: • StartMoveRetry must be used in all cooperated program tasks. • If need movement is needed in any ERROR handler then the instructions StorePath ... RestoPath must be used in all cooperated program tasks. • The program must move the robot back to the error position before RestoPath is executed if the robot was moved on the StorePath level. Error handling If the robot is too far from the path (more than 10 mm or 20 degrees) to perform a restart of the interrupted movement then the system variable ERRNO is set to ERR_PATHDIST . If the robot is in hold state at the time StartMoveRetry is executed then the system variable ERRNO is set to ERR_STARTMOVE . If the program execution is stopped several times during the regain to path movement with StartMoveRetry then the system variable ERRNO is set to ERR_PROGSTOP . If the robot is moving at the time StartMoveRetry is executed then the system variable ERRNO is set to ERR_ALRDY_MOVING . It is not possible to do any error recovery from these errors because StartMoveRetry can only be executed in some error handler. Syntax StartMoveRetry ’;’ Continued Continues on next page 1 Instructions 1.175. StartMoveRetry - Restarts robot movement and execution RobotWare - OS 491 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Stopping movements StopMove - Stops robot movement on page 515 Continuing a movement StartMove - Restarts robot movement on page 486 Resume execution after an error RETRY - Resume execution after an error on page 364 Store/restore path StorePath - Stores the path when an interrupt occurs on page 521 RestoPath - Restores the path after an interrupt on page 362 Continued 1 Instructions 1.176. STCalib - Calibrate a Servo Tool Servo Tool Control 3HAC 16581-1 Revision: J 492 © Copyright 2004-2010 ABB. All rights reserved. 1.176. STCalib - Calibrate a Servo Tool Usage STCalib is used to calibrate the distance between the tool tips. This is necessary after tip change or tool change, and it is recommended after performing a tip dress or after using the tool for a while. Note! The tool performs two close/open movements during the calibration. The first close movement will detect the tip contact position. Basic examples Basic examples of the instruction STCalib are illustrated below. Example 1 VAR num curr_tip_wear; VAR num retval; CONST num max_adjustment := 20; STCalib gun1 \ToolChg; Calibrate a servo gun after a toolchange. Wait until the gun calibration has finished before continuing with the next Rapid instruction. Example 2 STCalib gun1 \ToolChg \Conc; Calibrate a servo gun after a toolchange. Continue with the next Rapid instruction without waiting for the gun calibration to be finished. Example 3 STCalib gun1 \TipChg; Calibrate a servo gun after a tipchange. Example 4 STCalib gun1 \TipWear \RetTipWear := curr_tip_wear; Calibrate a servo gun after tip wear. Save the tip wear in variable curr_tip_wear . Example 5 STCalib gun1 \TipChg \RetPosAdj:=retval; IF retval > max_adjustment THEN TPWrite "The tips are lost!"; ... Calibrate a servo gun after a tipchange. Check if the tips are missing. Example 6 STCalib gun1 \TipChg \PrePos:=10; Calibrate a servo gun after a tipchange. Move fast to position 10 mm then start to search for contact position with slower 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
494
1 Instructions 1.175. StartMoveRetry - Restarts robot movement and execution RobotWare - OS 491 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Related information For information about See Stopping movements StopMove - Stops robot movement on page 515 Continuing a movement StartMove - Restarts robot movement on page 486 Resume execution after an error RETRY - Resume execution after an error on page 364 Store/restore path StorePath - Stores the path when an interrupt occurs on page 521 RestoPath - Restores the path after an interrupt on page 362 Continued 1 Instructions 1.176. STCalib - Calibrate a Servo Tool Servo Tool Control 3HAC 16581-1 Revision: J 492 © Copyright 2004-2010 ABB. All rights reserved. 1.176. STCalib - Calibrate a Servo Tool Usage STCalib is used to calibrate the distance between the tool tips. This is necessary after tip change or tool change, and it is recommended after performing a tip dress or after using the tool for a while. Note! The tool performs two close/open movements during the calibration. The first close movement will detect the tip contact position. Basic examples Basic examples of the instruction STCalib are illustrated below. Example 1 VAR num curr_tip_wear; VAR num retval; CONST num max_adjustment := 20; STCalib gun1 \ToolChg; Calibrate a servo gun after a toolchange. Wait until the gun calibration has finished before continuing with the next Rapid instruction. Example 2 STCalib gun1 \ToolChg \Conc; Calibrate a servo gun after a toolchange. Continue with the next Rapid instruction without waiting for the gun calibration to be finished. Example 3 STCalib gun1 \TipChg; Calibrate a servo gun after a tipchange. Example 4 STCalib gun1 \TipWear \RetTipWear := curr_tip_wear; Calibrate a servo gun after tip wear. Save the tip wear in variable curr_tip_wear . Example 5 STCalib gun1 \TipChg \RetPosAdj:=retval; IF retval > max_adjustment THEN TPWrite "The tips are lost!"; ... Calibrate a servo gun after a tipchange. Check if the tips are missing. Example 6 STCalib gun1 \TipChg \PrePos:=10; Calibrate a servo gun after a tipchange. Move fast to position 10 mm then start to search for contact position with slower speed. Continues on next page 1 Instructions 1.176. STCalib - Calibrate a Servo Tool Servo Tool Control 493 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Example 7 Example of non valid combination: STCalib gun1 \TipWear \RetTipWear := curr_tip_wear \Conc; Perform a tip wear calibration. Continue with the next Rapid instruction without waiting for the gun calibration to be finished. The parameter curr_tip_wear will in this case not hold any valid value since the \Conc switch is used (The next Rapid instruction will start to execute before the calibration process is finished). Arguments STCalib ToolName [\ToolChg] | [\TipChg] | [\TipWear] [\RetTipWear] [\RetPosAdj] [\PrePos] [\Conc] ToolName Data type: string The name of the mechanical unit. [\ToolChg] Data type: switch Calibration after a tool change. [\TipChg] Data type: switch Calibration after a tip change. [\TipWear] Data type: switch Calibration after tip wear. [\RetTipWear] Data type: num The achieved tip wear [mm]. [\RetPosAdj] Data type: num The positional adjustment since the last calibration [mm]. [\PrePos] Data type: num The position to move with high speed before the search for contact position with slower speed is started [mm]. [\Conc] Data type: switch Subsequent instructions are executed while the gun is moving. The argument can be used to shorten cycle time. This is useful when, for example, two guns are controlled at the same time. 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
495
1 Instructions 1.176. STCalib - Calibrate a Servo Tool Servo Tool Control 3HAC 16581-1 Revision: J 492 © Copyright 2004-2010 ABB. All rights reserved. 1.176. STCalib - Calibrate a Servo Tool Usage STCalib is used to calibrate the distance between the tool tips. This is necessary after tip change or tool change, and it is recommended after performing a tip dress or after using the tool for a while. Note! The tool performs two close/open movements during the calibration. The first close movement will detect the tip contact position. Basic examples Basic examples of the instruction STCalib are illustrated below. Example 1 VAR num curr_tip_wear; VAR num retval; CONST num max_adjustment := 20; STCalib gun1 \ToolChg; Calibrate a servo gun after a toolchange. Wait until the gun calibration has finished before continuing with the next Rapid instruction. Example 2 STCalib gun1 \ToolChg \Conc; Calibrate a servo gun after a toolchange. Continue with the next Rapid instruction without waiting for the gun calibration to be finished. Example 3 STCalib gun1 \TipChg; Calibrate a servo gun after a tipchange. Example 4 STCalib gun1 \TipWear \RetTipWear := curr_tip_wear; Calibrate a servo gun after tip wear. Save the tip wear in variable curr_tip_wear . Example 5 STCalib gun1 \TipChg \RetPosAdj:=retval; IF retval > max_adjustment THEN TPWrite "The tips are lost!"; ... Calibrate a servo gun after a tipchange. Check if the tips are missing. Example 6 STCalib gun1 \TipChg \PrePos:=10; Calibrate a servo gun after a tipchange. Move fast to position 10 mm then start to search for contact position with slower speed. Continues on next page 1 Instructions 1.176. STCalib - Calibrate a Servo Tool Servo Tool Control 493 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Example 7 Example of non valid combination: STCalib gun1 \TipWear \RetTipWear := curr_tip_wear \Conc; Perform a tip wear calibration. Continue with the next Rapid instruction without waiting for the gun calibration to be finished. The parameter curr_tip_wear will in this case not hold any valid value since the \Conc switch is used (The next Rapid instruction will start to execute before the calibration process is finished). Arguments STCalib ToolName [\ToolChg] | [\TipChg] | [\TipWear] [\RetTipWear] [\RetPosAdj] [\PrePos] [\Conc] ToolName Data type: string The name of the mechanical unit. [\ToolChg] Data type: switch Calibration after a tool change. [\TipChg] Data type: switch Calibration after a tip change. [\TipWear] Data type: switch Calibration after tip wear. [\RetTipWear] Data type: num The achieved tip wear [mm]. [\RetPosAdj] Data type: num The positional adjustment since the last calibration [mm]. [\PrePos] Data type: num The position to move with high speed before the search for contact position with slower speed is started [mm]. [\Conc] Data type: switch Subsequent instructions are executed while the gun is moving. The argument can be used to shorten cycle time. This is useful when, for example, two guns are controlled at the same time. Continued Continues on next page 1 Instructions 1.176. STCalib - Calibrate a Servo Tool Servo Tool Control 3HAC 16581-1 Revision: J 494 © Copyright 2004-2010 ABB. All rights reserved. Program execution Calibration modes If the mechanical unit exists then the servo tool is ordered to calibrate. The calibration is done according to the switches, see below. If the RetTipWear parameter is used then the tip wear is updated. Calibration after toolchange: The tool will close with slow speed waiting for tips in contact to open fast, close fast to a low force, and open again in one sequence. The tip wear will remain unchanged. Calibration after tipchange: The tool will close with slow speed waiting for tips in contact to open fast, close fast to a low force, and open again in one sequence. The tip wear will be reset. Calibration after tipwear: The tool will close with high speed to the contact position, open fast, close fast to a low force, and open again in one sequence. The tip wear will be updated. NOTE! If the switch Conc is used then the instruction will be considered ready once started and therefore the return value RetTipWear will not be available. In this case the RetTipWear will be returned by the function STIsOpen . For more details, see RobotWare OS functions - STIsOpen . Positional adjustment The optional argument RetPosAdj can be used to detect, for example, if the tips are lost after a tip change. The parameter will hold the value of the positional adjustment since the last calibration. The value can be negative or positive. Using a pre-position In order to speed up the calibration it is possible to define a pre-position. When the calibration starts the gun arm will run fast to the pre-position, stop, and then continue slowly*) forward in order to detect the tip contact position. If a pre-position is used then select it carefully! It is important that the tips do not get in contact until after the pre-position is reached! Otherwise the accuracy of the calibration will become poor and motion supervision errors may possibly occur. A pre-position will be ignored if it is larger than the current gun position (in order not to slow down the calibration). *) The second movement will also be fast if the \TipWear option is used. 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
496
1 Instructions 1.176. STCalib - Calibrate a Servo Tool Servo Tool Control 493 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Example 7 Example of non valid combination: STCalib gun1 \TipWear \RetTipWear := curr_tip_wear \Conc; Perform a tip wear calibration. Continue with the next Rapid instruction without waiting for the gun calibration to be finished. The parameter curr_tip_wear will in this case not hold any valid value since the \Conc switch is used (The next Rapid instruction will start to execute before the calibration process is finished). Arguments STCalib ToolName [\ToolChg] | [\TipChg] | [\TipWear] [\RetTipWear] [\RetPosAdj] [\PrePos] [\Conc] ToolName Data type: string The name of the mechanical unit. [\ToolChg] Data type: switch Calibration after a tool change. [\TipChg] Data type: switch Calibration after a tip change. [\TipWear] Data type: switch Calibration after tip wear. [\RetTipWear] Data type: num The achieved tip wear [mm]. [\RetPosAdj] Data type: num The positional adjustment since the last calibration [mm]. [\PrePos] Data type: num The position to move with high speed before the search for contact position with slower speed is started [mm]. [\Conc] Data type: switch Subsequent instructions are executed while the gun is moving. The argument can be used to shorten cycle time. This is useful when, for example, two guns are controlled at the same time. Continued Continues on next page 1 Instructions 1.176. STCalib - Calibrate a Servo Tool Servo Tool Control 3HAC 16581-1 Revision: J 494 © Copyright 2004-2010 ABB. All rights reserved. Program execution Calibration modes If the mechanical unit exists then the servo tool is ordered to calibrate. The calibration is done according to the switches, see below. If the RetTipWear parameter is used then the tip wear is updated. Calibration after toolchange: The tool will close with slow speed waiting for tips in contact to open fast, close fast to a low force, and open again in one sequence. The tip wear will remain unchanged. Calibration after tipchange: The tool will close with slow speed waiting for tips in contact to open fast, close fast to a low force, and open again in one sequence. The tip wear will be reset. Calibration after tipwear: The tool will close with high speed to the contact position, open fast, close fast to a low force, and open again in one sequence. The tip wear will be updated. NOTE! If the switch Conc is used then the instruction will be considered ready once started and therefore the return value RetTipWear will not be available. In this case the RetTipWear will be returned by the function STIsOpen . For more details, see RobotWare OS functions - STIsOpen . Positional adjustment The optional argument RetPosAdj can be used to detect, for example, if the tips are lost after a tip change. The parameter will hold the value of the positional adjustment since the last calibration. The value can be negative or positive. Using a pre-position In order to speed up the calibration it is possible to define a pre-position. When the calibration starts the gun arm will run fast to the pre-position, stop, and then continue slowly*) forward in order to detect the tip contact position. If a pre-position is used then select it carefully! It is important that the tips do not get in contact until after the pre-position is reached! Otherwise the accuracy of the calibration will become poor and motion supervision errors may possibly occur. A pre-position will be ignored if it is larger than the current gun position (in order not to slow down the calibration). *) The second movement will also be fast if the \TipWear option is used. Continued Continues on next page 1 Instructions 1.176. STCalib - Calibrate a Servo Tool Servo Tool Control 495 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Error handling If the specified servo tool name is not a configured servo tool then the system variable ERRNO is set to ERR_NO_SGUN . If the gun is not open when STCalib is invoked then the system variable ERRNO is set to ERR_SGUN_NOTOPEN . If the servo tool mechanical unit is not activated then the system variable ERRNO is set to ERR_SGUN_NOTACT . Use instruction ActUnit to activate the servo tool. If the servo tool position is not initialized then the system variable ERRNO is set to ERR_SGUN_NOTINIT . The servo tool position must be initialized the first time the gun is installed or after a fine calibration is made. Use the service routine ManServiceCalib or perform a tip change calibration. The tip wear will be reset. If the servo tool tips are not synchronized then the system variable ERRNO is set to ERR_SGUN_NOTSYNC . The servo tool tips must be synchronized if the revolution counter has been lost and/or updated. No process data such as tip wear will be lost. If the instruction is invoked from a background task and there is an emergency stop, the instruction will be finished, and the system variable ERRNO is set to ERR_SGUN_ESTOP . Note that if the instruction is invoked from the main task then the program pointer will be stopped at the instruction, and the instruction will be restarted from the beginning at program restart. If the argument PrePos is specified with a value less than zero then the system variable ERRNO is set to ERR_SGUN_NEGVAL . If the instruction is invoked from a background task and the system is in motors off state then the system variable ERRNO will be set to ERR_SGUN_MOTOFF . All above errors can be handled in a RAPID error handler. Syntax STCalib [ ’ToolName’ :=’ ] < expression ( IN ) of string > ‘,’ [ ’\’ToolChg] | [’\’TipChg] | [ ’\’TipWear] [’ \’RetTipWear’ :=’ < variable or persistent( INOUT ) of num > ]’;’ [ ’\’RetPosAdj’ :=’ < variable or persistent( INOUT ) of num > ]’;’ [ ’\’PrePos’ :=’ < expression ( IN ) of num > ]’ [ ’\’Conc’ ];’ Related information For information about See Open a servo tool STOpen - Open a Servo Tool on page 513 Close a servo tool STClose - Close a Servo Tool on page 496 Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
497
1 Instructions 1.176. STCalib - Calibrate a Servo Tool Servo Tool Control 3HAC 16581-1 Revision: J 494 © Copyright 2004-2010 ABB. All rights reserved. Program execution Calibration modes If the mechanical unit exists then the servo tool is ordered to calibrate. The calibration is done according to the switches, see below. If the RetTipWear parameter is used then the tip wear is updated. Calibration after toolchange: The tool will close with slow speed waiting for tips in contact to open fast, close fast to a low force, and open again in one sequence. The tip wear will remain unchanged. Calibration after tipchange: The tool will close with slow speed waiting for tips in contact to open fast, close fast to a low force, and open again in one sequence. The tip wear will be reset. Calibration after tipwear: The tool will close with high speed to the contact position, open fast, close fast to a low force, and open again in one sequence. The tip wear will be updated. NOTE! If the switch Conc is used then the instruction will be considered ready once started and therefore the return value RetTipWear will not be available. In this case the RetTipWear will be returned by the function STIsOpen . For more details, see RobotWare OS functions - STIsOpen . Positional adjustment The optional argument RetPosAdj can be used to detect, for example, if the tips are lost after a tip change. The parameter will hold the value of the positional adjustment since the last calibration. The value can be negative or positive. Using a pre-position In order to speed up the calibration it is possible to define a pre-position. When the calibration starts the gun arm will run fast to the pre-position, stop, and then continue slowly*) forward in order to detect the tip contact position. If a pre-position is used then select it carefully! It is important that the tips do not get in contact until after the pre-position is reached! Otherwise the accuracy of the calibration will become poor and motion supervision errors may possibly occur. A pre-position will be ignored if it is larger than the current gun position (in order not to slow down the calibration). *) The second movement will also be fast if the \TipWear option is used. Continued Continues on next page 1 Instructions 1.176. STCalib - Calibrate a Servo Tool Servo Tool Control 495 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Error handling If the specified servo tool name is not a configured servo tool then the system variable ERRNO is set to ERR_NO_SGUN . If the gun is not open when STCalib is invoked then the system variable ERRNO is set to ERR_SGUN_NOTOPEN . If the servo tool mechanical unit is not activated then the system variable ERRNO is set to ERR_SGUN_NOTACT . Use instruction ActUnit to activate the servo tool. If the servo tool position is not initialized then the system variable ERRNO is set to ERR_SGUN_NOTINIT . The servo tool position must be initialized the first time the gun is installed or after a fine calibration is made. Use the service routine ManServiceCalib or perform a tip change calibration. The tip wear will be reset. If the servo tool tips are not synchronized then the system variable ERRNO is set to ERR_SGUN_NOTSYNC . The servo tool tips must be synchronized if the revolution counter has been lost and/or updated. No process data such as tip wear will be lost. If the instruction is invoked from a background task and there is an emergency stop, the instruction will be finished, and the system variable ERRNO is set to ERR_SGUN_ESTOP . Note that if the instruction is invoked from the main task then the program pointer will be stopped at the instruction, and the instruction will be restarted from the beginning at program restart. If the argument PrePos is specified with a value less than zero then the system variable ERRNO is set to ERR_SGUN_NEGVAL . If the instruction is invoked from a background task and the system is in motors off state then the system variable ERRNO will be set to ERR_SGUN_MOTOFF . All above errors can be handled in a RAPID error handler. Syntax STCalib [ ’ToolName’ :=’ ] < expression ( IN ) of string > ‘,’ [ ’\’ToolChg] | [’\’TipChg] | [ ’\’TipWear] [’ \’RetTipWear’ :=’ < variable or persistent( INOUT ) of num > ]’;’ [ ’\’RetPosAdj’ :=’ < variable or persistent( INOUT ) of num > ]’;’ [ ’\’PrePos’ :=’ < expression ( IN ) of num > ]’ [ ’\’Conc’ ];’ Related information For information about See Open a servo tool STOpen - Open a Servo Tool on page 513 Close a servo tool STClose - Close a Servo Tool on page 496 Continued 1 Instructions 1.177. STClose - Close a Servo Tool Servo Tool Control 3HAC 16581-1 Revision: J 496 © Copyright 2004-2010 ABB. All rights reserved. 1.177. STClose - Close a Servo Tool Usage STClose is used to close the Servo Tool. Basic examples Basic examples of the instruction STClose are illustrated below. Example 1 VAR num curr_thickness1; VAR num curr_thickness2; STClose gun1, 1000, 5; Close the servo gun with tip force 1000 N and plate thickness 5 mm. Wait until the gun is closed before continuing with the next Rapid instruction. Example 2 STClose gun1, 2000, 3\RetThickness:=curr_thickness; Close the servo gun with tip force 2000 N and plate thickness 3 mm. Get the measured thickness in variable curr_thickness . Example 3 Concurrent mode: STClose gun1, 1000, 5 \Conc; STClose gun2, 2000, 3 \Conc; Close the servo gun1 with tip force 1000 N and plate thickness 5 mm. Continue the program execution without waiting for gun1 to be closed, and close the servo gun2 with tip force 2000 N and plate thickness 3 mm. Continue the execution of the Rapid program without waiting for gun2 to be closed. Example 4 IF STIsClosed (gun1)\RetThickness:=curr_thickness1 THEN IF curr_thickness1 < 0.2 Set weld_start1; ENDIF IF STIsClosed (gun2)\RetThickness:=curr_thickness2 THEN IF curr_thickness2 < 0.2 Set weld_start2; ENDIF Get the measured thickness in the function STIsClosed variable curr_thickness1 and curr_thickness2 . Example 5 Example of non valid combination: STClose gun1, 2000, 3\RetThickness:=curr_thickness \Conc; Close the servo gun and continue with the Rapid program execution. The parameter curr_thickness will in this case not hold any valid value since the \Conc switch is used (The next Rapid instruction will start to execute before the gun is closed). Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
498
1 Instructions 1.176. STCalib - Calibrate a Servo Tool Servo Tool Control 495 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Error handling If the specified servo tool name is not a configured servo tool then the system variable ERRNO is set to ERR_NO_SGUN . If the gun is not open when STCalib is invoked then the system variable ERRNO is set to ERR_SGUN_NOTOPEN . If the servo tool mechanical unit is not activated then the system variable ERRNO is set to ERR_SGUN_NOTACT . Use instruction ActUnit to activate the servo tool. If the servo tool position is not initialized then the system variable ERRNO is set to ERR_SGUN_NOTINIT . The servo tool position must be initialized the first time the gun is installed or after a fine calibration is made. Use the service routine ManServiceCalib or perform a tip change calibration. The tip wear will be reset. If the servo tool tips are not synchronized then the system variable ERRNO is set to ERR_SGUN_NOTSYNC . The servo tool tips must be synchronized if the revolution counter has been lost and/or updated. No process data such as tip wear will be lost. If the instruction is invoked from a background task and there is an emergency stop, the instruction will be finished, and the system variable ERRNO is set to ERR_SGUN_ESTOP . Note that if the instruction is invoked from the main task then the program pointer will be stopped at the instruction, and the instruction will be restarted from the beginning at program restart. If the argument PrePos is specified with a value less than zero then the system variable ERRNO is set to ERR_SGUN_NEGVAL . If the instruction is invoked from a background task and the system is in motors off state then the system variable ERRNO will be set to ERR_SGUN_MOTOFF . All above errors can be handled in a RAPID error handler. Syntax STCalib [ ’ToolName’ :=’ ] < expression ( IN ) of string > ‘,’ [ ’\’ToolChg] | [’\’TipChg] | [ ’\’TipWear] [’ \’RetTipWear’ :=’ < variable or persistent( INOUT ) of num > ]’;’ [ ’\’RetPosAdj’ :=’ < variable or persistent( INOUT ) of num > ]’;’ [ ’\’PrePos’ :=’ < expression ( IN ) of num > ]’ [ ’\’Conc’ ];’ Related information For information about See Open a servo tool STOpen - Open a Servo Tool on page 513 Close a servo tool STClose - Close a Servo Tool on page 496 Continued 1 Instructions 1.177. STClose - Close a Servo Tool Servo Tool Control 3HAC 16581-1 Revision: J 496 © Copyright 2004-2010 ABB. All rights reserved. 1.177. STClose - Close a Servo Tool Usage STClose is used to close the Servo Tool. Basic examples Basic examples of the instruction STClose are illustrated below. Example 1 VAR num curr_thickness1; VAR num curr_thickness2; STClose gun1, 1000, 5; Close the servo gun with tip force 1000 N and plate thickness 5 mm. Wait until the gun is closed before continuing with the next Rapid instruction. Example 2 STClose gun1, 2000, 3\RetThickness:=curr_thickness; Close the servo gun with tip force 2000 N and plate thickness 3 mm. Get the measured thickness in variable curr_thickness . Example 3 Concurrent mode: STClose gun1, 1000, 5 \Conc; STClose gun2, 2000, 3 \Conc; Close the servo gun1 with tip force 1000 N and plate thickness 5 mm. Continue the program execution without waiting for gun1 to be closed, and close the servo gun2 with tip force 2000 N and plate thickness 3 mm. Continue the execution of the Rapid program without waiting for gun2 to be closed. Example 4 IF STIsClosed (gun1)\RetThickness:=curr_thickness1 THEN IF curr_thickness1 < 0.2 Set weld_start1; ENDIF IF STIsClosed (gun2)\RetThickness:=curr_thickness2 THEN IF curr_thickness2 < 0.2 Set weld_start2; ENDIF Get the measured thickness in the function STIsClosed variable curr_thickness1 and curr_thickness2 . Example 5 Example of non valid combination: STClose gun1, 2000, 3\RetThickness:=curr_thickness \Conc; Close the servo gun and continue with the Rapid program execution. The parameter curr_thickness will in this case not hold any valid value since the \Conc switch is used (The next Rapid instruction will start to execute before the gun is closed). Continues on next page 1 Instructions 1.177. STClose - Close a Servo Tool Servo Tool Control 497 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Arguments STClose ToolName TipForce Thickness [\RetThickness][\Conc] ToolName Data type: string The name of the mechanical unit. TipForce Data type: num The desired tip force [N]. Thickness Data type: num The expected contact position for the servo tool [mm]. [\RetThickness] Data type: num The achieved thickness [mm], will only get a value if the \Conc switch is not used. [\Conc] Data type: switch Subsequent instructions are executed while the gun is moving. The argument can be used to shorten cycle time. This is useful when e.g. two guns are controlled at the same time. Program execution If the mechanical unit exists then the servo tool is ordered to close to the expected thickness and force. The closing will start to move the tool arm to the expected contact position (thickness). The movement is stopped in this position, and a switch from position control mode to force control mode is done. The tool arm is moved with max speed and acceleration as it is defined in the system parameters for corresponding external axis. As for other axes movements, the speed is reduced in manual mode. When the desired tip force is achieved the instruction is ready and the achieved thickness is returned if the optional argument RetThickness is specified. NOTE! If the switch Conc is used then the instruction will be considered to be ready once started and therefore the return value RetThickness will not be available. In this case the RetThickness will be returned by the function STIsClosed . For more details see RobotWare OS functions - STIsClosed . It is possible to close the tool during a programmed robot movement as long as the robot movement does not include a movement of the tool arm. For more details see Servo tool motion control. 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
499
1 Instructions 1.177. STClose - Close a Servo Tool Servo Tool Control 3HAC 16581-1 Revision: J 496 © Copyright 2004-2010 ABB. All rights reserved. 1.177. STClose - Close a Servo Tool Usage STClose is used to close the Servo Tool. Basic examples Basic examples of the instruction STClose are illustrated below. Example 1 VAR num curr_thickness1; VAR num curr_thickness2; STClose gun1, 1000, 5; Close the servo gun with tip force 1000 N and plate thickness 5 mm. Wait until the gun is closed before continuing with the next Rapid instruction. Example 2 STClose gun1, 2000, 3\RetThickness:=curr_thickness; Close the servo gun with tip force 2000 N and plate thickness 3 mm. Get the measured thickness in variable curr_thickness . Example 3 Concurrent mode: STClose gun1, 1000, 5 \Conc; STClose gun2, 2000, 3 \Conc; Close the servo gun1 with tip force 1000 N and plate thickness 5 mm. Continue the program execution without waiting for gun1 to be closed, and close the servo gun2 with tip force 2000 N and plate thickness 3 mm. Continue the execution of the Rapid program without waiting for gun2 to be closed. Example 4 IF STIsClosed (gun1)\RetThickness:=curr_thickness1 THEN IF curr_thickness1 < 0.2 Set weld_start1; ENDIF IF STIsClosed (gun2)\RetThickness:=curr_thickness2 THEN IF curr_thickness2 < 0.2 Set weld_start2; ENDIF Get the measured thickness in the function STIsClosed variable curr_thickness1 and curr_thickness2 . Example 5 Example of non valid combination: STClose gun1, 2000, 3\RetThickness:=curr_thickness \Conc; Close the servo gun and continue with the Rapid program execution. The parameter curr_thickness will in this case not hold any valid value since the \Conc switch is used (The next Rapid instruction will start to execute before the gun is closed). Continues on next page 1 Instructions 1.177. STClose - Close a Servo Tool Servo Tool Control 497 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Arguments STClose ToolName TipForce Thickness [\RetThickness][\Conc] ToolName Data type: string The name of the mechanical unit. TipForce Data type: num The desired tip force [N]. Thickness Data type: num The expected contact position for the servo tool [mm]. [\RetThickness] Data type: num The achieved thickness [mm], will only get a value if the \Conc switch is not used. [\Conc] Data type: switch Subsequent instructions are executed while the gun is moving. The argument can be used to shorten cycle time. This is useful when e.g. two guns are controlled at the same time. Program execution If the mechanical unit exists then the servo tool is ordered to close to the expected thickness and force. The closing will start to move the tool arm to the expected contact position (thickness). The movement is stopped in this position, and a switch from position control mode to force control mode is done. The tool arm is moved with max speed and acceleration as it is defined in the system parameters for corresponding external axis. As for other axes movements, the speed is reduced in manual mode. When the desired tip force is achieved the instruction is ready and the achieved thickness is returned if the optional argument RetThickness is specified. NOTE! If the switch Conc is used then the instruction will be considered to be ready once started and therefore the return value RetThickness will not be available. In this case the RetThickness will be returned by the function STIsClosed . For more details see RobotWare OS functions - STIsClosed . It is possible to close the tool during a programmed robot movement as long as the robot movement does not include a movement of the tool arm. For more details see Servo tool motion control. Continued Continues on next page 1 Instructions 1.177. STClose - Close a Servo Tool Servo Tool Control 3HAC 16581-1 Revision: J 498 © Copyright 2004-2010 ABB. All rights reserved. Error handling If the specified servo tool name is not a configured servo tool then the system variable ERRNO is set to ERR_NO_SGUN . If the gun is not open when STClose is invoked then the system variable ERRNO is set to ERR_SGUN_NOTOPEN . If the servo tool mechanical unit is not activated then the system variable ERRNO is set to ERR_SGUN_NOTACT . Use instruction ActUnit to activate the servo tool. If the servo tool position is not initialized then the system variable ERRNO is set to ERR_SGUN_NOTINIT . The servo tool position must be initialized the first time the gun is installed or after a fine calibration is made. Use the service routine ManServiceCalib or perform a tip change calibration. The tip wear will be reset. If the servo tool tips are not synchronized then the system variable ERRNO is set to ERR_SGUN_NOTSYNC . The servo tool tips must be synchronized if the revolution counter has been lost and/or updated. No process data such as tip wear will be lost. If the instruction is invoked from a background task and if there is an emergency stop then the instruction will be finished and the system variable ERRNO is set to ERR_SGUN_ESTOP . Note that if the instruction is invoked from the main task then the program pointer will be stopped at the instruction, and the instruction will be restarted from the beginning at program restart. If the instruction is invoked from a background task and if the system is in motors off state then the system variable ERRNO will be set to ERR_SGUN_MOTOFF . All errors above can be handled in a Rapid error handler. Syntax STClose [ ’ToolName ’:=’ ] < expression ( IN ) of string > ‘,’ [ ’Tipforce’ :=’ ] < expression ( IN ) of num > ‘,’ [ ’Thickness’ :=’] < expression ( IN ) of num > ] [‘\’ ’RetThickness’ :=’ < variable or persistent ( INOUT ) of num > ] [’\’Conc] Related information For information about See Open a servo tool STOpen - Open a Servo Tool on page 513 Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
500
1 Instructions 1.177. STClose - Close a Servo Tool Servo Tool Control 497 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. Arguments STClose ToolName TipForce Thickness [\RetThickness][\Conc] ToolName Data type: string The name of the mechanical unit. TipForce Data type: num The desired tip force [N]. Thickness Data type: num The expected contact position for the servo tool [mm]. [\RetThickness] Data type: num The achieved thickness [mm], will only get a value if the \Conc switch is not used. [\Conc] Data type: switch Subsequent instructions are executed while the gun is moving. The argument can be used to shorten cycle time. This is useful when e.g. two guns are controlled at the same time. Program execution If the mechanical unit exists then the servo tool is ordered to close to the expected thickness and force. The closing will start to move the tool arm to the expected contact position (thickness). The movement is stopped in this position, and a switch from position control mode to force control mode is done. The tool arm is moved with max speed and acceleration as it is defined in the system parameters for corresponding external axis. As for other axes movements, the speed is reduced in manual mode. When the desired tip force is achieved the instruction is ready and the achieved thickness is returned if the optional argument RetThickness is specified. NOTE! If the switch Conc is used then the instruction will be considered to be ready once started and therefore the return value RetThickness will not be available. In this case the RetThickness will be returned by the function STIsClosed . For more details see RobotWare OS functions - STIsClosed . It is possible to close the tool during a programmed robot movement as long as the robot movement does not include a movement of the tool arm. For more details see Servo tool motion control. Continued Continues on next page 1 Instructions 1.177. STClose - Close a Servo Tool Servo Tool Control 3HAC 16581-1 Revision: J 498 © Copyright 2004-2010 ABB. All rights reserved. Error handling If the specified servo tool name is not a configured servo tool then the system variable ERRNO is set to ERR_NO_SGUN . If the gun is not open when STClose is invoked then the system variable ERRNO is set to ERR_SGUN_NOTOPEN . If the servo tool mechanical unit is not activated then the system variable ERRNO is set to ERR_SGUN_NOTACT . Use instruction ActUnit to activate the servo tool. If the servo tool position is not initialized then the system variable ERRNO is set to ERR_SGUN_NOTINIT . The servo tool position must be initialized the first time the gun is installed or after a fine calibration is made. Use the service routine ManServiceCalib or perform a tip change calibration. The tip wear will be reset. If the servo tool tips are not synchronized then the system variable ERRNO is set to ERR_SGUN_NOTSYNC . The servo tool tips must be synchronized if the revolution counter has been lost and/or updated. No process data such as tip wear will be lost. If the instruction is invoked from a background task and if there is an emergency stop then the instruction will be finished and the system variable ERRNO is set to ERR_SGUN_ESTOP . Note that if the instruction is invoked from the main task then the program pointer will be stopped at the instruction, and the instruction will be restarted from the beginning at program restart. If the instruction is invoked from a background task and if the system is in motors off state then the system variable ERRNO will be set to ERR_SGUN_MOTOFF . All errors above can be handled in a Rapid error handler. Syntax STClose [ ’ToolName ’:=’ ] < expression ( IN ) of string > ‘,’ [ ’Tipforce’ :=’ ] < expression ( IN ) of num > ‘,’ [ ’Thickness’ :=’] < expression ( IN ) of num > ] [‘\’ ’RetThickness’ :=’ < variable or persistent ( INOUT ) of num > ] [’\’Conc] Related information For information about See Open a servo tool STOpen - Open a Servo Tool on page 513 Continued 1 Instructions 1.178. StepBwdPath - Move backwards one step on path RobotWare - OS 499 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.178. StepBwdPath - Move backwards one step on path Usage StepBwdPath is used to move the TCP backwards on the robot path from a RESTART event routine. It is up to the user to introduce a restart process flag so StepBwdPath in the RESTART event routine is only executed at process restart and not at all program restarts. This instruction can only be used in the main task T_ROB1 or, if in a MultiMove System, in Motion tasks. Basic examples Basic examples of the instruction StepBwdPath are illustrated below. Example 1 StepBwdPath 30, 1; Move backwards 30 mm in 1 second. Arguments StepBwdPath StepLength StepTime StepLength Data type: num Specifies the distance, in millimeters, to move backwards during this step. This argument must be a positive value. StepTime Data type: num Specifies the time, in seconds, the movement will take. This argument must have a positive value. Program execution The robot moves back on its path for the specified distance. The path is exactly the same in the reverse way as it was before the stop occurred. In the case of a quick stop or emergency stop, the RESTART event routine is called after the regain phase has completed so the robot will already be back on its path when this instruction is executed. The actual speed for this movement is the lowest of: • StepLength / StepTime • The programmed speed on the segment • 250 mm/s Following properties are valid in MultiMove System - Synchronized Coordinated Movements: • All involved mechanical units are moved backward simultaneously and coordinated • Each executed StepBwdPath in any involved program task results in one new backward movement step (without need of any StartMove ) • To restart and continue the interrupted process movements, instruction StartMove must be executed in all involved program tasks Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
501
1 Instructions 1.177. STClose - Close a Servo Tool Servo Tool Control 3HAC 16581-1 Revision: J 498 © Copyright 2004-2010 ABB. All rights reserved. Error handling If the specified servo tool name is not a configured servo tool then the system variable ERRNO is set to ERR_NO_SGUN . If the gun is not open when STClose is invoked then the system variable ERRNO is set to ERR_SGUN_NOTOPEN . If the servo tool mechanical unit is not activated then the system variable ERRNO is set to ERR_SGUN_NOTACT . Use instruction ActUnit to activate the servo tool. If the servo tool position is not initialized then the system variable ERRNO is set to ERR_SGUN_NOTINIT . The servo tool position must be initialized the first time the gun is installed or after a fine calibration is made. Use the service routine ManServiceCalib or perform a tip change calibration. The tip wear will be reset. If the servo tool tips are not synchronized then the system variable ERRNO is set to ERR_SGUN_NOTSYNC . The servo tool tips must be synchronized if the revolution counter has been lost and/or updated. No process data such as tip wear will be lost. If the instruction is invoked from a background task and if there is an emergency stop then the instruction will be finished and the system variable ERRNO is set to ERR_SGUN_ESTOP . Note that if the instruction is invoked from the main task then the program pointer will be stopped at the instruction, and the instruction will be restarted from the beginning at program restart. If the instruction is invoked from a background task and if the system is in motors off state then the system variable ERRNO will be set to ERR_SGUN_MOTOFF . All errors above can be handled in a Rapid error handler. Syntax STClose [ ’ToolName ’:=’ ] < expression ( IN ) of string > ‘,’ [ ’Tipforce’ :=’ ] < expression ( IN ) of num > ‘,’ [ ’Thickness’ :=’] < expression ( IN ) of num > ] [‘\’ ’RetThickness’ :=’ < variable or persistent ( INOUT ) of num > ] [’\’Conc] Related information For information about See Open a servo tool STOpen - Open a Servo Tool on page 513 Continued 1 Instructions 1.178. StepBwdPath - Move backwards one step on path RobotWare - OS 499 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.178. StepBwdPath - Move backwards one step on path Usage StepBwdPath is used to move the TCP backwards on the robot path from a RESTART event routine. It is up to the user to introduce a restart process flag so StepBwdPath in the RESTART event routine is only executed at process restart and not at all program restarts. This instruction can only be used in the main task T_ROB1 or, if in a MultiMove System, in Motion tasks. Basic examples Basic examples of the instruction StepBwdPath are illustrated below. Example 1 StepBwdPath 30, 1; Move backwards 30 mm in 1 second. Arguments StepBwdPath StepLength StepTime StepLength Data type: num Specifies the distance, in millimeters, to move backwards during this step. This argument must be a positive value. StepTime Data type: num Specifies the time, in seconds, the movement will take. This argument must have a positive value. Program execution The robot moves back on its path for the specified distance. The path is exactly the same in the reverse way as it was before the stop occurred. In the case of a quick stop or emergency stop, the RESTART event routine is called after the regain phase has completed so the robot will already be back on its path when this instruction is executed. The actual speed for this movement is the lowest of: • StepLength / StepTime • The programmed speed on the segment • 250 mm/s Following properties are valid in MultiMove System - Synchronized Coordinated Movements: • All involved mechanical units are moved backward simultaneously and coordinated • Each executed StepBwdPath in any involved program task results in one new backward movement step (without need of any StartMove ) • To restart and continue the interrupted process movements, instruction StartMove must be executed in all involved program tasks Continues on next page 1 Instructions 1.178. StepBwdPath - Move backwards one step on path RobotWare - OS 3HAC 16581-1 Revision: J 500 © Copyright 2004-2010 ABB. All rights reserved. Limitations After the program has been stopped it is possible to step backwards on the path with the following limits: • The 1st StepBwdPath movements step will be reduced to the current segment for the robot • Further StepBwdPath movements steps will be limited to the segment before the previous segment (possible to step backward within two segment before the interupted segment). If an attempt is made to move beyond these limits then the error handler will be called with ERRNO set to ERR_BWDLIMIT . Syntax StepBwdPath [ StepLength’:=’ ] < expression ( IN ) of num >’,’ [ StepTime ’:=’ ] < expression ( IN ) of num >’;’ Related information For information about See Motion in general Technical reference manual - RAPID overview , section Motion and I/O principle Positioning instructions Technical reference manual - RAPID overview , section RAPID summary - Motion Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
502
1 Instructions 1.178. StepBwdPath - Move backwards one step on path RobotWare - OS 499 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.178. StepBwdPath - Move backwards one step on path Usage StepBwdPath is used to move the TCP backwards on the robot path from a RESTART event routine. It is up to the user to introduce a restart process flag so StepBwdPath in the RESTART event routine is only executed at process restart and not at all program restarts. This instruction can only be used in the main task T_ROB1 or, if in a MultiMove System, in Motion tasks. Basic examples Basic examples of the instruction StepBwdPath are illustrated below. Example 1 StepBwdPath 30, 1; Move backwards 30 mm in 1 second. Arguments StepBwdPath StepLength StepTime StepLength Data type: num Specifies the distance, in millimeters, to move backwards during this step. This argument must be a positive value. StepTime Data type: num Specifies the time, in seconds, the movement will take. This argument must have a positive value. Program execution The robot moves back on its path for the specified distance. The path is exactly the same in the reverse way as it was before the stop occurred. In the case of a quick stop or emergency stop, the RESTART event routine is called after the regain phase has completed so the robot will already be back on its path when this instruction is executed. The actual speed for this movement is the lowest of: • StepLength / StepTime • The programmed speed on the segment • 250 mm/s Following properties are valid in MultiMove System - Synchronized Coordinated Movements: • All involved mechanical units are moved backward simultaneously and coordinated • Each executed StepBwdPath in any involved program task results in one new backward movement step (without need of any StartMove ) • To restart and continue the interrupted process movements, instruction StartMove must be executed in all involved program tasks Continues on next page 1 Instructions 1.178. StepBwdPath - Move backwards one step on path RobotWare - OS 3HAC 16581-1 Revision: J 500 © Copyright 2004-2010 ABB. All rights reserved. Limitations After the program has been stopped it is possible to step backwards on the path with the following limits: • The 1st StepBwdPath movements step will be reduced to the current segment for the robot • Further StepBwdPath movements steps will be limited to the segment before the previous segment (possible to step backward within two segment before the interupted segment). If an attempt is made to move beyond these limits then the error handler will be called with ERRNO set to ERR_BWDLIMIT . Syntax StepBwdPath [ StepLength’:=’ ] < expression ( IN ) of num >’,’ [ StepTime ’:=’ ] < expression ( IN ) of num >’;’ Related information For information about See Motion in general Technical reference manual - RAPID overview , section Motion and I/O principle Positioning instructions Technical reference manual - RAPID overview , section RAPID summary - Motion Continued 1 Instructions 1.179. STIndGun - Sets the gun in independent mode Servo Tool Control 501 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.179. STIndGun - Sets the gun in independent mode Usage STIndGun ( Servo Tool independent gun ) is used to set the gun in independent mode and thereafter move the gun to a specified independent position. The gun will stay in independent mode until the instruction STIndGunReset is executed. During independent mode the control of the gun is separated from the robot. The gun can be closed, opened, calibrated, or moved to a new independent position, but it will not follow coordinated robot movements. Independent mode is useful if the gun performs a task that is independent of the robot’s task, e.g. tip dressing of a stationary gun. Basic examples Basic examples of the instruction STIndGun are illustrated below. Example 1 This procedure could be run from a background task while the robot in the main task can continue with, for example, move instructions. PROC tipdress() ! Note that the gun will move to current robtarget position, if ! already in independent mode. STIndGunReset gun1; ... STIndGun gun1, 30; StClose gun1, 1000, 5; WaitTime 10; STOpen gun1; ... STIndGunReset gun1; ENDPROC Independent mode is activated and the gun is moved to an independent position ( 30 mm). During independent mode the instructions StClose , WaitTime , and STOpen are executed without interfering with robot motion. The instruction StIndGunReset will take the gun out of independent mode and move the gun to current robtarget position. Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
503
1 Instructions 1.178. StepBwdPath - Move backwards one step on path RobotWare - OS 3HAC 16581-1 Revision: J 500 © Copyright 2004-2010 ABB. All rights reserved. Limitations After the program has been stopped it is possible to step backwards on the path with the following limits: • The 1st StepBwdPath movements step will be reduced to the current segment for the robot • Further StepBwdPath movements steps will be limited to the segment before the previous segment (possible to step backward within two segment before the interupted segment). If an attempt is made to move beyond these limits then the error handler will be called with ERRNO set to ERR_BWDLIMIT . Syntax StepBwdPath [ StepLength’:=’ ] < expression ( IN ) of num >’,’ [ StepTime ’:=’ ] < expression ( IN ) of num >’;’ Related information For information about See Motion in general Technical reference manual - RAPID overview , section Motion and I/O principle Positioning instructions Technical reference manual - RAPID overview , section RAPID summary - Motion Continued 1 Instructions 1.179. STIndGun - Sets the gun in independent mode Servo Tool Control 501 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.179. STIndGun - Sets the gun in independent mode Usage STIndGun ( Servo Tool independent gun ) is used to set the gun in independent mode and thereafter move the gun to a specified independent position. The gun will stay in independent mode until the instruction STIndGunReset is executed. During independent mode the control of the gun is separated from the robot. The gun can be closed, opened, calibrated, or moved to a new independent position, but it will not follow coordinated robot movements. Independent mode is useful if the gun performs a task that is independent of the robot’s task, e.g. tip dressing of a stationary gun. Basic examples Basic examples of the instruction STIndGun are illustrated below. Example 1 This procedure could be run from a background task while the robot in the main task can continue with, for example, move instructions. PROC tipdress() ! Note that the gun will move to current robtarget position, if ! already in independent mode. STIndGunReset gun1; ... STIndGun gun1, 30; StClose gun1, 1000, 5; WaitTime 10; STOpen gun1; ... STIndGunReset gun1; ENDPROC Independent mode is activated and the gun is moved to an independent position ( 30 mm). During independent mode the instructions StClose , WaitTime , and STOpen are executed without interfering with robot motion. The instruction StIndGunReset will take the gun out of independent mode and move the gun to current robtarget position. Continues on next page 1 Instructions 1.179. STIndGun - Sets the gun in independent mode Servo Tool Control 3HAC 16581-1 Revision: J 502 © Copyright 2004-2010 ABB. All rights reserved. xx0500002342 The position p1 depends on the position of the gun given in the robtarget just performed by the robot. Arguments STIndGun ToolName GunPos ToolName Data type: string The name of the mechanical unit. GunPos Data type: num The position (stroke) of the servo gun in mm. Syntax STIndGun [ ToolName ’:=’ ] < expression ( IN ) of string > ‘,’ [ GunPos ’:=’ < expression ( IN ) of num > ]’;’ Continued
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
504
1 Instructions 1.179. STIndGun - Sets the gun in independent mode Servo Tool Control 501 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.179. STIndGun - Sets the gun in independent mode Usage STIndGun ( Servo Tool independent gun ) is used to set the gun in independent mode and thereafter move the gun to a specified independent position. The gun will stay in independent mode until the instruction STIndGunReset is executed. During independent mode the control of the gun is separated from the robot. The gun can be closed, opened, calibrated, or moved to a new independent position, but it will not follow coordinated robot movements. Independent mode is useful if the gun performs a task that is independent of the robot’s task, e.g. tip dressing of a stationary gun. Basic examples Basic examples of the instruction STIndGun are illustrated below. Example 1 This procedure could be run from a background task while the robot in the main task can continue with, for example, move instructions. PROC tipdress() ! Note that the gun will move to current robtarget position, if ! already in independent mode. STIndGunReset gun1; ... STIndGun gun1, 30; StClose gun1, 1000, 5; WaitTime 10; STOpen gun1; ... STIndGunReset gun1; ENDPROC Independent mode is activated and the gun is moved to an independent position ( 30 mm). During independent mode the instructions StClose , WaitTime , and STOpen are executed without interfering with robot motion. The instruction StIndGunReset will take the gun out of independent mode and move the gun to current robtarget position. Continues on next page 1 Instructions 1.179. STIndGun - Sets the gun in independent mode Servo Tool Control 3HAC 16581-1 Revision: J 502 © Copyright 2004-2010 ABB. All rights reserved. xx0500002342 The position p1 depends on the position of the gun given in the robtarget just performed by the robot. Arguments STIndGun ToolName GunPos ToolName Data type: string The name of the mechanical unit. GunPos Data type: num The position (stroke) of the servo gun in mm. Syntax STIndGun [ ToolName ’:=’ ] < expression ( IN ) of string > ‘,’ [ GunPos ’:=’ < expression ( IN ) of num > ]’;’ Continued 1 Instructions 1.180. STIndGunReset - Resets the gun from independent mode Servo Tool Control 503 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.180. STIndGunReset - Resets the gun from independent mode Usage STIndGunReset ( Servo Tool independent gun reset ) is used to reset the gun from independent mode and thereafter move the gun to current robtarget position. Basic examples Basic examples of the instruction STIndGunReset are illustrated below. STIndGunReset gun1; Arguments STIndGunReset ToolName ToolName Data type: string The name of the mechanical unit. Program execution The instruction will reset the gun from independent mode and move the gun to current robtarget position. During this movement the coordinated speed of the gun must be zero otherwise an error will occur. The coordinated speed will be zero if the robot is standing still or if the current robot movement includes a “zero movement” from the gun. Syntax STIndGunReset [ToolName ´:=´]<expression ( IN ) of string>´;´
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
505
1 Instructions 1.179. STIndGun - Sets the gun in independent mode Servo Tool Control 3HAC 16581-1 Revision: J 502 © Copyright 2004-2010 ABB. All rights reserved. xx0500002342 The position p1 depends on the position of the gun given in the robtarget just performed by the robot. Arguments STIndGun ToolName GunPos ToolName Data type: string The name of the mechanical unit. GunPos Data type: num The position (stroke) of the servo gun in mm. Syntax STIndGun [ ToolName ’:=’ ] < expression ( IN ) of string > ‘,’ [ GunPos ’:=’ < expression ( IN ) of num > ]’;’ Continued 1 Instructions 1.180. STIndGunReset - Resets the gun from independent mode Servo Tool Control 503 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.180. STIndGunReset - Resets the gun from independent mode Usage STIndGunReset ( Servo Tool independent gun reset ) is used to reset the gun from independent mode and thereafter move the gun to current robtarget position. Basic examples Basic examples of the instruction STIndGunReset are illustrated below. STIndGunReset gun1; Arguments STIndGunReset ToolName ToolName Data type: string The name of the mechanical unit. Program execution The instruction will reset the gun from independent mode and move the gun to current robtarget position. During this movement the coordinated speed of the gun must be zero otherwise an error will occur. The coordinated speed will be zero if the robot is standing still or if the current robot movement includes a “zero movement” from the gun. Syntax STIndGunReset [ToolName ´:=´]<expression ( IN ) of string>´;´ 1 Instructions 1.181. SToolRotCalib - Calibration of TCP and rotation for stationary tool RobotWare - OS 3HAC 16581-1 Revision: J 504 © Copyright 2004-2010 ABB. All rights reserved. 1.181. SToolRotCalib - Calibration of TCP and rotation for stationary tool Usage SToolRotCalib (Stationary Tool Rotation Calibration) is used to calibrate the TCP and rotation of a stationary tool. The position of the robot and its movements are always related to its tool coordinate system, i.e. the TCP and tool orientation. To get the best accuracy it is important to define the tool coordinate system as correctly as possible. The calibration can also be done with a manual method using the FlexPendant (described in Operating manual - IRC5 with FlexPendan t, section Programming and testing ). Description To define the TCP and rotation of a stationary tool, you need a movable pointing tool mounted on the end effector of the robot. Before using the instruction SToolRotCalib , some preconditions must be fulfilled: • The stationary tool that is to be calibrated must be mounted stationary and defined with the correct component robhold ( FALSE ). • The pointing tool ( robhold TRUE ) must be defined and calibrated with the correct TCP values. • If using the robot with absolute accuracy then the load and center of gravity for the pointing tool should be defined. LoadIdentify can be used for the load definition. • The pointing tool, wobj0 , and PDispOff must be activated before jogging the robot. • Jog the TCP of the pointing tool as close as possible to the TCP of the stationary tool (origin of the tool coordinate system) and define a robtarget for the reference point RefTip . • Jog the robot without changing the tool orientation so the TCP of the pointing tool is pointing at some point on the positive z-axis of the tool coordinate system, and define a robtarget for point ZPos . • Jog the robot without changing the tool orientation so the TCP of the pointing tool is pointing at some point on the positive x-axis of the tool coordinate system, and define a robtarget for point XPos . As a help for pointing out the positive z-axis and x-axis, some type of elongator tool can be used. Definition of robtargets RefTip , ZPos , and XPos . See figure below. xx0500002343 Continues on next page
ABB_Technical_Reference_Manual
https://library.e.abb.com/public/688894b98123f87bc1257cc50044e809/Technical%20reference%20manual_RAPID_3HAC16581-1_revJ_en.pdf
506
1 Instructions 1.180. STIndGunReset - Resets the gun from independent mode Servo Tool Control 503 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. 1.180. STIndGunReset - Resets the gun from independent mode Usage STIndGunReset ( Servo Tool independent gun reset ) is used to reset the gun from independent mode and thereafter move the gun to current robtarget position. Basic examples Basic examples of the instruction STIndGunReset are illustrated below. STIndGunReset gun1; Arguments STIndGunReset ToolName ToolName Data type: string The name of the mechanical unit. Program execution The instruction will reset the gun from independent mode and move the gun to current robtarget position. During this movement the coordinated speed of the gun must be zero otherwise an error will occur. The coordinated speed will be zero if the robot is standing still or if the current robot movement includes a “zero movement” from the gun. Syntax STIndGunReset [ToolName ´:=´]<expression ( IN ) of string>´;´ 1 Instructions 1.181. SToolRotCalib - Calibration of TCP and rotation for stationary tool RobotWare - OS 3HAC 16581-1 Revision: J 504 © Copyright 2004-2010 ABB. All rights reserved. 1.181. SToolRotCalib - Calibration of TCP and rotation for stationary tool Usage SToolRotCalib (Stationary Tool Rotation Calibration) is used to calibrate the TCP and rotation of a stationary tool. The position of the robot and its movements are always related to its tool coordinate system, i.e. the TCP and tool orientation. To get the best accuracy it is important to define the tool coordinate system as correctly as possible. The calibration can also be done with a manual method using the FlexPendant (described in Operating manual - IRC5 with FlexPendan t, section Programming and testing ). Description To define the TCP and rotation of a stationary tool, you need a movable pointing tool mounted on the end effector of the robot. Before using the instruction SToolRotCalib , some preconditions must be fulfilled: • The stationary tool that is to be calibrated must be mounted stationary and defined with the correct component robhold ( FALSE ). • The pointing tool ( robhold TRUE ) must be defined and calibrated with the correct TCP values. • If using the robot with absolute accuracy then the load and center of gravity for the pointing tool should be defined. LoadIdentify can be used for the load definition. • The pointing tool, wobj0 , and PDispOff must be activated before jogging the robot. • Jog the TCP of the pointing tool as close as possible to the TCP of the stationary tool (origin of the tool coordinate system) and define a robtarget for the reference point RefTip . • Jog the robot without changing the tool orientation so the TCP of the pointing tool is pointing at some point on the positive z-axis of the tool coordinate system, and define a robtarget for point ZPos . • Jog the robot without changing the tool orientation so the TCP of the pointing tool is pointing at some point on the positive x-axis of the tool coordinate system, and define a robtarget for point XPos . As a help for pointing out the positive z-axis and x-axis, some type of elongator tool can be used. Definition of robtargets RefTip , ZPos , and XPos . See figure below. xx0500002343 Continues on next page 1 Instructions 1.181. SToolRotCalib - Calibration of TCP and rotation for stationary tool RobotWare - OS 505 3HAC 16581-1 Revision: J © Copyright 2004-2010 ABB. All rights reserved. NOTE! It is not recommended to modify the positions RefTip , ZPos , and XPos in the instruction SToolRotCalib . Basic examples Basic examples of the instruction SToolRotCalib are illustrated below. Example 1 ! Created with pointing TCP pointing at the stationary tool ! coordinate system CONST robtarget pos_tip := [...]; CONST robtarget pos_z := [...]; CONST robtarget pos_x := [...]; PERS tooldata tool1:= [ FALSE, [[0, 0, 0], [1, 0, 0 ,0]], [0, [0, 0, 0], [1, 0, 0, 0], 0, 0, 0]]; !Instructions for creating or ModPos of pos_tip, pos_z and pos_x MoveJ pos_tip, v10, fine, point_tool; MoveJ pos_z, v10, fine, point_tool; MoveJ pos_x, v10, fine, point_tool; SToolRotCalib pos_tip, pos_z, pos_x, tool1; The position of the TCP ( tframe.trans ) and the tool orientation ( tframe.rot ) of tool1 in the world coordinate system is calculated and updated. Arguments SToolRotCalib RefTip ZPos XPos Tool RefTip Data type: robtarget The point where the TCP of the pointing tool is pointing at the stationary tool TCP to calibrate. ZPos Data type: robtarget The elongator point that defines the positive z direction. XPos Data type: robtarget The elongator point that defines the positive x direction. Tool Data type: tooldata The persistent variable of the tool that is to be calibrated. Continued Continues on next page