Commander SE Advanced User Guide
13
Issue Number: 4
1.3.2 Writing Data
To write data (i.e. a value) to a drive parameter (i.e. host writing data to a drive), the message format from the host is as
follows:
Where:
CC = Control Character
GA = Group address
GU = Unit address
[M1][M2] = Menu number
[P1] [P2] = Parameter number
[D1][D2] ...[Dn] = Data characters including decimal point and sign where necessary
BCC = Block checksum (calculated as described below)
The data field can be of a variable length with a maximum length of 7 characters.
Following the 'write' message, the drive will respond with a single control character, as follows:
An example of a host writing a value of +76.4 to parameter
1.25
of a drive that is addressed as unit 6 of group 2, the host
message is:
The BCC in this example is calculated by the host as follows:
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 'write' message example above:
The first character of the BCC calculation is 0 (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 0101 is 53
CC
Address
CC
Parameter
Data
CC
BCC
EOT
GA
GA
UA
UA
STX
M1
M2
P1
P2
D1
D2
....
Dn
ETX
BCC
Control
Character
Meaning
Control Character on
Computer Keyboard
ASCII Character
NAK
Message invalid.
Data is too long or out of range, parameter
is invalid, parameter is read-only, or the
BCC is incorrect.
Control-U
ACK
Acknowledge — Message is valid and has
been understood and implemented.
Control-F
CC
Address
CC
Parameter
Data
CC
BCC
EOT
2
2
6
6
STX
0
1
2
5
+
7
6
.
4
ETX
5
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
2
0011 0010
0011 0011
5
0011 0101
0000 0110
+
0010 1011
0010 1101
7
0011 0111
0001 1010
6
0011 0110
0010 1100
.
0010 1110
0000 0010
4
0011 0100
0011 0110
ETX
0000 0011
0011 0101 =
BCC
Содержание 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...