Parameter
structure
Keypad and
display
Parameter x.00
Parameter
description format
Advanced parameter
descriptions
Macros
Serial comms
protocol
Electronic
nameplate
Performance RFC mode
402 Unidrive SP Advanced User Guide
www.controltechniques.com Issue Number: 10
7 Serial communications
protocol
7.1 ANSI communications protocol
7.1.1 Introduction
Unidrive SP supports an ANSIx3.28 type comms protocol as supported
by previous Control Techniques products with some modification to allow
access to 32 bit parameters. This chapter describes the implementation
of the protocol for Unidrive SP.
7.1.2 Physical layer and UART
7.1.3 Reading a parameter
The command to read a parameter is:
If the message is correct and the parameter exists the response is:
The length of the data field varies depending on the number of
significant digits required to represent the value of the parameter. The
maximum length is 12 digits including the sign and decimal point if
present. The data field always starts with a sign, minus sign for negative
numbers, or a plus sign for zero and positive numbers. The field may
contain a decimal point, but this will not be before all the numbers in the
field or after all the numbers in the field. The following examples
demonstrate some possible data fields.
If the parameter to be read does not exist the End of transmission
character (Ctl D) is returned.
The checksum is derived by exclusive ORing the message byte together
excluding the STX and the checksum, i.e. Checksum = M1 ^ M2 ^ P1^
P2 ^ D1 ^ D2 ^ ...... Dn ^ ETX. The checksum is an unsigned 8 bit value
and if the checksum is less than 32 then 32 is added to the calculated
checksum.
7.1.4 Writing to a parameter
The command to write to a parameter is:
The following rules apply to the data field:
1. The maximum length is 12 characters.
2. The field may contain leading spaces, but not after any other
character.
3. A sign character is optional. No sign indicates positive.
4. A decimal point is optional. This can appear at any point in the data
field, but not before the sign or before 10 numbers (i.e. the value
written should not have more than 9 decimal places). If the decimal
point is not in the same position as used by the parameter some
accuracy may be lost or extra decimal places added (i.e. if +1.2345
is written to a parameter with one decimal place the result is +1.2, if
+1.2 is written to a parameter with three decimal places the result is
+1.200). It should be noted that parameters can only have 0, 1, 2, 3,
4, 5, or 6 decimal places.
5. The data field can contain up to 10 numbers, but the value even
ignoring decimal points must not exceed the range –2
31
to 2
31
-1.
If the parameter is written successfully an Acknowledge character (Ctl F)
is returned. If the parameter does not exist, the value written exceeds
the allowed parameter range or the data field rules are not obeyed an
Not acknowledge character (Ctl U) is returned.
The checksum is derived by exclusive ORing the message byte together
excluding the STX and the checksum, i.e. Checksum = M1 ^ M2 ^ P1^
P2 ^ D1 ^ D2 ^ ...... Dn ^ ETX. The checksum is an unsigned 8 bit value
and if the checksum is less than 32 then 32 is added to the calculated
checksum.
Attribute Description
Physical layer 2 wire EIA485
Bit stream
Standard UART asynchronous symbols with Non
Return to Zero (NRZ)
Symbol
Each symbol consists of:
1 start bit
7 data bits (ASCII)
1 parity bit (even parity)
1 stop bit
Baud rates 300, 600, 1200, 2400, 4800, 9600, 19200, 38400
EOT End of transmission (Ctl D)
A1
Drive address: 1
st
digit
A1
Drive address: 1
st
digit
A2
Drive address: 2
nd
digit
A2
Drive address: 2
nd
digit
M1
Menu number: 1
st
digit
M2
Menu number: 2
nd
digit
P1
Parameter number: 1
st
digit
P2
Parameter number: 2
nd
digit
ENQ Enquiry (Ctl E)
STX Start of text (Ctl B)
M1
Menu number: 1
st
digit
M2
Menu number: 2
nd
digit
P1
Parameter number: 1
st
digit
P2
Parameter number: 2
nd
digit
D1
Data: 1
st
digit
D2
Data: 2
nd
digit
-
-
Dn
Data: n
th
digit
ETX End of text (Ctl C)
Checksum
Value Data field
0 +0 (parameter with no decimal places)
0 +0.00 (parameter with 2 decimal places)
1.2 +1.2
-345.78 -345.78
123456 +123456
EOT End of transmission (Ctl D)
A1
Drive address: 1
st
digit
A1
Drive address: 1
st
digit
A2
Drive address: 2
nd
digit
A2
Drive address: 2
nd
digit
STX Start of text (Ctl B)
M1
Menu number: 1
st
digit
M2
Menu number: 2
nd
digit
P1
Parameter number: 1
st
digit
P2
Parameter number: 2
nd
digit
D1
Data: 1
st
digit
D2
Data: 2
nd
digit
-
-
Dn
Data: n
th
digit
ETX End of text (Ctl C)
Checksum