Mitsubishi Melsec A User Manual page 78

Table of Contents

Advertisement

[Program example 21
Program t o specify and monitor the following bit devices (and
bit devices entered as 16 consecutive device numbers).
I
X 6 0 t o XBF, T8O t o T95 contacts, C I S 3 present value
D 2 6 0
,
W 1 7 5
,
R 7 0 0
I
100 A=$F000
. . . . . . . . . . . .
Sets indirect variable head address.
11 0 A$="X0060TS080CN183D0260W0175R0700".
. .
. . . .
Stores device numbers into work area.
120 B=$E800
. . . . . . . . . . . .
S e t s indirect variable head address.
130 B:O)=$FF
. . . . . . . . . . . .
.Defines PCstation number a s host.
140 B:l)='W".
. . . . . . . . . . .
.Specifies "word entry".
150 C=$E802
. . . . . . . . . . . .
S e t s
indirect variable head address.
160 C(O)=6.
. . . . . . . . . . . . .
S e t s
the number of points to be entered
to 6.
170 C(1 )=A.
. . . . . . . . . . . . .
Sets "entry" data head address.
180 C(2)=50
. . . . . . . . . . . . .
S e t s time check period to 50 (500msec).
190 Z=CALL(O, $8084, 1, B)
. .
.Calls system subroutine SADMO.
200 IF Z#0 PRINT "ERROR",
Z;GOTO 190
. . . . . . . . .
.Checks for errors in SADMO execution.
210 D=$E900
. . . . . . . . . . . .
Sets indirect variable head address.
220 D:O)=$FF.
. . . . . . . . . . .
.Defines PC station number a s host.
230 D: l)='W".
. . . . . . . . . . .
Specifies "word monitor".
240 D ( l )=$EA00
. . . . . . . . . .
Data destination head address.
250 D(2)=50.
. . . . . . . . . . . .
S e t s
time check period to 50 (500msec).
260 Z=CALL(O, $8087, 1, D ) .
.
.Calls system subroutine SADM1.
270 IF Z#U PRINT "ERROR",
2;
GOT0 260
. . . . . . . . .
.Checks for errors in SADMl execution.
280 END
The data is stored in the AD51 in the following formats depending on whether
"bit"or "word" has been specified.
Bit ( E x a m ~ l e 1)
B I 86 B5 84
83 82
B1
80
EAWH
X7D
EAOIH
YZOI
EA02H
MI18
EAOJH
83AO
EA04H
T46 ronmcc
EA05H
C85 coil
Word (Examvle 2)

Advertisement

Table of Contents
loading

Table of Contents