
104
Epsilon EP-P Drive and FM-3/4 Module Reference Manual
‘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
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
Else
This program flow instruction is used in conjunction with the If/Then/Endif instruction. If the If/Then test condition evaluates
to true the code after the If/Then and before the Else is executed. If the test evaluates to false the code between the Else and
the Endif is executed.
Examples:
If DriveInput.1=ON Then ‘The following two lines are executed if
‘DriveInput.1=ON
DriveOutput.1=ON
DriveOutput.2=OFF
Else ‘The following two lines are executed if
‘DriveInput.1=OFF
DriveOutput.1=OFF
DriveOutput.2=ON
Endif
If (DriveInput.5=ON) Then ‘Set fast velocity if DriveInput.5 = ON
Jog.0.Vel = 1.0 ‘in/s
Else ‘Set slow velocity if DriveInput.5 = OFF
Jog.0.Vel = 0.1 ‘in/s
Endif
For Count/Next
This instruction is used to execute section of code a specific number of times.
Examples:
For Count = 1 to 5
Index.1.Initiate ‘Incremetal,Dist=5.250in,Vel=10.0in/s
Dwell For Time 1.000 ‘seconds
Next
For Count = 1 To 10
Wait For DriveInput.1 = ON
Index.0.Initiate ‘Incremetal,Dist=5.000in,Vel=50in/s
Wait For Index.AnyCommandComplete
DriveOutput.1=ON ‘Turn DriveOutput.1 On
Wait For Time 1.000 ‘seconds
DriveOutput.1=OFF ‘Turn DriveOutput.1 Off
Next
Do While/Loop
This program instruction is used for repeating a sequence of code as long as an expression is true. To loop forever use
“TRUE” as the test expression as shown in the third example below. The test expression is tested before the loop is entered.
If the test expression is evaluated as False (0) the code in the loop will be skipped over.
Logical tests (AND, OR, NOT) can be used in the Do While/Loop instruction. Parenthesis “()” can be used to group the
logical tests.
Comentarios a estos manuales