Frequently Asked Question

How can I use Modbus inside Typhoon HIL?
Last Updated 2 years ago

User can implement three diverse components related to Modbus communication protocol in Typhoon HIL Schematic editor:

  1. Modbus Device component implements Modbus TCP Server (Slave) functionality. There can be multiple Modbus device components in the Schematic editor model. All of them can have arbitrary IP addresses, but those addresses must be free and belong to the same subnetwork. There are some Modbus protocol configurations with multiple devices having the same register configurations and IP address. In those configurations, Slave ID plays a crucial role for routing the packages to/from appropriate Server device.
  2. Modbus Client component implements Modbus TCP Client (Master) functionality. The defined IP address for this component must be network free. One Client component can poll just one Server. For polling X number of Servers using just Modbus Client components, the user must add X number of Client components to the model. IP addresses of those multiple Client components must belong to the same subnetwork. In comparison with Modbus API based Client, which is executed on the PC, user can test Client instance faster utilizing Modbus Client component, since this component executes on the HIL device’s CPU. Modbus Client component allows direct connection with the plant model without utilizing SCADA and does not need scripts to be installed.
  3. SunSpec Modbus Device implements Modbus TCP Server (Slave) functionality according to SunSpec Alliance standards. SunSpec Modbus Device component is developed as a subsystem with the Modbus Device component underneath. For that reason, all the rules for setting up Modbus Device component are valid for the SunSpec Modbus Device component also.

All these three components are Signal processing based and expect Signal processing components at the inputs and outputs. These components are executed on embedded ARM processor of the HIL device. User can also implement Modbus Client functionality by utilizing Modbus API in HIL SCADA, Standalone HIL SCADA and standalone Python scripts.

Modbus communication protocol is supported by all HIL devices. In Virtual HIL mode, only Modbus Client configured through Modbus API in HIL SCADA is supported.

Typhoon HIL device can serve as both Modbus Client and Modbus Server. However, one HIL device can’t emulate Client and Server at the same time. To overcome this limitation, user can utilize Modbus API in HIL SCADA, Standalone HIL SCADA and standalone scripts to emulate Modbus Client. This is Python based API that runs on PC even without HIL device. When Modbus API is used for sending signals from SCADA to HIL device, user PC will be the Modbus client instance sending requests to the server in the HIL device. In this way, the user can have multiple Modbus Client entities. Frequently done error when using Modbus Client implemented through Modbus API and Modbus Server in Typhoon HIL Schematic Editor is setting the different IP address in Modbus Server component and IP address of Server component in Modbus Client script.

Modbus protocol is implemented as Modbus/TCP in Typhoon HIL toolchain. Nevertheless, it is possible to interface a HIL device with Modbus RTU by using Modbus RS485 adapter, which converts it from one type to another.

The user can simulate Modbus communication between multiple devices, which must be connected to the same Ethernet network. For example:

Modbus Client is emulated on the PC side. PC’s IP address is 192.168.0.1 and subnet mask is 255.255.255.0. Modbus Server emulated on HIL device must have IP address 192.168.0.x, where “x” can have integer value between 2 - 255. This IP address must be free in the network. An easy way to find the free network address is displayed here.

HIL device and Modbus Server component don’t need to be in the same subnetwork. This is valid also for HIL device and Modbus Client component. In fact, these components mustn’t have the same IP address as HIL device.

To find out more about Modbus protocol in Typhoon HIL toolchain, please enroll in Typhoon HIL Academy’s dedicated Modbus protocol course.

Please Wait!

Please wait... it will take a second!