Mitsubishi Electronics FX3U Garage Door Opener User Manual


 
230
FX3S/FX3G/FX3GC/FX3U/FX3UC Series
Programming Manual - Basic & Applied Instruction Edition
8 Program Flow – FNC 00 to FNC 09
8.2 FNC 01 – CALL / Call Subroutine
8.2.1 Cautions on subroutines and interrupt routines
This section explains cautions on creating programs in subroutines and interrupt routines.
The explanation below is given for subroutines, but the situation also applies to interrupt routines.
1. When using timers in subroutines (or interrupt routines)
Use retentive type timers T192 to T199 in subroutines.
These timers execute counting when the coil instruction or END instruction is executed.
After a timer reaches the set value, the output contact is activated when the coil instruction or END instruction is
executed.
Because general timers execute counting only when the coil instruction is executed, they do not execute counting if
they are used in subroutines in which the coil instruction is executed only under some conditions.
2. When using retentive type 1 ms timers in subroutines (or interrupt routines)
If a retentive type 1 ms timer is used in a subroutine, note that the output contact is activated when the first coil
instruction (or subroutine) is executed after the timer reaches its set value.
3. Countermeasures against latches of devices used in subroutines (or interrupt routines)
Devices which were set to ON in a subroutine are latched in the ON status even after the subroutine is finished. (Refer
to the program example shown below.)
When RST instruction for a timer or counter is executed, the reset status of the timer or counter is latched also.
For turning OFF such a device latched in the ON status or for canceling such a timer or counter latched in the reset
status, reset such a device in the main program after the subroutine is finished, or program a sequence for resetting
such a device or for deactivating RST instruction in the subroutine.
(Refer to the program example shown on the next page.)
Example in which outputs are latched
In the following program example, the counter C0 is provided to count X001. When X000 is input, the subroutine P0 is
executed only in one scan, and then the counter is reset and Y007 is output.
1) Program example
2) Timing chart
X000
X000
K10
FNC 01
CALLP
C0
RST C0
X001
P0
FNC 06
FEND
FNC 02
SRET
P0
Y007
Execution of
subroutine P0
triggered by X000
X001
Current
value of C0
1
2
3
Counter
is reset.
Because the reset instruction
for C0 is valid, the current value
of C0 remains unchanged even
if pulses are input.
Remains reset.
Y007 is being output.
Outputs are held.
RST
C0
Y007
Subroutine is executed.