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-on-unipi11-hidden [2021/05/11 12:15]
avsetula
en:sw:01-mervis:creating-new-project-on-unipi11-hidden [2021/09/10 13:07] (current)
avsetula [First project with Unipi 1.1/Lite]
Line 22: Line 22:
   - [[https://​www.unipi.technology/​2gb-prumyslova-microsd-pametova-karta-slc-p232|MicroSD card]] for the PLC    - [[https://​www.unipi.technology/​2gb-prumyslova-microsd-pametova-karta-slc-p232|MicroSD card]] for the PLC 
   - MicroSD->​SD adapter or a microSD card reader with USB connector   - MicroSD->​SD adapter or a microSD card reader with USB connector
-  - [[https://​www.unipi.technology/​napajeci-zdroj-pro-din-listu-5v-dc-2-4a-p65?​categoryId=15|5 ​VDC / 2 A power supply]] +  - [[https://​www.unipi.technology/​napajeci-zdroj-pro-din-listu-5v-dc-2-4a-p65?​categoryId=15|5 ​V⎓ / 2 A power supply]] 
-  - Downloaded archive with [[en:files:software:os-images:00-start#​unipi_11_mervis_os|Mervis OS for Unipi 1.1/​Lite]] +  - Downloaded archive with [[en:hw:03-unipi11:download-image:01-mervis|Mervis OS for Unipi 1.1/​Lite]] 
-  - Computer with [[cs:​files:​software:​mervis:​00-start|Mervis IDE]] installed. ​+  - Computer with [[en:​files:​software:​mervis:​00-start|Mervis IDE]] installed. ​
  
 {{ :​files:​img_breakline_2.png?​nolink |}} {{ :​files:​img_breakline_2.png?​nolink |}}
Line 31: Line 31:
   - [[en:​sw:​01-mervis:​01-mervis-ide| Get to know Mervis IDE]]   - [[en:​sw:​01-mervis:​01-mervis-ide| Get to know Mervis IDE]]
   - [[en:​sw:​01-mervis:​connecting-to-unipi-hidden| Connect the PLC to your computer]]   - [[en:​sw:​01-mervis:​connecting-to-unipi-hidden| Connect the PLC to your computer]]
-  - [[en:​sw:​01-mervis:​running-on-neuron-hidden#​mervis_on_unipi_neuron_11| Deploy Mervis OS to the SD card]]+  - [[en:​sw:​01-mervis:​running-on-unipi11-hidden| Deploy Mervis OS to the SD card]]
   - Plug in the power supply and wait for at least a minute until the PLC's OS boots up.    - Plug in the power supply and wait for at least a minute until the PLC's OS boots up. 
 </​WRAP>​ </​WRAP>​
Line 45: Line 45:
 {{ :​en:​sw:​01-mervis:​02_creating-new-project-on-unipi11_en.png?​direct |}} {{ :​en:​sw:​01-mervis:​02_creating-new-project-on-unipi11_en.png?​direct |}}
  
- 
- 
-/* FIXME - project skeleton */ 
 The second thing you need to specify when creating a solution is **Mode selection**. The mode determines the behaviour of the Mervis IDE during its use; **Simple Mode** pre-defines the whole core of the solution, i.e. defines basic programs, generates mapping of variables, etc. At the same time, however, this option will limit the selection of the programming method only to **Function Block Diagram (FBD)**. Simple mode is therefore especially suitable for beginners. For more experienced users, there is a **Full mode** from which you can switch to the Simple mode, but this step is irreversible. Full Mode does not create the initial project structure and the entire basic configuration is up to you.  The second thing you need to specify when creating a solution is **Mode selection**. The mode determines the behaviour of the Mervis IDE during its use; **Simple Mode** pre-defines the whole core of the solution, i.e. defines basic programs, generates mapping of variables, etc. At the same time, however, this option will limit the selection of the programming method only to **Function Block Diagram (FBD)**. Simple mode is therefore especially suitable for beginners. For more experienced users, there is a **Full mode** from which you can switch to the Simple mode, but this step is irreversible. Full Mode does not create the initial project structure and the entire basic configuration is up to you. 
  
Line 60: Line 57:
 {{ :​en:​sw:​01-mervis:​04_creating-new-project-on-unipi11_en.png?​direct |}} {{ :​en:​sw:​01-mervis:​04_creating-new-project-on-unipi11_en.png?​direct |}}
  
-The **Attach Controller** dialogue will appear, in which we can specify, how the Mervis IDE should connect to the controller. If the PLC is in the same LAN network, you can use the **UDP Broadcast** and then click on **Next >**.+The **Attach Controller** dialogue will appear, in which we can specify, how the Mervis IDE should connect to the controller. If the PLC is in the same LAN network, you can use the **UDP Broadcast** and then click on **Next >**.
  
 {{ :​en:​sw:​01-mervis:​05_creating-new-project-on-unipi11_en.png?​direct |}} {{ :​en:​sw:​01-mervis:​05_creating-new-project-on-unipi11_en.png?​direct |}}
  
-You will now be prompted to enter a username and password (SSCP access) to connect to the controller. The default setting is: **admin / rw**. Now leave and click **Next >​**. ​+You will now be prompted to enter a username and password (SSCP access) to connect to the controller. The default setting is: **admin / rw**. Now leave and click **Next >​**. ​
  
 {{ :​en:​sw:​01-mervis:​06_creating-new-project-on-unipi11_en.png?​direct |}} {{ :​en:​sw:​01-mervis:​06_creating-new-project-on-unipi11_en.png?​direct |}}
Line 72: Line 69:
 {{ :​en:​sw:​01-mervis:​07_creating-new-project-on-unipi11_en.png?​direct |}} {{ :​en:​sw:​01-mervis:​07_creating-new-project-on-unipi11_en.png?​direct |}}
  
-After the searching is finished, you will be presented with the list of all detected controllers. The target controller has its name displayed in the **Platform** tab. This tutorial used Unipi 1.1 device - in your case, choose whatever controller you are using and click on **Next**.+After the searching is finished, you will be presented with the list of all detected controllers. The target controller has its name displayed in the **Platform** tab. This tutorial used Unipi 1.1 device - in your case, choose whatever controller you are using and click on **Next >**.
  
 {{ :​en:​sw:​01-mervis:​08_creating-new-project-on-unipi11_en.png?​direct |}} {{ :​en:​sw:​01-mervis:​08_creating-new-project-on-unipi11_en.png?​direct |}}
Line 102: Line 99:
  
 ===== Connecting inputs/​outputs ===== ===== Connecting inputs/​outputs =====
-In Mervis IDE you now have Unipi 1.1/Lite attached. Construction-wise,​ Unipi controllers consist of a computing module (Raspberry Pi in our case) and a circuit board with inputs and outputs. The board communicates with the computer using **Modbus TCP** and **I2C**. This is the reason why you need to set up **two** communication channels to control Unipi 1.1/1.1 Lite boards. The first channel is for controlling analog and digital I/Os via Modbus TCP protocol while the I2C channel controls relay outputs. ​+In Mervis IDE you now have Unipi 1.1/Lite attached. Construction-wise,​ Unipi controllers consist of a computing module (Raspberry Pi in our case) and a circuit board with inputs and outputs. The board communicates with the computer using **Modbus TCP** and **I²C**. This is the reason why you need to set up **two** communication channels to control Unipi 1.1/1.1 Lite boards. The first channel is for controlling analog and digital I/Os via Modbus TCP protocol while the I²C channel controls relay outputs. ​
  
 Add two **communication channels** to the PLC. TO add a channel right-click on the **PLC** name and then click on **Add Channel**. Repeat for the second channel. ​ Add two **communication channels** to the PLC. TO add a channel right-click on the **PLC** name and then click on **Add Channel**. Repeat for the second channel. ​
Line 112: Line 109:
 {{ :​en:​sw:​01-mervis:​12_creating-new-project-on-unipi11_en.png?​direct |}} {{ :​en:​sw:​01-mervis:​12_creating-new-project-on-unipi11_en.png?​direct |}}
  
-If you click on the first channel, its properties will appear in the right panel. The first item determines the channel'​s name; we recommend to give channels descriptive names - in this case, I2C will do. +If you click on the first channel, its properties will appear in the right panel. The first item determines the channel'​s name; we recommend to give channels descriptive names - in this case, I²C will do. 
  
-Click on **no protocol** and select **PlatformIO** from the list. By doing so more options will appear - all you need to do here is to make sure the **link protocol** is set to **I2C**. +Click on **no protocol** and select **PlatformIO** from the list. By doing so more options will appear - all you need to do here is to make sure the **link protocol** is set to **I²C**. 
  
 The first channel for relay outputs is already set.  The first channel for relay outputs is already set. 
Line 128: Line 125:
 With both channels configured we can now move to add individual devices. These device definitions **are different between Unipi 1.1 and Unipi 1.1 Lite**, making the correct selection of definition necessary. ​ With both channels configured we can now move to add individual devices. These device definitions **are different between Unipi 1.1 and Unipi 1.1 Lite**, making the correct selection of definition necessary. ​
  
-==== I2C ==== +==== I²C ==== 
-In the **left panel** right-click on the I2C channel. Select **Add Library Device** from the context menu. +In the **left panel** right-click on the I²C channel. Select **Add Library Device** from the context menu. 
  
 {{ :​en:​sw:​01-mervis:​15_creating-new-project-on-unipi11_en.png?​direct |}} {{ :​en:​sw:​01-mervis:​15_creating-new-project-on-unipi11_en.png?​direct |}}
  
-In the **Add Library Device** dialogue window you will see a list of devices. Find and expand the **Unipi (v1.1)** folder and move to the **I2C** subfolder. Select the suitable device definition accordingly (eg. **Analog-Inputs + Unipi1_Relays** for Unipi 1.1 and **Unipi1Lite_Relay** for Unipi 1.1 Lite). If you have the definition selected, click on the arrow icon {{:​files:​dialog_arrow_right.png?​nolink|}} to add the controller into the list of the selected device. After that, you need only to confirm by clicking on OK. +In the **Add Library Device** dialogue window you will see a list of devices. Find and expand the **Unipi (v1.1)** folder and move to the **I²C** subfolder. Select the suitable device definition accordingly (eg. **Analog-Inputs + Unipi1_Relays** for Unipi 1.1 and **Unipi1Lite_Relay** for Unipi 1.1 Lite). If you have the definition selected, click on the arrow icon {{:​files:​dialog_arrow_right.png?​nolink|}} to add the controller into the list of the selected device. After that, you need only to confirm by clicking on OK. 
  
 {{ :​en:​sw:​01-mervis:​16_creating-new-project-on-unipi11_en.png?​direct |}} {{ :​en:​sw:​01-mervis:​16_creating-new-project-on-unipi11_en.png?​direct |}}
Line 148: Line 145:
 {{ :​en:​sw:​01-mervis:​18_creating-new-project-on-unipi11_en.png?​direct |}} {{ :​en:​sw:​01-mervis:​18_creating-new-project-on-unipi11_en.png?​direct |}}
  
-The new device will appear below the corresponding ​I2C / Modbus TCP channel. ​+The new device will appear below the corresponding ​I²C / Modbus TCP channel. ​
  
 {{ :​en:​sw:​01-mervis:​19_creating-new-project-on-unipi11_en.png?​direct |}} {{ :​en:​sw:​01-mervis:​19_creating-new-project-on-unipi11_en.png?​direct |}}
Line 154: Line 151:
  
 ===== Switching to Full Mode ===== ===== Switching to Full Mode =====
-/* FIXME - project skeleton */ 
 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 a 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. ​ 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 a 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. ​
  
Line 167: Line 163:
 {{ :​en:​sw:​01-mervis:​21_creating-new-project-on-unipi11_en.png?​direct |}} {{ :​en:​sw:​01-mervis:​21_creating-new-project-on-unipi11_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 ​**Globals** folder containing ​**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 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. 
  
 <WRAP center round info 90%> <WRAP center round info 90%>
Line 176: Line 172:
  
  
-===== Building and uploading ​the solution (project) =====+===== Building and Deploying ​the solution (project) =====
  
 ==== Solution building ==== ==== Solution building ====
Line 194: Line 190:
  
 ==== Deploying the solution ==== ==== 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.+**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.
  
 {{ :​en:​sw:​01-mervis:​26_creating-new-project-on-unipi11_en.png?​direct |}} {{ :​en:​sw:​01-mervis:​26_creating-new-project-on-unipi11_en.png?​direct |}}
Line 245: Line 241:
 {{ :​en:​sw:​01-mervis:​36_creating-new-project-on-unipi11_en.png?​direct |}} {{ :​en:​sw:​01-mervis:​36_creating-new-project-on-unipi11_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 **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**. ​
  
 {{ :​en:​sw:​01-mervis:​37_creating-new-project-on-unipi11_en.png?​direct |}} {{ :​en:​sw:​01-mervis:​37_creating-new-project-on-unipi11_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**, 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 I²C and Modbus TCP channels and click on **Set autogen** in the context menu. 
  
 If you followed the guide closely, Simple Mode already generated all variables for the program. If you followed the guide closely, Simple Mode already generated all variables for the program.
Line 271: Line 267:
 {{ :​en:​sw:​01-mervis:​40_creating-new-project-on-unipi11_en.png?​direct |}} {{ :​en:​sw:​01-mervis:​40_creating-new-project-on-unipi11_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 relay output ​**Relay1** ​will be switched every 5 seconds.  ​
  
 ---- ----