The text of a manual · part 9 of 20
M-Drive: M-Drive 7 Serial Comm, pages 61 to 68
Pages 61 to 68 of 148, from M-Drive
The original document is the PDF (4.1 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
Filed in the catalog under the Fenner M-TRIM-2 and Contrex M-TRIM-2
Page 61
SERIAL COMMUNICATIONS 7
INTRODUCTION
The M-Drive serial communications protocol utilizes a polling technique. A message or record is sent to the M-Drive from the host computer to establish communications. The M-Drive then responds with a confirming or error message.
Messages sent to the M-Drive can be categorized into three types:
1. Parameter Send 2. Data Inquiry 3. Control Command Send
The Parameter Send message is used to change any of the control parameters in the M-Drive (CP-xx). All of the parameters accessible via the front keypad are also accessible through the serial communications interface.
The Data Inquiry message is used to request the current value of any of the control parameters (CP-xx) or monitor variables (MV-xx) in the M-Drive.
The Control Command Send message is used to provide computer control of M-Drive Operations - e.g., run, stop, forward, reverse, etc.
Ali M-Drive messages use the USA Code for Information Interchange (see Appendix 1). This chapter is divided into seven sections. M-Drive Serial Communications Setup describes which CP-xx variables to alter to allow an individual M-Drive to utilize serial communications. The next six sections provide a character level description for each of the three message types and their responses:
Parameter Send - Host Transmission Parameter Send - M-Drive Response
Data Inquiry - Host Transmission Data Inquiry - M-Drive Response
Control Command Send - Host Transmission Control Command Send - M-Drive Response
Page 7-1
Page 62
M-DRIVE SERIAL COMMUNICATIONS SETUP
The following parameters are used to physically structure a M-Drive to utilize the RS422 serial communications network.
70 - DEVICE ADDRESSES
The M-Drive has a settable physical address from 1 to 32. This is used to uniquely identify the individual M-Drive units on a multidropped RS422 line.
NOTE: Messages using a device address of zero are accepted by all M-Drive Units.
71 - BAUD RATE
There are six different baud or data rates for the M-Drive:
1 = 300 Baud 2 = 600 Baud 3 = 1200 Baud 4 = 2400 Baud 5 = 4800 Baud 6 = 9600 Baud
72 - CHARACTER FORMAT The M-Drive accepts 3 different character formats:
8 Data Bits, No Parity, One Stop Bit Data Bits, Even Parity, One Stop Bit
1 2=7 3 = 8 Data Bits, No Parity, Two Stop Bits
Page 7-2
Page 63
73 - CONTROL MASK
When the computer control is switch selected (See Local/ Computer on Page 3-14), it is possible to allow the computer to control some of the functions associated with the discrete switch inputs. These functions are:
1 = Ramp_Enable/Disable
4 = Run/R-Stop
8 = Secondary Setpoint Select
16 = Primary_Setpoint Select
32 = Closed/Open Loop
64 = Not Used
128 = Primary/Secondary Control Mode
To delegate control of the selected function to the computer, simply add the associated function number to the total. For example, a value of 132 for code 73 would mean the computer has control of the Primary/Secondary Mode and the Run/R-Stop functions.
Note: The computer changes these functions using the Control Command Send Message (Page 7-14).
Page 7-3
Page 64
PARAMETER SEND-HOST TRANSMISSION
CHAR # 1 2 3 4 5 6 7 8 9 1g 11 12 Dev#| Dev#] MSG Par# |Par#| DATA]DATA | DATA DATA! DATA DESC. | STX!] 18s! ls |TYPE! 1s ls 1490s/}1890s|1@s !ls FORM | ETX
ASCII | STX|8-9 | 9-9 3. |G8-9 @-9 | G-9 |G8-9 |G-9 |G-9 | 9-7 |ETx 39-| 36- 30- 38-| 30-| 36-| 39-1 39-1 35- |HEX B2 39 39 33 39 39 39 39 39 39 37 |93
CHARACTER 1: STX
The leading STX character must be received by the M-Drive to enable the receive buffer. All characters are ignored until the STX character is received.
CHARACTERS 2 & 3: DEV # Characters 2 and 3 are the device number (address) of the M-Drive that is to be accessed. This number differentiates the individual M-Drive devices on the multidrop RS-422 communications line. Data is only accepted if there is a match between these characters and Control Parameter 70 (the Device Address set on the M-Drive). The only exception is device address 00, which is universally accepted by all the M-Drives on the RS-422 line.
CHARACTER 4: MSG TYPE
Should always be a 3 for a Parameter Send message.
CHARACTER 5 & 6: PARAMETER NUMBER
These characters are the Parameter Code numbers used to identify which Control Parameter is to be changed.
Appendix D lists all valid Control Parameters and their minimum and maximum values.
Page 7-4
Page 65
CHARACTERS 7 TO 10: DATA
These characters are used to transmit the new data for the selected parameter. Data must be within the range specified by Appendix D.
CHARACTER 11: DATA FORMAT
If the data is either negative or not integer, character 11 is used to code its format. This code determines how characters 7 through 10 are interpreted by the M-Drive.
Note: Data Format codes 1, 2, 3, 5,6 and7 are only valid for CP-20, CP-21, CP-22 and CP-23. All other decimal locations are either fixed or derived, and should use Code 0 for the Data Format Code.
C FORMAT + XXXX + XXX.X + XX.XX + X.XXX - XXXX - XXX.X ~ XX.XX - X.XXX +XX.XX.
ONONAWONM=AO015 m
CHARACTER 12: ETX
The message or record must always be terminated by the ASCII ETX character.
EXAMPLE:
A new acceleration time of 52.3 seconds is sent to the M-Drive with device address 4:
ASCII Representation: STX0431605230ETX
HEX Representation:
Device #4 CP-16 Format (+XXXX)
STX H H H ETX
\_ _ _| i,
02 3034 33 3136 30353233 30 03 / !
I MSG Type 3 Data (0523)
Note: Spaces are visual clarity only. Note: The decimal point for CP-16 is fixed by the M-Drive.
(See the NOTE for Character 11 above.) Page 7-5
Page 66
PARAMETER SEND - M-DRIVE RESPONSE
CHAR # 1 2 3 4 5 6 7 8 ) 1 11 12 Dev# | Dev#] ERROR Par#|Par#| DATA/DATA DATA IDATA DATA DESC. | STX{| 19s] 1s |copDE 18s ls 18@09s/106s|19s [is FORM | ETX a - ASCII | STxXx|9-9 {9-9 | DET, g-9 8-9 | G-9 |G-9 |G-9 jg-9 [9-7 |ETx 36-| 30-[ 49- | 3g- 30-| 30-| 36~|/°38-] 39-T 3g - HEX G2 39 39 7F 39 39 39 39 39 39 37 |63
CHARACTER 1: STX
The leading character of the Response message is always the ASCII STX.
CHARACTERS 2 & 3: DEV # The next two characters are the device address.
Note: If the universal address is used in the Host Transmission, no response message is transmitted back to avoid line contention.
CHARACTER 4: ERROR CODE
The Error Code indicates if any errors existed in the send message received by the M-Drive. This character is bit structured and can be decoded as follows:
Bit 7 - Always 0
Bit 6 - Always 1
Bit 5 - Data was out of minimum/maximum range
Bit 4 - Invalid Parameter Code, Checksum or Decimal Point Error
Bit 3 - Receive buffer filled before ETX received or Message Format Error Bit 2 - Invalid Parameter Data
Bit 1 - Parity error
Bit 0 - M-Drive in Local not Computer Mode:
Refer to Table 7-1 to transfer from the ASCII character sent back from the M-Drive and the corresponding binary bit structure.
Note: The ASCII error code @ (01000000 binary) (40 HEX) indicates that the Host Transmission contained no errors.
The M-Drive only accepts data if no errors were encountered.
Page 7-6
Page 67
ASCII BINARY ASCII BINARY Bit H ne G Bit 7 Bit @ @ G1ag9g0R ' | 16000 A G1698961 a 91189001 B glagagig b @1199818 c 61680911 c 91188611 D 61880199 d 91190196 E 81688161 e 811681981 F 81969118 f #1199119 G @1896111 g 91166111 H G18G10898 h 81181898 I 91691961 i 81181881 J $1981818 5 81181819 K 61661911 k 91181811 L 61981198 1 911681198 M $1691191 m 91161191 N @1681119 n 611981118 QO 81681111 ° #1191111 P 81919688 P 81119808 Q G1810901 q 91119601 R #1819818 r #1119919 s 91818911 s $1119611 T #1418199 t 911191998 U 81818181 u @1116181 Vv G1918118 v 81119119 W §181@111 w 91118111 x @1G11900 x G11119989 Y $1811961 y @11119081 2 01811616 z 81111812 [ G1811811 { 81111911 \ g191119¢@ ' 81111199 j 61811181 } #1111191 “ #1811116 ~ 91111118 - @1811111 DEL @1111111
Table 7-1: Error Code Translation -- ASCII to Binary
CHARACTERS 5 & 6: PARAMETER NUMBER
The Parameter Code number from the send message is echoed back in the return message.
CHARACTERS 7 TO 10: DATA
The Data from the send message is echoed back in the return message.
CHARACTER 11: DATA FORMAT
The Data Format character from the send message is echoed back in the return message.
CHARACTER 12: ETX
The return message is always terminated with the ASCII ETX character.
Page 7-7
Page 68
DATA INQUIRY-HOST TRANSMISSION
CHAR # 1 2 3 4 5 6 7 8 9 19 ll 12 Dev# |Dev# | MSG Par#| Par#| DATA!/DATA [DATA DATA | DATA DESC. | STX} 19s! 1s [TYPE] 10s ls 1980s 1168s |1@s |1s FORM} E'TX
ASCII | STX|8-9 |8-9 2 |8-9 8-9 @ “4 4} @ V4) ETX 3G-{ 39- 36- 36- HEX G2 39 39 32 39 39 3G 38 36 30 38 |83
CHARACTER 1: STX
The leading character must always be the ASCII STX.
CHARACTERS 2 & 3: DEVICE NUMBER
The device address of the M-Drive.
CHARACTER 4: MSG TYPE
The message type is the ASCII 2 for a data inquiry message.
CHARACTERS 5 & 6: PARAMETER NUMBER
This is the parameter code number for the desired variable.
CHARACTERS 7 TO 10: DATA
Should be set to zero in the message to the M-Drive.
CHARACTER 11: DATA FORMAT
Should be set to zero in the message to the M-Drive.
CHARACTER 12: ETX
The message should terminate with the ASCII ETX character.
Page 7-8