IDEC FT1A Series User Manual page 130

Hide thumbs Also See for FT1A Series:
Table of Contents

Advertisement

5: S
F
PECIAL
UNCTIONS
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.
MOV(W)
M8120
Main Program
Interrupt Program
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.
5-42
S1 –
D1 –
REP
0
D8036
END
LABEL
0
LRET
S
AXIS P
MART
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.
/L
U
'
M
FT9Y-B1378
RO
ITE
SER
S
ANUAL

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents