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/05/13 07:00]
jan_kozak [DIP switches]
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 ​==== +
-DIP switches are small levers with two positions - up or down. If the lever is pushed down, its specific function is enabled.  +
- +
-{{:cs:sw:01-mervis:​dipswitch.png|}} +
- +
-On all Extension models, the DIP switches allow for configuring bitrate, parity and address. +
- +
-<​html><​span class="​kbBlueText">​The RS485-END</​span></​html>,​ placed next to RS-485 connectors, is intended for attaching or unattaching an internal 120Ω resistor between RS485-A and RS485-B ports for a proper termination of the RS-485 bus. The resistor needs to be attached if the said module is the last device on the bus - this instruction applies mostly for large serial buses several hundred meters long.   +
- +
-<​html><​span class="​kbBlueText">​Switches 1 to 3</​span></​html>​ serve for device addressing in a binary format, and can be used to set an address within 0-7 range.  +
- +
-^ Address ^ DIP no.1 ^ DIP no. 2 ^ DIP čo. 3 ^ +
-| 0       | OFF       | OFF       | OFF       | +
-| 1       | ON        | OFF       | OFF       | +
-| 2       | OFF       | ON        | OFF       | +
-| 3       | ON        | ON        | OFF       | +
-| 4       | OFF       | OFF       | ON        | +
-| 5       | ON        | OFF       | ON        | +
-| 6       | OFF       | ON        | ON        | +
-| 7       | ON        | ON        | ON        | +
- +
-<​html><​span class="​kbBlueText">​DIP switch 4</​span></​html>​ configures the serial bus' bitrate. There are two bitrates available - **19200 bps** (''​OFF''​ position) and **9600 bps** (''​ON''​ position. +
- +
-<​html><​span class="​kbBlueText">​DIP switch 5</​span></​html>​ serves for switching between **even** parity (''​OFF''​ position) or **no** parity (''​ON''​ position). +
- +
-==== 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 66: 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 74: 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 111: 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 127: 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.