Till Statement
Specifies and displays event condition that, if satisfied, completes the motion command (Jump, Go, Move, etc.) in progress by decelerating and stopping the robot at an intermediate position.
Syntax
Till [ eventcondition ]
Parameters
- eventcondition
- Specify input status used as a trigger.
- [Event] Comparative operator ( =, <>, >=, >, <, <= ) [Integer expression]
- The following functions and variables can be used in the Event.
Functions: Sw, In, InW, Oport, Out, OutW, MemSw, MemIn, MemInW, Ctr, GetRobotInsideBox, GetRobotInsidePlane, Force, AIO_In, AIO_InW, AIO_Out, AIO_OutW, Hand_On, Hand_Off, SF_GetStatus
Variables : Byte, Int32, Integer, Long , Short, UByte, UInt32, UShort global preserve variable, Global variable, module variable
- In addition, using the following operators you can specify multiple event conditions.
Operator: And, Or, Xor
- [Example]
Till Sw(5) = On Till Sw(5) = On And Till(6) = Off
Description
The Till statement can be used by itself or as a search expression in a motion command statement.
The Till condition must include at least one of the functions above.
When variables are included, their values are computed when setting the Till condition. No use of variable is recommended. Otherwise, the condition may be an unintended condition. Multiple Till statements are permitted. The most recent Till condition remains current until superseded.
When parameters are omitted, the current Till definition is displayed.
Notes
Till Setting at Main Power On
At power on, the Till condition is initialized to Till Sw(0) = On.
Use of Stat or TillOn to Verify Till
After executing a motion command which uses the Till qualifier there may be cases where you want to verify whether or not the Till condition was satisfied. This can be done through using the Stat function or the TillOn function.
To use a variables in the event condition expression
- Available variables are Integer type (Byte, Int32, Integer, Long, Short, UByte, UInt32, UShort)
- Array variables are not available
- Local variables are not available
- If variables value cannot satisfy the event condition for more than 0.01 seconds, the change in variables may not be retrieved.
- Up to 64 can wait for variables in one system (including the ones used in the event condition expressions such as Wait). If it is over 64, an error occurs during the project build.
- If you try to transfer a variable waiting for variables as a reference with Byref, an error occurs.
- When a variable is included in the right side member of the event condition expression, the value is calculated when starting the motion command. We recommend not using variables in an integer expression to avoid making unintended conditions.
See Also
Find, Go, In, InW, Jump, MemIn, MemSw, Move, Stat, Sw, TillOn, SF_GetStatus
Till Statement Example
Shown below are some sample lines from programs using the Till instruction.
Till Sw(1) = Off 'Specifies Till condition (Input bit 1 off)
Go P1 Till 'Stop if previous line condition is satisfied
Till Sw(1) = On And Sw($1) = On 'Specify new Till condition
Move P2 Till 'Stop if previous line condition satisfied
Move P5 Till Sw(10) = On 'Stop if condition on this line is satisfied