Omron V600 Series Operation Manual page 14

Serial interface id controller
Hide thumbs Also See for V600 Series:
Table of Contents

Advertisement

Communications Program Example
80
PRINT "TXD$=";TXD$
90
PRINT #1,TXD$+CHR$(&HD);
100
IF LOC(1) <> 0 THEN 140
110
CNT=CNT+1
120
IF CNT=1000 THEN 1000
130
GOTO 100
140
INPUT #1, RXD$
150
IF RXD$ <> TXD$ THEN 2000
160
PRINT "RXD$="RXD$+"
170
GOTO 20
1000 '******* TIME UP *******
1010 CNT=0
1020
ER$(NG)="TIME UP"
1030
NG=NG+1
1040
IF NG=3 THEN 3000
1050
GOTO 80
******* ERROR RESPONSE *******
2000
2010
ER$(NG)=RXD$+"
2020
NG=NG+1
2030
IF NG=3 THEN 3000
2040
GOTO 80
3000 '******* ERROR MESSAGE *******
PRINT "*** ERROR OCCURRED ***"
3010
3020
PRINT "RXD$–1=";ER$(0)
3030
PRINT "RXD$–2=";ER$(1)
3040
PRINT "RXD$–3=";ER$(2)
3050
GOTO 20
4000 '******* CALCULATE FCS *******
* FCSSET
4010
4020
L=LEN(T$)
4030
A=0
4040
FOR J=1 TO L
4050
TJ$=MID$(T$,J,1)
4060
A=ASC(TJ$)XOR A
4070
NEXT J
4080
FCS$=HEX$(A)
4090
IF LEN(FCS$)=1 THEN FCS$="0"+FCS$
4100
RETURN
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
Time up time set according to value compared to CNT
. . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Decision as to whether normal termination occurred
. . . . .
OK"
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
NG"
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . .
Note Above BASIC Program is for use with an IBM PC/AT or compatible computer.
Decision as to whether response was received
Receive response
Number of retries set to 3
Number of retries set to 3
FCS computation routine
Section
3-6
Send command
51

Advertisement

Table of Contents
loading

This manual is also suitable for:

V600-ca1a-v seriesV600-ca2a-v seriesV600-h seriesV600-d seriesV600-ca1a-v2V600-ca2a-v2 ... Show all

Table of Contents