Chapter 3            Programming 
3 – 62 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
If counter value exceeds preset value 1 or 2, then program execution is interrupted and corresponding FUNCTION 
is called. After that, program execution returns back to the original position. 
Each counter has two different preset values, but the same FUNCTION is called. This can be identified by the 
variable “EventPrm.byChannelIndex” in the FUNCTION. If counter value exceeds preset  1, then 1  is stored in 
EventPrm.byChannelIndex. 
 
Functions contain no internal state information. Use global variables including local I/O (external I/O) in functions. 
Local I/O (external I/O) used only in functions is not updated. Make sure to use in other programs or function 
blocks also. 
 
Sample program