Chapter 5 Instruction Specifications

Program example

 

X00007

CTU17

 

4

LD

X00007

 

 

 

 

 

 

 

 

 

 

 

 

 

 

OUT

CTU17 4

 

X00008

CTD17

 

 

 

 

 

LD

X00008

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

OUT

CTD17

 

X00009

CL17

 

 

 

 

 

LD

X00009

 

 

 

 

 

 

 

OUT

CL17

 

 

 

 

 

 

 

 

CT17

R107

 

 

LD

CT17

 

 

 

 

 

 

 

OUT

R107

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

An example of a word I/O being used as the set value for the circuit shown above.

z

OUT CTU n s OUT CTD n

R7E3

 

 

 

WR0017=4

 

 

 

 

 

 

 

 

 

X00007

 

 

CTU17

 

 

 

 

 

 

 

 

 

X00008

CTD17

 

 

 

 

 

 

 

 

 

X00009

CL17

 

 

 

 

 

 

 

 

 

CT17

R107

 

LD

R7E3

 

[

 

 

WR0017=4

WR0017

]

 

LD

X00007

 

 

OUT

CTU17 WR0017

 

LD

X00008

 

OUT

CTD17

 

LD

X00009

 

OUT

CL17

 

LD

CT17

 

OUT

R107

Program description

[Time chart]

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Ignored

 

Ignored

X00007

 

 

 

 

 

 

 

Ignored

 

 

 

 

 

 

 

 

X00008

 

 

 

 

 

 

 

 

CL17

 

 

 

 

 

 

 

 

CT17

 

 

 

 

 

65 535

 

 

 

 

 

 

 

 

 

 

Set value

 

 

 

 

 

65 534

 

 

 

 

5

 

 

5

 

 

=4

 

 

 

 

 

 

 

4

 

 

4

4

 

 

 

 

3

 

 

3

3

 

 

Progress value

 

2

 

 

 

2

 

0

 

1

 

 

 

 

 

(TC17)

1]

2]

3]

4]

5]

6]

7]

6]

 

1] The progress value (count value) is up-counted at the leading edge of X00007.

2] The counter coil (CT17) is turned on when the progress value set value.

3] When the up-coil and down-coil startup conditions turn on simultaneously, the progress value does not change.

4] The progress value is down-counted at the leading edge of X00008.

5] The counter coil turns off when set value > progress value.

6] The progress value will not exceed 65535 (decimal). Also, it will not be below 0.

7] When the counter clear (CL17) turns on, the progress value and the counter coil are cleared. The progress value is not updated while the counter clear is on.

The clear is performed under the conditions set immediately before execution of the counter coil instruction.

Example using the word I/O as the set value

When RUN is commenced, the set value is set to word I/O.

Or, the word I/O for the set value is designated to store in the power failure memory.

5-35

Page 85
Image 85
Hitachi NJI-350B manual CTU17