Mitsubishi Melsec A User Manual page 76

Table of Contents

Advertisement

7. COMMUNICATION WITH PROGRAMMABLE CONTROLLER CPU
[MELSEC
(4) Defining device numbers t o be monitored. (Before a given device
can be monitored using the SADMl subroutine, it must be spe-
cified and "entered" using the following procedure.)
[Program example 1
I
Program t o specify the following bit devices for monitoring (i.e.
monitor data entry)
I
X7D , Y 2 0 l
, M I 7 8
B3AO. T46 contact. C85 coil
I
100 A=$F000
. . . . . . . . . . . .
Sets indirect variable head address.
110 A$="X007DY0201 M0178B03AOTS046CC085".
. .
....
Sores device numbers into work area.
120 B=$E800
. . . . . . . . . . . .
Sets indirect variable head address.
130 B:O)=$FF
. . . . . . . . . . . .
Defines PC station number as host.
140 B:l )="BZ'
. . . . . . . . . . . .
.Specifies "bit entry".
150 C=$E802
. . . . . . . . . . . .
Sets indirect variable head address.
160 C(O)=6.
. . . . . . . . . . . . .
.Sets the number of points to be entered
to 6.
170 C(1 )=A.
. . . . . . . . . . . . .
Sets "entry" data head address.
180 C(2)=50
. . . . . . . . . . . . .
Sets time check period to 50 (500msec).
190 Z=CALL(O, $8084, 1.8)
. .
.Calls system subroutine SADMO.
200 IF Z#0 PRINT "ERROR",
Z;GOTO 190
. . . . . . . . .
.Checks for errors in SADMO execution.
210 END
[Program example 21
Program t o specify the following word devices for monitoring
(or bit devices entered as 16 consecutive device numbers).
X60 t o X6F, T80 t o T95 contacts, CIS3 present value
0
, W175
,
R700
100 A=$F000
. . . . . . . . . . . .
Sets indirect variable head address.
110 A$="X0600TS080CN183D0260W0175R0700".
. .
. . . .
Stores device numbers into work area.
120 B=$E800
. . . . . . . . . . . .
Sets
indirect
variable
head address.
130 B:OI=$FF
. . . . . . . . . . . .
.Defines PC station number as host.
140 B:l
)='W".
. . . . . . . . . . .
.Specifies "word entry".
150 C=$E802
. . . . . . . . . . . .
Sets indirect variable head address.
160 C(O)=6.
. . . . . . . . . . . . .
Sets the number of points to be entered
to 6.
170 C(l)=A.
. . . . . . . . . . . . .
Sets "entryr'data head address.
180 C(2)=70
. . . . . . . . . . . . .
Sets time check period to 70 (700msecl.
190 Z=CALL(O, $8084, 1. 8 )
. .
.Calls system subroutine SADMO.
200 IF Z#0 PRINT "ERROR".
Z; GOT0 190
. . . . . . . . .
.Checks for errors in SADMO execution.
210 END

Advertisement

Table of Contents
loading

Table of Contents