5: F
UNCTIONS
AND
S
ETTINGS
5-34
FC6A S
ERIES
M
ICRO
S
MART
A
LL
-
IN
-O
NE
T
YPE
U
SER
’
S
M
ANUAL
FC9Y-B1722
Example: Interrupt Input
The following example demonstrates a program using the interrupt input function, with input I1 designated as an interrupt input.
When the interrupt input is turned on, the input I0 status is immediately transferred to output Q0 using the IOREF (I/O refresh)
instruction before the END instruction is executed. For the IOREF instruction, See Chapter 21 "Trigonometric Function Instructions"
in the "FC6A Series MicroSmart LAD Programming Manual".
Notes for Using Interrupt Inputs and Timer Interrupt:
•
When using an interrupt input or timer interrupt, 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 an interrupt input or timer interrupt, include the label number of the interrupt program to be executed when an interrupt occurs.
The label numbers stored in data registers D8214, D8215, and D8032 through D8035 specify the interrupt programs for interrupt inputs I0,
I1, I3, I4, I6, and I7 and timer interrupt, respectively.
•
When more than one interrupt input is turned on at the same time, interrupt program execution is given priority to inputs I0, I1, I3, I4, I6,
and I7, in that order. 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, WKTIM, WJTBL, WEEK, YEAR, MSG, DISP, DGRD, COMRF, DI, EI, XYFS, CVXTY, CVYTX, AVRG, PULS, PWM,
RAMP, ZRN, ARAMP, ABS, JOG, PID, PIDA, DTML, DTIM, DTMH, DTMS, TTIM, FIFOF, NDSRC, HOUR, SCALE, FLWA, FLWP, PING, EMAIL, TXD,
RXD, ETXD, ERXD, DLOG, and TRACE.
LABEL
0
M8120
END
Main Program
M8125
Q0000
REP
S1 –
0
D1 –
D8032
MOV(W)
IOREF
S1
I0000
M0300
M8125
IOREF
S1
Q0000
LRET
M8120 is the initialize pulse special internal relay.
D8032 stores 0 to designate jump destination label 0 for interrupt input I1.
The interrupt program is separated from the main program by the END instruction.
When input I1 is on, program execution jumps to label 0.
M8125 is the in-operation output special internal relay.
IOREF immediately reads input I0 status to internal relay M0300.
M0300 turns on or off the output Q0 internal memory.
Another IOREF immediately writes the output Q0 internal memory status to actual
output Q0.
Program execution returns to the main program.
Insert LRET at the end of the subroutine to return to the main program.
Summary of Contents for FC6A series
Page 1: ...B 1722 2 FC6A SERIES All in One Type User s Manual ...
Page 10: ...TABLE OF CONTENTS Preface 9 FC6A SERIES MICROSMART ALL IN ONE TYPE USER S MANUAL FC9Y B1722 ...
Page 28: ...1 GENERAL INFORMATION 1 18 FC6A SERIES MICROSMART ALL IN ONE TYPE USER S MANUAL FC9Y B1722 ...
Page 286: ...6 DEVICES 6 32 FC6A SERIES MICROSMART ALL IN ONE TYPE USER S MANUAL FC9Y B1722 ...
Page 334: ...7 HMI FUNCTION 7 48 FC6A SERIES MICROSMART ALL IN ONE TYPE USER S MANUAL FC9Y B1722 ...
Page 340: ...8 INSTRUCTIONS REFERENCE 8 6 FC6A SERIES MICROSMART ALL IN ONE TYPE USER S MANUAL FC9Y B1722 ...
Page 360: ...9 FUNCTIONAL MODULES 9 20 FC6A SERIES MICROSMART ALL IN ONE TYPE USER S MANUAL FC9Y B1722 ...
Page 368: ...10 ANALOG CARTRIDGE 10 8 FC6A SERIES MICROSMART ALL IN ONE TYPE USER S MANUAL FC9Y B1722 ...