5: S
PECIAL
F
UNCTIONS
5-42
S
MART
AXIS P
RO
/L
ITE
U
SER
'
S
M
ANUAL
FT9Y-B1378
Example: Timer Interrupt
The following example demonstrates a program of using the timer interrupt function. The Function Area Settings must also be
completed to use the timer interrupt function as described on the preceding page.
Notes for Using Timer Interrupt and Interrupt Inputs:
•
When using a timer interrupt or interrupt input, separate the interrupt program from the main program using the END instruction at the end
of the main program.
•
When an interrupt program calls another subroutine, a maximum of 3 subroutine calls can be nested. If more than 3 calls are nested, a user
program execution error occurs, turning on special internal relay M8004 and the ERR LED.
•
When using a timer interrupt or interrupt input, include the label number of the interrupt program to be executed when an interrupt occurs.
The label numbers stored in data registers D8032 through D8035, D8037, and D8038 specify the interrupt programs for interrupt inputs I0,
I2, I3, and I5 through I7 and timer interrupt, respectively.
•
If an interrupt is initiated while another interrupt program is executed, the subsequent interrupt program is executed after the prior interrupt
is completed. Multiple interrupt programs cannot be executed simultaneously.
•
Make sure that the execution time of the interrupt program is shorter than interrupt intervals sufficiently.
•
Interrupt programs cannot use the following instructions: SOTU, SOTD, TML, TIM, TMH, TMS, TMLO, TIMO, TMHO, TMSO, CNT, CDP, CUD,
CNTD, CDPD, CUDD, SFR, SFRN, WEEK, YEAR, MSG, DI, EI, XYFS, CVXTY, CVYTX, AVRG, PULS, PWM, RAMP, ZRN, ARAMP, DTML, DTIM,
DTMH, DTMS, TTIM, FIFOF, NDSRC, HOUR, TXD, RXD, ETXD, ERXD, DLOG, TRACE, and SCRPT.
LABEL
0
M8120
END
Main Program
REP
S1 –
0
D1 –
D8036
MOV(W)
LRET
Interrupt Program
M8120 is the initialize pulse special internal relay.
D8036 stores 0 to designate jump destination label 0 for timer interrupt.
The interrupt program is separated from the main program by the END instruction.
While the SmartAXIS is running, program execution jumps to label 0 repeatedly at
intervals selected in the Function Area Settings.
Each time the interrupt program is completed, program execution returns to the main
program at the address where timer interrupt occurred.
Insert LRET at the end of the subroutine to return to the main program.
Summary of Contents for FT1A-B12RA
Page 1: ...FT9Y B1378 5 ...
Page 2: ......
Page 208: ...7 DEVICE ADDRESSES 7 16 SMARTAXIS PRO LITE USER S MANUAL FT9Y B1378 ...
Page 226: ...8 INSTRUCTIONS FUNCTION BLOCKS REFERENCE 8 18 SMARTAXIS PRO LITE USER S MANUAL FT9Y B1378 ...
Page 340: ...13 SCRIPTS 13 36 SMARTAXIS PRO LITE USER S MANUAL FT9Y B1378 ...
Page 385: ...SMARTAXIS PRO LITE USER S MANUAL FT9Y B1378 A 19 APPENDIX Japanese Font JIS X0201 ...
Page 386: ...APPENDIX A 20 SMARTAXIS PRO LITE USER S MANUAL FT9Y B1378 ...