Sense Statement
Specifies and displays input condition that, if satisfied, completes the Jump in progress by stopping the robot above the target position.
Syntax
Sense [ condition ]
Parameters
- condition
- 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, 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]
Sense Sw(5) = On Sense Sw(5) = On And Sw(6) = Off
Description
Sense checks the input condition at the timing just before the start of the descent of Joint #3 during execution of the Jump command.
It also checks the input conditions at the timing immediately before the start of the approach operation during execution of the Jump3 and Jump3CP commands.
The Sense condition must include at least one of the functions above.
When variables are included in the Sense condition, their values are computed when setting the Sense condition. No use of variable is recommended. Otherwise, the condition may be an unintended condition. Multiple Sense statements are permitted. The most recent Sense condition remains current until superseded with another Sense statement.
Jump, Jump3, Jump3CP with Sense Modifier
Checks if the current Sense condition is satisfied. If satisfied, the Jump instruction completes with the robot stopped above the target position. (i.e. When the Sense Condition is True, the robot arm remains just above the target position without executing approach motion. When the Sense condition is False, the robot arm completes the full Jump instruction motion through to the target position.
When parameters are omitted, the current Sense definition is displayed.
Notes
Sense Setting at Main Power On
At power on, the initial Sense condition is: Sense Sw(0) = On 'Robot does not execute downward motion when Input bit 0 is on.
Use of JS and Stat to Verify Sense
Use JS or Stat to verify if the Sense condition has been satisfied after executing a motion command using Sense modifier.
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
In, JS, Jump, Jump3, Jump3CP, MemIn, MemSw, Stat, Sw, SF_GetStatus
Sense Example
This is a simple example on the usage of the Sense instruction.
Function test
.
.
TrySense:
Sense Sw(1) = Off 'Specifies the arm stops above the target when 'the input bit 1 is Off.
Jump P1 C2 Sense
If JS = True Then
GoSub ERRPRC 'If the arm remains stationary
GoTo TrySense 'above the point specified, 'then execute ERRPRC and go to TrySense.
EndIf
On 1; Wait 0.2; Off 1
.
.
Fend
[Other Syntax Examples]
> Sense Sw(1)=1 And MemSw(1)=1
> Sense Sw(0) Or (Sw(1) And MemSw(1))