Delta RMC151 User Manual
Page 434
RMC70/150 and RMCTools User Manual
Response
Code
Description
00
Success.
01
Malformed.
02
Too Long.
03
Invalid Address.
Notice that in certain other error cases, the RMC will not generate an error response, but
will instead either discard the incoming packet with no response, or close the TCP/IP
connection:
•
The Packet Length field is less than 5. The RMC will discard the packet without
response.
•
The Packet Length field is greater than 4110. The connection will be closed.
•
Unable to receive the entire packet from the TCP stream. The connection will be
closed.
•
Unable to successfully send the response over the TCP stream. The connection will be
closed.
•
The Static Values (bytes 2-3) are not 00 and 02 respectively. The RMC will discard the
packet without response.
•
Unsupported function code (byte 6). The RMC will discard the packet without
response.
The errors above are also logged in the Event Log.
Example 1: Writing a Single Register
In this example, the client will write the value 0x11223344 to variable 0 (%MD56.0),
using the LSB-first byte order (00). The client chooses a Transaction ID of 00 00 for this
packet, either because he is not using this field, or because this is the first transaction.
Plugging in the above values in the proper byte order gives us the following packet that
should be sent to TCP port 1324 on the RMC:
12 00 00 02 00 00 15 00
38 00 00 00 01 00 00 00
44 33 22 11
After the RMC has successfully received and processed this write request, it will respond
with the following packet:
06 00 00 02 00 00 95 00
Notice that the last byte is the Response Code, with 00 meaning success.
Example 2: Reading a Single Register
In this example, the client will read a value from variable 0 (%MD56.0). The client
chooses a Transaction ID of 0x0001, perhaps because this is the second transaction.
Plugging in the above values in the proper byte order gives us the following packet that
should be sent to TCP port 1324 on the RMC:
0C 00 00 02 01 00 14 00
38 00 00 00 01 00
After the RMC has successfully received and processed this write request, it will respond
with the following packet if variable 0 held the value 0x11223344:
0A 00 00 02 01 00 94 00
44 33 22 11
Notice that byte 7 holds the Response Code, and bytes 8-11 hold the data that was read.
414
Delta Computer Systems, Inc.