
FM-3 Programming Module Reference Manual
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 |
|
|
Wait For (MasterAxis.PosnFeedback > 1000.00)
DriveOutput.1 = ON
Wait For (VelFeedback > 50.00)
DriveOutput.2 = ON
Wait For Time
This program instruction is used to halt program execution for a specified period of time. This instruction is not a motion instruction and can be used while a motion instruction is executing. Units: Seconds, Resolution: 0.001 seconds
A comment is automatically inserted after the “Wait For Time” instruction which notes that the time is in units of seconds. The comment starts with the apostrophe ‘ character.
Examples:
Wait For Time 5.000 | ‘seconds |
Do While (TRUE) | ‘Repeat until the program is halted |
Index.1.Initiate | ‘Incremental,Dist=25.250in,Vel=10.0in/s |
Wait For AtVel |
|
| ‘Turn Output 1 ON for 1 second, after the |
| ‘index reaches its’ target velocity |
DriveOutput.1=ON |
|
Wait For Time 1.000 | ‘seconds |
DriveOutput.1=OFF
Wait For Index.AnyCommandComplete
Loop
Call Program
This program flow instruction is used to call another program. When the called program finishes the controller picks up where it left off in the program that called it. This is often used when a section of code is used in multiple places in a program. By moving the code to another program and calling that program the total number of program lines can be reduced. This can also make the program easier to understand. Care should be taken not to "nest" more than four program calls due to processor stack overflow. Therefore, no more than four different programs should be called without returning to the original program.
122