124
Epsilon EP-P Drive Reference Manual
www.controltechniques.com
Revision: A4
Endif
If (DriveInput.3=ON) Then
‘Jog- when DriveInput.3=ON
Jog.0.MinusInitiate
‘Vel=20in/s
Wait For DriveInput.3=OFF
‘Stop when the input goes OFF
Jog.Stop
‘Decelerate to a 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 RedDot 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 (DriveInput.2 = ON) Then
GoTo Start:
‘ Go to Start label if Input2 on
EndIf
DriveOutput.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. In the following example if the value of var.var0 is one then case <1> will be
executed. When the break instruction is encountered the program will continue with the instruction after the EndSwitch command.
Example:
Switch<var.var0>
case <1>
Home.0.Initiate
‘Home0,Sensor,SpecifiedOffset=0.0000 revs,Vel=200 revs/m
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 (DriveInput=ON, AtVel, etc.) as well as comparisons
(PosnFeedback > 1234, VelFeedback < 100, etc.) can be used in a Wait For instruction.
Example:
Wait For (DriveInput.1=ON AND DriveInput.2=OFF)
Index.0.Initiate
Wait For Index.AnyCommandComplete
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
Endif
If (DriveInput.3=ON) Then
‘Jog- when DriveInput.3=ON
Jog.0.MinusInitiate
‘Vel=20in/s
Wait For DriveInput.3=OFF
‘Stop when the input goes OFF
Содержание Epsilon EP-P
Страница 2: ......
Страница 14: ...xii Epsilon EP P Drive Reference Manual www controltechniques com Revision A4 Glossary 225 Index 231...
Страница 124: ...110 Epsilon EP P Drive Reference Manual www controltechniques com Revision A4...
Страница 200: ...186 Epsilon EP P Drive Reference Manual www controltechniques com Revision A4...
Страница 218: ...204 Epsilon EP P Drive Reference Manual www controltechniques com Revision A4...
Страница 238: ...224 Epsilon EP P Drive Reference Manual www controltechniques com Revision A4...
Страница 244: ...230 Epsilon EP P Drive Reference Manual www controltechniques com Revision A4...
Страница 247: ......