Differences

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

Link to this comparison view

Next revision
Previous revision
cs:sw:01-mervis:connecting-to-unipi-extension-hidden [2020/01/17 07:24]
avsetula created
cs:sw:01-mervis:connecting-to-unipi-extension-hidden [2024/03/14 09:04] (current)
kcerny typos
Line 1: Line 1:
-FIXME - překlad +====== ​Připojení rozšiřujícího modulu Unipi Extension ​====== 
-====== ​Connecting to UniPi extension ​====== +<WRAP group> 
-The UniPi extensions are convenient way how to extend the number of inputs and outputs at one locationor make accessible at another one+<WRAP half column 81%> 
 +Rozšiřující moduly Unipi Extension představují praktický a jednoduchý způsobjak zvýšit počet vstupů a výstupů v jedné lokaci, či zpřístupnit vstupy a výstupy v lokaci vzdálenější
  
-The communication between controller and extension is via RS485 portsThe extension acts as a Modbus slave, which has an extended support in the Mervis. ​+Rozšíření komunikují s PLC skrze sériový port RS485.Rozšiřující moduly fungují jako Modbus slave zařízení s rozšířenou podporou v softwaru ​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 ​===== +===== Hardwarové zapojení ​===== 
-You need only two cables to connect the UniPi extension to the controllerJust interconnect the RS485-A ​port on the controller to RS485-A port on the extension and RS485-B on the controller to RS485-B ​on the extension.+K připojení rozšiřujícího modulu ke kontroléru potřebujete pouze kabel se dvěma vodičiS nimi jednoduše propojte porty **RS485-A ​RS485-B** na rozšíření s porty **RS485-A a RS485-B** na kontroléru
  
-{{ :en:​sw:​01-mervis:​connecting-the-unipi-extension-01-hw-connection.png?​direct ​|}} +{{: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. +
- +
-==== 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. +
- +
-{{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-02-dip-switches.jpg?​direct |}} +
- +
-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 last device on the bus. Typically, this applies to very long buses, over several 100s of meters. +
- +
-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 has 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 ​==== +===== Adresace modulů a komunikační parametry ===== 
-The connection parameters can be also set in Mervis. The HW settings takes precedence, so in order 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.+{{page>​cs:​hw:​04-extensions-communication-hidden}}
  
-===== Using UniPi extension in the Mervis ​===== +===== Práce s rozšiřujícími moduly Unipi v Mervisu ​===== 
-Let's assume you have a basic project in **Full mode**, you are attached to the controlleryou have **Executable project** with one **FBD** ​program and this program is configured as sole **Task** of the PLC. And you **Set Autogen** ​on the UniPi deviceYour workspace should look like this:+Předpokládejme nyní, že již máte vytvořený projekt v Mervis IDE  v **plném módu**, jste připojení ke kontrolérumáte v projektu vytvořený ​**spustitelný projekt** s jedním programem v jazyce ​**FBD** a tento program je nastaven jako jeden **task** pro PLC. Rovněž také předpokládejme,​ že jste na Unipi využili funkci ​**Nastavit ​Autogen**. ​Váš pracovní prostor by tak měl vypadat zhruba následovně
  
 {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-02-workspace.png?​direct |}} {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-02-workspace.png?​direct |}}
  
-As we stated previouslythe communication with UniPi extension is via ModbusRTUSo create a channel by right clicking on the PLC in the **Left panel** and selecting the **Add Channel** option.+Jak jsme již zmínilirozšíření komunikují pomocí sériového protokolu Modbus RTUVytvoříme proto odpovídající kanál - v **levém panelu** klikněte pravým tlačítkem myši na PLC a zvolte ​**Přidat kanál**. 
  
 {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-03-add-channel.png?​direct |}} {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-03-add-channel.png?​direct |}}
  
-A new channel will appear under the PLC. Select it and in the **Properties panel** change the **Name** to something more descriptivelike **ModbusRTU**. ​Also change the **Protocol** to **Modbus**.+Pod PLC se objeví nový kanálVyberte jej a v panelu ​**Vlastnosti** změňte ​**Jméno** na něco více popisnéhojako například ​**ModbusRTU**. **Protokol** pak změňte na **Modbus**. ​
  
 {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-04-channel-name-and-protocol.png?​direct |}} {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-04-channel-name-and-protocol.png?​direct |}}
  
-Leave the **Link Protocol** to **Serial**, ​but change the **Port Number** to serial ​port on your PLC. Our testing UniPi Neuron L503 is equipped with two RS485 portsand we will use the one on the 1st group.+**Linkový protokol** ponechte nastavený na **Serial**, ​pouze změňte ​**Číslo portu** na použitý sériový ​port Vašeho ​PLC. Tento tutoriál byl vytvářen s jednotkou Unipi Neuron L503 vybavenou dvojicí portů ​RS485, ​my proto využijeme port umístěný v 1. skupině
  
 {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-05-port-number.png?​direct |}} {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-05-port-number.png?​direct |}}
  
-We will also change the **Baud Rate** (a.k.a speed) to 19200, ​as it is a default value for UniPi'​s extensions.+**Přenosovou rychlost** změníme na 19200, ​neboli výchozí rychlost pro rozšíření Unipi
  
 {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-06-baud-rate.png?​direct |}} {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-06-baud-rate.png?​direct |}}
  
-Now we can add the device and we can do it in two waysYou are used to right click on the channel name and then clicking on the **Add Library Device** and then selecting the proper device from the listThis will work, but with UniPi extensionsyou can let the Mervis ​detect all the units on the bus automatically and add all of them at once+Nyní můžeme přidat samotný rozšiřující modulLze tak učinit dvěma způsoby, z nichž jeden již dobře znáte - kliknete pravým tlačítkem na **Přidat zařízení z knihovny** a ze seznamu vyberete konkrétní model zařízeníTento způsob je samozřejmě správnýu rozšiřujících modulů Unipi ale máte možnost nechat ​Mervis ​nadetekovat všechna zařízení na sériové sběrnici automaticky a najednou 
  
 <WRAP center round tip 60%> <WRAP center round tip 60%>
-When new channel is addedthe autodetection will not work until you deploy the solutionbecause the PLC doesn'​t know this channel yet.+Pokud přidáváte nový kanálautodetekce nebude fungovatneboť ​PLC zatím nový kanál nerozpoznává. Je proto potřeba před autodetekcí nahrát sestavu
 </​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**.+Autodetekci spustíte kliknutím pravým tlačítkem na název kanálu v **levém panelu**. V kontextovém ​menu pak klikněte na **Autodetekce modulů Unipi**. 
  
 {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-07-autodetect.png?​direct |}} {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-07-autodetect.png?​direct |}}
  
-You will be probably presented with dialog ​warning youthat the autodetection needs to be executed while the PLC is in the **Commissioning mode**. The Mervis ​will offer you to switch to this mode and after the detection it will switch back to the previous mode.+Mervis IDE Vám pravděpodobně zobrazí ​dialog ​varující Vásže autodetekci lze spustit pouze pokud je PLC **oživovacím módu**. Mervis ​Vám nabídne přepnutí PLC do tohoto módu a po dokončení autodetekce se PLC automaticky přepne zpět do předchozího používaného módu
  
 {{ :​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 dialog will ask you for the range of Modbus ​ID's the autodetect will look forYou can leave the default ​1 - 15.+Další dialogové okno se vás dotáže na rozsah ​Modbus ​adres, které bude autodetekce vyhledávatZde můžete ponechat výchozí rozsah ​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 |}}
  
-The detection has finished and you can see a list of UniPi extensions on your RS485 busYou can tick the **Import** ​checkbox and import their definitions.+Po dokončení autodetekce se Vám zobrazí seznam všech modulů Unipi na dané sběrnici ​RS485. ​Máte zde možnost zaškrtnout políčko ​**Import** ​a importovat tak definice připojených modulů
  
 {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-10-import.png?​direct |}} {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-10-import.png?​direct |}}
  
-And confirm the restore to previous mode.+Potvrdťe návrat do výchozího módu PLC
  
 {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-11-restoring.png?​direct |}} {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-11-restoring.png?​direct |}}
  
-A new device(s) will appear under the channelYou should rename them to something more descriptivee.g. by their purpose or location.+Pod kanálem ModbusRTU se objeví jedno či více nových zařízeníDoporučujeme je popisně přejmenovatnapřpodle jejich účelu či umístění
  
 {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-12-device-name.png?​direct |}} {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-12-device-name.png?​direct |}}
  
-Also run **Set Autogen** ​on the device in order to generate all the variables which the extension has.+Rovněž na zařízení spusťte ​**Nastavit ​Autogen** ​pro vygenerování všech proměnných,​ které rozšiřující modul nabízí
  
-Turn on the **Debugging** and select the **Variable browser** tab in the **Main window**. Under the namesearch for the name you gave the extension ​(in our case the **boilerRoom**). ​In the browser, you should now see only the variables for the extension and their current values.+Nyní spusťte ​**ladění** **hlavního panelu** vyberte záložku ​**Prohlížeč proměnných**. Vyhledejte názevkterý jste rozšiřujícímu modulu dali (v našem případě ​**boilerRoom**). ​V prohlížeči byste nyní měli vidět pouze proměnné rozšiřujícího modulu a jejich aktuálních hodnot
  
 {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-13-variable-browser.png?​direct |}} {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-13-variable-browser.png?​direct |}}
  
-You can try changing the values of boilerRoom_ULED_1.01 ​and you should see the LED X1 on the extension turn ON and OFF.+Nyní můžete zkusit změnit hodnotu proměnné ​boilerRoom_ULED_1.01. Pokud jste vše provedli správně, dioda X1 na rozšiřujícím modulu se rozsvítí
  
-===== Reconfiguration of the UniPi extension ​===== +===== Překonfigurování rozšiřujícího modulu ​===== 
-We already learnedthat you can set a subset of the communication parameters by HW DIP switchesNow we will learnhow to set those in Mervis.+Již jsme se naučiliže pomocí ​DIP přepínačů lze manuálně nastavit komunikační parametryNyní si ukážemejak tyto parametry nastavit v Mervisu
  
-To set the parameters, you need to have a working connection with the extension. We already have this in our current projectso let's continue.+Pro nastavení parametrů je nutné se k rozšíření připojit. ​To jsme provedli v ukázkovém projektu výšemůžeme proto přejít přímo k nastavení
  
-The parameters are configured on the device itselfSelect the extension in the **Left panel** and check the properties on the **Left panel**.+Parametry se nastavují přímo na zařízení**levém panelu** vyberte modul a prohlédněte si jeho dostupné vlastnosti
  
 {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-14-extension-properties.png?​direct |}} {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-14-extension-properties.png?​direct |}}
  
-In Mervis, we can set **address**, **baud rate** and **parity**. The **data bits** will always be **8** and **stop ​bits** will be **1**. ​So let's change the parameters to address = 12 and baudrate = 115200.+V Mervisu můžete nastavit ​**adresu**, **přenosovu rychlost** **paritu**. **Datové bity** jsou ve výchozím nastavení na hodnotě ​**8** **stop ​bity** na **1**. ​ 
 + 
 +Změňme proto parametry na adresu **12** a přenosovou rychlost na **115200**
  
 {{ :​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 |}}
  
-In order to save these settings, you need to configure the moduleRight click on the extension in the **Left panel** ​and in the context ​menu, click on **UniPi - Configure module**.+Pro uložení tohoto nastavení je třeba modul nakonfigurovatKlikněte pravým tlačítkem na **levý panel** ​a v kontextovém ​menu klikněte na **Konfigurovat modul Unipi**. 
  
 {{ :​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 |}}
  
-You will probably be asked to switch to **Commissioning mode** as with the autodetectionAfter confirmation,​ you will see a progress bar of the configurationAfter the configuration finishes, confirm the dialog ​by clicking on **OK**+Stejně jako u autodetekce,​ i nyní se Vás Mervis IDE pravděpodobně zeptá na přepnutí zařízení do **oživovacího módu**. Po potvrzení pak uvidíte indikaci průběhu konfiguraciPo jejím dokončení potvrďte ​dialog ​kliknutím na **OK**
  
 {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-17-configuring.png?​direct |}} {{ :​en:​sw:​01-mervis:​connecting-the-unipi-extension-17-configuring.png?​direct |}}
Line 137: Line 110:
  
 <WRAP center round tip 60%> <WRAP center round tip 60%>
-We downloaded the configuration into the extension, but to apply the settings, you need to restart the extension as well.+Konfiguraci jsme již stáhli přímo do modulu. Pro její uložení je třeba rozšiřující modul restartovat
 </​WRAP>​ </​WRAP>​
  
-Now that we changed the configuration of extension, we need to do changes in the project as wellRememberthat our ModbusRTU ​channel is configured to 19200bpsWe need to change it to 115200bps to match the speed of the extensionYou should know the drill: select the channel in **Left panel**change the **Baud Rate** property in the **Properties panel** to **115200** ​and don'forget to **Deploy** the solution afterwards.+Po změně nastavení modulu je nyní nutné provést odpovídající změny i v samotném projektuMějte na pamětiže kanál ​ModbusRTU ​je nastaven na rychlost 19200 bpsRychlost je proto třeba změnit na 115200 bps, tjshodnou s rychlostí rozšíření. Nyní byste již měli vědětco dál - v **levém panelu** vyberte kanál ModbusRTU, změňte parametr ​**Přenosová rychlost** na **115200** ​a po dokončení ​těchto kroků nezapomeňte ​**nahrát sestavu**. 
  
-If you run the **UniPi - Modules autodetect** againyou should find the extension on new address ​12. You could import the new devicebut then you would have two devices under the ModbusRTU ​channelEasier way is to change the communication address in the current device'​s propertiesSelect the extension in the **Left panel** and in the **Properties panel** check the **Modbus Device Parameters**.+Pokud nyní znovu spustíte ​**autodetekci modulů Unipi**, rozšiřující moduly by měly být dostupné na adrese ​12. Můžete rovněž importovat nové zařízenípod ModbusRTU ​kanálem by ale pak byla dvě zařízeníJednodušším způsobem je změnit komunikační adresu na současnou adresu rozšiřujícího moduluTo provedete výběrem rozšíření v **levém panelu**, po čemž v panelu ​**Vlastnosti** přejděte na  ​**Parametry Modbusu**. 
  
 {{ :​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. +**Adresu zařízení** změňte tak, aby se shodovala se **SW adresou modulu**. Poté **nahrajte sestavu** a spusťte ​**mód ladění**. **prohlížeči proměnných** byste nyní měli vidět všechny vlastnosti modulů a jejich aktuální hodnoty
- +
- +
- +
- +
- +