Hitachi NJI-350B Video Game Controller User Manual


 
Chapter 5 Instruction Specifications
5-131
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
zzzz
Instruction format Number of steps
156
Condition Steps
FUN 142 (s) 3
Bit Word Double word
Usable I/O
XY
R,
M
TD, SS,
CU, CT WX WY
WR,
WM TC DX DY
DR,
DM
Constant
Other
s
Argument (Counter
number, Up/Down
instruction)
{
Function
Counter number: H01 to H04
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
LD R2
AND DIF2
[
WR2 = H101
FUN 142 ( WR2 )
]
DIF2
WR2 = H0101
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).
S
Counter number Up/Down instruction
15 8 7 0
FUN 142 (s)