6. RKC COMMUNICATION
IMS01J02-E2
63
Example of temperature set values selecting checking program
1000 '-------------------- Identifier setting ----------------------
1010 ID$="S1"
1020 '
1030 '--------------- Communications initial setting ---------------
1040 CM$="N81NN"
1050 STX$=CHR$(&H2) : EOT$=CHR$(&H4) : ENQ$=CHR$(&H5)
1060 ACK$=CHR$(&H6) : NAK$=CHR$(&H15): ETX$=CHR$(&H3)
1070 OPEN "COM1:"+CM$ AS #1
1080 CONSOLE ,,,1
1090 COLOR 7:CLS 3
1100 '
1110 '------------------ Program main routine ---------------------
1120 *SEL
1130 PRINT " (Selection check) "
1140 PRINT "********Transmission of set values*********"
1150 PRINT "
1160 INPUT "Unit No.=";ADD$:INPUT "Channel No.=";C$
:INPUT "Set value=";S$
1170 DT$=EOT$+ADD$+STX$+ID$+C$+" "+S$+ETX$
1180 PRINT "Transmitting data=";DT$
1190 GOSUB *BCCCH
1200 DT$=DT$+CHR$(BCC)
1210 GOSUB *TEXT
1220 GOSUB *RXDT
1230 '
1240 *J20
1250 J=0
1260 '
1270 *IF2
1280 IF LOC(1)=0 THEN J=J+1:IF J<500 THEN *IF2 ELSE PRINT "
TIME OUT ":END
1290 '
1300 K$=INPUT$(1,#1)
1310 IF K$=NAK$ THEN PRINT " NAK":END
1320 IF K$=ACK$ THEN PRINT "Control unit has received the data"
:END
1330 '
1340 '
1350 '
Identifier setting
Communications data configuration setting
Communications character setting
Opening of RS-232C circuit
Input of the unit and channel number,
and the temperature set value
Data configuration setting 1
Display of transmitting data
Data configuration setting 2
Setting of the receiving waiting time
1
(Timeout processing)
Communications condition check,
Display of communication result,
and closing of RS-232C circuit
1
Setting of the receiving waiting time:
If time out occurs in using high speed computer (Except no response), the numeral value of
500
in
the program should be changed to an appropriately-sized numeral value.
Continued on the next page.