Interface, Interface data, Protocol – Baumer N 143 User Manual
Page 5: Redundancy check (crc byte)

N 143
www.baumer.com
5
3. Interface
3.1. Interface data
Type: RS485
Baud rate:
19200
Parity: No
Data bits:
8
Stop bits:
1
Handshake: Nein
Redundancy check
Yes (CRC)
Timeout reply*:
0,1...60 ms
* To avoid bus collisions, a minimum timeout reply of 1 ms (default parame-
ter) is to be kept, i.e. the time elapsed between transmission of the last bit
in the request until start of transmission of the first bit in the SPA’s re-
sponse.
The operator should see that due to the minimized timeout reply of 1 ms
the bus switching time after having transmitted the last bit must not exceed
1 ms.
Default parameters enable optional alteration by serial interface in incre-
ments of 0,1 ms within the range of 0,1...60 ms. Refer also to command „x“
(78h).
BUS switching time**
<0,1 ms
** The BUS switching time is the time required by the SPA to be ready again
for transmission after having replied to the host.
3.2. Protocol
The spindle position display operates on ASCII protocol (clear text protocol). Depending on the command, the
protocol data package varies between 5 and 17 bytes.
Byte
Hex-Code
Significance
Parameters
1
01H
SOH = start of header
ever 01h
2
XXh
Adr = address
00...31dez + 20h Offset (address 00 = 20h)
3
XXh
Cmd = command
specific commands
4-n
[XXh..XXh]
[Data] = data
20h-7Fh
n+1
04h
EOT = end of transmission
ever 04h
n+2
XXh
CRC = cyclic redundancy check
00h...FFh
3.3. Redundancy check (CRC byte)
For optimized error-free data communication the CRC byte is added after the footer (EOT, end of transmission)
to the string to be transmitted. Upon receiving a command the attached CRC byte is crosschecked with the
auto-calculated CRC byte.
Algorithm:
1) Reset CRC byte.
2) Rotate CRC byte by 1 bit to the left.
3) Link result to first data byte XOR.
4) Rotate result by 1 bit to the left.
5) Link result to the second data byte XOR.
:
x) Rotate result by 1 bit to the left.
y) Link result to the last data byte (ever 04H) XOR.
z) Add result as CRC after the footer indicator (04H) to the string to be transmitted.
Note:
1101 0000
RL 1010 0001
Important: Bit 7 is shifted in bit 0 during rotation
Example:
String w/o CRC byte = 01h 20h 43h 04h
CRC-byte
= 0Ah
0000 0000
RL
0000 0000 XOR 0000 0001 (01h)
=
0000 0001
0000 0001
RL
0000 0010 XOR 0010 0000 (20h)
=
0010 0010
0010 0010
RL
0100 0100 XOR 0100 0011 (43h)
=
0000 0111
0000 0111
RL
0000 1110 XOR 0000 0100 (04h)
=
0000 1010
= CRC
Legend: RL = rotate left; XOR = antivalence link