Epsilon EP-P Drive Reference Manual
123
Revision A4
www.controltechniques.com
For<var>
This program instruction is used to execute a section of code as long as the end number is not reached.
For <variable> = <start> to <end> step <increment>... Next
<variable> = A single user variable that will be set and incremented by this instruction.
<start> = An expression that the <variable> will be initialized to at the start of the instruction.
<end> = A number that is used to exit the For<var> loop. For a positive increment, when <variable> Greater than or equal
to <end> the loop is exited. For negative increment, when <variable> is Less than or equal to <end> the loop is exited.
<increment> = An expression that the <variable> will be incremented by at the end of the loop. Expression is a
mathematical formula including variables, numbers, and math operators that represent a single value when executed.
Example:
For var.var0 = 1 To 20 Step .5
Next
The Break instruction is allowed within the For<var> instruction loop.
GoTo
The GoTo instruction is used in conjunction with the Label: 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 RedDot error will be generated.
The Label to which program flow transfers is a character string 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 “:”.
Labels are not case sensitive.
Example:
Do While (TRUE)
If (DriveInput.1 = ON) Then
GoTo RunIndex1:
‘Go to RunIndex1 label
Else
GoTo RunIndex2:
‘Go to RunIndex2 label
EndIf
RunIndex1:
‘If Input.1 is on, resume here
Index.1.Initiate
GoTo EndLoop:
‘GoTo EndLoop label
RunIndex2:
‘If Input.1 is off, resume here
Index.2.Initiate
EndLoop:
Wait For Index.AnyCommandComplete
Loop
See the Label: instruction for additional examples.
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.
Examples:
If DriveInput.1=ON Then
’Turn Outputs 1 On and 2 Off if Drive
’Input.1 is ON.
DriveOutput.1=ON
DriveOutput.2=OFF
Endif
If (DriveInput.1=ON AND DriveInput.2=OFF) Then
‘Turn Outputs 1 On and 2 Off if Drive
‘Input.1 is ON and DriveInput.2 is OFF
DriveOutput.1=ON
DriveOutput.2=OFF
Endif
If (DriveInput.2=ON) Then
‘Jog+ when DriveInput.2=ON
Jog.0.PlusInitiate
‘Vel=20in/s
Wait For DriveInput.2=OFF
‘Stop when the input goes OFF
Jog.Stop
‘Decelerate to a stop
Summary of Contents for Epsilon EP-P
Page 2: ......
Page 124: ...110 Epsilon EP P Drive Reference Manual www controltechniques com Revision A4...
Page 200: ...186 Epsilon EP P Drive Reference Manual www controltechniques com Revision A4...
Page 218: ...204 Epsilon EP P Drive Reference Manual www controltechniques com Revision A4...
Page 238: ...224 Epsilon EP P Drive Reference Manual www controltechniques com Revision A4...
Page 244: ...230 Epsilon EP P Drive Reference Manual www controltechniques com Revision A4...
Page 247: ......