6.ADDRESS ASSIGNMENT TO POINTS OPERATION B-82604EN/01
- 46 -
6.9 READING AND WRITING THE VALUE AND SIM STATUS
OF I/O (%R)
I/O values can be read and written assigning to %I, %Q, %AI, %AQ.
And I/O values can be also assigned to %R like registers. And I/O
SIM status can be read and written through CIMPLICITY.
Set $SNPX_ASG to perform %R assignment in the same manner as
for registers.
When assigning the value or SIM status of I/O, set the elements of
$SNPX_ASG as follows:
$SNPX_ASG element Explanation
$ADDRESS Meaning: Start address of %R to be assigned
Range: 1 to 16384
$SIZE Meaning: Number of %R’s to be assigned
The number of %R’s required for I/O depends on the value of $MULTIPLY.
When $MULTIPLY is 1, one %R is required per one I/O.
When $MULTIPLY is 0, one %R is required per sixteen I/O.
(In the case GI/O and AI/O, one %R is always required per one I/O
undepending on the value of $MULTIPLY.)
Range: 1 to 16384
$VAR_NAME Meaning: Character string indicating the data to be assigned
When assigning I/O, specify, for example, DI[1]. The number in brackets is an
I/O number.
Value SIM status
DI DI[1] DI[S1]
DO DO[1] DO[S1]
RI RI[1] RI[S1]
RO RO[1] RO[S1]
UI UI[1]
UO UO[1]
SI SI[1]
SO SO[1]
WI WI[1] WI[S1]
WO WO[1] WO[S1]
WSI WSI[1] WSI[S1]
WSO WSO[1] WSO[S1]
GI GI[1] GI[S1]
GO GO[1] GO[S1]
AI AI[1] AI[S1]
AO AO[1] AO[S1]
Example: Assigning the values of 32 I/O’s, DI[11] to DI[42]
When $MULTIPLY is 1, set 32 to $SIZE, and set DI[11] to $VAR_NAME.
Here, the index 11 indicates that I/O’s are assigned sequentially from DI[11].
When $MULTIPLY is 0, set 2 to $SIZE because one %R is assigned to 16
I/O’s, and set DI[11] to $VAR_NAME.
$MULTIPLY Meaning: $MULTIPLY specifies if I/O is assigned as a bit value or not.
One I/O is assigned to one %R 1
Sixteen I/O’s are assigned to one %R 0