Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
cs:sw:01-mervis:automatic-restart-of-1-wire-hidden [2020/01/17 07:27] avsetula created |
cs:sw:01-mervis:automatic-restart-of-1-wire-hidden [2021/08/05 14:34] (current) avsetula |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | FIXME - překlad | + | ====== Automatický restart sběrnice 1-Wire ====== |
- | ====== Automatic restart of the 1-Wire bus ====== | + | <WRAP group> |
- | The 1-Wire bus is prone to EMI which can result in sensors being "stuck" and disabling the whole bus communication. With our PLCs you are able to turn the power off for the whole 1-Wire bus and forcing the sensors to reset. | + | <WRAP half column 81%> |
+ | Sběrnice 1-Wire je náchylná k EMI, což může vést k "zaseknutí" senzorů a deaktivaci celé komunikace na sběrnici. S našimi PLC můžete vypnout napájení pro celou 1-Wire sběrnici a donutit senzory k resetování. | ||
+ | </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-axon">Axon</span></html> | ||
+ | ;;# | ||
+ | </WRAP> | ||
+ | </WRAP> | ||
<WRAP center round info 60%> | <WRAP center round info 60%> | ||
- | In Mervis, the property controlling the power supply for the 1-Wire bus is called **OW_off_1**. By setting the value to ''TRUE'', the bus will be disconnected from the power supply and by resetting back to ''FALSE'' the power supply will be connected back. | + | V Mervis se vlastnost ovládající napájení zdroje pro 1-Wire bus nazvaná **OW_off_1**. Nastavením hodnoty na ''TRUE'' bude sběrnice odpojena od napájení a nastavením zpět na ''FALSE'' bude napájení znovu obnoveno. |
</WRAP> | </WRAP> | ||
- | You can reset the power supply manually, but with the help of **commerror** attributes, you can let Mervis do it automatically. The attributes are available on the particular device or the whole channel and they indicate when the Mervis wasn't able to read the datapoints for given device/channel. | + | Můžete resetovat napájení i ručně, ale pomocí atributů **commerror** můžete nechat Mervis, aby to dělal automaticky. Atributy jsou k dispozici na konkrétním zařízení nebo na celém kanálu a ukazují, kdy Mervis nedokázal přečíst datové body pro dané zařízení či celý kanál. |
- | We will start the project in the **Full mode**, attaching to the controller, creating a FBD program and setting a task executing this program. Next we create ModbusTCP channel for the IOs of the PLC and 1-Wire channel for the 1-Wire bus. Then deploy the solution and detect the 1-Wire sensors. Your workspace should look like this: | + | Zahájíme projekt v **Plném módu**, připojíme se ke kontroléru, vytvoříme program FBD a nastavíme úlohu provádějící tento program. Dále vytvoříme 1-Wire kanál pro 1-Wire sběrnici. **Nahrajte sestavu** a detekujte senzory 1-Wire. Váš pracovní prostor by měl vypadat následovně: |
{{ :en:sw:01-mervis:automatic-restart-of-the-1-wire-01-workspace.png?direct |}} | {{ :en:sw:01-mervis:automatic-restart-of-the-1-wire-01-workspace.png?direct |}} | ||
- | As you can see, we have one 1-Wire thermometer, which we renamed to "office". Now double click on the **1-Wire** channel in the **Left panel**. You will be presented by all the available datapoints: | + | Jak můžete vidět, máme jeden 1-Wire teploměr a ten jsme přejmenovali na "Kancelar". Nyní dvakrát klikněte na kanál **1-Wire** na **levém panelu**. Zobrazí se vám všechny dostupné datové body: |
{{ :en:sw:01-mervis:automatic-restart-of-the-1-wire-02-attributes.png?direct |}} | {{ :en:sw:01-mervis:automatic-restart-of-the-1-wire-02-attributes.png?direct |}} | ||
- | The most important is the attribute **commerror**, which indicates if there is a communication error with **any** of the connected sensors. The attribute's type is bool and when the value is ''TRUE'', it means there is a communication error and once the error disappears, the attribute is ''FALSE''. As you can see, attribute of the same name is in the **office** section as well. This attribute indicates communication error **only** for the sensor called **office**. | + | Nejdůležitější je atribut **commerror**, který označuje, zda došlo k chybě komunikace s některými připojenými senzory. Typ atributu je bool a pokud je hodnota ''TRUE'', znamená to, že došlo k chybě komunikace a jakmile chyba zmizí, je hodnota ''FALSE''. Jak vidíte, atribut se stejným názvem je také v sekci **Kancelar**. Tento atribut označuje chybu komunikace pouze pro senzor zvaný **Kancelar**. |
- | The solution for automatic restart needs to check the value of the **commerror** and when it is ''TRUE'' we need to briefly set the **OW_off_1** to ''TRUE'' and then set it back to ''FALSE''. Better yet, if the **commerror** stays in ''TRUE'' we will try resetting the bus periodically. For this function, we can use block **Pulse Generator (BD2)**: | + | Program sestavy pro automatický restart kontroluje hodnotu **commerror** a když je ''TRUE'', musíme krátce nastavit **OW_off_1** na hodnotu ''TRUE'' a poté ji nastavit zpět na ''FALSE''. Ještě lepším řešením je, že když **commerror** zůstane v ''TRUE'', zkoušíme periodicky resetovat sběrnici. Pro tuto funkci můžeme použít blok **Pulse Generator (BD2)**: |
{{ :en:sw:01-mervis:automatic-restart-of-the-1-wire-03-pulse-generator.png?direct |}} | {{ :en:sw:01-mervis:automatic-restart-of-the-1-wire-03-pulse-generator.png?direct |}} | ||
- | By default the block has visible input **Enable**. If the input is ''TRUE'', the block will generate square signal on the **Out** output. You can set the length of the pulse and the pause via the hidden inputs **Tfalse** and **Ttrue**. | + | Ve výchozím nastavení má blok viditelný vstup **Enable**. Pokud je vstupem ''TRUE'', bude generovat čtvercový signál na výstupu **Out**. Délka impulsu a pauzy můžete nastavit pomocí skrytých vstupů **Tfalse** a **Ttrue**. |
- | As you probably guessed, we will use the **commerror** attribute as a input and we can directly wire the **Out** output to the **OW_off_1** variable: | + | Jak jste pravděpodobně uhodli, jako vstup použijeme atribut **commerror** a můžeme přímo propojit výstup **Out** s proměnnou **OW_off_1**: |
{{ :en:sw:01-mervis:automatic-restart-of-the-1-wire-04-complete-project.png?direct |}} | {{ :en:sw:01-mervis:automatic-restart-of-the-1-wire-04-complete-project.png?direct |}} | ||
- | All we need to alter is the length of the pulse and the pause between pulses to some reasonable values such as Ttrue = 1s and Tfalse = 4s, deploy the solution and start debugging. Then you can unplug the 1-Wire sensor and you will see that the measured values are red and the **commerror** attribute is ''TRUE'' and the **Pulse Generator** is sending reset pulses to the bus: | + | Potřebujeme pouze změnit délku impulsu a pauzu mezi impulzy na rozumné hodnoty, např: Ttrue = 1 s a Tfalse = 4 s. **Nahrajte sestavu** a klikněte na **Start ladění**. Poté můžete odpojit snímač 1-Wire a uvidíte, že naměřené hodnoty jsou červené, atribut **commerror** je ''TRUE'' a **Pulse Generator** odesílá resetovací impulzy pro napájení sběrnice 1-Wire: |
{{ :en:sw:01-mervis:automatic-restart-of-the-1-wire-05-debugging.png?direct |}} | {{ :en:sw:01-mervis:automatic-restart-of-the-1-wire-05-debugging.png?direct |}} |