The Modbus IP data source in Mango OS is used to gather data from Modbus-compatible devices over an IP network. These devices can reside on a local network, an intranet, or even the public internet. The data source operates by polling the devices at regular intervals to read values.
From the Data integration menu, go to Data Sources.
Click New to create a new data source.
Data Source Type: Select Modbus IP from the dropdown.
Name: Enter a descriptive name (e.g., Boiler Room Modbus).
Enabled: Check this box to activate the data source.
Update Period: Set the frequency for polling data (e.g., 10 seconds).
Quantize: Optional – Check this to align polling to rounded time intervals (e.g., exactly on the 10th, 20th second, etc.).
These settings define how the system handles communication failures:
Timeout (ms): Time to wait for a device response (e.g., 5000 ms).
Retries: Number of retry attempts before declaring failure (e.g., 3).
Use multiple write commands only: Check if your device does not support single-value write commands.
Contiguous batches only: Check if the device requires requests to reference contiguous register spaces.
Create device monitor points: Check to auto-create a binary point that tracks device availability (useful for alerts).
Transport Type:
TCP: Opens a new connection per poll (ideal for infrequent polling).
TCP with keep-alive: Maintains a persistent connection (recommended for most setups).
UDP: Efficient but may require strict network configuration.
Encapsulated: Uses Modbus RTU over IP—ideal for serial-to-Ethernet converters.
Linger (seconds): Determines socket close behavior:
Negative value disables the linger feature.
Zero closes the socket forcefully.
Positive number causes graceful close with timeout.
Host: Enter the IP address or domain name of the Modbus device.
Port: Common Modbus ports are 502, 47808, or 47809.
Max read bit count / Max read register count / Max write register count: Set based on device capabilities (default values typically work).
Discard data delay (ms): Time before buffered data is discarded (set to 0 to never discard).
Log IO: Enable to log raw hex communication for troubleshooting.
D
If devices become unreachable:
Scale Factor: Determines how quickly retry delays grow (e.g., 1.5).
Max back-off on connection failure: Maximum wait time between retries (e.g., 5 minutes).
This strategy helps prevent network overloads and improves system stability.
You can scan your network to detect available Modbus nodes and inspect specific register values.
Open the configured Modbus IP Data Source.
Click Modbus Tools (located within the data source).
In the Device ID field, enter the ID of the device you want to scan.
Typical range is from 1 to 240.
Set the Register Range to choose which type of Modbus register to scan:
Coil Status (0x01): Read/write single bits (e.g., outputs).
Input Status (0x02): Read-only single bits (e.g., inputs).
Holding Register (0x03): Read/write 16-bit data registers.
Input Register (0x04): Read-only 16-bit registers (e.g., sensor values).
Offset:
This is the starting address of the register you want to read.
For example, an offset of 0 targets the first register in the selected range.
Number of Registers:
Specifies how many consecutive registers to read, starting from the offset.
Use this to pull multiple values in one scan.
Modbus Data Type:
Defines how Mango should interpret the raw register data.
Examples:
Two byte integer – standard 16-bit value.
Four byte float – used for temperature, pressure, etc.
BCD, String, and other types depending on device implementation.
Bit (Optional):
If you're scanning a register that contains multiple status bits, this lets you extract a specific bit.
Useful for discrete alarms or boolean flags.
Hex Offset:
Check this box if the offset is specified in hexadecimal format.
For example, 0x10 = decimal 16.
Click Start Scan to initiate the read.
After the scan completes, click Read Data to view the values.
If you want to import the result as a data point:
Click +Add Data Point to automatically create and add that point to your data source.
✅ Devices that successfully respond to the scan will be listed and available for further interaction or point creation.
Review all settings and click Save.
You can now begin adding data points to collect values from Modbus registers.