12
Commander SE Advanced User Guide
Issue Number: 4
Calculating the block checksum (BCC)
The block checksum is calculated by applying an exclusive 'or' function (XOR) to all of the characters of a message after the
'STX' control character.
XOR truth table
For the 'read' response example above:
The first character of the BCC calculation is 0 (ASCII 30 Hex or 0011 0000 in binary), the value of which is taken as a starting
or result value. The next character is 1 (0011 0001 in binary), which now has the exclusive 'or' (XOR) operator act upon it.
With the previous result value, a new result occurs of (0000 0001) in binary.
The complete calculation is show in the table below:
The final value is the BCC, provided that its equivalent decimal value exceeds 31 (or 1FH) (ASCII characters from 0 to 31 are
used as control codes).
When the final XOR result produces a decimal value less than 32, then 32 is added. In this example, 0011 0010 is 50
decimal, so this is the final BCC value. 50 decimal is the ASCII character '2'.
Re-reading data
Once a 'read' message has been sent from the host and the drive has responded with a valid response, another request for
further data can be requested without the need for a full 'read' message from the host. The host can request:
•
to receive the same parameter data/value again,
•
to request the next parameter data/value, or
•
to request the previous parameter data/value.
The request from the host consists of a single control character, as follows:
This facility can be used to save time when monitoring a parameter value over a period of time.
If the message is lost following data corruption, it will be necessary to recommence the 'read' communication by starting with
a complete message sequence and then reverting to the 're-read' rapid sequence described above.
A
B
Out
0
0
0
0
1
1
1
0
1
1
1
0
Character
Binary Value
XOR result
0
0011 0000
0011 0000
1
0011 0001
0000 0001
1
0011 0001
0011 0000
7
0011 0111
0000 0111
–
0010 1101
0010 1010
0
0011 0000
0001 1010
0
0011 0000
0010 1010
4
0011 0100
0001 1110
7
0011 0111
0010 1001
.
0010 1110
0000 0111
6
0011 0110
0011 0001
ETX
0000 0011
0011 0010 =
BCC
Control
Character
Function
Control Character on
Computer Keyboard
NAK
Return the value of
the same parameter
Control-U
ACK
Return the value of
the next parameter
Control-F
BS
Return the value of
the previous
parameter
Control-H
Содержание COMMANDER SE
Страница 76: ...76 Commander SE Advanced User Guide Issue Number 4...
Страница 93: ...Commander SE Advanced User Guide 93 Issue Number 4...
Страница 98: ...98 Commander SE Advanced User Guide Issue Number 4...
Страница 142: ...142 Commander SE Advanced User Guide Issue Number 4 Figure 6 9 Input line reactor 4400 0241 All dimensions in mm...
Страница 144: ...144 Commander SE Advanced User Guide Issue Number 4 Figure 7 3 Commander SE Size 4 All dimensions in mm...