Micromod MOD: 1800P - MOD 30ML Identity Module (Version 2) System, I/O and Communications Functions User Manual

Page 247

Advertising
background image

Logic Functions - Book 1

APPENDIX B - MODBUS MASTER CONFIGURATION

B-3

The Expression in the Expression block can still be used. The Modbus Master code will
execute first and then the expression will be evaluated.

When an Expression block is used for a Modbus Master interface it’s message handler routine
will not allow writes to attributes that are configuration parameters for the Modbus Master
function.

The EX block and the LOOP block it is under must both be in the RUN state for Modbus
Master message transactions to occur.

Messages are processed as follows:

Modbus is a half duplex protocol. Therefore, except for a global write message, the
master will send a message and wait for a response message or until a specified
timeout occurs.

If a global write message has been sent the driver will wait at least 100 msec plus the
configured INTER MESSAGE DELAY time before sending the next message.

Messages are queued up in the order that they are triggered by Modbus Master EX
blocks.

The MSC block executes every 50 msec. When it executes, if it is currently
transmitting a message or waiting for a response, it will do nothing. Otherwise, if a
response has been received it will mark it appropriately so the Modbus Master EX
block can process it when it executes. If the INTER MESSAGE DELAY is configured
for 0 and there is another message in the queue it will be sent. Else, the MSC block
will wait until the INTER MESSAGE DELAY is satisfied and there is a message in the
queue to be sent.

If no response is received from a slave for the NUMBER OF RETRIES configured the
driver will timeout all messages in the queue destined for this slave’s address. This
eliminates wasting time on a slave that is not on the bus.

MODBUS MASTER Read EX blocks will copy data read from a slave device into it’s
INPUT attribute storage locations when the EX block executes.

MODBUS MASTER Write EX blocks will copy the data from it’s INPUTS into the
message to be sent to the slave device when the EX block executes.

Advertising