Herunterladen Inhalt Inhalt Diese Seite drucken

Control Characters; Block Check Character (Bcc); Epc/Tid Data Format - Balluff BIS U-6127-081-1 4-06-ST36 Betriebsanleitung

Inhaltsverzeichnis

Werbung

Verfügbare Sprachen

Verfügbare Sprachen

BIS U-6127-081-1_4-06-ST36
Processor unit
8
007 protocol (continued)
8.2

Control characters

The following control characters are used for protocol
control or for the output of status messages.
Control
HEX Designa-
cha-
tion
racters
<STX>
02
Start of
Text
<EOT>
04
End of
Transmis-
sion
<ACK>
06
Acknow-
ledge
<DLE>
10
Data Link
Escape
<NAK>
15
Negative
Acknow-
ledge
8.3

Block Check Character (BCC)

In addition to the data transmission security mechanisms
provided by USB and TCP/IP, the user data is secured by
a simple Block Check Character (BCC). The BCC is
formed by simple Exclusive OR operations (XOR
operations) over all bytes to be sent and appended to the
end of the commands. To check whether data has been
received correctly, the BCC of the received data can be
recalculated and compared with the received BCC. If there
is a match, correct data can be assumed.
The BCC is calculated according to the following principle:
Result
Operand 1
AKKU(1)
Data_Byte(1)
AKKU(2)
Data_Byte(2)
...
...
AKKU(n−1) Data_Byte(n−1)
BCC
Data_Byte(n)
90
english
Function/
Meaning
direction
Controller/
Protocol
Request
control for
multi-stage
commands
or requesting
data.
Control/
Protocol
Response
control for
multi-stage
commands
or designa-
tes the last
data frame.
Status/
Request
Response
successful.
Status/
Asynchro-
Response
nous Tag
comes or
Tag goes
message.
Status/
Request not
Response
successful,
observe
status code.
Operator
Operand 2
XOR
00
hex
XOR
AKKU(1)
...
...
XOR
AKKU(n−2)
XOR
AKKU(n−1)
Example:
Read EPC data from data carrier before read/write head 1
(command R
, epc).
ead data caRRieR
Command:
ASCII
'O1' BCC
Calculation:
Result
Operand 1
4F
4F
hex
hex
7E
(BCC)
31
hex
hex
Data to be sent:
ASCII
'O1~'
The following code snippet shows how the calculation
could be implemented using the C programming language:
char CalculateBcc(char* messageBytes,
int countOfBytes)
{
int loopCount = 0;
char bccValue = 0x00;
for(loopCount = 0; loopCount <
countOfBytes; loopCount++)
{
bccValue = bccValue ^
messageBytes[loopCount];
}
return bccValue;
}
8.4

EPC/TID data format

The epc/tid format is always transmitted in 64-byte
frames, of which a maximum of 62 bytes is data and
1 byte indicates the length of the epc/tid.
EPC and TID are output in reverse order with leading
zeros.
Structure:
1st byte
2nd byte
Length
Reserved
Example
EPC: 01 02 06 05 04 03 02 02 08 09 0A 0B;
length 12 bytes
0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0B, 0x0A, 0x09, 0x08,
0x02, 0x02, 0x03, 0x04, 0x05, 0x06, 0x02, 0x01
HEX
4F
31
BCC
hex
hex
hex
Operator
Operand 2
XOR
00
hex
XOR
4F
hex
HEX
4F
31
7E
hex
hex
hex
3....64th byte
EPC/TID data

Werbung

Kapitel

Inhaltsverzeichnis
loading

Diese Anleitung auch für:

Bis0193

Inhaltsverzeichnis