Emerson EZMotion User Manual page 175

Table of Contents

Advertisement

GoTo RunIndex1: 'Go to RunIndex1 label
Else
GoTo RunIndex2: 'Go to RunIndex2 label
EndIf
RunIndex1:
Index.1.Initiate
GoTo EndLoop:
RunIndex2:
Index.2.Initiate
EndLoop:
Wait For Index.AnyCommandComplete
Loop
See the Label: instruction for additional examples.
GraphRun
This instruction allows you to enable the graph from a user program. It is similar to pressing the "Run" button on the Graph
view. The instruction will wait until the full graph buffer is full, then it exits into the looking for trigger state.
If/Then/EndIf
This is a program flow control instruction used to selectively run a section of code only if a logical test condition is true. If the
test evaluates to true the code between the If/Then and Endif lines is executed. If the test evaluates to false the code is not
executed and the program skips to the next line of code after the Endif.
Logical tests (AND, OR, NOT) can be used in the If/Then/Endif instruction. Parenthesis "()" can be used to group the logical
tests.
Example:
If EZInput.1=ON Then
EZOutput.1=ON
EZOutput.2=OFF
Endif
Example:
If (EZInput.1=ON AND EZInput.2=OFF) Then
EZOutput.1=ON
EZOutput.2=OFF
Endif
Example:
If (SPInput.4=OFF) Then
Jog.0.PlusInitiate 'Vel=20in/s
Wait For SPInput.4=OFF
Jog.Stop
Endif
Example:
If (NOT SPInput.5=ON) Then
Jog.0.MinusInitiate 'Vel=20in/s
Wait For SPInput.5=OFF
Jog.Stop
Endif
Label:
The Label: instruction is used in conjunction with the GoTo instruction to cause program flow to transfer to a specified location
within a program. The destination label is allowed to be above or below the GoTo instruction within the same program. It is not
possible to GoTo a label outside of the program containing the GoTo instruction, nor is it possible to use a GoTo/Label: to exit
out of a For Count/Next loop. In either of these conditions, a Red Dot error will be generated.
The Label to which program flow transfers is a string of up to 50 characters in length and can be made up of any alphanumeric
character. The label name must not start with a number, and must end with a colon character ":". When using the Label:
instruction, a ":" will be automatically inserted for the user.
Labels are not case sensitive.
Example:
Start:
Index.1.Initiate
Wait For Index.AnyCommandComplete
If (EZInput.2 = ON) Then
GoTo Start:
EndIf
EZOutput.1 = ON
End
See GoTo instruction for additional examples.
Switch
The Switch instruction is used in conjunction with the Case: instruction to cause program flow to transfer based on the switch
expression value and execute the instructions associated with that case instruction.
EZMotion User/Programming Guide
Revision A8
www.controltechniques.com
163

Advertisement

Table of Contents
loading

Table of Contents