Is It Possible to Remotely Access the Embedded UI of My NI Linux Real-Time Target?

Updated Mar 19, 2024

Reported In

Hardware

  • CompactRIO Controller

Operating System

  • LabVIEW Real-Time (NI Linux Real-Time)

Issue Details

I want to access the UI I created in my CompactRIO (cRIO), but I don't have a monitor to connect to it, I would like to be able to access and manipulate it remotely through my PC.

Solution

It is possible to accomplish this by using the opkg feed x11vnc. This is a package that allows you to serve the current UI over a VNC connection to the target (meaning that you can remotely check the status of an embedded UI of a running LabVIEW application).

Note: This is not a recommended solution in the long term, to interact with a Real-Time executable, NI recommends developing a host VI or use a web-based control with G Web Development Software.

In order to do this, it is needed to follow these steps:
 

1. Make sure your NI Real-Time Target support embedded UI. See Which NI Real-Time Targets Support Embedded UI? - NI for more information.
2. Use NI MAX to check Enable Embedded UI on the target and save settings.

ENABLE EMVEDDED ui.png
3. Connect to the shell on the target via SSH using a terminal emulator such as PuTTY. See Accessing the Shell on NI Linux Real-Time Devices for more information.

4. Run the following commands to install the feed: 

opkg update
opkg install x11vnc

5. Start the VNC Server by running the next command on the shell:

DISPLAY=:0 x11vnc

Alternatively, you can also run the following command on the terminal from the embedded UI instead:

x11vnc

x11vnc embedded UI.png

Once any of these commands are run, it will start the server and provide the port it will use.

port.png

Note: Right now, as configured, the x11vnc server will exit after the first connection is closed, if you want to keep the interface up run instead:

DISPLAY=:0 x11vnc -forever

or

x11vnc -forever

Depending on if you're using the shell or the terminal from the embedded UI.

6. Download a VNC client for your OS of choice.

7. Connect to your target by entering its IP address and the port being used (as mentioned in step 5) in the VNC Client.

vnc.png

8. (Optional) If you want this to run automatically during the startup, in the embedded UI, you can go to Settings Manager and select Session and Startup:

process VNC.png

Then go to Application Autostart, select Add application and write the following command:

process x11 vnc.png
This will ensure that the VNC server is initialized each time the target is restarted and therefore can be accessed remotely.

Additional Information

Installation of x11vnc on NI Linux Real-Time controller is available to download since Real-Time version 2016. If your CompactRIO actually runs LabVIEW Real-Time 2015 and having VNC server is critical for your application you should consider software update to version 2016 (this might require formatting the device). The x11vnc with all required libraries is available in NI Linux Real-Time 2016 feeds and any higher version. 

The constant use of this tool is not recommended since it may cause a hang in the Real-Time target due to the use of resources.

Note: The screenshots in this article use TightVNC, a third-party VNC client, although any VNC client can be used.