3-6SectionCommunications Program Example
50
3-6 Communications Program Example
3-6-1 Serial System Link to Host Computer
System Configuration Example (1 to 1 Procedure)
RS-232C
BASIC Program Example This
is an example of a program that uses write commands to write data from the
DC
Head 1 in hexadecimal code. Specify the write address in the range 0006
H
to
07FF
H
,
and the write data in two-character units, up to 256 characters. Be sure
to correctly set the ID Controller communications format by setting its DIP
switches to conform to the communications format with the host computer to
which it is connected.
10 CLS
20 OPEN ”COM1:9600, E, 8, 1, CSO, DSO, CDO, PE” AS #1
30 WIDTH #1,255
40 PRINT ”EXECUTING WRITE COMMAND”
50 INPUT ”WRITE ADDRESS (HEX DATA:0006 TO 07FF)”; WA$
60 INPUT ”WRITE DATA (HEX DATA:2-CHARACTER UNITS)”; WD$
70 TX$=”WTH1”+WA$+WD$+”*”+CHR$(&HD)
80 PRINT TX$
90 PRINT #1, TX$;
100 INPUT #1, RX$
110 PRINT ”RS DATA=”;RX$
120 GOTO 40
Note Above BASIC Program is for use with an IBM PC/AT or compatible computer.
3-6-2 Example of Basic Program with Host Computer’s Time-up
Functions
System Configuration
B500-AL004 (-P)
Link Adapter
RS-232C
RS-422
V600-CA2A-Vj
BASIC Program Example
10 OPEN ”COM1:9600,E,8,1,CS0,DSO,CDO,PE” AS#1 RS-232C open.
. . . . . . .
20 NG=0:1=0:CNT=0:PRINT
40 T$=”@00TS0123456789ABSDEF” Test data.
. . . . . . . . . . . . . . . . . . . . . . . . . .
50 GOSUB*FCSSET
70 TXD$=T$+FCS$+”*”