Find Statment
Specifies or displays the condition to store coordinates during motion.
Syntax
Find [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
Find statement can be used by itself or as a modifier of a motion command.
The Find condition must include at least one of the functions above.
When variables are included in the Find condition, their values are computed when setting the Find condition. No use of variable is recommended. Otherwise, the condition may be an unintended condition. Multiple Find statements are permitted. The most recent Find condition remains current.
When parameters are omitted, the current Find definition is displayed.
Notes
Find Setting at Main Power On
At power on, the Find condition is: Find Sw(0) = On 'Input bit 0 is on.
Use of PosFound Function to Verify Find
Use PosFound function to verify if the Find condition has been satisfied after executing a motion command using Find modifier.
Use Variables in 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
FindPos, Go, Jump, PosFound, SF_GetStatus
Find Statement Example
Find Sw(5) = On
Go P10 Find
If PosFound Then
Go FindPos
Else
Print "Cannot find the sensor signal."
EndIf