Emerson EZMotion User Manual page 176

Table of Contents

Advertisement

Example:
Switch<var.var0>
case <1>
Home.0.Initiate
break
case <2>
Dwell For Time 60 'seconds
break
Default:
Index.0.Initiate'Index0,Incremental,Distance-300 revs,Vel=2000 rev/m
Wait For Index.AnyCommandComplete
EndSwitch
In the above example if var.var0 = 2 then the program will execute from "case 2" and process the instructions of case 2 and proceed
through the program.
Wait For
This program flow instruction is used to halt program execution until an expression becomes true. Once the expression becomes
true the program continues on with the next line of code.
Logical tests (AND, OR, NOT) can be used in the Wait For instruction. Output events (EZ=ON, AtVel, etc.) as well as comparisons
(PosnFeedback > 1234, VelFeedback < 100, etc.) can be used in a Wait For instruction.
Example:
Wait For (EZInput.1=ON AND EZInput.2=OFF)
Index.0.Initiate
Example:
Wait For Index.AnyCommandComplete
If (EZInput.2=ON) Then
Jog.0.PlusInitiate 'Vel=20in/s
Wait For EZInput.2=OFF
Jog.Stop
Endif
If (SPInput.6=ON) Then
Jog.0.MinusInitiate 'Vel=20in/s
Wait For SPInput.6=OFF
Jog.Stop
Endif
Example:
Wait For (MasterAxis.PosnFeedback > 1000.00)
EZOutput.1 = ON
Example:
Wait For (VelFeedback > 50.00)
EZOutput.2 = ON
Wait For Control Loop
This program instruction is used to halt the program execution until the next control loop. The control loop processes the input and
output events. So the "Wait For Control Loop" is very useful to allow event to be processed before using the results or clearing it's
activation request.
Examples:
DefineHome=true
Wait For Control Loop
DefineHome=false
Wait For Time
This program instruction is used to halt program execution for a specified period of time. This instruction is not a motion instruction
and can be used while a motion instruction is executing.
Units: Seconds, Resolution: 0.001 seconds
A comment is automatically inserted after the "Wait For Time" instruction which notes that the time is in units of seconds. The
comment starts with the apostrophe ' character.
The accuracy of the Wait For Time instruction is dependant on the Trajectory Update Rate found on the Setup view. The actual
accuracy for this instruction is +/- 1 Trajectory Update. Therefore, if the Trajectory Update Rate is set to 2msec, then the worst-case
accuracy is 2msec.
Example:
Wait For Time 5.000 'seconds
Do While (TRUE)
Index.1.Initiate
Wait For AtVel
EZOutput.1=ON
Wait For Time 1.000 'seconds
EZOutput.1=OFF
Wait For Index.AnyCommandComplete
Loop
164
'Home0,Sensor,SpecifiedOffset=0.0000 revs,Vel=200 revs/m
www.controltechniques.com
EZMotion User/Programming Guide
Revision: A8

Advertisement

Table of Contents
loading

Table of Contents