Mitsubishi MELSEC QCPU Programming Manual page 265

Programmable logic controller
Table of Contents

Advertisement

6 BASIC INSTRUCTIONS
The count processing performed on the present value is as shown below:
-32768
(4) Count processing based on the UDCNT1 instruction starts the count when the count command
goes from OFF to ON, and suspends the count when it goes from ON to OFF.
When the count command goes from OFF to ON once again, the count is restarted from the
value in effect when it was suspended.
(5) The RST instruction clears the present value of the counter designated at
contact OFF.
POINTS
(1) The UDCNT1 instruction registers the argument device data to the work area of the CPU
module and the actual counting operation is processed as a system interrupt.
(The device data registered to the work area of the CPU module are cleared when the
command input is turned OFF or when the CPU module is STOPped and then RUN.)
Therefore, to count pulses, it is necessary to provide their ON and OFF time as long as the
interrupt time of the CPU module or longer.
The interrupt time of individual CPU module is shown below:
(2) The setting values cannot be changed during a count based on the UDCNT1 instruction
(while the command input is ON)).
To change the setting values, first turn the command input off.
(3) Counters which have been designated by the UDCNT1 instruction cannot be used by other
instructions. 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 Errors]
(1) There are no operation errors associated with the UDCNT1 instruction.
[Program Example]
(1) This program uses C0 (up and down counter) to count the number of times X0 goes from off to
ON after X20 has gone ON.
[Ladder Mode]
[Operation]
6 - 114
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
-32767
-2
When counting up
When counting down
CPU module Type Name
High Performance model QCPU, Process CPU
QnACPU
X20
X0
Up
X1
Present
0 1 2 3 4 5 6 7 6 5 4 3 2 1 0-1-2 -3 -2 -1 0
value of COM
C0 contact
-1
0
1
2
32766
Interrupt Time
[List Mode]
Instruction
Steps
Down
Up
1
1
MELSEC-Q/QnA
32767
and turns the
D
1ms
5ms
Device
6 - 114

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec qnacpuMelsec q modeMelsec q series

Table of Contents