
4. CONVERSATIONAL MACRO FUNCTION
B–62073E–2/03
122
(1) PMC address write control
G310 Dd Qq Ll ;
G310 Rr Qq Ll ;
G310 Cc Qq Ll ;
G310 Kk Qq Ll ; (L1/2/4)
The data specified in address Q having the byte length specified in
address L is written to PMC address D, R, C, or K. Before being
written to the PMC address, the data is rounded off to the unit’s place
and converted to binary form. Negative values are converted to the
two’s complement.
When word data or longer data is written in PMC–NA format, the
bytes are arranged in a sequence such that the high–order byte is
assigned the lowest address, while the low–order byte is assigned the
highest address. If the system features PMC–NB, and if bit 4 of
parameter 8507 is set to 0, the data is arranged in the same sequence
as in PMC–NA format. If the system features PMC–NB, and if bit
4 of parameter 8507 is set to 1, the bytes are arranged in a sequence
such that the low–order byte is assigned the lowest address, while the
high–order byte is assigned the highest address.
Example:
#100=–500.0 ;
G310 D300 Q#100 L4 ;
Executing this program writes the following data to the PMC data
area D300 to D303:
Bit 7 6 5 4 3 2 1 0
D300
D301
D302
D303
1
1
1
0
1
1
1
0
1
1
1
0
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
0
1
1
0
0
The decimal value –500.0 is converted to the two’s complement
FFFFFE0CH.
Notes
1 Bit–by–bit specification is not allowed.
2 When the data exceeds the byte length specified in address
L, the data is only written up to the specified length. This is
not treated as an error. In the above example, if L1 is
specified, the least significant byte of the binary value of
–500.0 (namely, 0CH) is written to D300 only.
(2) PMC address read control
G310 Dd Pp Ll ;
G310 Rr Pp Ll ;
G310 Cc Pp Ll ;
G310 Kk Pp Ll ;
Data can be read from PMC address D, R, C, or K by specifying a
variable number in address P of control code G310. Address L can
be used to specify whether data is read in units of two or four bytes.
The data is regarded as a binary code having the specified byte length
and is converted to a variable.
When word data or longer data is written in PMC–NA format, the
bytes are arranged in a sequence such that the high–order byte is
assigned the lowest address, while the low–order byte is assigned the
highest address. If the system features PMC–NB, and if bit 4 of
4.5.26
PMC Address Control
Code (G310)