13. Program Support Functions
13.5 User Macro Specifications
346
Reading PLC data
PLC data can be read in with the system variables.
(Note 1)
These can be used only with some models.
(Note 2)
The read devices are limited.
Variable No.
Application
#100100
Device type designation
#100101
Device No. designation
#100102
Number of read bytes designation
#100103
Read bit designation
#100110
PLC data read
The PLC data is read in with the following five blocks using these five system variables.
#100100 = 1 ; ............Designates the device type.
#100101 = 0 ; ............Designates the device No.
#100102 = 1 ; ............Designates the number of bytes.
#100103 = 2 ; ............Designates the bit. (Valid only when reading word device bits.)
#100 = #100110 ; ......Reads in the PLC data.
(1) Device designation (#100100)
(a) System variable for device designation
The type of device to be read in can be designated by substituting the device designation
value in this system variable.
If the data is read without designating this number, the data will be read in the same
manner as if the minimum device designation value (0: M device) is designated. Once
designated, the setting is held until the device is designated again or until it is reset.
A program error (P39) will occur if a device that does not exist is set.
(b) Device designation values
Device
designa-
tion value
Device
Unit
Device No.
Device
designa-
tion value
Device
Unit
Device No.
0
M
Bit
M0 to M10239
10
F
Bit
F0 to F1023
1
D
Word
D0 to D2047
13
L
Bit
L0 to L511
2
C
Bit
C0 to C255
18
V
Bit
V0 to V255
4
X *
Bit
X0 to X1FFF
19
ST
Bit
ST0 to ST63
5
Y *
Bit
Y0 to Y1FFF
20
SD
Word SD0 to SD127
6
R
Word
R0 to R13311
21
SB*
Bit
SB0 to SB1FF
7
T
Bit
T0 to T703
22
SW*
Word SW0 to SW1FF
9
SM
Bit
SM0 to SM127
23
B*
Bit
B0 to B1FFF
24
W*
Word W0 to W1FFF
The unit is the amount of data per device No. "Word" has 16 bits, and "Bit" has one bit.
* is a device that expresses the device No. as a hexadecimal.