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:creating-new-project-hidden [2021/05/11 13:09]
avsetula
en:sw:01-mervis:creating-new-project-hidden [2024/01/24 09:30] (current)
avsetula [Uploading a blank configuration]
Line 1: Line 1:
 <​html><​div class="​version-switch">​ <​html><​div class="​version-switch">​
-  <a href="#​first_project_with_a_unipi_controller"><​div class="​actual-version">​IDE v2.4.0</​div></​a>​+  <a href="#​first_project_with_a_unipi_unit"><​div class="​actual-version">​IDE v2.3.0 and later</​div></​a>​
 </​div></​html>​ </​div></​html>​
-====== First project with a Unipi controller ​======+====== First project with a Unipi unit ======
 <WRAP group 100%> <WRAP group 100%>
 <WRAP half column 81%> <WRAP half column 81%>
Line 17: Line 17:
 </​WRAP>​ </​WRAP>​
  
-/* FIXME - prosím ověřit překlad poslední věty, případně upravit  +The following tutorial includes all basic configurations needed to create the core of a Mervis IDE project and to deploy it to Patron, Neuron, Gate, or Axon controller. All following tutorials use this one as their cornerstone. The last chapter of this manual is a well-known flashing diode, ​i.e. the program in FUPLA blocks switching the digital output. ​
-Následující návod obsahuje veškeré základní nastavení, které je potřebné pro vytvoření projektu v Mervis IDE a spuštění na kontrolérech Patron, Neuron, Gate, či Axon. Veškeré další návody se aplikují na tento první projekt. Poslední kapitola tohoto návodu je právě ono bliknutí diodou digitálního výstupu, tedy program ve FUPLA blocích spínající digitální výstup.  +
-*/ +
-The following tutorial includes all basic configurations needed to create the core of a Mervis IDE project and to deploy it to Patron, Neuron, Gate, or Axon controller. All following tutorials use this one as their cornerstone. The last chapter of this manual is a well-known flashing diode, ​ie a program in FUPLA blocks switching the digital output ​and its indication by a diode+
  
 <WRAP center round box> <WRAP center round box>
 <​html><​span class="​kbBlue-H4alt">​Prerequisites:</​span></​html>​ <​html><​span class="​kbBlue-H4alt">​Prerequisites:</​span></​html>​
   - PLC Unipi [[https://​www.unipi.technology/​patron-c44|Patron]] / [[https://​www.unipi.technology/​neuron-c2|Neuron]] / [[https://​www.unipi.technology/​gate-c50|Gate]] / Axon   - PLC Unipi [[https://​www.unipi.technology/​patron-c44|Patron]] / [[https://​www.unipi.technology/​neuron-c2|Neuron]] / [[https://​www.unipi.technology/​gate-c50|Gate]] / Axon
-  - [[https://​www.unipi.technology/​power-supply-for-din-rail-24v-dc-0-63a-p18|24 ​VDC / 0.5 A power supply]]+  - [[https://​www.unipi.technology/​power-supply-for-din-rail-24v-dc-0-63a-p18|24 ​V⎓ power supply]]
   - Downloaded Mervis OS archive for [[en:​files:​software:​os-images:​00-start#​patron_mervis_os|Patron]],​ [[en:​files:​software:​os-images:​00-start#​neuron_mervis_os|Neuron]],​ [[en:​files:​software:​os-images:​00-start#​gate|Gate]],​ or [[en:​files:​software:​os-images:​00-start#​axon_mervis_os|Axon]]   - Downloaded Mervis OS archive for [[en:​files:​software:​os-images:​00-start#​patron_mervis_os|Patron]],​ [[en:​files:​software:​os-images:​00-start#​neuron_mervis_os|Neuron]],​ [[en:​files:​software:​os-images:​00-start#​gate|Gate]],​ or [[en:​files:​software:​os-images:​00-start#​axon_mervis_os|Axon]]
   - a computer with [[en:​files:​software:​mervis:​00-start#​get_the_latest_stable_version|Mervis IDE]] installed ​   - a computer with [[en:​files:​software:​mervis:​00-start#​get_the_latest_stable_version|Mervis IDE]] installed ​
Line 101: Line 98:
  
 ===== Connecting the inputs/​outputs ===== ===== Connecting the inputs/​outputs =====
-/* FIXME - přeložit odstavec (nahradí celou tuto kapitolu) +You now have assigned controller in the Mervis IDE. From a structural point of view, Unipi controllers consist of computer module and printed circuit boards with inputs and outputs. Those are used by Mervis RT for primary communication via the **Modbus TCP** protocolAn exception is the Unipi Gate serieswithout inputs and outputsbut it is possible to read the status of the internal storage using Modbus TCP.
-Mervis IDE nyní máte přiřazen váš kontrolérZ konstrukčního hlediska jsou kontroléry ​Unipi složeny z výpočetního modulu ​desek plošných spojů se vstupy a výstupy se kterými ​Mervis RT primárně komunikuje skrze protokol ​**Modbus TCP**. ​Vyjímkou je řada Unipi Gate, kde vstupy a výstupy nejsouale je možné pomocí ​Modbus TCP číst stav interního úložiště+
  
-Zmiňovaný ​Modbus TCP komunikační kanál se přidal automaticky s přiřazením kontroléruPod tímto komunikačním kanálem dále naleznete automaticky vloženou ​modbus ​tabulku nazvanou podle konkrétního modelu ​PLC.+The above mentioned ​Modbus TCP communication channel was added automatically with the controller assignmentBelow this communication channel, you will also find an automatically inserted ​modbus ​table named according to the specific ​PLC model.
  
 {{ :​en:​sw:​01-mervis:​11_creating-new-project_en.png?​direct |}} {{ :​en:​sw:​01-mervis:​11_creating-new-project_en.png?​direct |}}
-*/ 
  
-<WRAP center round tip 60%> 
-This step is done automatically since Mervis IDE 2.2.0 for Patron, Neuron and Axon controllers and adds only the default Modbus TCP channel. Additional channels (1Wire, Modbus RTU) has do be done manually. 
-</​WRAP>​ 
- 
-Now that we attached to the running controller, we can configure the inputs and outputs. The Unipi is internally consisting of the CPU unit (running Mervis OS), and input/​output backplane, which communicates with the CPU unit via ModbusTCP.  ​ 
- 
-To connect to the backplane, we need to add **Channel**. The **Channel** is a communication point with hardware which happens in the defined protocol. To add **Channel**,​ right-click on the **PLC** name and then click on the **Add Channel**. ​ 
- 
-{{ :​en:​sw:​01-mervis:​creating_new_project_17_add_channel.png?​direct |}} 
- 
-New communication channel will appear under the **PLC**. Click on it. In the **Properties** panel, you will see information about the channel. It is a good thing to rename the channel to something more descriptive,​ e.g. "​ModbusTCP"​ since this channel is for ModbusTCP communication. 
- 
-{{ :​en:​sw:​01-mervis:​creating_new_project_18_set_channel_name.png?​direct |}} 
- 
-Next thing we need to change is the protocol to **Modbus** 
- 
-{{ :​en:​sw:​01-mervis:​creating_new_project_19_set_channel_protocol.png?​direct |}} 
- 
-With **Modbus** protocol, we need to select correct **Link Protocol**. The default is **Serial**, but as we stated above, the UniPi backplane is connected via **TCP**. 
- 
-{{ :​en:​sw:​01-mervis:​creating_new_project_20_set_link_protocol.png?​direct |}}  
- 
-The **Channel** is configured, now we can add the device. Right-click on the new channel name in the **Left panel**. It is under the **PLC** option tree. In the context menu, select the **Add Library Device**. 
- 
-{{ :​en:​sw:​01-mervis:​creating_new_project_21_add_library_device.png?​direct |}} 
- 
-In the dialogue **Add Library Device**, there is a large list of the supported devices. For quick searching, type the model name of your controller into **Device Name**. In this tutorial, we use [[https://​www.unipi.technology/​unipi-neuron-l503-p105?​categoryId=10|UniPi Neuron L503]], and by typing **L503**, the unit was found. Select it by left click, and click on the {{:​en:​sw:​01-mervis:​creating_new_project_23_right_arrow.png?​direct&​25}} icon to add it into the list of selected devices and then hit **OK**. 
- 
-{{ :​en:​sw:​01-mervis:​creating_new_project_22_adding_library_device.png?​direct |}} 
- 
-The new device appears under the ModbusTCP channel we created a few moments ago. Double click on the name and new tab will appear in the **Main window** containing the list of all inputs and outputs provided by the unit. 
- 
-{{ :​en:​sw:​01-mervis:​creating_new_project_24_inputs_outputs.png?​direct |}} 
  
 ===== Uploading a blank configuration ===== ===== Uploading a blank configuration =====
-/* FIXME - přeložit celý odstavec (nahradí původní) +Now we move to the configurationThis part is especially important if you are just starting a new project with a controller or expansion modules that have been used in the past. That'because these devices may have a previous configuration that is independent of the uploaded solutioneven the operating systemand may unexpectedly affect the operation of the entire solution.
-Nyní je na řadě konfiguraceTato část je důležitá zejména pokud právě začínáte nový projekt ​kontroléremči rozšiřujícími modulykteré již byly v minulosti používány. Tato zařízení totiž mohou mít uloženu předchozí konfiguraci,​ která je nezávislá na nahrané sestavě, dokonce i na operačním systému a může tak nečekaně ovlivnit činnost celé sestavy.+
  
-Není ale třeba se obávatstačí pouze v aktuálním čistém projektu kliknout pravým tlačítkem myši na modbus ​tabulku nazvanou podle přiřazeného kontroléru a vybrat položku ​**Konfigurovat modul Unipi**. ​Tím se nahraje výchozí konfiguracePodrobněji je tento postup rozepsán v tomto článku: [[cs:​sw:​01-mervis:​unipi-configure-module-hidden|Konfigurace modulu Unipi]].+There is no need to worryjust right-click on the modbus ​table named after the assigned controller in the current clean project and select ​**Configure ​Unipi module**. This will load the default configurationDetailed description of this procedure is in the article: [[en:​sw:​01-mervis:​unipi-configure-module-hidden|]].
  
 {{ :​en:​sw:​01-mervis:​12_creating-new-project_en.png?​direct |}} {{ :​en:​sw:​01-mervis:​12_creating-new-project_en.png?​direct |}}
-*/ 
  
-Now it's time to talk about the configuration of modules. This applies greatly if you are starting to work with PLC or Extension, which has been previously used. The units can have stored configuration,​ which is independent on the uploaded solution and therefor the PLC can act differently than expected. But no need to worry, all you need to do is to apply blank configuration by following this [[en:​sw:​01-mervis:​unipi-configure-module-hidden|tutorial]]. That's all you need to do right now and we will get back to this later in more details. 
  
 ===== Switching to Full Mode ===== ===== Switching to Full Mode =====
Line 167: Line 126:
 {{ :​en:​sw:​01-mervis:​14_creating-new-project_en.png?​direct |}} {{ :​en:​sw:​01-mervis:​14_creating-new-project_en.png?​direct |}}
  
-The result is you now have access to other functions. The most visible change occurred in the left panel - at its bottom, the **History log** item appeared. **Executable Projects** now also displays **generated.Mixed.st** file. This file contains variable definitions,​ in our case automatically generated by the Simple Mode. Don't delete, move or edit this file, its editing and creation are performed ​automatically. Autogen serves for automatic generation of variables from data points and can be applied to an entire device containing multiple data points, groups etc. +The result is you now have access to other functions. The most visible change occurred in the left panel - at its bottom, the **History log** item appeared. **Executable Projects** now also displays **generated.Mixed.st** file. This file contains variable definitions,​ in our case automatically generated by the Simple Mode. Don't delete, move or edit this file, its editing and creation are done automatically ​by Autogen 
 + 
 +Autogen serves for automatic generation of variables from data points and can be applied to an entire device containing multiple data points, groups etc. 
  
 <WRAP center round info 90%> <WRAP center round info 90%>
Line 207: Line 168:
  
  
-===== Switching a relay ===== +===== Switching a digital output ​===== 
-With the project good to go, we will now move to create your first control program. Its purpose will be to periodically switch the **Relay1** output. ​To switch ​the output ​will require setting Relay1 ​to alternate between ​''​True''​ and ''​False'' ​states. The basic executable project was generated automatically in Simple Mode, thanks to which we now have the **main** program available for creating the logic. In the **left panel** double-click on **main.Program.fbd**. ​+With the project good to go, we will now move to create your first control program. Its purpose will be to periodically switch the **DO_1.01** output. ​If this default project is created on a controller without digital outputs, you can also use a relay output, or create your own variable and simulate ​the output ​(e.g. for Unipi Gate). “Switch output” means that the output must be set to change values ​''​True''​ and ''​False'' ​repeatedly. The basic executable project was generated automatically in Simple Mode, thanks to which we now have the **main** program available for creating the logic. In the **left panel** double-click on **main.Program.fbd**. ​
  
 {{ :​en:​sw:​01-mervis:​22_creating-new-project_en.png?​direct |}} {{ :​en:​sw:​01-mervis:​22_creating-new-project_en.png?​direct |}}
Line 226: Line 187:
 {{ :​en:​sw:​01-mervis:​25_creating-new-project_en.png?​direct |}} {{ :​en:​sw:​01-mervis:​25_creating-new-project_en.png?​direct |}}
  
-For the demonstration and testing purposes you can create a simple logic for switching the above-mentioned **Relay1**. The entire logic will consist of predefined **function blocks (FB)** available in Mervis libraries. Each FB is designed for one specific function and consists of inputs, internal logic and outputs. The values on the inputs are processed by the internal logic and it then projects the result on the outputs, which can be connected to the inputs of other FBs or to the hardware outputs. ​+For the demonstration and testing purposes you can create a simple logic for switching the above-mentioned **DO_1.01** (or the alternatives). The entire logic will consist of predefined **function blocks (FB)** available in Mervis libraries. Each FB is designed for one specific function and consists of inputs, internal logic and outputs. The values on the inputs are processed by the internal logic and it then projects the result on the outputs, which can be connected to the inputs of other FBs or to the hardware outputs. ​
  
 Click on **FUPLA Box Explorer** - you can find it among tabs at the left panel'​s bottom edge.  Click on **FUPLA Box Explorer** - you can find it among tabs at the left panel'​s bottom edge. 
Line 240: Line 201:
 {{ :​en:​sw:​01-mervis:​28_creating-new-project_en.png?​direct |}} {{ :​en:​sw:​01-mervis:​28_creating-new-project_en.png?​direct |}}
  
-The **BD2 Pulse Generator** block contains simple logic - by default, the **Out** output periodically switches between ''​True''​ and ''​False''​ every second. Let's take a closer look at its inputs. **Enable** input and outputs **Out** and **OutN** are visible on the FB itself. However, if you double-click the block it will change its colour to yellow - an indication of selection. The **Properties** panel will then display a complete list of inputs and outputs. As you can see there are many more inputs than those visible in the main window, as most of the inputs/​outputs are hidden by default. Visibility of the individual inputs/​outputs can be toggled by the **Visible** property. As we need only the pulse generator'​s **Out** output, un-check the **Visible** box for all inputs/​outputs except **Out**. Bear in mind Mervis IDE does not allow any unconnected inputs in the **logic section** and any attempt to build such a solution will fail. The last step is to set 5s interval for **Ttrue** and **Tfalse** - that will ensure the relay will switch open/close every 5 seconds.  ​+The **BD2 Pulse Generator** block contains simple logic - by default, the **Out** output periodically switches between ''​True''​ and ''​False''​ every second. Let's take a closer look at its inputs. **Enable** input and outputs **Out** and **OutN** are visible on the FB itself. However, if you double-click the block it will change its colour to yellow - an indication of selection. The **Properties** panel will then display a complete list of inputs and outputs. As you can see there are many more inputs than those visible in the main window, as most of the inputs/​outputs are hidden by default. Visibility of the individual inputs/​outputs can be toggled by the **Visible** property. As we need only the pulse generator'​s **Out** output, un-check the **Visible** box for all inputs/​outputs except **Out**. Bear in mind Mervis IDE does not allow any unconnected inputs in the **logic section** and any attempt to build such a solution will fail. The last step is to set 5s interval for **Ttrue** and **Tfalse** - that will ensure the digital output ​will switch open/close every 5 seconds.  ​
  
 //​**Note:​**:​ you can display additional info about any block by selecting it and pressing F1 to open the help page for the block.// //​**Note:​**:​ you can display additional info about any block by selecting it and pressing F1 to open the help page for the block.//
Line 246: Line 207:
 {{ :​en:​sw:​01-mervis:​29_creating-new-project_en.png?​direct |}} {{ :​en:​sw:​01-mervis:​29_creating-new-project_en.png?​direct |}}
  
-You now need to connect the pulse generator'​s output to Relay1 ​input. Right-click on **input section** to display a context menu, move the cursor over **Global Variables** and from the submenu choose **Insert existing variable**. ​+You now need to connect the pulse generator'​s output to **DO_1.01** ​input (or the alternatives). Right-click on **input section** to display a context menu, move the cursor over **Global Variables** and from the submenu choose **Insert existing variable**. ​
  
 {{ :​en:​sw:​01-mervis:​30_creating-new-project_en.png?​direct |}} {{ :​en:​sw:​01-mervis:​30_creating-new-project_en.png?​direct |}}
  
-In the Insert ​existing variables, a list of all available variables, inputs and outputs of your controller ​will be displayed. If the list is nearly ​empty, you probably did not use Autogen ​to define ​variables available for your PLC. In that case, right-click on devices in both I2C and Modbus TCP channels ​and click on **Set autogen** in the context menu. +In the **Insert ​Existing Variable** dialog windowyou will see a list of all available variables, inputs and outputs of the controller. If the list is almost ​empty (this does not apply to Unipi Gate), you do not have Autogen-defined ​variables available for your PLC. In this case, right-click on the device (modbus table) next to the Modbus TCP channel ​and select ​**Set autogen** in the context menu.
  
-If you followed ​the guide closelySimple Mode already generated ​all variables ​for the program.+However, if you followed ​given instructions, all the variables ​are generated automatically in the program ​in Simple mode.
  
 <WRAP center round info 95%> <WRAP center round info 95%>
-**Autogen** ​generates ​variables based on all available or selected data points ​of inputs and outputsThat means we need to generate ​this list to use the PLC'​s ​inputs/outputs in the program.+**Autogen** ​performs a one-time generation of variables based on available or selected ​input and output ​data points. ​This means that when adding a device, ​this list must be generated so that we can use the inputs ​and outputs ​of the device ​in the program. ​
  
-Alternatively,​ you can double-click ​on **Unipi1_Relays** / **Unipi1Lite_Relays** and set the Autogen manually ​by right-clicking on the **Relay1** ​data point and selecting ​**Set Autogen** in the context menu. You can use this method for other devices ​as well+An alternative is to double-click ​the device to open it at the Modbus TCP channel and set the autogen for a specific data point (here **DO_1.01**by right-clicking on the data point and then select ​**Set autogen** in the context menu. 
 +You can work with other devices ​in the same way.
 </​WRAP>​ </​WRAP>​
  
-In the **Insert ​existing variable** dialogue ​window a long list of available variables ​will appear. You can search for variables ​manually, or you can try to find it by its name. For this tutorial, we will enter **Relay**, as all relays ​on Unipi 1.1/1.1 Lite are named as suchOn Unipi 1.1 you have 8 changeover relays available, ​with Unipi 1.1 Lite having only 6 of them. A relay is always named **RelayN** with N representing a specific relay number ​(1-8)Click on **Relay1** and confirm ​by clicking on **OK**. ​+The **Insert ​Existing Variable** dialog ​window ​displays ​a long list of available variables. You can search for the required variable ​manually, or try to search for it by its name. In this manual, we will enter **DO_** in the search bar, as this is how all digital outputs ​on the Unipi controller ​are named. ​Almost every Unipi controller has 4 digital outputsDigital outputs are always marked ​with the key string **DO_y.x**, where **Y** represents the number ​of the controller section and **X** the number ​of the specific outputSome output variables, including digital outputs, are marked at the end with the letter ​**R** or **W**, which indicates whether they are used to read the actual value or to entry. Select **DO_1.01_w** by a click and confirm ​with **OK**.
  
 {{ :​en:​sw:​01-mervis:​31_creating-new-project_en.png?​direct |}} {{ :​en:​sw:​01-mervis:​31_creating-new-project_en.png?​direct |}}
  
-The output variable appears in the **output section** at the marked location. Now it is necessary to connect the output of the function block of the pulse generator with the variable **Relay1**. Move the cursor to the black dot next to the **Out** output name of the pulse generator block. A small box will appear containing information about the type of output. ​+The output variable appears in the **output section** at the marked location. Now it is necessary to connect the output of the function block of the pulse generator with the variable **DO_1.01_w**. Move the cursor to the black dot next to the **Out** output name of the pulse generator block. A small box will appear containing information about the type of output. ​
  
 {{ :​en:​sw:​01-mervis:​32_creating-new-project_en.png?​direct |}} {{ :​en:​sw:​01-mervis:​32_creating-new-project_en.png?​direct |}}
  
-Click on the **dot**, hold the mouse button and move the cursor to a similar black dot placed next to the **Relay1**'s name. A green line will appear between both outputs. After releasing the mouse button, the line will change to orange. ​+Click on the **dot**, hold the mouse button and move the cursor to a similar black dot placed next to the **DO_1.01_w** output. A green line will appear between both outputs. After releasing the mouse button, the line will change to orange. ​
  
 {{ :​en:​sw:​01-mervis:​33_creating-new-project_en.png?​direct |}} {{ :​en:​sw:​01-mervis:​33_creating-new-project_en.png?​direct |}}
  
-You can now try to **build the solution** - see [[#​building_and_uploading_the_solution_project|Building and uploading the solution]]. If you did everything right, a **Build succeeded** message will appear in the **status bar**. **Warning** messages displayed in the **Results** tab can be safely ignored. ​+Now you can **Build Solution** - see [[#​building_and_uploading_the_solution_project|Building and uploading the solution]]. If you did everything right, a **Build succeeded** message will appear in the **status bar**. **Warning** messages displayed in the **Results** tab can be safely ignored. ​
  
 If the build succeeded and you followed the instructions above correctly, you can **upload** the solution into the controller - see [[#​building_and_uploading_the_solution_project|Building and uploading the solution]]. If the build succeeded and you followed the instructions above correctly, you can **upload** the solution into the controller - see [[#​building_and_uploading_the_solution_project|Building and uploading the solution]].
  
-Upon uploading ​the solution the Relay1 relay output will be switched every 5 seconds.  ​+Upon deploying ​the solution the digital ​output ​**DO_1.01** ​will be switched every 5 seconds.  ​
  
 ---- ----