Symaxprotocol

  • Uploaded by: Cesar Garcia
  • 0
  • 0
  • December 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Symaxprotocol as PDF for free.

More details

  • Words: 3,505
  • Pages: 13
Sy/Max Protocol

Date :

27/01/2001

Prepared by :

Cesar Garcia

Original information :

SquareD Buolletin

Version :

1.0.0

INTRODUCTION The SY/MAX PC Family protocol which is based on the ANSI 3.28 standard, provides for many operator fuctions. These functions consist of loading and retrieving ladder rungs, searching for I/O’sor registers, forcing I/O, and reading or writing register data and I/O status. For the majority of applications, all that is needed is register data and I/O status information. The following is a description of the minimum programming requirements to obtain and send register data and I/O status. I/O points and data storage are both defined as register values. Therefore, a register read will bring back either I/O status or a data value depending on how the register has been assigned in the programmable controller. A register write performs the function of entering a value into a data regsiter. A register write to an I/O will cause the register value to change only until the logic of the particular I/O point is scanned. At that point program control takes over. It is assumed that the user has read and understands the set-up and programming of communication statements of SY/MAX devices. All numeric values are decimal unless otherwise shown. This information is subject to change without notice. Square D can accept no liability for actual use based upon illustrations and examples within.

1. HARWARE REQUIREMENTS All SY/MAX PC Family devices communicate via RS-422, otherwise referred to as differential. RS-422 is not compatible with RS-232C and, therefore, a converter may be used.

The SY/MAX PC Family processor pinout is as follows:

www.plctools.org

Sy/Max Protocol

Pin Number

Function

1

Transmitted Data -

2

Transmitted Data +

3

Received Data -

4

Received Data +

5

+5 volts DC

6

+5 volts DC

7

Signal Ground

8

Signal Ground

9

Chassis Ground (cable shield)

2. SY/MAX COMMUNICATION A completed communication message between two devices using SY/MAX protocol consists of four steps as outlined below. Note that the protocol has been developed so that either the SY/MAX device or the user device can be the initiator of the communication. 1. The initiating (command) device sends address and register data (write command) or requests register data (read command) from the responding device. 2. The responding device acknowledges the transmission. 3. The responding device sends bacl to the initiating device a reply message that consists of status register data for a write command or both register data and status register data for a read command. The status register defined within the protocol is used to monitor the transmission information and errors. 4. The initiating device acknowledges the transmission referred to in 3. WRITE

READ

www.plctools.org

Sy/Max Protocol

3. COMMUNICATION RATES All transmissions are asynchronous seria binary, full duplex; 1 start bit, 1 stop bit, even parity, 8 data bits. The baud rate for the communication is determined by the value in SY/MAX Processor register 8169. Each port (COMM or PRG) may have its baud rate individually set. SY/MAX Processors default to 9600 baud on power up if the baud rate register has not been previously altered. The selected baud rates are stored in battery backed up memory.

4. MESSAGE FORMAT A read or write message has the following format:

NOTE: All numerical vaalues followed by an “H” refer to hexadecimal. 4.1 Start of Message DLE|SOH Start of message flag. EVE/ODD Alternating message ID character. This code must alternate with each message. Eeven=DC1 (11H) or Odd=DC2 (12H) ROUTE OPT Optional SY/Net Communications Network Routing information. See note 1 CAUTION: When connected to a SY/NET communication network via the Network Interface Module, the device dupplicating the SY/MAX protocol must have the ability to reject unimplemented opcodes. DLE|STX End of header/star of data flag. OPCODE Message Description: Read register command = 20H Write register command = 1EH Read register reply = 90H Write register reply = 92H DATA The data section will vary depending on the type of communication, read or write, and if the transmission is a command or reply. 4.2 Data Section www.plctools.org

Sy/Max Protocol

4.2.1 Read Register Command (20H) Status Register Addres - The address of the regsiter in the initiating device used to monitor the read operation. Local Register Address - The final destination in the initiating device of data. Remote Register Address - The source of the requested data in the responding device. Count - The number of sequential registers, starting with remote register address, being requested. The count value is placed in the protocol as two byte number computed by subtracting one from the desired count value. The Sy/MAX count number is 16 bit wide. The count must be sent as two 8 bit words. The upper 8 bits are sent followed by the lower 8 bits. If only one register is requested the count value is 0.0. If 6 register are requested, the ciunt is 0.5. 4.2.2 Write Register Command (1EH) Status Register Addres - The address of the regsiter in the initiating device used to monitor the read operation. Remote Register Address - The final destination in the receiving device of the data being transferred. Register Data - The data being transferred. If more than on register is transferred, the register data is sent, by register address, in sequential ascending order. The SY/MAX data register are 16 bits wide. The data must be sent as two 8 bit words. The upper 8 bits (most significant bits) are sent followed by the lower 8 bits (least significant bits). 4.2.3 Read Register Reply (90H) Status Register Addres - The address of the regsiter in the initiating device used to monitor the read operation. Status Data - The Status data is used to monitor the data transfer. The bit pattern is set by the responding device. SY/MAX Processor status data is: Bit 16 15 1 1 and 3 1, 3 and 4

Meaning if Bit Has Been Set to 1 Good communication has transpired, there were no errors. SY/MAX Processor that is responding is in rung. An error has occurred. Illegal Operation - An attempt was made to read from a device with no registers. Receiver Overflow - Too many registers were sent or resquested.

Any error (an error is indicated by bit 1 set to a 1) will cause the message data to be ignored by the initiating device. Local Register Address - The final destination in the initiating device of data. Register Data - The data being transferred. If more than on register is transferred, the register data is sent, by register address, in sequential ascending order. The SY/MAX data register are 16 bits wide. The data must be sent as two 8 bit words. The upper 8 bits (most significant bits) are sent followed by the lower 8 bits (least significant bits). 4.2.4 Write Register Reply (92H) Status Register Address - The same address as the status register in the command statement. Status Data - The status register bit pattern set by a SY/MAX Processor for a write command is as follows: Bit

Meaning if Bit Has Beenn Set to 1 www.plctools.org

Sy/Max Protocol 16 15 1 1 and 2 1 and 3 registers. 1 and 4 I/O register. 1 and 5

Good communication has transpired, ther were no errors. Proccesor that is responding is in run. Communication error has ocurred. Illegal Address - An attempt was made to write into and address that does not exist. Illegal Operation - An attempt was made to write to a device that does not contain Write to a read Only register - An attempt was made to write to a read only register or a Receiver Overflow - Too many registers were sent to the remote proccesor.

Any error (bit 1 set) will cause communication to be terminated. If a Sy/MAX Proccesor is the responding device and a error accurs, the data in thewrite commandis thrown away. 4.3 Data Section DLE|ETX End of data flag. CHECK SUM Eight bit 2’s compliment of the sum of all character following “SOH” and through “ETX”. PAD End of message (FEH) - one or more pads must be sent to terminate the communication.

5. ACKNOWLEDGE RECEPTION After each (command or reply) message transmission, the device that receives the (command or reply) message must check that the message for errors and then respond to the device that transmitted the (command or reply) message with an acknowledge/negative acknowledge or too busy to process the message. This response must be sent within ten character times os the end of transmission. The response messages should take the following forms: 5.1 Positive Acknowledge DLE|EVEN/ODD if the even/odd code matches the transmitted code, the transmission is completed. If the even/odd code does not match, the response should be treated as a DEL NAK. 5.2 Negative Acknowledge DLE|NAK The receiving device will respond with a DEL NAK if an error (check sum, parity, overrun or incorrect format) is detected. The originating device should automatically resend the message up to 8 times. (SY/MAX Proccesor will automatically resend the message.) 5.3 Device Busy Acknowledge DLE|SYN Indicates the receiving device was too busy to respond. The message should be automatically resent until a DEL EVEN/ODD or DEL NAK is received. At that time, the rules for DEL,EVEN/ODD and DEL NAK should be followed.

6. EMBEDDED RESPONSE Acknowledge reception responses (DEL EVEN/ODD, NAK or SYN) can be embedded within a command or reply message, or interleaved between messages. A SY/MAX PC Family device will embed a response if, while it is transmitting a message, it receives a message through the same port. The response will be placed inside the message currently being transmitted. These embedded responses are not allowed:

www.plctools.org

Sy/Max Protocol

1. Between DEL and a control code (ETX, SOH, STX or DEL). 2. Between ETX and the checksum. Embedded responses accur because the protocol specifies that an acknoeledgement to a message must be sent within 10 character times of the end of a received message. Because the SY/MAX device has full duplex communication capability, a message can be received while a totally different message is being transmitted. If the received message is completed, and the transmitted message has more than 10 characters left to transmit, the DEL EVEN/ODD, NAK or SYN must be embedded in the message currently being sent. To avoid having to transmit or receive an embedded response, follow the two rules below: 1. The deice duplicating the protocol must act as the communication master. It must initiate al lread and write command. 2. Allow only one communication at a time. Once a command is sent, another command cannot be sent until the reply is received and acknowledged. If both the above procedures are not followed, the device duplicating the protocol must be capable of handling embedded response situation.

7. SPECIFIC PROTOCOL FORMAT REQUERIMENTS ADDRESSES - All addresses (status, local and remote) are put into SY/MAX protocol using the following formula: 1. Multiply the decimal address by 2. 2. Subtract 2. 3. Result is the SY/MAX protocol value of the address. Example : Address 40 40*2 = 80 80-2=78 Address 0040 in SY/MAX protocol is 0078. EVEN/ODD - With every command or reply communication message, an alternating code of 11 hex or 12 hex will be sent in the message. All acknowledgements to messages must be made using the same even/odd code. If the acknowledgement does not match the message even/odd code, the processor will assume the acknowledgement is incorrect and resend the original message. The even/odd byte should not be alternate when a message retry is necessary. If the last response to a transmitted DEL ENQ was a DEL NAK, the ODD/EVEN code can be set to either odd or even. DATA - The 16 bit data registers are sent as two 8 bit words. The first 8 bits are sent as the most significant byte (M.S.B.), the second 8 bits are sent as the least significant byte (L.S.B.).

8. ROUTING CAUTION: When performing register read and writes as erations over SY/NET it is possible to encounter protocol situations not covered in this literature. Therefore, all computers dupplicating the SY/MAX protocol should reject all messages that are not register read and write described above.

www.plctools.org

Sy/Max Protocol Route characters can be optionally inserted in a communication message. For a simple communication (not over SY/NET) no route information is needed. A route consists of the network interface module numbers that must handle the message between its source and destination. The network interface module has an eight bit number transmitted as 2 ASCII hex characters. A transmission along a single networks requires a minimum of two drop numbers of two characters apiece. One pair for the source (sender) and one pair for the destination (receiver). There can be maximun of eight route number pairs in a message. The decimal route numbers are converted to SY/MAX protocol by: 1. Converting the decimal route number into its hexadecimal equivalent. 2. Converting each hex digit into the Hex ASCII code for that digit. 3. The Hex ASCII digits are then placed in the read or write statement. Example: Route 15 is converted to 0F hex. The Hex ASCII code for 0 is 30H; for F it is 46. A route of 15 has the protocol form 30 46. Rounting example for SY/MAX Proccesor: This is sent as: The receiving device turns the route around in its reply. DEL even/odd, DEL NAK and DEL SYN replys do not need routing. This data does not go out over the network, it is processed by the SY/NET Network Interface module.

9. DLE IN DATA FIELD It is possible that a byte of data between the first DEL STX and the last DEL ETX may be a “DEL” (10H). In order to prevent this data from begin interpreted as part of a control sequence, an extra “DEL” must be sent with each data byte that happens to be a “DEL” (10 hex). The extra DEL’s should be added into the checksum. When the receiving device sees two “DEL’s”, one of them should be removed from the data field (but remember it’s still part of the checksum). If a message’s checksum is equal to 10H (DEL) no extra “DEL’s” should be sent.

10. RETRANSMISSION A DEL ENQ is sent by a SY/MAX Proccesor to the responding device to request retransmission of that devices most recently transmitted response (DEL EVEN/ODD, NAK, or SYN). A DEL ENQ will be sent by the processor for the following reasons: 1. If the SY/MAX Proccesor has not received a valid response (DEL EVEN/ODD, NAK, or SYN) after sending a message and waiting 10 character times, the SY/MAX processor will send a DEL ENQ to request retransmission of the last response. The procedure must be followed in order to prevent dropped or duplicated messages. If the SY/MAX processor sends 32 DL ENQ’s (10 character times apart) and no valid response is received, the processor assumes the communication link has been broken. The SY/MAX processor will place an error code in register 8175 and proceed with any other communication

www.plctools.org

Sy/Max Protocol that may be present. See the Programmer or Processor Instruction Bulletins for an explanation of error codes. 2. A DEL ENQ is continuosly sent by the processor if the communication link is idle. This is done to determine if the serial link is operational. If 32 DEL ENQ (10 character time apart) are sent by the proccesor with no response, the processor assumes that the link is not operational. The processor will then respond to the next DEL ENQ sent to it with a DEL NAK. 3. When power is firts applied, a SY/MAX Proccesor sens a DEL ENQ request to check if:a) any devices are connected to its ports, and b) find the odd/even code of the connected device. If no response is generated, tha last response is set to NAK as explained in b. NOTE : Although the above discussion on DEL ENQ refers to the processor, any device duplicatting the protocol must also follow the above procedure to assure message transmissions. RECEIVING A DLE ENQ The reception of a DEL ENQ should cause the receiving device to resend its last response. The only valid responses to a DLE ENQ are DLE DC! (odd), DLE DC2 (even), DLE NAK or DLE SYN. A DLE SYN does not satisfy the DLE ENQ, it only resets the ENQ counter. CAUTION: The DLE ENQ is used for error recovery and must be implemented in order to prevent dropped or duplicated messages.

11. SY/MAX MODEL 100 The Model 100 obeys all of the preceding protocol information. However, the Model 100 will not transmit a reply to a read register or write register command without first being sent a DEL ENQ. Therefore, when implementing a protocol with Model 100, after sending the command message, a DEL ENQ must be sent to initiate the reply sequence.

12. EXAMPLES OF A SY/MAX PROCESSOR INITIATED COMMUNICATION. 12.1 Read The following is a example of the data generated when a processor performs a “read register” statement. The message is sent on an open to closed transition of the initiating contact. Command Message Number of Bytes 1 1 1 1 1 1 2

ASCII Code DEL SOH DC1 or DC2 DEL STX Opcode Status Reg. Address

www.plctools.org

Hex Code 10 01 11 or 12 10 02 20 00 M.S.B. 26 L.S.B.

Sy/Max Protocol 2

PC reg. Address

2

User Reg. Address

1

Count

1 1 1

DEL ETX Checksum

1 to 10

PAD

00 M.S.B 28 L.S.B. 00 M.S.B. 00 L.S.B. 00 M.S.B 04 L.S.B. 10 03 58 or 57 (depending on Even/Odd) FE

ASCII Code

Hex Code

Acknowledge Command: The receiving device now acknowledge with Number of Bytes 1 1

DEL Odd or Even or NAK or SYN

10 11 or 12 or 15 or 16.

This completes one side of the transmission. The receiving device now assembles the proper bits and replys to the PC with following: Assume receiving device has the following values in its firts 5 registers. Reg. # S1 S2 S3 S4 S5

Value 10 11 12 13 14

Reply Message: Number of Bytes 1 1 1 1 1 1

ASCII Code DEL SOH DC1 or DC2 DEL STX Opcode

www.plctools.org

Hex Code 10 01 11 or 12 10 02 90

Sy/Max Protocol 2

Status Reg. Address

2

Status Reg. Data

2

PC Register Address

2

Data

2

Data

2

Data

2

Data

2

Data

1 1 1 1 to 10

DEL ETX Checksum PAD

Number of Bytes 1 1

ASCII Code

00 M.S.B. 26 L.S.B. 80 M.S.B 00 L.S.B. 00 M.S.B. 28 L.S.B. 00 M.S.B. 0A L.S.B. 00 M.S.B. 0B L.S.B. 00 M.S.B. 0C L.S.B. 00 M.S.B. 0D L.S.B. 00 M.S.B. 0E L.S.B. 10 03 30 or 2F FE

Acknowledge Reply: The PC now sends:

DEL DC1 or DC2 or NAK

Hex Code 10 11 or 12 or 15

The transmission is complete. The data is in the PC’s register 21-25. 12.2 Write The following is an example of the data generated when a processor performs a “write register” statement. The message is sent on an open to closed transition of initiating contact. Reg. 10 of the local processor is assumed to contin A00 Hex.

Command Message: Number of Bytes 1 1 1

ASCII Code DEL SOH DC1 or DC2 www.plctools.org

Hex Code 10 01 11 or 12

Sy/Max Protocol 2 1 1 1 2

Route Route DEL STX Opcode Status Reg. Address

2

PC Address Local

2 2

User Reg. Adrress (remote) Local reg. Adrress

1 1 1 1 to 10

DLE ETX Checksum PAD

01 07 10 02 1E 80 M.S.B 0E L.S.B. 00 M.S.B. 12 L.S.B. 00 M.S.B. 1C L.S.B. 00 M.S.B. AA L.S.B. 10 03 BE or BD FE

Acknowledge Command: The receiving device now acknowledges Number of Bytes 1 1

ASCII Code

Hex Code

DEL DC1 or DC2 or NAK or SYN

10 11,12, 15 or 16

This ends the first prt of the communication. The user places the data sent it in the proper register and then returns the status data.

Reply Message: Number of Bytes 1 1 1 2

ASCII Code

1 1 1 2

DLE SOH DC1 or DC2 Route Route DLE STX Opcode Status Reg. Address

2

Status Reg. Data

www.plctools.org

Hex Code 10 01 11 or 12 07 01 10 02 92 00 M.S.B 0E L.S.B. 80 M.S.B. 00 L.S.B.

Sy/Max Protocol 1 1 1 to 10

DLE ETX Checksum PADS

10 03 A2 or A1 FE

Acknowledge Reply: The PC will now sen a reply: Number of Bytes 1 1

ASCII Code

Hex Code

DEL DC1 or DC2 or NAK or SYN

10 11,12, 15 or 16

This ends the communication.

13. ASCII / HEXADECIMAL CODE EQUIVALENTS ASCII Code DEL EVEN/ODD Even = DC1 Odd = DC2 ENQ ETX NAK OPCODE Read register command Write register command Read register reply Write register reply PAD SOH STX SYN

Hex Code 10 11 12 05 03 15 20 1E 90 92 FE 01 02 16

www.plctools.org

Sy/Max Protocol

www.plctools.org

Related Documents

Symaxprotocol
December 2019 10

More Documents from "Cesar Garcia"

Symaxprotocol
December 2019 10
As 511
December 2019 23
Control De Calidad
June 2020 10
June 2020 7