MODBUS Server

MODBUS Server

MODBUS Server communication protocol

Supported device types and versions


The protocol implements a server (slave) communication with arbitrary devices that support the MODBUS RTU standard, either in a serial communication version or a MODBUS over TCP/IP variant.

Communication line configuration


  • Line category: Serial (serial communication), SerialOverUDP Device Redundant (serial communication).

  • Line category TCP/IP-TCP (MODBUS over TCP/IP). Use a symbolic address ALL or *, in order for the KOM process to listen on a selected TCP port on all existing network interfaces. TCP port 502 is commonly used, but any of the ports can be used.
    Line number - set the value, for example, 1.
    Note: The KOM process works as a multitasking TCP server, and that is why it is able to handle multiple clients at the same time.

Line protocol parameters


Configuration dialog box - table Parameters.
They influence some optional parameters of the protocol. The following line protocol parameters can be set:

Table 1

Parameter

Meaning

Unit

Default value

Parameter

Meaning

Unit

Default value

Silent Interval

A delay before the start of transmission of each data packet.

ms

50

No Request Timeout

If the timeout passes and no valid request comes, all stations on the line will go to a communication error. However, the values of output I/O tags will not be invalidated (as this is a server protocol).

mi:ss

1:00

Single Server

If the value of the parameter is set to YES, the KOM process replies with a SLAVE_DEVICE_FAILURE error to each request that is sent to a non-existent station (a station with an unknown address). If the value is NO, the KOM process ignores this request and does not send a reply to it.

YES/NO

YES

Moxa Timeout

The switching time of Moxa redundant devices in case of a communication error or some problems. As this is a server protocol that waits for requests from external devices, a failure to receive a communication request for a longer time than the value of this parameter is considered to be an error. It is effective only for the SerialOverUDP Device Redundant line.

sec

10 sec

TCP No Delay

Setting the TCP No Delay parameter to YES causes the low-level socket option TCP_NODELAY to be set, thus turning off the default packet coalesce feature.
The parameter is implemented only for TCP/IP-TCP line.

YES/NO

NO

Redundancy Mode

The parameter specifies the protocol behavior in redundancy for the TCP/IP-TCP line category if the KOM process is not active:

  • Passive NoBind - The passive KOM process closes the TCP port and does not listen on it.

  • Passive Disconnect - The passive KOM process immediately disconnects clients (closes TCP connections), but still listens on the TCP port.

  • Passive Read - The passive KOM process communicates and responds to read requests, but does not respond to write requests

Passive NoBind
Passive Disconnect
Passive Read



Passive NoBind

Communication station configuration


  • Communication protocol "Modbus Server".

  • The station address is a decimal figure in the range of 1 to 247. Address 0 is reserved for broadcast.

It is possible to configure more stations with different addresses on one line; the KOM process will reply on behalf of every configured station. See also the line protocol parameters Single Server.

Station protocol parameters

Configuration dialog box - tab Parameter.
They influence some optional parameters of the protocol. Following station protocol parameters can be set:

Table 2

Parameter

Meaning

Unit

Default value

Addressing model

Sets an address model of the MODBUS protocol:
MODBUS PDU data are addressed from 0 up to 65535.
MODBUS data Model data are addressed from 1 up to 65536.

Note: MODBUS PDU is a default value. If the MODBUS data Model is set, the object with the address X is addressed as X-1 in the MODBUS PDU.
After a change of this parameter, the KOM process must be restarted.

MODBUS PDU
MODBUS data Model

MODBUS PDU

I/O tag configuration


Possible value types: Ai, Ao, Di, Do, Ci, Co.

I/O tag address: