
B–62093E–1/02
6. FUNCTIONS OF THE MACRO
EXECUTOR
PROGRAMMING
63
(1) PMC address write control
Data of one, two, or four bytes can be written when address L is
specified with control code G310.
G310 Dd Qq Lx;
G310 Rr Qq Lx;
G310 Cr Qq Lx;
G310 Kr Qq Lx;
These commands write the data indicated by address Q at the PMC
address indicated by address D, R, C, or K, a number of bytes at a time
as indicated by address L. The data cannot be specified in bits.
The write data indicated by address Q is rounded as follows: Decimal
places of 0.5 and over are counted as a whole number and the rest are
discarded. Then the data is expressed in binary form and written.
When the data is a negative value, it is handled and converted as two’s
complement.
When the following is specified, the data is written in the PMC data
area (D300 to D303) as shown in the table below:
#100 = –500.0;
G310 D300 Q#100 L4;
Bit 7 6 5 4 3 2 1 0
D300 0 0 0 0 1 1 0 0
D301 1 1111110
D302 1 1111111
D303 1 1 1 1 1 1 1 1
In two’s complement, the decimal number –500 becomes FFFFFE0CH in
hexadecimal.)
When the specified data contains more bytes than that indicated by
address L, only the data of the length specified by address L is written.
This will not cause an error. (If L1 is specified in the example above,
the identical data is written only in D300.)
(2) PMC address read control
When a variable is indicated by address P with control code G310, the
PMC data can be read. Address L indicates that the data of one, two,
or four bytes is read at a time.
G310 Dd Pp Lx;
G310 Rr Pp Lx;
G310 Cr Pp Lx;
G310 Kr Pp Lx;
These commands read the data which starts from the PMC address
indicated by address D, R, C or K and whose length is indicated in
bytes by address L into the variable indicated by address P. The read
data is handled as binary data consisting of the specified number of
bytes, converted, and assigned to the variable.
If G310 D400 P101 L2; is specified when the PMC data area (D400
to D401) has the data shown below, –500.0 is input in #101.
Bit 7 6 5 4 3 2 1 0
D400 0 0 0 0 1 1 0 0
D401 1 1 1 1 1 1 1 0
6.3
READING AND
WRITING A PMC
ADDRESS