Chapter 5 Instruction Specifications

Item number

 

FUN instructions-7

 

Name

 

High-speed Counter Up-Count/Down-count Control (Single

 

 

 

phase counter only)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Ladder format

 

 

 

Condition code

 

Processing time (s)

Remark

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

R7F4

R7F3

 

R7F2

R7F1

R7F0

Average

Maximum

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FUN 142 (s)

 

DER

ERR

 

SD

 

V

 

C

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

z

 

z

 

z

 

z

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Instruction format

 

 

 

Number of steps

 

156

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Condition

 

 

Steps

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FUN 142 (s)

 

 

 

 

3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Bit

 

 

 

 

 

Word

 

Double word

 

Constant

 

 

Usable I/O

 

 

 

 

 

 

 

 

 

 

Other

 

X Y M

 

CU, CT

WX WY WM

TC

DX DY

DM

 

 

 

 

 

 

R,

 

TD, SS,

 

 

WR,

 

 

DR,

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Argument (Counter

 

 

 

 

 

 

{

 

 

 

 

 

 

 

snumber, Up/Down instruction)

Function

15

8 7

0

Counter number:

H01 to H04

 

 

 

 

 

S

 

Counter number

 

Up/Down instruction

Up/down instruction:

H00 – Up-count,

 

 

 

 

 

 

H01 – Down-count

This controls the up-count/down-count of the specified counter.

Up-count and down-count control can be performed during the count operation.

Notes

If a value other than H01 to H04 is specified for the counter number and the up/down instruction is set to a value other than H00 or H01, DER will be set to “1”and no processing will be performed.

If the specified counter number is set to a function other than single-phase counter, DER will be set to “1” and no processing will be performed.

Since Counter 4 is invalid when a 10-point CPU is used, if Counter 4 is specified, DER will be set to “1” and no processing will be performed.

If the specified counter number is unable to make an output (PI/O function setting result by R7F5), DER will be set to “1” and no processing will be performed.

This instruction is only used to control the up-count and down-count. Other counter settings will not be changed and it will not affect the count operation.

The control contents of this instruction will be reflected in bits 11 to 8 of the special internal output WRF07E of the corresponding counter number.

Program example

R2

DIF2

 

 

LD

R2

WR2 = H0101

 

 

AND

DIF2

 

 

 

 

 

 

 

 

 

FUN 142 (WR2)

 

[

 

 

 

 

 

 

 

 

 

 

 

 

 

WR2

= H101

 

 

 

 

 

 

FUN

142 ( WR2 )

 

 

 

 

 

]

 

Program description

• Switches the counter operation of the counter No. 1 to down count.

The count edges (leading/trailing) will follow the specification of the special internal output (WRF07E).

FUN 142 (s)

5-131

Page 181
Image 181
Hitachi NJI-350B manual 131