iRidi for Modbus
Tools for creating interfaces to control Modbus-compatible equipment description
Documentation updated 07.5.2026
iRidi for Modbus is a set of tools for creating an interface to control a home or office based on Modbus-compatible equipment.
iRidi connects to the controller as a Modbus Master; the controller is always a Slave. Modbus TCP, RTU, and ASCII are supported (RS232 operation is possible). To connect to an OPC server, you can use the Modbus Server driver, which operates as a Slave, but this mode is not suitable for use with a PLC.
iRidi for Modbus licensing: details
Connection
Equipment configuration and settings required for iRidi to control a Modbus-compatible PLC.
PLC connection methods
Different ways of connecting to a PLC require different drivers in iRidi.
- Modbus TCP / Modbus TCP Server

- Modbus TCP / Modbus TCP to RTU / Modbus TCP to ASCII

-
A connection using the client-server model, where i3 pro is the Master and initiates transactions to the Slave controller. No additional hardware is needed to work with the controller because it has an Ethernet interface.
-
The same data transfer model is used, but a TCP/IP to Modbus RTU/ASCII converter is required. Any gateway of this type can serve as the converter (Moxa, ICP-DAS, etc.)
If you use Modbus, take its characteristics into account:
- PLCs often limit the number of simultaneous connections. Make sure your controller supports the required number of connections at a time
- Do not add registers that are not configured on the PLC to the project; this causes control delays
- Increase the controller's Update Time if its performance degrades when iRidi connects
- By default, iRidi sends fc5 and fc6 commands (single coil, single register) to Coil and Holding registers. If the controller does not support these commands, it must return error 01 (illegal function), after which iRidi automatically switches to fc15 and fc16 (multiple coils, multiple registers). If the controller does not return error 01, the switch to fc15 and fc16 does not occur! Configure the controller to work with fc5 and fc6 (single coil, single register) if register control does not work but feedback is received from the controller.
Communication modes:
- Modbus TCP - driver for connecting directly to a controller via Modbus TCP, without additional hardware or software. iRidi is the Master; the controller is the Slave;
- Modbus TCP to RTU and Modbus TCP to ASCII - drivers for connecting to a controller through a TCP/IP to Modbus RTU (ASCII) converter. iRidi is the Master; the controller is the Slave;
- Modbus RTU and Modbus ASCII - drivers for connecting to a controller via Modbus RTU or ASCII using RS232/RS485 serial networks. The iRidi application with these drivers can run only on a device physically connected to the controller through a serial data port. iRidi is the Master; the controller is the Slave;
- Modbus Server - connects iRidi to an OPC server via Modbus TCP. iRidi is the slave; the OPC server is the master. This cannot be used with a regular PLC because Modbus variables on the Slave side are reset each time iRidi starts (the PLC must be protected against variables being reset when the application restarts). With the Modbus Server driver, data should be placed in feedback channels; command channels are not used.
Contact iRidi technical support for more detailed recommendations.
Importing Modbus addresses into iRidi
Modbus in iRidi lets you control many controllers from different manufacturers. The universal data import system lets you create a list of commands and feedback channels for the Modbus driver in an Excel spreadsheet. The CSV spreadsheet is added to the iRidi project as a new driver:

- The blue block specifies the IP address, port, and transaction frequency for a Modbus TCP controller connection. If you use another driver, copy its name from GUI Editor and enter it in the template's first row instead of MODBUS TCP (TCP);
- The green block lists the Commands to create in the project's device tree. Each row is a command with a name and settings (for more information about the settings, see the general description in "Sending commands and reading data via Modbus");
- The orange block lists the Feedbacks to create in the project's device tree. Each row is a feedback channel with a name and settings (for more information about the settings, see the general description in "Sending commands and reading data via Modbus").
After creating the command and feedback channel lists, save the Excel spreadsheet as *.CSV :

This creates a file ready to import into iRidi. Open iRidi GUI Editor, create a new project, and use File > Import. Select the CSV file you created and confirm the data import into your project.
Commands & Feedbacks
The import produces two levels of PLC settings:
- Modbus TCP - the driver containing the list of PLC registers;
- Commands and Feedbacks - commands and feedback channels within devices that let you control Modbus registers. Commands are writable registers; feedback channels are readable registers.
Commands and feedback channels must be linked to the project's graphic items to control equipment:
- Bind a command to a graphical item and specify the value to send to the register when the item is pressed;
- Bind a feedback channel to a graphical item to display the register state.
To link a command or channel to a graphic item, use drag&drop - dragging an object onto another.
Examples of commands for controlling different register types are shown below.
iRidi supports the following registers and functions:
- Coil Register (0x05, 0x0F, 0x01) - flag registers, one bit, read and write;
- Holding Register (0x06, 0x10, 0x03) - holding registers, 16-bit word, read and write;
- Discret Inputs (0x02) - discrete inputs, one bit, read-only;
- Input Register (0x04) - input registers, 16-bit word, read-only.
Word Size - the word length sent to the controller, up to 32 bits:
- Word (16-bit) - 16-bit word corresponding to the standard Modbus protocol;
- Word(16 bit) unsigned - unsigned 16-bit word corresponding to the standard Modbus protocol;
- DWord (32-bit) - 32-bit word consisting of two standard Word registers;
- Float (32-bit) - 32-bit word supporting floating-point values;
- Dword(32 bit) unsigned - unsigned 32-bit word consisting of two standard Word registers.
- If the project contains 32-bit registers and SinglePoll is enabled in the subdevice properties, command and feedback addresses must be spaced 2 units apart (for example, addresses 2, 4, 6, 9, 11 are allowed, but 2, 3, 4, 6, 7, 8 are not).
Content Type - classification by data write order and size:
For 16 bits:
- Low Endian - byte order used by the standard Modbus protocol. Data is written from the least significant byte to the most significant byte (b1, b2);
- Big Endian - data is written from the most significant byte to the least significant byte (b2, b1).
For 32 bits:
- Swapped Big Endian - byte order used by the standard Modbus protocol. Data is written from the least significant byte to the most significant byte (b1, b2, b3, b4);
- Swapped Low Endian - data is written from the most significant byte to the least significant byte (b4, b3, b2, b1);
- Low Endian and Big Endian - byte order follows the definitions above, but the bytes in each word are swapped in pairs (for Low Endian - b3, b4, b1, b2, for Big Endian b2, b1, b4, b3).
The driver sends and receives data based on the Commands and Feedbacks lists. The transaction frequency is specified in the connection settings.
Configuring the PLC connection
Select the default connection settings. You can change them while working on the project.
Modbus TCP / Modbus TCP to RTU / Modbus TCP to ASCII / Modbus TCP Server:

- Host - PLC IP address (IPv4).
- Port - PLC TCP connection port (usually 502).
- Keep Alive - TCP connection check interval. If there is no response to a Keep Alive request, the driver is forced into the disconnected state. This setting ensures that the online status is displayed correctly if the client disconnects unexpectedly or incorrectly. 0 disables the setting.
- Update Time (ms) - PLC polling interval for updating its status data.
- Coil Write Function - discrete command write mode (Single - write one coil register, Multiple - write multiple coil registers).
- Holding Write Function - output register command write mode (Single - write one register, Multiple - write multiple registers).
For Internet operation, specify the public IP address of the router to which the controller is connected and configure forwarding for the control port (Port Forwarding).
You can find the router's public IP address using, for example, Yandex.Internet
Modbus RTU / Modbus ASCII:

- Log Level - logging level.
- Host - number of the COM port connected to the controller.
- Used with iRidi device - sets the host for the corresponding equipment (the Host field is disabled when this option is selected).
- Update Time (ms) - interval at which iRidi requests changes in the controller variable states. Recommended values: 1000...2000 ms.
- Baud Rate - controller communication speed.
- Data Bits - number of data bits in a frame.
- Parity is the parity check.
- Stop Bits - stop bits in a frame (1; 1,5; 2).
The web interface displays stop bits as follows:
| iRidi studio: | Web interface: |
|---|---|
| 1 | 0 |
| 1,5 | 1 |
| 2 | 2 |
- Coil Write Function - send a separate packet to write each register (Single - write one coil register, Multiple - write multiple coil registers).
- Holding Write Function - output register command write mode (Single - write one register, Multiple - write multiple registers).
- Silent Period (ms) - pause between sending commands, maximum value: 20 ms.
RS232 works only on a device physically connected to the PLC through a COM port or with a virtual COM port for communicating with the PLC,
Modbus TCP Network

- Log Level - logging level.
- Host - PLC IP address (IPv4)
- Port - PLC TCP connection port (usually 502)
- Wait for Data (ms) - wait for a response from the driver. Reconnects the driver after the specified time.
- Keep Alive - TCP connection check interval. If there is no response to a Keep Alive request, the driver is forced into the disconnected state. This setting ensures that the online status is displayed correctly if the client disconnects unexpectedly or incorrectly. 0 disables the setting.
- Update Time (ms) - PLC polling interval for updating its status data.
- Coil Write Function - send a separate packet to write each register. Single - write one coil register, Multiple - write multiple coil registers).
- Holding Write Function - output register command write mode (Single - write one register, Multiple - write multiple registers).
- Single Poll - when enabled, a separate packet is created to poll each subdevice channel.
- Send wait time - pause between subdevice polling attempts. The number of attempts is specified in the subdevice's "Number of attempts" field.
Subdevices now have a Change Write Function parameter. Enabling it makes additional subdevice settings available: Coil Write Function and Holding Write Function .
Modbus RTU Network / Modbus ASCII Network

- Log Level - logging level.
- Host - COM port address.
- Wait for Data (ms) - overall wait for a response from the driver. Reconnects the driver after the specified time.
- Used with iRidi device sets the host for the corresponding equipment (selecting this parameter disables the Host field);
- Update Time (ms) - PLC polling interval for updating its status data.
- Baud Rate - controller communication speed.
- Data Bits - number of data bits in a frame.
- Parity is the parity check.
- Stop Bits - stop bits in a frame (1; 1,5; 2).
The web interface displays stop bits as follows:
| iRidi studio: | Web interface: |
|---|---|
| 1 | 0 |
| 1,5 | 1 |
| 2 | 2 |
- Coil Write Function - send a separate packet to write each register (Single - write one coil register, Multiple - write multiple coil registers).
- Holding Write Function - output register command write mode (Single - write one register, Multiple - write multiple registers).
- Single Poll - when enabled, a separate packet is created to poll each subdevice channel.
- Send wait time - pause between subdevice polling attempts. The number of attempts is specified in the subdevice's "Number of attempts" field.
- Silent Period (ms) - pause between sending commands, maximum value: 20 ms.
Changing connection settings
You need to change connection parameters when you disconnect from the automation site's Wi-Fi network and start using 3G or another Wi-Fi network. For control to continue working, switch from the local IP address to the Internet router's public IP address.
Switching is not automatic; you need to press the connection mode selection button. For remote access, the automation system's control ports must be made public. To do this, configure Port Forwarding on the Internet router. A VPN can provide a secure connection.
-
Download the template (*.js) (right-click and save the target), then add it to the script editor using (+) Add Script from file
-
Configure the script parameters as shown in the example:
function Internal_1() {
IR.GetDevice("Modbus TCP").SetParameters({Host: "192.168.0.100", Port: 502, UpdateTime: 1000});
}
function External_1() {
IR.GetDevice("Modbus TCP").SetParameters({Host: "215.110.10.10", Port: 502, UpdateTime: 1000});
}
Copy the driver name from the device panel; copy the parameter list exactly as shown in the example.
- Select the button that will switch between the Internal and External parameters. Open the macros editor for the Press event (Object Properties > Programming), select the Script call command, and double-click to add it. Select the name of the function the button will call:

Each button press now applies the corresponding connection settings.
PLC specifics
Insyte Spyder II
To use Modbus TCP with the SPIDER 2 controller, enable this protocol in the controller's network settings on the Ethernet tab. Sample configuration:
-
Make sure the SPIDER 2 controller has firmware 1.40 or later; otherwise, significant communication delays and problems with Coil registers may occur.
-
When creating commands, offset addresses by "-1" relative to INSYTE: SPIDER 2 register addresses start at 1, while iRidi addresses start at zero.
-
To address SPIDER 2 VARIABLES, use the formula:
Address = 1000 + [slot number]*2
Every variable has a slot number, visible when you hover over the variable. Type: Holding Register, Word Size: Dword(32-bit)
- To send IR commands, use:
Address = IR emitter number
Value = IR command number
Beckhoff
Modbus/ADS memory map for Beckhoff CX8090:
| Modbus areas | Modbus address (HEX) | Modbus address (DEC) | ADS area | |
|---|---|---|---|---|
| Digital inputs | 0x0000 - 0x7FFF | 0 - 32767 | Index group: 0xF021 - process image of physical inputs (bit access) | Index offset: 0x0 |
| 0x8000 - 0x80FF | 32768 - 33023 | Name of the variables in PLC program: .mb_Input_Coils | Data type: ARRAY [0..255] OF BOOL | |
| Digital outputs (coils) | 0x0000 - 0x7FFF | 0 - 32767 | Index group: 0xF031 - process image of physical outputs (bit access) | Index offset: 0x0 |
| 0x8000 - 0x80FF | 32768 - 33023 | Name of the variables in PLC program: .mb_Output_Coils | Data type: ARRAY [0..255] OF BOOL | |
| Input registers | 0x0000 - 0x7FFF | 0 - 32767 | Index group: 0xF020 - process image of physical inputs | Index offset: 0x0 |
| 0x8000 - 0x80FF | 32768 - 33023 | Name of the variables in PLC program: .mb_Input_Registers | Data type: ARRAY [0..255] OF WORD | |
| Output registers | 0x0000 - 0x2FFF | 0 - 12287 | Index group: 0xF030 - process image of physical outputs | Index offset: 0x0 |
| 0x3000 - 0x5FFF | 12288 - 24575 | 0x4020 - PLC memory area | 0x0 | |
| 0x6000 - 0x7FFF | 24576 - 32767 | 0x4040 - PLC data area | 0x0 | |
| 0x8000 - 0x80FF | 32768 - 33023 | Name of the variables in PLC program: .mb_Output_Registers | Data type: ARRAY [0..255] OF WORD |
Read/Write Holding Registers:
- iPad1 AT %MB0 : WORD; (address 12288)
- iPad2 AT %MB1 : WORD; (address 12289)
Read/Write Coils. Create an mb_Output_Coils array in global_var
- mb_Output_Coils AT %QB1000 : ARRAY[0..255] OF BOOL;
- Create the variables:
- iPad1 AT %QX1000.0 : BOOL; (address 32768)
- iPad2 AT %QX1001.0 : BOOL; (address 32769)
- iPad3 AT %QB1002 : ARRAY[0..5] OF BOOL; (address 32770-32775)
- iPad3 AT %QB1007 : ARRAY[0..5] OF BOOL; (address 32775-32780)
Modbus/ADS memory map for Beckhoff BC9хх0:
See the controller documentation for the Modbus memory map. The Modbus address of a programmatically created Read/Write Holding Registers controller variable is calculated using the formula:
Address = 16384 + 12 = 16395- 16384 - start of the %MB area (0x4000-0x47FF)
- 12 - variable index (a variable property)
OWEN
When configuring the controller, add its TCP connection port to the FIX parameter. The default is 502. One port supports one TCP master connection (iRidi client).
Modbus register numbers can be found from addresses such as %QB7.1.5:
Address = %QB7.1.5 - 1 = 5 - 1 = 4
The last digit of the address minus one is the register number to specify in iRidi.
Aligning CoDeSys variables in the Modbus memory area:
Variables of 8 bits, 2 bytes, and 4 bytes must be placed only at specific addresses. A 4-byte variable's address is a multiple of 4; a 2-byte variable's address is a multiple of 2; a 1-byte variable's address is a multiple of 1 and can be anywhere in memory. For example, if the first variable is a byte, it is placed at address 0х00, the next at 0х01, and so on. If a 4-byte variable follows, it must be placed at 0х04, and so on. If a one-byte variable occupies an address that is a multiple of four, the next 4-byte variable occupies the next address that is a multiple of 4. Variables can be declared in any order; alignment places them at addresses that are multiples of their lengths. This creates unused memory spaces that the user must account for when polling the device. These spaces are accounted for when declaring variables.
Adding and configuring subdevices
You can add the required number of subdevices to a Network driver. Each subdevice can represent a separate equipment type (lighting, air conditioner, etc.). To add a subdevice, left-click the added driver (network) and select Add subdevice > Custom .


Subdevice settings:
- Name - the subdevice name;
- Driver Type is the driver type;
- Device ID - individual device identifier;
- Number of attempts - number of attempts to poll a subdevice if it does not respond;
- Skip to recovery - number of polling cycles to skip if the subdevice does not respond (after the "Number of attempts" polling attempts have finished);
- Change Write Function - enables or disables the "Coil Write Function" and "Holding Write Function" settings. When enabled, the subdevice settings are used; when disabled, the network's general "Coil Write Function" and "Holding Write Function" settings are used; *Coil Write Function - send a separate packet to write each register. Single - write one coil register, Multiple - write multiple coil registers); *Holding Write Function - output register command write mode (Single - write one register, Multiple - write multiple registers);
- Single Poll - enables separate register polling (when disabled, adjacent registers are polled in one packet; when enabled, each register is polled in a separate packet).
Feedback:
| Parameter | Value | Description |
|---|---|---|
| Pollerror | 0 1 | Polling is successful; the device is available. A packet containing an error was received, or the device response timeout expired |
The Network token is 1 if at least one feedback value of any subdevice is 1; otherwise, it is 0.
Controlling registers

To control equipment, configure Commands and Feedbacks. To send a command, drag it onto a graphical item and specify the Value to send. To display feedback, drag the Feedback onto a graphical item and specify how to display its Value.
For more information about graphical items, see Graphical item types.
The available command, channel, and graphical item settings are shown below:
Coil
Command:
| Parameter | Value | Description |
|---|---|---|
| Type | Coil | Read/write coil register |
| Address | 0 .. n | Register address in decimal format |
| Value * | 0 .. 1 | 0 = Off, 1 = On |
/* specify when dragging the command onto a graphical item
Feedback:
The settings are the same as for a command. Value is received by Feedback and can be used to display register states on items
Holding
Command:
| Parameter | Value | Description |
|---|---|---|
| Type | Holding Register | Read/write holding register |
| Address | 0 .. n | Register address in decimal format |
| Word Size | Word(16 bit) | 16-bit word corresponding to the standard Modbus protocol |
| Word(16 bit) unsigned | Unsigned 16-bit word corresponding to the standard Modbus protocol | |
| DWord (32-bit) | 32-bit word consisting of two standard Word registers | |
| Float (32-bit) | 32-bit floating-point word | |
| DWord(32 bit) unsigned | Unsigned 32-bit word consisting of two standard Word registers | |
| Content Type use the appropriate "Content Type" for each equipment type | Low Endian | Data is written from the least significant byte to the most significant byte (b1, b2, b3, b4) |
| Big Endian | Data is written from the most significant byte to the least significant byte (b4, b3, b2, b1) | |
| Swapped Low Endian, Swapped Big Endian | Bits in each word are swapped in pairs (Swapped Low Endian - b3, b4, b1, b2; Swapped Big Endian - b4, b3, b2, b1) | |
| Value * | Word Size | Value according to the selected word size |
| 0 .. 65535 | Word(16 bit) unsigned | Unsigned 2 bytes |
| -32768 .. 32767 | Word(16 bit) | Signed 2 bytes |
| 0 ... 4294967295 | DWord(32 bit) | Unsigned 4 bytes |
| -2147483648 .. 2147483647 | DWord(32 bit) | Signed 4 bytes |
| -2147483648.0 .. 2147483647.0 | Float(32 bit) | 4 floating-point bytes |
| 0 ... 4294967295 | DWord(32 bit) unsigned | Unsigned 4 bytes |
Feedback:
The settings are the same as for a command. Value is received by Feedback and can be used to display register states on items
Discrete Inputs
Feedback:
| Parameter | Value | Description |
|---|---|---|
| Type | Discrete Inputs | Read-only discrete input |
| Address | 0 .. n | Register address in decimal format |
| Value * | 0 .. 1 | 0 = Off, 1 = On |
/* Value is received by Feedback and can be used to display the register state on items
Input Register
Feedback:
| Parameter | Value | Description |
|---|---|---|
| Type | Input Register | Read-only input register |
| Address | 0 .. n | Register address in decimal format |
| Word Size | Word(16 bit) | 16-bit word |
| DWord (32-bit) | 32-bit word consisting of two standard Word registers | |
| Float (32-bit) | 32-bit floating-point word | |
| Content Type | Low Endian | Data is written from the least significant byte to the most significant byte (b1, b2, b3, b4) |
| Big Endian | Data is written from the most significant byte to the least significant byte (b4, b3, b2, b1) | |
| Swapped Low Endian, Swapped Big Endian | Bits in each word are swapped in pairs (Swapped Low Endian - b3, b4, b1, b2; Swapped Big Endian - b4, b3, b2, b1) | |
| Value * | Word Size | Value according to the selected word size |
| 0 .. 65535 | Word(16 bit) | Unsigned 2 bytes |
| -32768 .. 32767 | Word(16 bit) | Signed 2 bytes |
| 0 ... 4294967295 | DWord(32 bit) | Unsigned 4 bytes |
| -2147483648 .. 2147483647 | DWord(32 bit) | Signed 4 bytes |
| -2147483648.0 .. 2147483647.0 | Float(32 bit) | 4 floating-point bytes |
/* Value is received by Feedback and can be used to display the register state on items
Monitoring
The server's web interface shows all information about controller values sent and received over a specified period. To open monitoring, go to the server's web interface and select WORK > Drivers > Monitoring. Monitoring works for both TCP and RTU drivers.

Monitoring example for Modbus RTU Network :

- Start log - starts logging (disabled by default);
- Stop log - stops logging (the log remains in the workspace);
- SAVE TO CSV - saves the log to an Excel spreadsheet;
- Disable Scroll: - disables log list scrolling;
- Clear - clears the log. Data is cleared automatically when it reaches 1000 entries;
- Date/time - entry date and time (the polling interval is specified in the driver settings);
- Log level - logging level (specified in the driver settings);
- Command Type is the command type:
- RECEIVE - records a response from the equipment (feedback);
- SEND - records a request from the driver to the equipment (command);
- Value - value sent / received (the equipment sends a packet containing the device address, function type, and value in hexadecimal)
RGB lighting
Color Picker converts the color selected on a palette into red, green and blue component values. In the general Modbus example, these values are sent to three Holding registers; brightness is sent to a separate register.
The following is a general Modbus example with separate R, G and B registers. For Arlight, use the palette setup in this section, but send commands using the dedicated code in Setting up the RGB palette in the Arlight article. The general example does not replace the Arlight register map or code.
Creating the palette and color display item
- Create a Joystick graphical item. In the Image field, select a color palette image. The joystick detects the color under the cursor; the cursor itself can be invisible.
- Set both the X and Y axes to a range from 0 to 100. Configure the other settings as shown in the image.

- Create a Trigger Button with 2 states. The item turns the strip on and off and displays the selected color when the strip is on.

General Modbus example: commands and script
In the Modbus device tree, create 4 commands with the Holding Register type. Link them to the red, green, blue and brightness registers of your LED strip.
In Script Editor, add a script from a file or create a new one. The name of a new script must not consist entirely of digits. Paste the Color Picker module code:
function work_pick_color(in_color_picker, in_color_resipient, in_sRed, in_sGreen, in_sBlue)
{
var device = IR.GetDevice("ModBus TCP"); // ModBus TCP Driver in your Project Device Tree
var color = in_color_picker.PickColor;
var red = (color >> 24) & 0xFF;
var green = (color >> 16) & 0xFF;
var blue = (color >> 8) & 0xFF;
in_color_resipient.GetState(1).FillColor = color;
device.Set(in_sRed, red);
device.Set(in_sGreen, green);
device.Set(in_sBlue, blue);
}
// Обработчик "DMX 1". Скопируйте этот модуль, чтобы управлять еще одним ColourPicker:
IR.AddListener(IR.EVENT_ITEM_RELEASE,
IR.GetItem("Page_ColorPicker").GetItem("Item Color Picker 1"), // Color Picker (Page.Item)
function()
{
work_pick_color(
IR.GetItem("Page_ColorPicker").GetItem("Item Color Picker 1"), // Color Picker (Page.Item)
IR.GetItem("Page_ColorPicker").GetItem("Item Display Color 1"), // Display Colour Item (Page.Item)
"R", // Red Channel
"G", // Green Channel
"B"); // Blue Channel
}
);
Configure the following names in the script:
- the Modbus driver in the project tree;
- the page and Color Picker palette item;
- the Display button;
- the Red, Green and Blue channels, which receive color component values in the range from 0 to 255.
Link the brightness control command to the trigger button's Press event and enable Add a Feedback Channel in the same dialog.