6F3B0250
Basic Hardware and Function 113
6. Programming Information

6.6.2 Sub-program #1

If t he sub- program #1 is pr ogrammed, it is executed once at the beginning of the first
scan (bef or e m ain pr ogram execution).
Therefore, the sub- program #1 can be used t o set the initial value into the reg ist er s.
The sub-pr ogram #1 is called the initial progr am .
The figure below shows the first scan oper at ion.
The end of the sub-prog r am #1 is recognized by the END instruction.

6.6.3 Timer interrupt program

The timer interrupt is the highest priorit y task. It is executed cyclically with a user
specified int er val, with suspending ot her operation.
The inter r upt interval is set in the system information. ( 5 t o 1000 m s , 5 m s unit s )
The end of the timer int er r upt is recognized by the IRET inst r uct ion.
I/O Main program
Main programSub#1Timer I/OMode Timer
RUN mode
transition 1st scan 2nd scan
Time
1 scan1 scan1 scan
Scan
Timer in terrupt
1 scan
Timer in terrupt
interval
Timer in terrupt
interval
Time
CTi Automation - Phone: 800.894.0412 - Fax: 208.368.0415 - Web: www.ctiautomation.net - Email: info@ctiautomation.net