
86
FM-3 Programming Module Reference Manual
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 (ModuleInput.2=ON) Then ‘Jog+ when ModuleInput.2=ON
Jog.0.PlusInitiate ‘Vel=20in/s
Wait For ModuleInput.2=OFF ‘Stop when the input goes OFF
Jog.Stop ‘Decelerate to a stop
Endif
If (ModuleInput.3=ON) Then ‘Jog- when ModuleInput.3=ON
Jog.0.MinusInitiate ‘Vel=20in/s
Wait For ModuleInput.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 (ModuleInput.5=ON) Then ‘Set fast velocity if ModuleInput.5 = ON
Jog.0.Vel = 1.0 ‘in/s
Else ‘Set slow velocity if ModuleInput.5 = OFF
Jog.0.Vel = 0.1 ‘in/s
Endif
Comentarios a estos manuales