Knowledge Base / Protocols / Modbus

Read Commands from my Modbus Master to a ProSoft MCM Slave are working but Write Commands are failing. How do I fix this?

Search KB

Kategorien

When a MCM module has a port set up as a Slave, especially if there are other Slaves on the same physical network, the Modbus Master may have trouble sending Write Commands to the MCM Slave port. In these cases, the Read Commands alway execute successfully; but the Write Commands often or always fail.

In such cases, the "UseGuardBand" and "GuardBandTime" parameters (in older versions of ladder logic or ProLinx Configuration file) or the "InterCharacterDelay" parameter (in newer versions of ladder logic) can be used to activate an alternate timing scheme that allows Write Commands to be properly interpreted and appropriate responses sent.

To activate this alternate timing scheme in older versions of ladder logic and ProLinx Gateways, set the UseGuardBand to "1" to enable this feature and set the GuardBandTime to any value greater than 8 (milliseconds.) Values between 10 and 25 are typical; but certain applications may require even higher values.

To activate this alternate timing scheme in newer versions of ladder logic, set the InterCharacterDelay parameter to any value other than 0. Again, typical values are between 10-25; but may need to be higher.

Guard Band Parameter

With multiple nodes in the network (multidrop), the module must be able to define the time period used to properly recognize the received data sequence as a valid Modbus message. This time period is defined through the guardband timer parameter. Failure to set the Guard Band functionality may cause successive communication errors in the Modbus network.

This functionality is only used for Modbus RTU mode, when the module is configured as a slave device in a multidrop network (RS-422 or RS-485 wiring). In RTU mode, when the module receives sequence of data from another node, it will recognize the end of the message when it detects a 3.5 character gap. The next byte received after a 3.5 character gap will be recognized as the start of a new Modbus message. The 3.5 character gap depends on the port communication settings, especially the baud rate. The higher the baud rate, the lower the corresponding time period equivalent to the 3.5 character delay.

To use the default Guard Band Timeout parameter, set the Guard Band Time as follows:

Guard Band Time = 0

This configuration will set the module to use a pre-defined time interval for Modbus message recognition calculated for each baud rate. This should provide optimal performance for most applications.

The following guard band timer values will be automatically used by the module with the default parameter value (Guard Band Timer = 0) is selected:

Baud Guard Band Timer (ms)

110 350
150 256
300 128
600 64
1200 32
2400 16
4800 8
9600 4
19200 2
28800 2
38400 2
57600 1
115200 1

If you still observe a considerable number of communication errors, try to increase the Guard Band Time value (in milliseconds) until the network performance is improved.