Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:sw:01-mervis:weintek-ip-series-hidden [2020/06/15 14:35] – [Connecting Mervis IDE to Weintek HMI device using the ModbusTCP/RTU protocol] avsetula | en:sw:01-mervis:weintek-ip-series-hidden [2025/11/04 07:21] (current) – typo ofojt | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| <WRAP group> | <WRAP group> | ||
| <WRAP half column 81%> | <WRAP half column 81%> | ||
| - | In this tutorial, we are going to demonstrate how to connect the Weintek iP series HMI device with UniPi controller running Mervis. | + | In this tutorial, we are going to demonstrate how to connect the Weintek iP series HMI device with Unipi controller running Mervis. |
| + | |||
| + | The goal of this tutorial is to display temperature measured by the 1-Wire temperature sensor connected to Unipi on the HMI display and have a touch button on the display that will turn the relay output of the Unipi ON and OFF. | ||
| </ | </ | ||
| <WRAP half column 15%> | <WRAP half column 15%> | ||
| ;;# | ;;# | ||
| - | < | + | < |
| < | < | ||
| - | < | + | < |
| + | < | ||
| + | < | ||
| ;;# | ;;# | ||
| </ | </ | ||
| </ | </ | ||
| - | |||
| - | The goal of this tutorial is to display temperature measured by the 1-Wire temperature sensor connected to UniPi on the HMI display and have a touch button on the display that will turn the relay output of the UniPi ON and OFF. | ||
| <WRAP center round important 85%> | <WRAP center round important 85%> | ||
| - | Do you need to communicat | + | Do you need to communicate |
| Check out our new tutorial describing connection of a **[[en: | Check out our new tutorial describing connection of a **[[en: | ||
| - | |||
| </ | </ | ||
| - | ===== Necessary equipment and setup ===== | + | |
| - | * UniPi Neuron controller with [[en: | + | <WRAP center round box> |
| + | < | ||
| + | * Unipi Neuron controller with [[en: | ||
| * [[https:// | * [[https:// | ||
| - | * [[https:// | + | * [[https:// |
| - | * 3 ethernet connections - one for UniPi controller, one for HMI and one for your PC | + | * 3 ethernet connections - one for Unipi controller, one for HMI and one for your PC |
| - | + | ||
| - | In this tutorial, we will use: | + | |
| + | \\ | ||
| + | < | ||
| * [[https:// | * [[https:// | ||
| * [[https:// | * [[https:// | ||
| * [[https:// | * [[https:// | ||
| + | </ | ||
| - | **Wiring of the test setup** | + | == Wiring of the test setup == |
| {{: | {{: | ||
| ===== Installation of software ===== | ===== Installation of software ===== | ||
| - | For basic configuration of the UniPi controller and installation of Mervis on your computer, please follow [[en: | + | For basic configuration of the Unipi controller and installation of Mervis on your computer, please follow [[en: |
| For configuration of the HMI we need to install the Weintek EasyBuilder Pro. You can download the version used in this tutorial [[files: | For configuration of the HMI we need to install the Weintek EasyBuilder Pro. You can download the version used in this tutorial [[files: | ||
| Line 70: | Line 74: | ||
| In the **New Numeric Object** dialog, we will set some description. The description acts as a comment - it will not be displayed anywhere on the HMI device. | In the **New Numeric Object** dialog, we will set some description. The description acts as a comment - it will not be displayed anywhere on the HMI device. | ||
| Since we want to display the temperature, | Since we want to display the temperature, | ||
| - | The **Read address** box is for mapping the **Numeric** object to some variable or register. Because we haven' | + | The **Read address** box is for mapping the **Numeric** object to some variable or register. Because we haven' |
| {{ : | {{ : | ||
| Line 83: | Line 87: | ||
| {{ : | {{ : | ||
| - | So far we have created simple window, which displays a numeric value of some register. To make this tutorial little bit more versatile, let's learn, how to create a button, which - in the end - will operate relay output on our UniPi. To do this, we have to place new object onto the window canvas, called **Set bit**. On **Object** panel, click on the **Set bit**. | + | So far we have created simple window, which displays a numeric value of some register. To make this tutorial little bit more versatile, let's learn, how to create a button, which - in the end - will operate relay output on our Unipi. To do this, we have to place new object onto the window canvas, called **Set bit**. On **Object** panel, click on the **Set bit**. |
| {{ : | {{ : | ||
| - | In the **New Set Bit Object** dialog you can fill the comment. The comment will not be shown anywhere in the window, it is just for your better orientation in the project. The box **Write address** looks very similar to the **Read address** block we saw in the **New Numeric object**. But in this instance, we point the output value of the button (ON/OFF, TRUE/FALSE) to some **bit** variable. In numeric object, we pointed it to **word** variable. Since we still didn't configure connection to UniPi, we will leave it as is. | + | In the **New Set Bit Object** dialog you can fill the comment. The comment will not be shown anywhere in the window, it is just for your better orientation in the project. The box **Write address** looks very similar to the **Read address** block we saw in the **New Numeric object**. But in this instance, we point the output value of the button (ON/OFF, TRUE/FALSE) to some **bit** variable. In numeric object, we pointed it to **word** variable. Since we still didn't configure connection to Unipi, we will leave it as is. |
| What we will change is the **Attribute**. This attribute sets how the button will output the value. We will change it to **Momentary**, | What we will change is the **Attribute**. This attribute sets how the button will output the value. We will change it to **Momentary**, | ||
| {{ : | {{ : | ||
| Line 105: | Line 109: | ||
| {{ : | {{ : | ||
| - | Let's download the project into HMI device. First, we need to get its IP address. The device in default settings gets IP address from DHCP server | + | Let's download the project into HMI device. First, we need to get its IP address. The device in default settings gets IP address from DHCP server |
| After acquiring the IP address, we can proceed with the actual download. On the **Ribbon** click on the **Project** and then click on **Download**. | After acquiring the IP address, we can proceed with the actual download. On the **Ribbon** click on the **Project** and then click on **Download**. | ||
| Line 112: | Line 116: | ||
| The only operation you have to do in the **Download** dialog is filling the IP address. Then hit **Download**. The HMI device will reboot and start your project. The result should look the same as in the simulation. The temperature will be 0 and pressing the button does nothing. | The only operation you have to do in the **Download** dialog is filling the IP address. Then hit **Download**. The HMI device will reboot and start your project. The result should look the same as in the simulation. The temperature will be 0 and pressing the button does nothing. | ||
| - | ===== Communication between HMI and UniPi===== | + | ===== Communication between HMI and Unipi===== |
| - | So far we have fully functional HMI design and now we have to connect it to UniPi. But first, we need to discuss the data exchange options we have. | + | So far we have fully functional HMI design and now we have to connect it to Unipi. But first, we need to discuss the data exchange options we have. |
| - | The HMI device can communicate with UniPi via two different protocols: | + | The HMI device can communicate with Unipi via two different protocols: |
| - ModbusTCP over ethernet | - ModbusTCP over ethernet | ||
| - ModbusRTU over two wire RS485 | - ModbusRTU over two wire RS485 | ||
| Line 121: | Line 125: | ||
| In Modbus protocol, the communication is always initialized by the master (client) device. The slave (server) device responds to the commands issued by the master. Master is the one who reads data from slave, or writes data to slave. | In Modbus protocol, the communication is always initialized by the master (client) device. The slave (server) device responds to the commands issued by the master. Master is the one who reads data from slave, or writes data to slave. | ||
| - | Since the UniPi and Weintek iP series HMI can act both as a master and slave, we have to decide which way to go. That depends on your application and overall logic of your system. In this tutorial, we will investigate both options and demonstrate the pros and cons. | + | Since the Unipi and Weintek iP series HMI can act both as a master and slave, we have to decide which way to go. That depends on your application and overall logic of your system. In this tutorial, we will investigate both options and demonstrate the pros and cons. |
| - | ==== UniPi as master, HMI as slave ==== | + | ==== Unipi as master, HMI as slave ==== |
| - | This is the traditional data exchange method. PLC downloads data from Modbus slaves (UniPi extensions, energy meters, | + | This is the traditional data exchange method. PLC downloads data from Modbus slaves (Unipi extensions, energy meters, |
| **Pros:** | **Pros:** | ||
| Line 131: | Line 135: | ||
| **Cons: | **Cons: | ||
| * The HMI has to be configured in Mervis as a Modbus slave device with complicated parsing of data | * The HMI has to be configured in Mervis as a Modbus slave device with complicated parsing of data | ||
| - | * The HMI doesn' | + | * The HMI doesn' |
| - | ==== HMI as master, | + | ==== HMI as master, |
| - | In this setup, the data exchange between HMI and UniPi is initiated by the HMI device. The HMI reads the temperature from UniPi, which shares this information via its ModbusTCP Server register. | + | In this setup, the data exchange between HMI and Unipi is initiated by the HMI device. The HMI reads the temperature from Unipi, which shares this information via its ModbusTCP Server register. |
| **Pros:** | **Pros:** | ||
| Line 144: | Line 148: | ||
| For the rest of the tutorial, we will use this method. | For the rest of the tutorial, we will use this method. | ||
| - | ===== Setting up the UniPi for sharing temperature and relay output ===== | + | ===== Setting up the Unipi for sharing temperature and relay output ===== |
| - | For the purposes of our demonstration, | + | For the purposes of our demonstration, |
| Next thing we need to configure is the temperature reading from 1-Wire temperature sensor. You can find it [[en: | Next thing we need to configure is the temperature reading from 1-Wire temperature sensor. You can find it [[en: | ||
| Line 151: | Line 155: | ||
| In order to share the temperature over ModbusTCP, you need to configure ModbusTCP server channel. We have a tutorial ready for this as well: [[en: | In order to share the temperature over ModbusTCP, you need to configure ModbusTCP server channel. We have a tutorial ready for this as well: [[en: | ||
| - | Now we need to clarify, what type of data we need to set in the Mervis ModbusTCP server. Modbus protocol knows only two types of data: 16bit registers for numeric values and 1bit " | + | Now we need to clarify, what type of data we need to set in the Mervis ModbusTCP server. Modbus protocol knows only two types of data: 16 bit registers for numeric values and 1 bit " |
| - | The temperature in the Mervis is represented as a real number - 32bit unsigned integer. To transfer this value via Modbus, we would need to split it into two 16bit registers and put them together on the HMI side, which is out of the scope of this tutorial. But we can convert the real temperature value to roughly fit the 16bit register. Let's assume we measure room temperature, | + | The temperature in the Mervis is represented as a real number - 32 bit unsigned integer. To transfer this value via Modbus, we would need to split it into two 16 bit registers and put them together on the HMI side, which is out of the scope of this tutorial. But we can convert the real temperature value to roughly fit the 16 bit register. Let's assume we measure room temperature, |
| {{ : | {{ : | ||
| Line 158: | Line 162: | ||
| On the input side, we have variable '' | On the input side, we have variable '' | ||
| - | The actual temperature if 26.8125°C. We multiply it by 10 in the '' | + | The actual temperature if 26.8125 °C. We multiply it by 10 in the '' |
| We cheated the measured values a bit, but for our purposes, it works OK. Now we can export this variable in ModbusTCP server. In Mervis, double click on the ModbusTCP server device. | We cheated the measured values a bit, but for our purposes, it works OK. Now we can export this variable in ModbusTCP server. In Mervis, double click on the ModbusTCP server device. | ||
| Line 181: | Line 185: | ||
| {{ : | {{ : | ||
| - | Deploy the solution and start the UniPi controller in **Full mode**. | + | Deploy the solution and start the Unipi controller in **Full mode**. |
| ===== Setting the HMI to read data from Mervis ===== | ===== Setting the HMI to read data from Mervis ===== | ||
| Line 199: | Line 203: | ||
| {{ : | {{ : | ||
| - | In the dialog **IP address settings** set the parameters that you have setted | + | In the dialog **IP address settings** set the parameters that you have set in the ModbusTCP server settings in Mervis. Confirm all the dialogs by clicking on **OK** until you will see the main window. |
| {{ : | {{ : | ||
| - | Now that we have the connection configured, we need to point the **Numeric** and **Set bit** objects to the correct devices and registers. Double click on the temperature **Numeric** object. In the **Numeric Object' | + | Now that we have the connection configured, we need to point the **Numeric** and **Set bit** objects to the correct devices and registers. Double click on the temperature **Numeric** object. In the **Numeric Object' |
| {{ : | {{ : | ||
| Line 217: | Line 221: | ||
| {{ : | {{ : | ||
| - | The last missing step is the address on the button. Double click the button and on the **Set Bit Object' | + | The last missing step is the address on the button. Double click the button and on the **Set Bit Object' |
| {{ : | {{ : | ||