beautypg.com

Protocol, Checksum (cyclic redundancy check), Data transmission properties – Baumer N 153 User Manual

Page 5: Broadcast commands

background image

N 153

www.baumer.com

5

3.2. Protocol

The spindle position display operates with ASCII protocol (clear text protocol). Depending on the command, the
protocol data package varies between 5 and 17 bytes.

Byte

Hex code

Significance

Values

1

01H

SOH = start of heading

permanent 01h

2

XXh

Adr = identifier

00...31dez + 20h offset (identifier 00 = 20h)

3

XXh

Cmd = command code

specific commands

4-n

[XXh..XXh]

[Data] = data

20h-7Fh

n+1

04h

EOT = end of transmission permanent 04h

n+2

XXh

CRC = checksum

00h...FFh

3.3. Checksum (Cyclic Redundancy Check)

For optimized error-free data transmission the CRC byte is added after the footer token (EOT, end of transmis-
sion) to the string to be transmitted. Upon receiving a command the CRC byte transmitted 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 token (04H) to the string transmitted.

Note:

1101 0000

RL 1010 0001

Important: Bit 7 is shifted in bit 0 during rotation


Example:

Transmitted string less CRC = 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

3.4. Data transmission properties

For reasons of compatibility, within the complete multicon system the amount of data is always the same (see
table in chapter 6), no matter how many digits are in the display. For example, command “R” (read actual value)
comprises a transmitted data amount of 6 bytes, but only 5 digits are indicated in the display. If it is a negative
value, digit 6 respectively digit 5 is always 0 (30h).

3.5. Broadcast commands

Some specific commands are designated so-called broadcast commands. As soon as the master broadcasts a
command to identifier 99, the command is addressed to every multicon device in the network. Each individual
SPA will accomplish the respective command but will not respond any confirmation to master.