User interface on real-time LabVIEW applications
Some time ago, we developed an application that required an embedded user interface (UI) on a real-time (RT) Linux target. The purpose of the UI was to configure the hardware, set up measurements, and view the measurement results.
I know what you're thinking, but our first idea was not to develop an Advanced UI for an RT Target. I mean, an RT system is chosen for its timing accuracy and reliability. You may want to develop a simple embedded UI for debugging purposes, but not an advanced UI that uses a significant amount of resources. In addition, some RT targets do not even support an embedded UI.
Nevertheless, we still chose to create such a UI for the project mentioned above. In this blog post, I want to share some of our experiences.
How did we create the UI?
We developed the application in the LabVIEW 2020 development environment for Windows, and we used this to create the UI. It may be good to know that the RT Linux target for this project was an 8-core PXI system.
Firstly, the development of a UI for an RT Linux target is not much different than for a Windows system. However, there is a small difference considering how to test your UI's appearance. On a regular Windows system, you can just run the application. For an RT target, you need to deploy the application and run it as startup.
What did we observe?
First, we saw that the font did not look the same on the RT Linux target compared to the Windows system. If you use 15pt Application Fonts, the font on both systems looks as presented below. But even if you use a specific font, like Arial, the font may look different.
The difference in appearance does not only apply to text elements but also to e.g. Boolean texts:
So, the challenge is to find a font that looks nice on the RT Linux target, independent of how it looks on the Windows system. This has probably been the issue we spent most of our time on, trying to get the UI appearance right.
After a lot of experimenting with different fonts and different font sizes we found that the Helvetica font gave us the best results on both Windows and Linux RT.
Second, it became clear to us that a little bit more work is required to set the right dimensions for multicolumn list boxes. Suppose that you add a multicolumn listbox on the UI which has to show the latest log entries. It should consist of a “Date Time” and “Message” column. Due to the different appearance of the font, the columns may be too small on the RT Linux target, and e.g. the date and time entries are not entirely visible.
Therefore, it is necessary to adjust the dimensions, deploy the application, and run it as startup. This includes some extra manual steps and, if you're unlucky, you have to repeat this procedure several times.
Third, we also observed that decorations may be shifted by one pixel on the RT Linux UI. Depending on the layout of your UI, it may be necessary to adjust their positions. This also requires the extra steps of deploying the application and running it as startup. In addition, it may also take several tries and thus extra work to get their position right.
Fourth, it appeared that there are some limitations considering plotting data in e.g. waveform graphs. We did not quantify this, but we observed that, when several graphs are used, the UI updates become very slow at some point and that the RT Linux target reaches its limits. In that case, it can help to downsize data and to switch off anti-aliasing. However, these measures also have their limitations. So, if you want to use a lot of graphs on your UI, it may be worth considering using a UI on a Windows system rather than an embedded UI on a Linux Target.
So, it is possible to create an embedded UI for an RT Linux target that could be used for more than just debugging purposes. However such a UI has its limitations. From our experience, a few points should be considered:
- Fonts look differently on an RT Linux target compared to a Windows system. It can be challenging to find a nice-looking font. In addition, this can influence the necessary size and dimensions of UI elements like a multicolumn list box.
- The position of decorations may shift. To keep it simple, it is recommended to limit the number of decorations.
- There are some limitations considering e.g. waveform graphs and plotting data. To keep the performance up, it is recommended to limit the number of plots, downsize the data to plot, and switch off anti-aliasing.