
85
Programming
Dwell For Time
This motion instruction is used to pause program execution for a very precise amount of time.
It operates as a motion instruction – similar to an index, home or jog. Like all other motion
instructions it will not start until the preceding motion instruction has completed. A “Wait for
Index.AnyCommandComplete” is not required. Likewise, any subsequent motion commands
will wait and start after the dwell has completed. The total time required to complete a sequence
of indexes and “Dwell For Time” instructions is extremely repeatable.
The “Dwell For Time” instruction is in units of seconds with a resolution of milliseconds (0.000
seconds).
If you want to pause the program while an index is executing you should use a “Wait for Time”
instruction described below.
A comment is automatically inserted after the “Dwell For Time” instruction which notes that
the dwell time is in units of seconds. The comment starts with the ‘ character.
Examples:
Do While (TRUE)
Index.0.Initiate ‘Incremetal,Dist=25.000in,Vel=25in/s
Dwell For Time 1.000 ‘Seconds
Loop
Do While (TRUE)
Index.0.Initiate ‘Incremetal,Dist=25.000in,Vel=25in/s
Dwell For Time 1.000 ‘Seconds
Index.1.Initiate ‘Incremental,Dist=15.000in,Vel=25in/s
Dwell For Time 0.500 ‘Seconds
Loop
Program Flow Instructions
If/Then/Endif
This is a program flow control instruction used to selectively run a section of code only if a
logical test condition is true. If the test evaluates to true the code between the If/Then and
Endif lines is executed. If the test evaluates to false the code is not executed and the program
skips to the next line of code after the Endif.
Logical tests (AND, OR, NOT) can be used in the If/Then/Endif instruction. Parenthesis “()”
can be used to group the logical tests.
Examples:
If DriveInput.1=ON Then ’Turn Outputs 1 On and 2 Off if Drive
’Input.1 is ON.
DriveOutput.1=ON
Comentarios a estos manuales