EasyManua.ls Logo

Mitsubishi Electric MELSEC-Q/L - Page 337

Mitsubishi Electric MELSEC-Q/L
1084 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
6 BASIC INSTRUCTIONS
6.8 Other Convenient Instructions
335
6
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 STOPRUN.) 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 the CPU module is 1ms.
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.
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.
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
In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into SD0.
Program example
This program uses C0 (Up/Down counter) to count the number of times X0 goes from OFF to ON after X20 has gone ON.
Error
code
Error details Q00J/
Q00/
Q01
QnH QnPH QnPRH QnU LCPU
4101 The device specified by (S) exceeds the range of the corresponding device. 
[Ladder Mode] [List Mode]
[Operation]
Step
Instruction
Device
X0
X20
X1
C0 present value
C0 contact
012345676543210123210 11-----
Down
UpUp

Table of Contents

Related product manuals