User manual

26 Modbus RTU MN744
Poll Controller
This PDU is used when the response time from the slave is longer than normal. It provides a way to avoid a
timeout. Normally a Modbus Master sends a request and waits for the slave to respond. If the slave does not
respond within a fixed time-period a time-out has occurred and the Master can send another request. This is
how standard function codes are supported. Standard function codes do not support the Poll Controller Function
Code.
For standard function codes, if the master sends another request before the slave has responded, the slave
responds with the exception code SLAVE DEVICE BUSY. In this case, there is a chance that the master and
slave could transmit at the same time thereby corrupting the message.
Special H2 functions codes do support the Poll Controller Function Code. Some of these codes take an
indeterminate amount of time to complete. In this case, polling is used. Consider the following sequence.
The master sends a special H2 function code request PDU.
Byte 1
Byte 2 Byte n . . .
Function Code (14) Data Data . . .
The slave responds with a Modbus Exception:
Byte 1
Byte 2 Byte n . . .
Function Code (14) Data Data . . .
The master must now poll the slave for a response. The slave will not respond automatically. If at any time after
an ACKNOWLEDGE the master fails to poll but instead makes another request, the slave shall respond with an
ILLEGAL FUNCTION exception.
The master polls the slave using PDU.
Byte 1
Poll Controller (14)
The slave responds with PDU:
Byte 1
Byte 2
Poll Controller (14) SLAVE DEVICE BUSY (06)
The master continues polling the slave so long as the SLAVE DEVICE BUSY exception code is returned.
The polling sequence ends upon any of the following responses from the slave:
The response PDU to the original PDU request is returned
A Modbus exception other than ACKNOWLEDGE or SLAVE DEVICE BUSY is returned.
The following time table shows a typical polling sequence.
Time Master Slave
0 PDU1
1 Acknowledge
2 Poll Controller
3 Slave Device Busy
4 Poll Controller
3 Slave Device Busy
4 Poll Controller
Slave Device Busy
S S S S
N Poll Controller
N+1 Response PDU1
N+2 PDU2