Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:sw:01-mervis:connecting-to-unipi-extension-hidden [2020/02/26 08:50]
jan_kozak
en:sw:01-mervis:connecting-to-unipi-extension-hidden [2021/08/05 12:30] (current)
avsetula
Line 1: Line 1:
 ====== Connecting to Unipi extension ====== ====== Connecting to Unipi extension ======
 +<WRAP group>
 +<WRAP half column 81%>
 The Unipi extensions are a convenient way how to extend the number of inputs and outputs at one location or make accessible at another one.  The Unipi extensions are a convenient way how to extend the number of inputs and outputs at one location or make accessible at another one. 
  
 The communication between controller and extension is via RS485 ports. The extension acts as a Modbus slave, which has extended support in the Mervis. ​ The communication between controller and extension is via RS485 ports. The extension acts as a Modbus slave, which has extended support in the Mervis. ​
 +</​WRAP>​
 +<WRAP half column 15%>
 +;;#
 +<​html><​span class="​dev-tag dev-patron">​Patron</​span></​html>​ \\
 +<​html><​span class="​dev-tag dev-neuron">​Neuron</​span></​html>​ \\
 +<​html><​span class="​dev-tag dev-gate">​Gate</​span></​html>​ \\
 +<​html><​span class="​dev-tag dev-axon">​Axon</​span></​html>​ \\
 +<​html><​span class="​dev-tag dev-extens">​Extension</​span></​html>​
 +;;#
 +</​WRAP>​
 +</​WRAP>​
  
 ===== HW connection ===== ===== HW connection =====
Line 9: Line 22:
 {{:​cs:​sw:​01-mervis:​connecting-the-unipi-extension-01-hw-connection.png|}} {{:​cs:​sw:​01-mervis:​connecting-the-unipi-extension-01-hw-connection.png|}}
  
-For communication to work, you have to have identical serial port parameters on both sides - speed, data bits, stop bits and parity. ​ Also, each extension unit has to have unique Modbus address. You can set those in two ways: by HW DIP switches or in the Mervis. +===== Module addressing and communication parameters ===== 
- +{{page>en:hw:04-extensions-communication-hidden}}
-==== DIP switches ​==== +
-The DIP switches are small levers, which can be pushed down, or pulled up. When the lever is pushed down, the function is enabled. +
- +
-{{:cs:sw:01-mervis:​dipswitch.png|}} +
- +
-On model xS10, xS30 and xS40, you can set the speed, parity and address by DIP switches. On the xS50, only the DIP switches for address are present on the unit. +
- +
-The first DIP switch is called **RS485-END**. It is for connecting and disconnecting internal 120ohm resistor between RS485-A and RS485-B for proper termination of the RS485 bus. You will have to enable this option when the extension is the last device on the bus. Typically, this applies to very long buses, over several 100s of meters. +
- +
-The second DIP switch is omitted, without any function. +
- +
-The third to sixth DIP switch is for setting address. With these switches, you can set address from 0 - 15 in binary format. +
- +
-^ Address ^ DIP sw. 3 ^ DIP sw. 4 ^ DIP sw. 5 ^ DIP sw. 6 ^ +
-| 0       | OFF       | OFF       | OFF       | OFF       | +
-| 1       | ON        | OFF       | OFF       | OFF       | +
-| 2       | OFF       | ON        | OFF       | OFF       | +
-| 3       | ON        | ON        | OFF       | OFF       | +
-| 4       | OFF       | OFF       | ON        | OFF       | +
-| 5       | ON        | OFF       | ON        | OFF       | +
-| 6       | OFF       | ON        | ON        | OFF       | +
-| 7       | ON        | ON        | ON        | OFF       | +
-| 8       | OFF       | OFF       | OFF       | ON        | +
-| 9       | ON        | OFF       | OFF       | ON        | +
-| 10      | OFF       | ON        | OFF       | ON        | +
-| 11      | ON        | ON        | OFF       | ON        | +
-| 12      | OFF       | OFF       | ON        | ON        | +
-| 13      | ON        | OFF       | ON        | ON        | +
-| 14      | OFF       | ON        | ON        | ON        | +
-| 15      | ON        | ON        | ON        | ON        | +
- +
-The seventh switch is for setting speed of the serial bus between **19200bps** (''​OFF''​ state) or **9600bps** (''​ON''​ state). +
- +
-The eighth switch is for setting parity of the serial bus between **Even** (''​OFF''​ state) or **None** (''​ON''​ state). +
- +
-<WRAP center round info 60%> +
-The xS50 has DIP switches only for the address. Other parameters of the serial port have to be configured in the software. The default settings are as follows: **19200, 8 data bits, 1 stop bit and no parity**. +
-</​WRAP>​ +
- +
-==== Software settings ==== +
-The connection parameters can be also set in Mervis. The HW settings take precedence, so to SW settings take place **you have to set the address to 0**. The rest will be described [[#​reconfiguration_of_the_unipi_extension|later]] in this tutorial.+
  
-===== Using UniPi extension in the Mervis ===== +===== Using Unipi extension in the Mervis ===== 
-Let's assume you have a basic project in **Full mode**, you are attached to the controller, you have **Executable project** with one **FBD** program and this program is configured as a sole **Task** of the PLC. And you **Set Autogen** on the UniPi device. Your workspace should look like this:+Let's assume you have a basic project in **Full mode**, you are attached to the controller, you have **Executable project** with one **FBD** program and this program is configured as a sole **Task** of the PLC. And you **Set Autogen** on the Unipi device. Your workspace should look like this:
  
 {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-02-workspace.png?​direct |}} {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-02-workspace.png?​direct |}}
Line 80: Line 52:
 </​WRAP>​ </​WRAP>​
  
-To autodetect the devices, right-click on the channel name in **Left panel** and in the context menu click on the **UniPi - Modules autodetect**.+To autodetect the devices, right-click on the channel name in **Left panel** and in the context menu click on the **Unipi - Modules autodetect**.
  
 {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-07-autodetect.png?​direct |}} {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-07-autodetect.png?​direct |}}
Line 88: Line 60:
 {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-08-switch-to-commisioning.png?​direct |}} {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-08-switch-to-commisioning.png?​direct |}}
  
-Next dialogue will ask you for the range of Modbus ID's the autodetect will look for. You can leave the default 1 - 15.+Next dialogue will ask you for the range of Modbus ID's the autodetect will look for. You can leave the default 1-15.
  
 {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-09-id-range.png?​direct |}} {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-09-id-range.png?​direct |}}
Line 125: Line 97:
 {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-15-changed-properties.png?​direct |}} {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-15-changed-properties.png?​direct |}}
  
-To save these settings, you need to configure the module. Right-click on the extension in the **Left panel** and in the context menu, click on **UniPi - Configure module**.+To save these settings, you need to configure the module. Right-click on the extension in the **Left panel** and in the context menu, click on **Unipi - Configure module**.
  
 {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-16-configure-module.png?​direct |}} {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-16-configure-module.png?​direct |}}
Line 141: Line 113:
 Now that we changed the configuration of extension, we need to do changes in the project as well. Remember, that our ModbusRTU channel is configured to 19200bps. We need to change it to 115200bps to match the speed of the extension. You should know the drill: select the channel in **Left panel**, change the **Baud Rate** property in the **Properties panel** to **115200** and don't forget to **Deploy** the solution afterwards. Now that we changed the configuration of extension, we need to do changes in the project as well. Remember, that our ModbusRTU channel is configured to 19200bps. We need to change it to 115200bps to match the speed of the extension. You should know the drill: select the channel in **Left panel**, change the **Baud Rate** property in the **Properties panel** to **115200** and don't forget to **Deploy** the solution afterwards.
  
-If you run the **UniPi - Modules autodetect** again, you should find the extension on new address 12. You could import the new device, but then you would have two devices under the ModbusRTU channel. An easier way is to change the communication address in the current device'​s properties. Select the extension in the **Left panel** and in the **Properties panel** check the **Modbus Device Parameters**.+If you run the **Unipi - Modules autodetect** again, you should find the extension on new address 12. You could import the new device, but then you would have two devices under the ModbusRTU channel. An easier way is to change the communication address in the current device'​s properties. Select the extension in the **Left panel** and in the **Properties panel** check the **Modbus Device Parameters**.
  
 {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-19-changing-device-address.png?​direct |}} {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-19-changing-device-address.png?​direct |}}
  
 Change the **Device Address** to match the **Module SW Address**, **Deploy** the solution and start the **Debugging**. In the **Variable browser** you should see all the properties and their current value. Change the **Device Address** to match the **Module SW Address**, **Deploy** the solution and start the **Debugging**. In the **Variable browser** you should see all the properties and their current value.