Mitsubishi Melsec A User Manual page 72

Table of Contents

Advertisement

7. COMMUNICATION
w m
PROGRAMMABLE CONTROLLER CPU
/MELSEC
[Program example
21
Proaram t o write onloff data to Y80 t o Y9F from the AD51 as
individual bits.
Switch on Y80 to Y8F
I
Switch off Y90 to Y9F
I
d address
INPUT data
for system subroutine
110 A:O)=$FF
. . . . . . . . . . . .
.Defines PC station number as host.
. . . . . . . . . . .
120 A:l)='WW".
.Specifies word write.
130 B=$E802
. . . . . . . . . . . .
Sets indirect variable head address.
. . . . . . . . .
140 B$="Y0080.
Sets destination head device using charac-
ter string variable.
. . . . . . . . . . . .
150 C=$E807
.Sets indirect variable head address.
. . . . . . . . . . . . .
160 C(O)=2.
.Sets the number of words to be written
t o 2.
. . . . . . . . . .
170 C ( l )=$E000
Sets source data head address.
180 C(2)=30
. . . . . . . . . . . . .
.Sets time check period t o 30 (300msecl.
190 @($EOOO)=SFFFF
]
, ,
.
, ,
Generates data to be written to addresses
200 @($E002)=0
EOOOH to E003H.
.
210 Z=CALL(O, $807E, 1, A).
.Calls system subroutine SADW.
220 IF
Z#0
PRINT "ERROR",
. . . . . . . . .
Z; GOT0 210
.Checks for errors in SADW execution.
230 END
1
REMARKS
1
8 7 8 6 8 5 8 4 8 3 8 2 8 1 80
EWOH
Y80
E W l H
Y81
EWZH
Y82
EOlC
Y9C
EOlDH
Y9D
EOlEH
Y9E
EOlFH
Y9F
When "bit write", is specified, one byte of AD51 memory
is
required per bit of
data. When "word write"
is
specified, one byte of AD51 memory contains 8 bits
of data.
See below:
.only
80 i s valid and 81 to67 are ignored.
Bit Units (Example 1)
Word
Units IExample
2)
I

Advertisement

Table of Contents
loading

Table of Contents