121
Programming
ModuleOutput.1=OFF
‘Turn ModuleOutput.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.
Examples:
Do While ModuleInput.1=ON
‘Repeat the three lines of code below
‘as long as ModuleInput.1 is ON.
Index.1.Initiate
‘Incremental,Dist=5.250in,Vel=10.0in/s
Dwell For Time 1.000
‘seconds
Loop
Do While (ModuleInput.1=ON AND ModuleInput.2=OFF)
‘Repeat the three lines of code below
‘as long as ModuleInput.1 is ON and
‘ModuleInput.2=OFF.
Index.1.Initiate
‘Incremental,Dist=5.250in,Vel=10.0in/s
Dwell For Time 1.000
‘seconds
Loop
Do While (TRUE)
‘Repeat until the program is halted
Index.1.Initiate
‘Incremental,Dist=5.250in,Vel=10.0in/s
Dwell For Time 1.000
‘seconds
Loop
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.
Examples:
Wait For (ModuleInput.1=ON AND ModuleInput.2=OFF)
Index.0.Initiate
Wait For Index.AnyCommandComplete
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
Summary of Contents for FM-3
Page 2: ......
Page 14: ...xii ...
Page 16: ...2 FM 3 Programming Module Reference Manual Figure 2 FM 3 Programming Module Features ...
Page 128: ...114 FM 3 Programming Module Reference Manual ...
Page 156: ...142 FM 3 Programming Module Reference Manual ...
Page 196: ...182 FM 3 Programming Module Reference Manual ...
Page 238: ...224 FM 3 Programming Module Reference Manual ...
Page 251: ...237 Diagnostics and Troubleshooting Figure 97 Diagnostic Cable DGNE Diagram ...
Page 262: ...248 FM 3 Programming Module Reference Manual ...
Page 264: ...250 FM 3 Programming Module Reference Manual AX4 CEN CDRO ...
Page 265: ...251 Specifications Cable Diagrams ...
Page 266: ...252 FM 3 Programming Module Reference Manual SNCE XXX Cable SNCDD 001 5 Cable ...
Page 267: ...253 Specifications SNCO 003 Cable SNCI 003 Cable ...
Page 268: ...254 FM 3 Programming Module Reference Manual SNCLI 003 Cable ...
Page 272: ...258 FM 3 Programming Module Reference Manual TIA XXX Cable DDS XXX Cable ...
Page 274: ...260 FM 3 Programming Module Reference Manual CMDS XXX Cable CMMS XXX Cable ...
Page 275: ...261 Specifications CFCS XXX Cable ...
Page 276: ...262 FM 3 Programming Module Reference Manual CFCO XXX Cable ...
Page 277: ...263 Specifications CFOS XXX Cable ...
Page 278: ...264 FM 3 Programming Module Reference Manual ...
Page 286: ...272 FM 3 Programming Module Reference Manual ...
Page 290: ...276 FM 3 Programming Module Reference Manual ...
Page 291: ......