Skip to main content
Version: Next

Modbus TCP

Getting Started

This article explains how to configure the Modbus TCP within Rubix CE. This will allow us the send and receive Modbus data from connected Modbus devices.

Adding a Modbus TCP Network

  1. Step-1 On the controller level, under drivers, click the create add icon to select and download and install the relevant network.
  2. Step-2 Select the Modbus Network . This will download the appropriate modules and drivers.
  3. Step-3 Configure the Modbus Network. Add the network name, network description and choose IP on Network Transport Type, you can also turn ON the History if needed. Disregards other settings.
  4. Step-4 Once all the settings are configured click on Create Network button. This will now create the Modbus and network. Now open the Modbus network to add a device.

max800px

AttributeDescription
NameName of the network
DescriptionDescription of the network, eg: level 1 network
PortDefault port is 502 you can also set it to another port if required.
EnableEnable the network
Network Transport TypeProtocol used to physically transport Modbus messages between devices. This can be Serial, IP or LoRa
Serial PortFor Serial network only, physical connector on a device that facilitates serial communication. use /dev/tty/RS485-1 / /dev/tty/RS485-2 RTU ports. respectively. For wireless Modbus-Over-LoRa® Network, use /data/socat/serialBridge1.
Serial BaudrateFor serial network only, rate at which data is transmitted over a serial communication link, must match for all devices on the Modbus Network
Serial Data BitNumber of bits used for each character in the communication (typically 8 bits in Modbus), must match for all devices on the Modbus Network
Serial Stop BitSignal bit that denotes the end of a data frame (usually 1 stop bit in Modbus), must match for all devices on the Modbus Network
Serial Time OutMaximum wait time for a response from another device (critical for error handling)
Max Poll RateMaximum time, in seconds, for sending requests to slave devices (depends on network conditions and system requirements).
info

Important things to note before proceeding: You must have a Rubix Compute and a modbus RTU device and know the settings required to add the device User Manual

Adding a Modbus Device in the Network

  1. Step-1 On Modbus Network, under drivers, click the create new device add icon.
  2. Step-2 Fill out the details in the pop-up window with the correct information for the device you are adding. Information such as device name, Address ID, Host IP Address and Port. Click Save to confirm.
AttributeDescription
NameName of the device
DescriptionDescription of the device, eg: sensor 1
EnableEnable the device
Host IPFill in for Modbus IP only, IP of the device you wanted to connect with
PortModbus IP only, Default port is 502 you can also set it to another port if required.
Fast Poll RateRefers to the shortest interval or fastest frequency at which the Modbus master sends requests to the Modbus slaves for data. A fast poll rate means that the master device queries the slaves more frequently.
Normal Poll RateA moderate interval or frequency for polling Modbus slave devices. It’s a balanced approach where the master requests data at a rate that is frequent enough for timely updates but not as fast as the "Fast Poll Rate."
Slow Poll RateLonger interval or slower frequency for polling Modbus slaves. A slow poll rate means that the master device queries the slaves less frequently. This might be used in applications where the data doesn't need to be updated very often, or to reduce network traffic and conserve bandwidth.
Zero ModeRefer to a mode where polling is effectively disabled or set to a very slow rate, potentially even stopping polling altogether. It could be used in scenarios where periodic polling is unnecessary or where the system is in a standby state.
History EnableEnable device history
TagsRight-click the network then tags, meta-tags to add in query key words
Meta-TagsRight-click the network then tags, meta-tags to add in query key words
MessageSee Troubleshooting for list of messages
Statelast_ok: Indicates the time since the system has been error-free.
last_fail: Specifies the date and time of the most recent occurrence of a failure.

Adding Points to the Modbus Device

  1. Step-1 Locate the device you want to add points to from the list under the Modbus network. Right-click to open its settings.
  2. Step-2 Click the create new point add icon.
  3. Step-3 Provide the necessary details in the pop-up window based on the device's manufacturer documentation for Modbus registers. Click the Save button to finalize.
AttributeDescription
NameName of the point
DescriptionDescription of the point, eg: temp 1
Host IPFill in for Modbus IP only, IP of the device you wanted to connect with
PortDefault port is 502 you can also set it to another port if required.
EnableEnable the device
Object TypeThis refers to the type of Modbus data object being configured. Common types include:
Coil: A single bit of read/write data.
Discrete Input: A single bit of read-only data.
Input Register: 16-bit read-only data.
Holding Register: 16-bit read/write data.
Registerhis specifies the address of the Modbus data object in decimal format. Registers in Modbus are memory locations where data is stored or from which it is read.
Decimal FormatSpecifies the type of data stored in the register.
Write modeDefines whether the register is read-only or read/write:
EndiannessSpecifies the byte order of multi-byte data types:
ABCD: Big-endian (most significant byte first).
DCBA: Little-endian (least significant byte first).
BACD: Middle-endian (varying byte order).
CDAB: Opposite of Middle-endian (varying byte order).
Poll PrioritySpecifies the priority level for polling this Modbus object. This helps in determining how frequently and quickly the data should be updated. Typical options include:
High: Poll frequently (short poll interval).
Normal: Poll moderately (moderate poll interval).
Low: Poll infrequently (long poll interval).
Poll RateSpecifies the frequency or interval at which the Modbus master device polls (requests data from) the Modbus slave device.
Multiplication FactorThis factor is applied to the raw data read from the Modbus slave device before scaling.
Scale EnableThis setting determines whether scaling should be applied to the data retrieved from the Modbus slave device. When enabled, the data read from the device is scaled according to the specified scaling parameters.
Scale: Input/Device MinDefines the minimum possible value of the input data range (raw data) coming from the Modbus slave device.
Scale: Input/Device MaxDefines the maximum possible value of the input data range (raw data) coming from the Modbus slave device.
Scale: Output/Point MinSpecifies the minimum value of the output data range after scaling. This is typically the desired minimum value for the scaled output data.
Scale: Output/Point MaxSpecifies the maximum value of the output data range after scaling. This is typically the desired maximum value for the scaled output data.
Round to DecimalsDefines the number of decimal places to which the value of a point (like analog inputs or outputs) should be rounded.
FallbackRefers to the number of retries or attempts a device makes to establish communication or to perform an operation before it considers an action as unsuccessful.
UnitRefer to the specification of the measurement or data type associated with a particular data point
History TypeDetermines how historical data is recorded or stored for the point.
History IntervalSpecifies the time interval between consecutive history samples recorded for the point.
History COV Threshold (Change of Value Threshold)Sets the threshold value that triggers a change of value notification for historical records. When the object's value changes by an amount exceeding this threshold, a history update is recorded.
TagsRight-click the point then tags, meta-tags to add in query key words
Meta-TagsRight-click the point then tags, meta-tags to add in query key words
MessageSee Troubleshooting for list of messages
Statelast_ok: Indicates the most recent successful update of the latest value.
last_fail: Indicates the time when the issue first appeared, as specified in the message field.