Modbus Server / Configuring Modbus Server
In this video of our N3uron Academy, we’re going to show how easy it is to configure the Modbus Server module, to make our data model available through the Modbus protocol. Let’s get started!
[06:30] Configuring Modbus Server
[00:00] Hello everyone! In this video, we’re going to show how easy it is to configure the Modbus Server module, to make our data model available through the Modbus protocol. We’ll use a Tank as our example to demonstrate how to map some tags like tank level, level setpoint, valve command, and valve statuts to a Modbus device. Let’s begin by creating a new instance of the Modbus Server module. Navigate to the “Config” tab under the “System” section in the Navigation panel. Click on “Modules,” and then select “New module” from the menu. We’ll call this one “ModbusServer”, and set the Module type to “ModbusServer”. All the other settings can stay as they are, so let’s save the changes. Now that our module is created, we’ll select it from the modules list in the Explorer panel and proceed to create a new channel.
[01:03] This channel will represent the physical medium that one or more slave devices will use to communicate. Let’s name it “Tank Channel” and get to configuring it. First, we’ll enable data collection to keep the channel active. Next, choose the Modbus mode. You can pick either TCP for direct Ethernet communication, or RTU encapsulated for Ethernet-to-serial converters. For this setup, we are going with TCP. Now, we’ll focus on the Server section. The default port number is 502, so we’ll leave that as is. For the network interface, we’ll select “All interfaces” to make sure the server listens to all network adapters. Set “Max connections” to 0 for unlimited connections. Finally, leave the “Source IP addresses” blank for no restrictions, or enhance security by specifying IP addresses separated by commas in the whitelist.
[02:00] With these settings configured, go to the Devices section to add a device. Remember, you can add one or multiple devices. Enable data collection for the device and assign it a unique device address. Then, adjust the Modbus address offset, buffer sizes, and swap settings to ensure compatibility with your Modbus clients. If you want to, you can also enable status control to monitor the device status and alert clients of any issues. When active, it checks a control tag’s quality or value. If the quality is not “Good” or the value is not zero, the device rejects requests from the Modbus client and sends an error response. Let’s move on to tag mapping. We’ll create a map group and set up our tags for both read and write requests. You’ll define if you’re sharing the tag’s value, timestamp, or quality, set the Modbus address, and pick the data type. There’s also an option to set a fallback value if the tag’s quality isn’t good.
[03:03] Begin by mapping the Level tag, a 16-bit unsigned integer, to Modbus address 400001 as a Holding Register. Next, map Level_Setpoint to 400002, another 16-bit unsigned integer Holding Register. The read and write permissions for this tag have already been configured in the tag’s settings. Then, map the Valve_Command tag to 000001 as a Coil with a Boolean data type, with its read/write permissions also pre-configured in the tag settings.
[04:00] Finally, map Valve_Status to 000002, another Boolean Coil, that shows the valve’s status. These addresses follow the Modbus standard. For more details on addressing registers and coils, check the Web UI help section or visit our knowledge base. With the Modbus Server module fully configured, it’s time to test it out. First, let’s check the diagnostics to ensure everything is running smoothly. As we can see, the server is up and actively listening for requests on all interfaces, and the tag mappings are in place.
[05:10] To test our setup, we’ll connect to the Modbus server using a Modbus client. Keep in mind that different clients may use varying addressing methods, handle addressing a bit differently. While some use implicit offset addressing, N3uron’s Modbus Server relies on absolute Modbus addressing. For example, when configuring Holding Registers, address 400001 on the server might correspond to address 0 on the client, 400002 to 1, and so on. We’ll start by writing a value to the Level_Setpoint tag. Notice how the Level tag adjusts to match the new setpoint. Now let’s open the valve by switching the value of the Valve_Command tag.
[06:03] As the valve opens, the Valve_Status tag will update to show the valve’s status, and we’ll observe the Level decreasing as the tank empties. That’s all for this video. Thanks for watching, and see you in the next one!
N3uron software is an Industrial Edge Platform for IIoT and DataOps that streamlines the flow of data between industrial systems and business applications, either on-premise or in the cloud. N3uron provides an out-of-the-box solution for data standardization, normalization and contextualization, seamless integration with industrial and IT systems, efficient information management, and unparalleled scalability and security. The N3uron platform makes it easier for operations teams to aggregate, manage and analyze industrial data, resulting in enhanced productivity and informed decision-making. Whether you're looking to optimize your operations, reduce downtime or improve product quality, the N3uron platform is the answer.
CONTRIBUTING MEMBER
N3uron is a Contributing Member of the Eclipse Foundation, actively participating in the development of their robust ecosystem. By leveraging EF technologies, we offer innovative products and services that drive our corporate strategy forward. N3uron is Sparkplug Compatible Software.
DLMS® UA MEMBER
N3uron is a member of the DLMS® User Association, the global community that drives standardization in the energy and water industry. Being part of the DLMS UA represents N3uron's commitment to advancing smart metering and energy management solutions.
FOLLOW US
N3uron Connectivity Systems • Paseo de la Castellana, 91, 4º, 1; Madrid, 28046, Spain • +34 911 841 938 • [email protected]
N3uron software is an Industrial Edge Platform for IIoT and DataOps that streamlines the flow of data between industrial systems and business applications, either on-premise or in the cloud. N3uron provides an out-of-the-box solution for data standardization, normalization and contextualization, seamless integration with industrial and IT systems, efficient information management, and unparalleled scalability and security. The N3uron platform makes it easier for operations teams to aggregate, manage and analyze industrial data, resulting in enhanced productivity and informed decision-making. Whether you're looking to optimize your operations, reduce downtime or improve product quality, the N3uron platform is the answer.
CONTRIBUTING MEMBER
N3uron is a Contributing Member of the Eclipse Foundation, actively participating in the development of their robust ecosystem. By leveraging EF technologies, we offer innovative products and services that drive our corporate strategy forward. N3uron is Sparkplug Compatible Software.
CONTRIBUTING MEMBER
N3uron is a Contributing Member of the Eclipse Foundation, actively participating in the development of their robust ecosystem. By leveraging EF technologies, we offer innovative products and services that drive our corporate strategy forward. N3uron is Sparkplug Compatible Software.
FOLLOW US
N3uron Connectivity Systems • Paseo de la Castellana, 91, 4º, 1; Madrid, 28046, Spain • +34 911 841 938 • [email protected]
N3uron software is an Industrial Edge Platform for IIoT and DataOps that streamlines the flow of data between industrial systems and business applications, either on-premise or in the cloud. N3uron provides an out-of-the-box solution for data standardization, normalization and contextualization, seamless integration with industrial and IT systems, efficient information management, and unparalleled scalability and security. The N3uron platform makes it easier for operations teams to aggregate, manage and analyze industrial data, resulting in enhanced productivity and informed decision-making. Whether you're looking to optimize your operations, reduce downtime or improve product quality, the N3uron platform is the answer.
CONTRIBUTING MEMBER
N3uron is a Contributing Member of the Eclipse Foundation, actively participating in the development of their robust ecosystem. By leveraging EF technologies, we offer innovative products and services that drive our corporate strategy forward. N3uron is Sparkplug Compatible Software.
DLMS® UA MEMBER
N3uron is a member of the DLMS® User Association, the global community that drives standardization in the energy and water industry. Being part of the DLMS UA represents N3uron's commitment to advancing smart metering and energy management solutions.
FOLLOW US
N3uron Connectivity Systems • Paseo de la Castellana, 91, 4º, 1; Madrid, 28046, Spain • +34 911 841 938 • [email protected]