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:00]
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:
  
  
-===== Creating ​program ​===== +===== Switching ​digital output ​===== 
-Next step in creating a working solution is to create a program.+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 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**
  
-In the **Left panel**, right-click on the **Executable projects** and in the context menu, click on the **Add New Project**.+{{ :en:sw:01-mervis:​22_creating-new-project_en.png?direct |}}
  
-{{ :​en:​sw:​01-mervis:​creating_new_project_26_add_new_project.png?direct |}}+A program window will appear in the **main window**
  
-In the **New Project** dialogue, you have to fill the **Name**. ​The **Location** is automatically a subdirectory in the **Solution** directory, so you can leave it as it is and confirm by clicking on **OK**+The FUPLA programming space is divided into **three sections** the left side is reserved for **Inputs** with each grey box available for placing a single input variable. ​
  
-{{ :​en:​sw:​01-mervis:​creating_new_project_27_new_project.png?direct |}}+{{ :​en:​sw:​01-mervis:​23_creating-new-project_en.png?direct |}}
  
-In the newly created ​**Executable project**, you can create programs. Right-click on the name of the executable project, in our instance the **mainProgram**. In the context menu hover over the **Add** and in the submenu click on **Add program**.+The middle section is called ​**logic section** and will be used for the programming itself
  
-{{ :​en:​sw:​01-mervis:​creating_new_project_28_add_program.png?direct |}}+{{ :​en:​sw:​01-mervis:​24_creating-new-project_en.png?direct |}}
  
-The dialogue **Add Program** will appearand we have to set the **Name**. Let's call this program **main**.+And finally, the right section is for placing ​**outputs**. As with the outputs, there is a number of grey boxes for placing output variables
  
-{{ :​en:​sw:​01-mervis:​creating_new_project_29_add_program_name.png?direct |}}+{{ :​en:​sw:​01-mervis:​25_creating-new-project_en.png?direct |}}
  
-In the same dialogue, look at the **Language** optionBy default, in the **Full mode**, ​the language is **st** which stands for [[https://​en.wikipedia.org/​wiki/​Structured_text|Structured text]]This is one of the 5 languages defined ​by the [[https://​en.wikipedia.org/​wiki/​IEC_61131-3|IEC 61131-3]] standard, ​and one of 2 supported by the Mervis IDE. Since learning ST language is out of the scope of this tutorial, select the **fbd**, which stands for [[https://​en.wikipedia.org/​wiki/​Function_block_diagram|Functional block diagram]] and confirm ​the program creation by clicking on **OK**.+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 librariesEach 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
  
-{{ :en:sw:01-mervis:​creating_new_project_30_add_program_language.png?direct |}} +Click on **FUPLA Box Explorer** ​you can find it among tabs at the left panel'​s bottom edge
  
-Under the **mainProgram** executable project in the **Left panel** appeared a new program named **main.Program.fbd**. Simultaneously the program has been opened as a new tab in the **Main window**. This is how your workspace should look like now:+{{ :​en:​sw:​01-mervis:​26_creating-new-project_en.png?direct |}}
  
-{{ :​en:​sw:​01-mervis:​creating_new_project_31_after_creation_of_program.png?direct |}}+The **left panel'​s** upper edge includes a search column for quick and easy search for blocks predefined by Mervis
  
-<WRAP center round info 60%> +{{ :en:sw:01-mervis:​27_creating-new-project_en.png?direct |}}
-You can close the program in the **Main window** and you can open it again, by double-clicking on the program name in the **Left panel**. +
-</​WRAP>​+
  
-===== Setting ​task ===== +Let's find pulse generatorEnter **pulse generator** into the search columnAs the system searches through function blocks ​in real-time, the number of results will gradually decrease. After entering the entire name of the block, only a single result will remain - the **Pulse Generator (BD2)** block. Click on ithold the mouse button and drag the block over to the **logic section**. Then place the block by releasing the button
-So far we have attached the controller, configure the access to inputs and outputs and created a structure of an executable projectWe also created a **main** program, so far without any logicThe last thing to do in this minimalistic ​**Solution** is to tell the controllerwhich program has to be executed after the start. This is called ​**Task**.+
  
-The first step in adding a task is **Build Solution** to attach the **main** program to the project. Double-click on **PLC** in the left panel. In the **main window** a new tab will appear named **PLC** (or your name if you renamed the controller)+{{ :​en:​sw:​01-mervis:​28_creating-new-project_en.png?direct |}}
  
-{{ :en:sw:01-mervis:​creating_new_project_32_no_tasks.png?direct |}}+The **BD2 Pulse Generator** block contains simple logic by default, the **Out** output periodically switches between ''​True''​ and ''​False''​ every secondLet'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.  ​
  
-The **PLC** tab is divided into several panels between which you can switch using tabs on the **main panel'​s** bottom edge. Visible are tabs **Tasks**, **IO Mapping**, **Messaging**m **Group Definition** a **User Definition**. As you can see,  we have no task created at the moment+//**Note:**you can display additional info about any block by selecting it and pressing F1 to open the help page for the block.//
  
-Let's start adding the task by double-clicking on the PLC name in the **Left panel**. In the **Main window**, a new tab called **PLC** (or the name of the PLC, if you renamed it in its properties) will appear.+{{ :​en:​sw:​01-mervis:​29_creating-new-project_en.png?direct |}}
  
-{{ :en:sw:01-mervis:​creating_new_project_32_no_tasks.png?direct |}}+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**
  
-The **PLC** tab is divided into subpanels. You can switch the subpanels at the bottom of the **Main window**. You can see the tabs **Tasks**, **IO Mapping**, **Messaging**,​ **Group Definition** and **User Rights**. We are interested in the **Tasks** tab, which should be active. The **Main window** of **PLC** tab therefor shows a list of defined tasks for this controller. As you can see, there are no tasks.+{{ :​en:​sw:​01-mervis:​30_creating-new-project_en.png?direct |}}
  
-To add a new **Task**, right-click on the space in the **Main window** and in the context menu, select **Add Task**+In the **Insert Existing Variable** dialog window, you 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.
  
-{{ :​en:​sw:​01-mervis:​creating_new_project_34_task_added.png?direct |}}+However, if you followed given instructions,​ all the variables are generated automatically in the program in Simple mode.
  
-New **Task** will appear in the listYou can see, that there is no value in the **Program Mapping**. To map a program ​to this task, click on the blank space+<WRAP center round info 95%> 
 +**Autogen** performs a one-time generation of variables based on available or selected input and output data pointsThis means that when adding a devicethis list must be generated so that we can use the inputs and outputs of the device ​in the program. ​
  
-{{ :en:sw:01-mervis:​creating_new_project_35_add_program_mapping.png?​direct |}} +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.
-A new dialogue will appear where we can see a list of our programs. So far, you should see only **main** program. Select it by clicking on it and then click on the {{:​en:​sw:​01-mervis:​creating_new_project_38_add_button.png?​direct&​35}} ​to add it into the right list. And confirm by clicking on **OK**. +
- +
-{{ :​en:​sw:​01-mervis:​creating_new_project_36_select_program.png?​direct |}} +
- +
-Now we are back in the list of tasks. You can see a red warning ​at the bottom about committing changes. Click on the **OK** to commit the changes. +
- +
-{{ :​en:​sw:​01-mervis:​creating_new_project_37_commiting_changes.png?​direct |}} +
- +
-Now we finished the bare minimum to deploy this **Solution** to the controller. +
- +
-===== Building a solution ===== +
-Building a solution means taking all the executable ​and HMI projects, library projects and HMI libraries and creating a binary for runtime environment in Mervis OS. The build will check if everything is ok and warn you if something prevents successful build. +
- +
-To build the project, click on the **Build** button on the **Ribbon** +
- +
-{{ :​en:​sw:​01-mervis:​creating_new_project_39_build.png?​direct |}} +
- +
-A dialogue **Selected devices to build** appears and shows you the list of attached PLCs, for which you want to build the project. By default, all attached PLCs are selected. Confirm the selection by clicking on the **OK**. +
- +
-The build will start and in the **Bottom panel** on **Result** tab you will see messages. On the **Status bar** you will see the overall result of the build. If you followed this tutorial precisely, your build should pass with **Status bar** message "​Solution build succeeded"​. +
- +
-{{ :​en:​sw:​01-mervis:​creating_new_project_41_build_result.png?​direct |}} +
- +
-===== Deploying solution ===== +
-Deploying solution means downloading the previously built binary to the controller and selecting the PLC's **Run mode**. To deploy ​solution, click on the **Deploy** button on the **Ribbon** +
- +
-{{ :​en:​sw:​01-mervis:​creating_new_project_42_deploy.png?direct |}} +
- +
-As with the **Build** you will be asked into which PLCs you want to deploy the solution. Confirm the selection by clicking on **OK** +
- +
-{{ :en:sw:01-mervis:​creating_new_project_43_select_devices_to_deploy.png?​direct |}} +
- +
-The last thing of the deploy is to set the new state of the Unipi controller. There are several options, but right now, leave the selected options ​**Warm restart**, **Full run** and **Memory Area 1+2**. For now, confirm ​by clicking on **OK**. +
-{{ :​en:​sw:​01-mervis:​creating_new_project_44_new_state_of_plc.png?​direct |}} +
- +
-===== Blinking LED ===== +
-Let's create our first program, which will blink with the status LED of the DO1.1 output. The blinking means we will periodically set the DO1.1 output to true and false. We have the basic **Executable structure** finished, so we can fill the **main** program with some logic. Double click on the **main.Program.fbd** option on the **Left panel**. +
- +
-{{ :​en:​sw:​01-mervis:​creating_new_project_45_edit_program.png?​direct |}} +
- +
-The program window will appear on the **Main window**. The program canvas is divided into three sections. On the left, we have **Input area**. Each grey box can be filled with some input variable. +
- +
-{{ :​en:​sw:​01-mervis:​creating_new_project_46_input_area.png?​direct |}} +
- +
-On the centre is the **Logic area**, where all the magic of our program is happening.  +
- +
-{{ :​en:​sw:​01-mervis:​creating_new_project_47_logic_area.png?​direct |}} +
- +
-And on the right side is the **Output area**. Each grey box can be filled with some output variables. +
- +
-{{ :en:sw:01-mervis:​creating_new_project_48_output_area.png?​direct |}} +
- +
-Now we could dive into the FBD programming for a long time, but we want to see some results first. So on the bottom of the **Left panel**, click on the **FUPLA Box Explorer**. The **FUPLA Box Explorer** is placed, where you can find **Function blocks** (FBs), which are the cornerstone of the FBD programming. Each **FB** does a certain thing. It has some internal logic, some inputs, which alters the behaviour of internal logic and some outputs of the logic which can be wired to other **FBs** or some HW outputs. +
- +
-Right at the top of the **Left panel**, you can see a search box, which allows you to lookup FBs predefined ​in Mervis. +
- +
-{{ :​en:​sw:​01-mervis:​creating_new_project_49_fupla_searching.png?​direct |}}  +
- +
-Let's search for the **pulse generator**. Enter the **pulse generator** into the search box. As you type, you can see that the search results below are refining and after finishing your search you will see only one result. Grab the FB **Pulse generator (BD2)** (left click and hold), move it above the **Logic area** and release the mouse button. +
- +
-{{ :​en:​sw:​01-mervis:​creating_new_project_50_placing_pulse_generator.png?​direct |}} +
- +
-The **BD2 Pulse Generator** functional block has a simple logic. It periodically sets output **Out** to **true** and **false** with the frequency of 1Hz. Ideal for our blinking example. Let's investigate the FB's inputs. On the FB itself, you can see input **Enable** and outputs **Out** and **OutN**. Click on the FB - it will turn yellow which is the indication, that the FB is selected. Now you can see it's properties on **Properties panel**. In the section **Parameters settings**, you can see a list of inputs and outputs. As you can see, there are much more inputs and outputs, than it is available on the graphical FB. It is because most of them are **hidden**. The visibility of the input or output is configurable via it's **Visible** property. Because we don't need anything else from the **Pulse generator** other than **Out** output, uncheck the **Visible** property on the rest of them. Also, Mervis IDE doesn'​t allow unconnected inputs/​outputs and such FB will fail the **Build**. +
- +
-{{ :​en:​sw:​01-mervis:​creating_new_project_54_visibility.png?​direct |}} +
- +
-Now we have to wire the output of the pulse generator to the DO1.1 output. Right-click on the **Output area** of the program. In the context menu hover over the **Global Variables** and from the submenu select the **Insert Existing Variable** +
- +
-{{ :​en:​sw:​01-mervis:​creating_new_project_52_insert_existing_variable.png?direct |}} +
- +
-In the **Insert Existing Variable** dialogue, you should see a list of all variables and inputs and outputs of your controller. But wait! There is almost nothing. What happened? +
- +
-{{ :​en:​sw:​01-mervis:​creating_new_project_53_insert_existing_variable_dialog.png?​direct |}} +
- +
-<WRAP center round tip 60%> +
-The missing variables in the program are a common problem. The devices we defined under the PLC's channels have some defined inputs and outputs. ​You can see them in their definition. But to have them available ​in the program as well, you need to generate their list into the **Executable project** you are working withThis can be done by the **Set Autogen** functionality ​+
 </​WRAP>​ </​WRAP>​
  
-We very briefly mentioned ​the **Autogen** in the [[#​creating_project|Creating project]] section - that the **Autogen** is automatically set in **Simple mode** and you have to run it on manually in **Full mode**.+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 outputs. Digital 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 output. Some 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**.
  
-The **Autogen** does a **one-time** generation of program variables from the list of inputs/​outputs. That means, even when we added a device, we have to generate the list of variables to be able to use it in the program. To generate the list, switch to the **Solution** tab on the **Left panel**. Right-click on the device name from which you want to generate the variables and then click on **Set Autogen**.+{{ :en:sw:01-mervis:​31_creating-new-project_en.png?direct |}}
  
-{{ :​en:​sw:​01-mervis:​creating_new_project_55_set_autogen.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 **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
  
-On the **Set Autogen** dialogue, you have everything prepared for confirmation by clicking on **OK**.+{{ :​en:​sw:​01-mervis:​32_creating-new-project_en.png?direct |}}
  
-{{ :​en:​sw:​01-mervis:​creating_new_project_56_set_autogen_dialog.png?direct |}}+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
  
-<WRAP center round important 60%> +{{ :en:sw:01-mervis:​33_creating-new-project_en.png?direct |}}
-The last thing you need to remember with **Set Autogen** is, that it is **one-time** generationIf you, for example, rename some input/​output on the device, you need to run it again +
-</​WRAP>​+
  
-Now we have the variables available in the program and we can add our DO1.1 output to the pulse generator. Right-click on the **Output area** of **main** program, hover over the **Global Variables** and from submenu select ​the **Insert Existing Variable**.+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
  
-{{ :en:sw:01-mervis:​creating_new_project_57_insert_global_variable.png?​direct ​|}}+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]].
  
-In the **Insert Existing Variable**, you can see a large list of possible variables. You can look for the variable manually, or you can search by the part of its name. We will search for **do**, which stands for **Digital output**. On our [[https://​www.unipi.technology/​unipi-neuron-l503-p105?​categoryId=10|Unipi Neuron L503]] unit, we have digital outputs DO1.1, DO1.2, DO1.3 and DO1.4. In the list, you can see all four twice, with _r and _w name suffix. Since we want to write to the digital output, we will select the **Neuron_L503_DO_1.01_w** variable and confirm the dialogue by clicking on **OK**.+Upon deploying ​the solution ​the digital output **DO_1.01** will be switched every 5 seconds 
  
-{{ :​en:​sw:​01-mervis:​creating_new_project_58_insert_existing_variable_dialog.png?​direct |}}  
- 
-The output variable will appear on the **Output area** where we right-clicked. Now we need to **wire** the output of the **pulse generator** FB to our output. Move the mouse cursor over the black dot right next to the **Out** output name of the pulse generator. A small box will appear containing information about the output type. Click on the black dot, hold the button and wireline over the black dot right next to the name of the output variable until the newly created line goes green and then release the button. You can see all three steps on the next screenshots. 
- 
-{{ :​en:​sw:​01-mervis:​creating_new_project_59_wiring_output.png?​direct |}} 
- 
-{{ :​en:​sw:​01-mervis:​creating_new_project_60_wiring_output_finishing.png?​direct |}} 
- 
-{{ :​en:​sw:​01-mervis:​creating_new_project_61_wiring_output_finished.png?​direct |}} 
- 
-Now you can try to **Build** the solution by clicking on the **Build** button in the **Ribbon**. If everything goes well, you should see a **Build succeeded** in the **Status bar**. Don't mind the warnings in the **Results** tab in the **Bottom window**. 
- 
-And if the build succeeded (it will, if you follow the tutorial precisely), you can **Deploy** it to the controller. See the [[#​deploying_solution|Deploying solution]] section.` 
- 
-Once the solution is deployed, the DO1.1 status LED will blink in the 1s interval. Congratulations! You just finished your first project with Unipi. 
- 
-===== Switching from Simple mode to Full mode ===== 
-The last thing to mention is how to switch the **Solution** from **Simple mode** to **Full mode**. Right-click on the **Project name** option (first option) in the **Solution** tab on the **Left panel**. In the context menu, click on the **Switch to Full mode**. 
 ---- ----
 ;#; ;#;
 \\ \\
-<​html><​span class="​kbBlueText">​Congratulations,​ your first project with Unipi PLC is now complete!</​span></​html>​+<​html><​span class="​kbBlueText">​Congratulations,​ your first project with Unipi controller ​is now complete!</​span></​html>​
 ;#; ;#;
 +
 ===== Related tutorials ===== ===== Related tutorials =====
   * [[use-mervis-runtime-licence-hidden|]]   * [[use-mervis-runtime-licence-hidden|]]