Omron V400-H111 User Manual page 88

Handheld 2d code reader
Hide thumbs Also See for V400-H111:
Table of Contents

Advertisement

Appendices
Calculation Programming Example for Sending FCS
DATA$
L
CODE$
A
100
110
120
130
140
150
160
170
180
190
200
FCS Check Subroutine Example for Received Data
1000
1010
1020
1030
1040
1050
1060
1070
1080
1090
1100
1110
1120
1130
V400-H111/211
86
User's Manual
Sample data string
Data length
Data character
Exclusive OR
'* * * * * CALCULATE FCS * * * * *
'* FCSSET
L=LEN(DATA$)
A=0
FOR J=1 TO L
CODE$=MID$(DATA$,J,1)
A=ASC(CODE$)XOR A
NEXT J
FCS$=HEX$(A)
IF LEN(FCS$)=1 THEN FCS$="0"+FCS$
RETURN
'* * * * * FCSHECK * * * * *
'* FCSHECK
Q=0:FCSCK$="OK"
PRINT RESPONSE $
LENGS=LEN(RESPONSE$)-3
FCSP$=MID$(RESPONSE$,LENGS+1,2)
FOR J=1 TO LENGS
Q=ASC(MID$(RESPONSE$,J,1))XOR Q
NEXT J
FCSD$=HEX$(Q)
IF LEN(FCSD$)=1 THEN FCSD$="0"+FCSD$
IF FCSD$ < > FCSP$ THEN FCSCK$="ERR"
PRINT "FCSD$=";FCSD$;"FCSP$=";FCSP$;
RETURN
'FCS in response data
'Calculation range of FCS
'FCS calculated in a program
'FCS received correctly: OK
"FCSCK$=";"FCSCK$=" 'FCS not received correctly:
ERR

Advertisement

Table of Contents
loading

This manual is also suitable for:

V400-h211V400-h111/211

Table of Contents