====== Multiple temperature monitoring using xG18 extension ====== The following guide demonstrates a quick deployment and testing of a PLC Unipi with three Unipi Extension xG18 extension models, an external web server (HMI), Mervis DB, Mervis Proxy and Mervis SCADA. As this guide assumes this is your first experience with Unipi controllers, every step is thoroughly explained. ;;# Patron \\ Neuron \\ Gate \\ Axon ;;# A demo of this project is available on the [[https://scada.unipi.technology/|Mervis SCADA interface]] webpage. * Login: demo * Password: demo Prerequisites: * [[https://www.unipi.technology/neuron-c2|Unipi Neuron S103 controller]] running [[en:files:software:os-images:00-start|Mervis OS]] v2.3.0 or newer * 3x [[https://www.unipi.technology/unipi-extension-xg18-p331|Unipi Extension xG18]] * 24x [[https://www.unipi.technology/cs/1-wire-temperature-sensor-p63|1-Wire Temperature Sensor]] * [[https://www.unipi.technology/power-supplies-c15|24 V⎓ power supply]] * Internet connection * Any PC with OS Windows and [[en:files:software:mervis:00-start|Mervis IDE]] 2.3.0 {{ :files:img_breakline_2.png?nolink |}} The selected Neuron S103 controller serves just as an example. The following guide can be used with any Unipi controller, except Unipi 1.1. {{ :files:img_breakline_2.png?nolink |}} Preparations for this tutorial: - Download and upload Mervis OS into your PLC and install Mervis IDE - [[en:sw:01-mervis:running-on-patron-hidden|Link for Unipi Patron]] - [[en:sw:01-mervis:running-on-neuron-hidden|Link for Unipi Neuron]] - [[en:sw:01-mervis:running-on-gate-hidden|Link for Unipi Gate]] - [[en:sw:01-mervis:running-on-axon-hidden|Link for Unipi Axon]] - [[en:sw:01-mervis:connecting-to-extension-xg18-hidden#connecting_xg18_to_an_unipi_plc|Connect the xG18 modules to your Unipi PLC using the RS485 interface]]. Make sure to follow the serial connection scheme (see the picture in the link) and continue to the next xG18 in line. With all xG18’s connected terminate the bus on each end (a switch next to the RS485’s connector). In this case (eg. the bus begins with an Unipi PLCs and ends with xG18 module), use terminating resistors on both of these devices. - Set Modbus slave addresses on all xG18 modules [[en:sw:01-mervis:connecting-to-extension-xg18-hidden#hardware_configuration_of_communication_parameters_through_dip_switches|using their DIP switches]] (select addresses 1,2,4) - Connect a power supply to the PLC and all xG18 modules - Create Unipi customer account via [[https://www.unipi.technology/customer/registration/|Unipi.Technology]] webpage. If you already have an account, log in - Create a Mervis SCADA project. A guide for the process is available in [[en:sw:01-mervis:mervis-scada-project-hidden#creating_a_scada_project|Chapter 1.2 of guide]] - Download this project, extract it and open it in Mervis IDE ;#; {{ :files:software:mervis:example-projects:scada_24_demo_project_en_v2.3.0_100623.zip |}} ;#; ===== Editing the project ===== Your workspace should now look like this: {{ :cs:sw:01-mervis:01_xg18-demo_cz.png?direct |}} Right-click on PLC and select **Attach PLC**. A dialogue window will open - select **UDP broadcast** and click on **Next**. If you have a PLC with freshly uploaded OS Mervis, click on **Next** - otherwise, enter valid data. The system will now look for all PLCs connected to your local network. Choose your PLC (ie. by its MAC address on the manufacturer sticker) and click on **Next**. A **PLC configuration download** dialogue will show. This is not required for now - leave the box unchecked and continue by clicking **OK**. {{ :cs:sw:01-mervis:02_xg18-demo_cz.png?direct |}} Click on **PLC** to display its properties in the right column. Here, look for **Mervis DB parameters** and **Proxy parameters** sections. If you possess only a licence request card with activation code for Mervis services, start by following [[en:sw:01-mervis:getting-mervis-licence-hidden|this guide]]. Enter your login and password for Mervis DB and the Proxy ID - both can be found on the [[https://www.unipi.technology/getmervis|Unipi.Technology]] webpage. {{ :cs:sw:01-mervis:03_xg18-demo_cz.png?direct |}} Mervis DB is designed for long-term (cloud) data storage and is utilized mainly by the Mervis SCADA service. Mervis Proxy then serves for remote and secure connection to PLCs, be it a connection through Mervis SCADA (which is then able to read to and write from variables for control and monitoring of programs on PLCs), or from the Mervis IDE for uploading, debugging and controlling programmes. To better understand Mervis DB, Mervis Proxy and their configurations you can check the following tutorials containing all important settings. This configuration is already included in the downloadable project. * [[cs:sw:01-mervis:storing-data-to-mervis-db-hidden#nastaveni_ve_vlastnostech_plc|Storing data into Mervis DB]] * [[cs:sw:01-mervis:connecting-to-unipi-via-mervis-proxy-hidden#nastaveni_proxy_serveru|Connecting to Unipi via Mervis Proxy]] As the previous steps changed the PLC configuration (which is not uploaded along with the solution), you need to upload it. In the **left** panel right-click on **PLC** and select: PLC Operations → PLC Settings → Upload configuration If you are unsure what to do, check out the [[en:sw:01-mervis:updating-a-runtime-configuration-hidden|Uploading a RunTime configuration]] guide. {{ :cs:sw:01-mervis:04_xg18-demo_cz.png?direct |}} Now click on ''Terminal_SCADA''. In the right panel, a list of the terminal's properties will display. Enter the same data as in the properties of the SCADA project you created in the [[https://www.unipi.technology/customer/scada/|customer portal]]. Open the customer portal and display the SCADA project you created earlier. Set the terminal parameters in Mervis IDE to the following: * **Project ID**: Copy the ID from the SCADA project detail * **Project name**: Copy the name from the SCADA project detail * **Timezone**: Set to the same value as in the SCADA project * **Project domain**: Copy the domain from the SCADA project detail * **URL Mervis DB**: leave at https://db.unipi.technology/dbaccess * **Mervis DB User and Mervis DB Password**: set the same info as on [[https://www.unipi.technology/getmervis|Unipi.Technology]] {{ :cs:sw:01-mervis:05_xg18-demo_cz.png?direct |}} Now click on the PLC assigned to the SCADA terminal. In the SSCP Parameters section edit the parameters as follows: * Set the same **Proxy ID** as in your Unipi customer account. * other parameters **of this project** are already set {{ :cs:sw:01-mervis:06_xg18-demo_cz.png?direct |}} ===== Uploading the project and SCADA definition ===== If you have everything set according to the previous steps, click on **Deploy solution**. After that check, if all available fields are marked in order to upload the program, the local web and also to create Mervis SCADA definition. {{ :cs:sw:01-mervis:07_xg18-demo_cz.png?direct |}} Continue by Chapter 4 of the [[en:sw:01-mervis:mervis-scada-project-hidden#uploading_the_mervis_scada_project_definition|Creating a Mervis SCADA project]] tutorial to upload the Mervis SCADA definition created in the previous step. ===== Useful tips ===== * Before deployment, you also need to set PLC login, password and some parameters for a secure connection. Follow this guide: [[en:sw:01-mervis:creating-new-project-hidden#securing_the_controller|Securing the controller]]. * If you wish to connect to the PLC from outside of the local network (eg. from any place with internet connectivity), it is necessary for the PLC to have Mervis Proxy set and be connected to the internet. Open the uploaded program in Mervis IDE and search for **Profiles** in the upper part of the left panel. Double-click on **Proxy** to activate the profile for connection through a proxy we created for you previously. //**Note**: Before any adjustments in the program or the configuration you need to switch back to the main profile by double-clicking on it. The selection is indicated by Proxy becoming grey. Re-activate the Proxy profile before remote deployment of the program and disable it again afterwards.// * The project also contains a program that signals an error or sensor disconnection. The entire program is created in **main.program.fbd** including comments. ===== Advantages ===== * Each sensor connected to Extension xG18 can be swapped with another without the need to edit the program. If the program is set accordingly, the swap can be performed on the run. * Easy system connection due to RS485 module bus topology and sensors with RJ45 connectors for connecting to Extension xG18. * The PLC can be easily programmed or debugged both locally and remotely through Mervis Proxy. * The project is implemented in Mervis SCADA cloud service and is suitable for use in monitoring centres which do not require to be in the same location.