Mitsubishi Melsec A User Manual page 70

Table of Contents

Advertisement

[Program example21
Program t o read data from
16
points,
XlOO
t o
XlOF
t o
AD51
ad-
dresses
EOOOH
t o
E001H
in word units. (i.e. batches of
16
bits)
. . . . . . . . . . . .
100 A=$F000
.Head address for system subroutine
INPUT data
. . . . . . . . . . .
110 A:O)=$FF.
Defines PC station number a s host.
120 A:l
)='W".
. . . . . . . . . . .
.Specifies word read.
130 B=$F002
. . . . . . . . . . . .
Sets indirect variable head address.
140 B$="X0100".
. . . . . . . . .
Sets head device t o be read using character
string variable.
150 C=$F007
. . . . . . . . . . . .
Sets indirect variable head address.
160 C(O)=l
. . . . . . . . . . . . . .
Sets the number of points to be read as 1.
170 C(ll=$E000
. . . . . . . . . .
Sets destination head address for data.
180 C(2)=60
. . . . . . . . . . . . .
Sets time check period t o 60 (600msec).
.
190 Z=CALL(O. $8078, 1. A).
.Callssystern subroutine SADR.
200 IF
Z#0
PRINT "ERROR",
. . . . . . . . .
2;
GOT0 190
.Checks for errors in SADR execution.
210 END
When "bit read" is specified, one byte of AD51 memory is required per bit of
data.
When "word read" i s specified, one byte of AD51 memory contains 8 bits of
data.
See below:
I
Bit Units IExample 11
EOOOH
E W l H
E W 2 H
EWSH
EWDH
E W E H
E W F H
4 1 : " "
0 : OFF
Word Units
(Example
2 1

Advertisement

Table of Contents
loading

Table of Contents