Description
The Yield Block defers further activity in the list of blocks until the next sample period. If the controller is operating at a sample rate of 1000 Hz then Yield correpsonds to a single sample delay of one millisecond. If the controller sample rate is set to 4000 Hz then a single yield will correspond
to a 250 microsecond delay. If the controller is waiting for something to occur the waiting process must include a Yield command so that other tasks can run in the meantime. However it would be unusual for a block programmer to explicitly reference a yield command since yields are already built into structures
and commands that might require waiting. All block looping structures include a yield already. Motion commands that take time to complete such as the blocking Move To and Move By commands internally include yields. Any Read/Write operation to a Console control internally provides yieids.
For most block programmers the only reason to use a Yield block would be to provide a way to have a time delay less than 1 milisecond if the controller sample rate is set to higher than 1000 Hz.
Escapes
The Yield block does not produce any escapes.
Examples
Assuming that the controller sample rate is set to 4 kHz this block list would generate a 2 kHz square wave output:
Related Topics
Delay