This is an old revision of the document!


Connecting to Unipi via Mervis Proxy

In this tutorial, we will learn how to set the Unipi controller to use the Mervis Proxy and how to connect to the Unipi via this proxy.

Axon
Neuron
Unipi 1.1

In this tutorial, we will use Unipi Neuron L503.

If you followed the Prerequisites, your workspace should look like this:

Select the PLC in the Left panel and look for the Proxy Parameters section in the Properties panel.

Change the values in the section accordingly:

  • Enabled: set this value to TRUE to enable the proxy communication
  • Proxy ID: fill the proxy ID which you obtained in your account on unipi.technology
  • URL: for Mervis OS v2.3.0 and newer, set the URL to https://proxy.unipi.technology:6678. For the rest, use http://proxy.unipi.technology:6677
  • Certification validation: set to FALSE by default. More info in the Certification validation article
  • Keep-alive Period: leave this option unchanged

Since we changed the configuration of PLC, we need to upload it in order to take affect. Right click on the PLC in the Left Panel and in the context menu select the PLC OperationPLC SetupUpload configuration. If you are not sure, check out the Uploading a RunTime configuration tutorial.

An upload configuration dialog will appear. If you are on the same LAN as your controller, you can select UDP Broadcast, otherwise select the Use Deploy Parameters and confirm by clicking on OK.

Now we can switch into the debugging mode and check, if the connection to Mervis Proxy is working. Start Debugging and switch to the System status tab in the Main window. Look for the Proxy in the Services section. You should see the status changing between Idle and Connecting, depending on the Keep-alive Period value.

To use the power of proxy connections, it is time to learn about Profiles. Profile are used in situations, where you need to switch between different settings of the Solution. In this tutorial, we need to switch between two connection parameters settings: first, when we are connecting to UniPi via local LAN and second, when we are connecting via proxy.

Every solution is automatically created with default profile, which you can see in the Left panel under the System option. To create new profile, right click on the default Profile and select Add Child Profile

A new profile called Profile will appear under the default one. Select it by clicking on it and move over to the Properties panel. Change to name of the profile to proxy.

And repeat the process for another profile and let's call it lan. You should have this workspace afterwards:

As you can see, the default Profile has colorized icon and the text is bold. This indicates the active profile. Any changes in the solution parameters will be stored into the active profile. To set another profile as active, double click on the profile name.

So double click on the proxy profile and it will become active. As you can see, the default profile is still active as well. This is due to the fact the proxy profile is a child profile of the default profile and therefor are active both.

Now we can change the connection parameters to use the proxy. Select the PLC in the Left panel and move over to the Properties panel. In the section PLC Connection Parameters change the Connection Type to Proxy.

In the section Connection parameters change the values accordingly:

  • URI: for PLCs using Mervis OS and Mervis IDE 2.3.0 or newer, set the URI to tcps://proxy.unipi.technology:12349. For the rest, use tcp://proxy.unipi.technology:12348
  • Proxy ID: fill the proxy ID which you obtained in your account on unipi.technology

Simply start the debugging session and the Mervis IDE will connect to the UniPi controller over the Mervis Proxy.

To change the connection parameters back to LAN settings simply set the lan profile active.