Mitsubishi MELSEC-Q/L Programming Manual page 290

Table of Contents

Advertisement

UDCNT1
1. With the UDCNT1 instruction, the argument device data is registered in the work area of the CPU module and counting
operation is processed as a system interrupt. (The device data registered in the work area is cleared by turning the
execution command OFF, or turning the STOP/RUN switch STOP RUN.) For this reason, the pulses that can be counted
must have longer ON and OFF times than the interrupt interval of the CPU module. The interrupt interval of individual
modules is shown below:
High Performance model QCPU, Process CPU,
Universal model QCPU, LCPU
2. The set value cannot be changed during counting directed by the UDCNT1 instruction (while the execution command is
ON). To change the set value, turn OFF the execution command.
3. Counters designated by the UDCNT1 instruction cannot be used by any other instruction. If they are used by other
instructions, they will not be capable of returning an accurate count.
4. The UDCNT1 instruction can be used as many as 6 times within all the programs being executed. The seventh and the
subsequent UDCNT1 instructions are not processed.
Operation Error
(1) In the following case, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into SD0.
Error
code
The device specified by
4101
device.
Program Example
(1) This program uses C0 (Up/Down counter) to count the number of times X0 goes from OFF to ON after X20 has gone
ON.
[Ladder Mode]
[Operation]
X20
X0
Up
X1
C0 present value
0 1 2 3 4 5 6 7 6 5 4 3 2 1 0 1 2 3 2 1 0
C0 contact
288
CPU Module Type Name
Error details
exceeds the range of the corresponding
S
[List Mode]
Step
Down
- - - - -
Interrupt Interval
1 ms
Q00J/
Q00/
QnH
Q01
––
Device
Instruction
Up
1
1
QnPH QnPRH
QnU
LCPU
––

Advertisement

Table of Contents
loading

Table of Contents