Mitsubishi Melsec A User Manual page 71

Table of Contents

Advertisement

7. COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU
/MELSEC
(2) Batch write t o device memory ISADW)
[Program example 11
Program t o write o n l o f f data
t o
Y80 to Y9F from the AD51 as
individual bits.
Switch on Y80 t o Y8F
1
Switch o f f Y90 t o Y9F
I
100 A=$E80O
. . . . . . . . . . . .
.Head
address
for
system subroutine
INPUT data
110 A:O)=$FF..
. . . . . . . . . .
.Defines
PC station number as host.
120 A : l )="B".
. . . . . . . . . . .
Specifies bit write.
130 B=$E802
. . . . . . . . . . . .
.Sets indirect variable head address.
140 BS="Y0080".
. . . . . . . . .
S e t s destination head device using charac-
ter string variable.
. . . . . . . . . . . .
150 C=SE807
Sets indirect variable head address.
160 C(O)=32
. . . . . . . . . . . . .
Sets the number of points to be written
t o 32.
. . . . . . . . . .
170 Cl1 )=SE000
Sets source data head address.
180 C12)=30
. . . . . . . . . . . . .
.Sets time check period to 30 1300msec).
190 D=SEOOO
200 FOR I=OTO 15
210 D : l ) = l
220 D:1+16)=0
230 NEXT I
Generates data t o be written t o addresses
. . . . . .
'EOOOH t o EOl FH.
240 Z=CALL(O. $807E. 1. A ) .
.
.Calls system subroutine SADW.
250 IF Z#0 PRINT "ERROR",
Z: GOT0 240
. . . . . . . . .
.Check for errors in SADW execution.
260 END

Advertisement

Table of Contents
loading

Table of Contents