Symax Protocol
Symax 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.
www.plctools.org
Sy/Max Protocol
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;
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:
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.
DATA The data section will vary depending on the type of communication, read or write, and if the
transmission is a command or reply.
www.plctools.org
Sy/Max Protocol
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.
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).
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:
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).
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:
www.plctools.org
Sy/Max Protocol
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.
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:
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.
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.)
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
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.
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.
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.
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.
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.
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.
The following is a example of the data generated when a processor performs a “read register” statement.
Command Message
www.plctools.org
Sy/Max Protocol
Acknowledge Command:
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. # Value
S1 10
S2 11
S3 12
S4 13
S5 14
Reply Message:
www.plctools.org
Sy/Max Protocol
Acknowledge Reply:
12.2 Write
The following is an example of the data generated when a processor performs a “write register” statement.
Command Message:
www.plctools.org
Sy/Max Protocol
2 Route 01
Route 07
1 DEL 10
1 STX 02
1 Opcode 1E
2 Status Reg. Address 80 M.S.B
0E L.S.B.
2 PC Address Local 00 M.S.B.
12 L.S.B.
2 User Reg. Adrress 00 M.S.B.
(remote) 1C L.S.B.
2 Local reg. Adrress 00 M.S.B.
AA L.S.B.
1 DLE 10
1 ETX 03
1 Checksum BE or BD
1 to 10 PAD FE
Acknowledge Command:
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:
www.plctools.org
Sy/Max Protocol
1 DLE 10
ETX 03
1 Checksum A2 or A1
1 to 10 PADS FE
Acknowledge Reply:
www.plctools.org
Sy/Max Protocol
www.plctools.org