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 12:48]
avsetula [Connecting the inputs/outputs]
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 =====
-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 worryall 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.+Now we move to the configuration. This part is especially important ​if you are just starting ​a new project ​with a controller ​or expansion modules that have been used in the pastThat's because these devices may have a previous ​configuration ​that is independent ​of the uploaded solution, even the operating system, and may unexpectedly affect the operation of the entire solution.
  
-===== Creating a program ===== +There is no need to worry, just 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 configuration. Detailed description of this procedure is in the article: [[en:​sw:​01-mervis:​unipi-configure-module-hidden|]].
-Next step in creating a working solution ​is to create a program.+
  
-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:​12_creating-new-project_en.png?direct |}}
  
-{{ :​en:​sw:​01-mervis:​creating_new_project_26_add_new_project.png?​direct |}} 
  
-In the **New Project** dialogue, you have to fill the **Name**. The **Location** is automatically ​subdirectory ​in the **Solution** directory, so you can leave it as it is and confirm by clicking on **OK**+===== Switching to Full Mode ===== 
 +As you created ​the solution in **Simple Mode**, you do not have access ​to some Mervis IDE functions such as history logs. The advantage of creating ​project ​in Simple mode is that you create the basic structure of the project, including the creation of the main program ​**main.program.fbd** and the assignment of this program to the PLC task, so it is not necessary to set everything manually. Another advantage is that all data points in device definitions (e.g. in modbus tables) have automatically generated global variables. This is especially useful when getting to know the Mervis IDE to make everything a little easier. ​
  
-{{ :​en:​sw:​01-mervis:​creating_new_project_27_new_project.png?direct |}}+With everything required configured, you can switch the solution to **Full Mode**
  
-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**.+Right-click on **Solution Name** (first tab) in the **Solution** panel in **left menu**. In the context menu click on **Switch to Full Mode**. 
  
-{{ :​en:​sw:​01-mervis:​creating_new_project_28_add_program.png?direct |}}+{{ :​en:​sw:​01-mervis:​13_creating-new-project_en.png?direct |}}
  
-The dialogue **Add Program** ​will appear, and we have to set the **Name**Let's call this program ​**main**.+A warning ​will tell you the action is irreversibleConfirm by **OK** to continue
  
-{{ :​en:​sw:​01-mervis:​creating_new_project_29_add_program_name.png?direct |}}+{{ :​en:​sw:​01-mervis:​14_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]] standardand one of 2 supported by the Mervis IDE. Since learning ST language is out of the scope of this tutorialselect 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**.+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 ModeDon't deletemove or edit this fileits editing ​and creation ​are done automatically ​by Autogen
  
-{{ :​en:​sw:​01-mervis:​creating_new_project_30_add_program_language.png?direct |}} +Autogen serves for automatic generation of variables from data points and can be applied to an entire device containing multiple data points, groups etc
  
-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: +<WRAP center round info 90%> 
- +[[autogen-hidden|More about Autogen here]]
-{{ :​en:​sw:​01-mervis:​creating_new_project_31_after_creation_of_program.png?​direct |}} +
- +
-<WRAP center round info 60%> +
-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>​ </​WRAP>​
  
-===== Setting a task ===== +{{ :​en:​sw:​01-mervis:​15_creating-new-project_en.png?direct |}}
-So far we have attached the controller, configure the access to inputs and outputs and created a structure of an executable project. We also created a **main** program, so far without any logic. The last thing to do in this minimalistic **Solution** is to tell the controller, which 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:​creating_new_project_32_no_tasks.png?​direct |}}+===== Building and Deploying the solution (project) =====
  
-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** ​**User Definition**As you can see we have no task created at the moment+==== Solution building ==== 
 +Solution build compiles all executable projectsHMI interfacesfunction libraries and HMI libraries into single binary file used by the Mervis OS runtimeDuring the process, the system checks the validity of all configurations and will warn you if anything would prevent a successful compilation
  
-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.+To start the compilation go to the **upper ribbon** and click on **Build Solution**. 
  
-{{ :​en:​sw:​01-mervis:​creating_new_project_32_no_tasks.png?direct |}}+{{ :​en:​sw:​01-mervis:​16_creating-new-project_en.png?direct |}}
  
-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** tabwhich should be activeThe **Main window** of **PLC** tab therefor shows a list of defined tasks for this controller. As you can see, there are no tasks.+**Selected Devices to Build** window will appear - a list of connected controllers ​the project can be compiled forBy default, the system selects all available controllersterminals or web interfacesConfirm your selection by clicking on **OK**.
  
-To add a new **Task**, right-click on the space in the **Main window** and in the context menu, select **Add Task**+{{ :​en:​sw:​01-mervis:​17_creating-new-project_en.png?direct |}}
  
-{{ :​en:​sw:​01-mervis:​creating_new_project_34_task_added.png?direct |}}+This step will start the compilation itself. The **Results** tab on the **bottom panel** will display any messages displayed during the compilation. The compilation progress can be monitored in the **status bar**. If you performed all the instructions above correctly, the compilation should be completed successfully and the status bar should display **"​Solution build succeeded"​**.
  
-New **Task** will appear in the list. You can see, that there is no value in the **Program Mapping**. To map a program to this task, click on the blank space+{{ :​en:​sw:​01-mervis:​18_creating-new-project_en.png?direct |}}
  
-{{ :en:​sw:​01-mervis:​creating_new_project_35_add_program_mapping.png?direct |}}+==== Deploying the solution ==== 
 +**Deploying a solution means:** compiling and then uploading the created binary file to the controller and running it in **Full run**. Click **Deploy Solution** on **upper ribbon** to deploy the solution.
  
-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:​19_creating-new-project_en.png?​direct ​|}}
  
-{{ :​en:​sw:​01-mervis:​creating_new_project_36_select_program.png?direct |}}+As with the **solution build**, **Deploy Solution** will also display a list of controllers to deploy the solution to. Confirm your selection by clicking on **OK**
  
-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:​20_creating-new-project_en.png?direct |}}
  
-{{ :​en:​sw:​01-mervis:​creating_new_project_37_commiting_changes.png?direct |}}+The last step in deploying a solution is to set a new controller status. There are multiple options, but for the purposes of this tutorial, leave the default options and click **OK**
  
-Now we finished the bare minimum to deploy this **Solution** to the controller.+{{ :​en:​sw:​01-mervis:​21_creating-new-project_en.png?direct |}}
  
-===== 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**+===== Switching a digital output ===== 
 +With the project ​good to gowe 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:​creating_new_project_39_build.png?direct |}}+{{ :​en:​sw:​01-mervis:​22_creating-new-project_en.png?direct |}}
  
-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**.+program window will appear in the **main window**. 
  
-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"​.+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_41_build_result.png?direct |}}+{{ :​en:​sw:​01-mervis:​23_creating-new-project_en.png?direct |}}
  
-===== Deploying solution ===== +The middle section is called ​**logic section** and will be used for the programming itself
-Deploying solution means downloading the previously built binary to the controller and selecting the PLC'​s ​**Run mode**. To deploy a solution, click on the **Deploy** button on the **Ribbon**+
  
-{{ :​en:​sw:​01-mervis:​creating_new_project_42_deploy.png?direct |}}+{{ :​en:​sw:​01-mervis:​24_creating-new-project_en.png?direct |}}
  
-As with the **Build** you will be asked into which PLCs you want to deploy ​the solutionConfirm the selection by clicking on **OK**+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_43_select_devices_to_deploy.png?direct |}}+{{ :​en:​sw:​01-mervis:​25_creating-new-project_en.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 nowconfirm ​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 inputsinternal 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_44_new_state_of_plc.png?direct |}}+
  
-===== Blinking LED ===== +Click on **FUPLA Box Explorer** - you can find it among tabs at the left panel's bottom edge
-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 |}}+{{ :​en:​sw:​01-mervis:​26_creating-new-project_en.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.+The **left ​panel'​s** upper edge includes a search column for quick and easy search for blocks predefined by Mervis
  
-{{ :​en:​sw:​01-mervis:​creating_new_project_46_input_area.png?direct |}}+{{ :​en:​sw:​01-mervis:​27_creating-new-project_en.png?direct |}}
  
-On the centre is the **Logic area**, where all the magic of our program is happening+Let's find a pulse generator. Enter **pulse generator** into the search column. As 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
  
-{{ :​en:​sw:​01-mervis:​creating_new_project_47_logic_area.png?direct |}}+{{ :​en:​sw:​01-mervis:​28_creating-new-project_en.png?direct |}}
  
-And on the right side is the **Output area**. Each grey box can be filled with some output ​variables.+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 outputsAs 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 
  
-{{ :en:sw:​01-mervis:​creating_new_project_48_output_area.png?direct |}}+//**Note:**you can display additional info about any block by selecting it and pressing F1 to open the help page for the block.//
  
-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.+{{ :​en:​sw:​01-mervis:​29_creating-new-project_en.png?direct |}}
  
-Right at the top of the **Left panel**, you can see search boxwhich allows you to lookup FBs predefined in Mervis.+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 ​context menumove the cursor over **Global Variables** and from the submenu choose **Insert existing variable**
  
-{{ :​en:​sw:​01-mervis:​creating_new_project_49_fupla_searching.png?direct |}} +{{ :​en:​sw:​01-mervis:​30_creating-new-project_en.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 resultGrab the FB **Pulse generator ​(BD2)** (left click and hold), move it above the **Logic area** and release ​the mouse button.+In the **Insert Existing Variable** dialog window, you will see a list of all available variables, inputs and outputs of the controllerIf 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 tablenext to the Modbus TCP channel and select ​**Set autogen** in the context menu.
  
-{{ :​en:​sw:​01-mervis:​creating_new_project_50_placing_pulse_generator.png?direct |}}+However, if you followed given instructions,​ all the variables are generated automatically in the program in Simple mode.
  
-The **BD2 Pulse Generator** functional block has 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**.+<WRAP center round info 95%> 
 +**Autogen** performs ​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_54_visibility.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.
-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|]]