* DELAY n
{* Applicable only to M+ PLC models}Purpose | To provide a time delay of n millisecond to the process |
Examples | DELAY 100 |
Comments: | Provide a 100 ms (0.1s) delay to the current custom
function. It is important to note that this is a "brute force" delay method and
only to be used with caution. When a DELAY function is executed the CPU waits at the
statement until the period specified by the "delay" is over. This means that all
the remaining ladder programs and other custom functions will stop responding to changing
input conditions, only system services (serial input, countdown timers and host link
commands etc) as well as interrupt driven CusFns will work during the period of delay.
This may not be desirable if the rest of the process must respond to fast changing inputs.
For delays longer than 0.1s a much better way is to invoke the regular PLC timer and use
the timer contact to trigger another custom function at the end of the delay. For T100MD+ and T100MX+, the minimum delay provided by this function is 10ms, and the resolution of the time delay is 10ms. This means that if you execute DELAY 155 the actual delay will be rounded to 160ms, whereas for DELAY 154 the actual delay will be 150ms. |