
Modbus Commands
C-20
TIWAY I Gateway User Manual
Modbus Function Descriptions (continued)
Code
1
1 returns a 2-byte status word and an associated 2-byte event
counter
. The status word is defined in the Modbus Protocol Reference
Specification as being 0 for no command in progress and FFFF if a previous
command is in progress. The status will always be 0 in the Gateway
.
The event counter is incremented for every successful message; it is not
incremented for exceptions or polls, or for this code or Code 12. This code
can be used to determine if a single command was successful when a
communication error occurred during the request or response.
The event counter will increment to the value FFFF (65535 decimal), then
begin again from zero.
Example:
I000000
Request: 15 0B XXXX
Checksum (XXXX)
Function code (0B)
Slave address (15)
Figur
e C-22
Get
Comms Event Counter Example — Request
In this example, secondary node 21 (15 hex) has been asked to return the
event counter and the associated status word.
I000000
Response: 15 0B 0000 0143 XXXX
Checksum (XXXX)
Number of events (0143)
Status word (0000)
Function code 1
1 (0B hex)
Slave address 21 (15 hex)
Figur
e C-23
Get
Comms Event Counter Example — Response
The response shows that the status word is 0000 and that 323 (decimal)
events have occurred.
Code 11 — Get
Comms Event
Counter
Comentarios a estos manuales