3. Instructions
738
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Function
PRV(881) reads the data specified in C for the port specified in P. The possible combinations of data
and ports are shown in the following table.
Note This function is supported only by CJ1M CPU Units with unit version 3.0 or later and CJ2M CPU Units.
z Reading a PV (C = 0000 hex)
P: Port specifier
C: Control data
0000 hex: Read PV
0001 hex: Read sta-
tus
0002 hex: Read
range
comparison results
00@3 hex: Read fre-
quency
(0000 to 0003 hex):
Pulse output
OK OK Not allowed.
Refer to the following
table.
(0010 to 0013 hex):
High-speed counter input
OK OK OK
(0100 to 0107 hex):
Interrupt input in counter mode
OK Not allowed. Not allowed.
(1000 to 1003 hex):
PWM (891) output
Not allowed. OK Not allowed.
P: Port specifier
00 3 hex: Read frequency
0003 hex: Pulse output
read high-speed counter
frequency
0013 hex: 10-ms
sampling method
0013 hex: 100-ms
sampling method
0013 hex:
1-s sampling method
(0000 to 0003 hex):
Pulse output
OK (See note.) Not allowed. Not allowed. Not allowed.
(0010 to 0013 hex):
High-speed counter input
OK
(high-speed counter 0
only)
OK (See note.)
(high-speed counter 0
only)
OK (See note.)
(high-speed counter 0
only)
OK (See note.)
(high-speed counter 0
only)
(0100 to 0107 hex):
Interrupt input in counter mode
Not allowed. Not allowed. Not allowed. Not allowed.
(1000 to 1003 hex):
PWM (891) output
Not allowed. Not allowed. Not allowed. Not allowed.
Port and mode Operation Setting range
Pulse output (P = 0000 to 0003 hex) The present value of the pulse output is stored in
D and D+1.
8000 0000 to 7FFF FFFF hex
(−2,147,483,648 to 2,147,483,647)
High-speed counter
input (P = 0010 to 0013
hex)
Linear Mode The present value of the high-speed counter is
stored in D and D+1.
8000 0000 to 7FFF FFFF hex
(−2,147,483,648 to 2,147,483,647)
Ring Mode 0000 0000 to FFFF FFFF hex
(0 to 4,294,967,295)
Input interrupt in counter mode
(P = 0100 to 0107 hex)
The present value of the input interrupt is stored
in D.
0000 to FFFF hex
(0 to 65,535)