Omron V600 Series Operation Manual page 33

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

Advertisement

Command Format
3-3-4 FCS Computation Program Example (V600-CA2A-V
1000
*******FCSCHECK*******
1010
*FCSCHECK
1020
Q=0:FCSCK$="OK"
1030
PRINT RESPONSE$
1040
LENGS=LEN (RESPONSE$)–3
1050
FCSP$=MID$ (RESPONSE$.LENGS+1, 2)
1060
FOR I=1 TO LENGS
1070
Q=ASC (MID$ (RESPONSE$, I, 1) XOR Q
1080
NEXT I
1090
FCSD$=HEX$ (Q)
1100
IF LEN (FCSD$)=1 THEN FCSD$="0"+FCSD$
1110
IF FCSD$<>FCSP$ THEN FCSCK$="ERR"
1120
PRINT "FCSD$="FCSD$, "FCSP$="FCSP$, "FCSCK$="FCSCK$:
1130
RETURN
3-3-5 Data Code Specification
ASCII Code Specification
Example:
@
0
2
R
Controller
Header
@
0
2
R
D
H
1
0
0
0
5
Computation
result
ASCII code
See the test program example (page 50) for an example of an FCS computation
program for transmission. An example of an incoming data FCS check subrou-
tine is given below.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Note In this example, CR (CHR$(13)) is not included in RESPONSE$. To insert it,
change line 1040.
The command needs to include a specification indicating how the data to be
read or written is to be handled, either as ASCII code character data, or as hexa-
decimal code numerical data.
When the data length is set to seven bits using the ID Controller DIP switches
(page 83), this specifies ASCII code, and when the data length is set to eight
bits, this specifies JIS code.
D
H
1
0
0
Text
0100
0000
EOR
0000
EOR
0011
0010
EOR
0101
0010
EOR
0100
0100
EOR
0100
1000
EOR
0011
0001
EOR
0011
0000
EOR
0011
0000
EOR
0011
0000
EOR
0011
0101
0010
1000
2
8
. . . . . . . . . . . . . . . . . . . . . . . . . . .
FCS computed by software
. . . . . . . . . . .
Section
0
5
2
8
FCS
Only)
Response data FCS
FCS computation range
OK for correct FCS
. . . .
ERR for in correct FCS
3-3
31

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