
13. Program Support Functions
13.5 User Macro Specifications
350
Examples of using macro program for reading PLC data
<Macro specifications>
G340 F_. A_. Q_. H_. ;
F_. ...........Number of bytes designation
F0...... Designates bit.
F1...... Designates one byte.
F2...... Designates two bytes.
A_. ............Device designation
A0 ..... Designates M.
A1 ..... Designates
D.
A2 ..... Designates
C.
A3 ..... Designates
G.
A4 ..... Designates
X.
A5 ..... Designates
Y.
A6 ..... Designates
R.
A7 ..... Designates
T.
Q_.............Device No. designation
For a bit, designates the bit with two digits
after the decimal point.
For a byte, a decimal value is not designated.
H_. ............ Storage
common
variable
Designates the common variable No. for
storing the read data.
<Macro contents>
#100100 = #1 ;
.......
Designates device.
#100101 = FIX [#17] ;
.......
Designates device No.
#100102 = #9 ;
.......
Designates number of bytes.
#100103 = FIX [#17
∗
100] MOD 100 ;
....... Designates
bit.
#[#11] = #100110 ;
.......
Reads PLC data.
M99 ;
Precautions for reading PLC data
(1) As the PLC data is read asynchronously from the ladder execution, the data is not necessarily
from the running program. Take care when reading devices that change.
(2) If reading of a device that does not exist is attempted by designating the device No. and
number of bytes, the 0 value will be read in only for the sections that do not exist.