Calibrating Your Touch Screen Monitor in NI Linux Real-Time

Updated Nov 30, 2022

Environment

Operating System

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

When first configuring a touch screen monitor for your NI Linux Real-Time target, you will need to calibrate the Touch Screen Monitor (TSM) to map your touch inputs properly to the user interface. To calibrate your TSM with NI Linux Real-Time, you can perform one of three options: use the attached VI to calibrate your monitor, configure the target remotely through SSH, or configure the target using the built-in NI Linux Real-Time terminal.

Calibrating your Touch Screen Monitor with LabVIEW

Using LabVIEW 2015 or later:

  1. Create a new project containing your target, and add a new VI under the target.
  2. On the block diagram of this VI, add RT Calibrate Touchscreen.vi located in the Real-Time » RT Utilities pallet.
  3. Run the VI and perform the on-screen calibration procedure on your touch screen monitor.
    1. Note: Disconnect any USB mice attached to the TSM

Using LabVIEW 2014 SP1 or earlier:

  1. Download the attached tpm_calibration.zip and extract the contents to a known location.
  2. Open the LabVIEW Project and re-assign the IP Address of your target to match the IP address found in MAX. You can accomplish this by right-clicking the target and selection Properties shown in Figure 1.

Figure 1. LabVIEW Project IP Setting

 

  1. Open Touch_Screen_Calibration.vi and run the VI on your target. If your monitor is connected via USB, you will see the calibration screen shown in Figure 2.

Figure 2. Calibration user Interface

 

  1. Disconnect any USB mice attached to the TSM and then complete the on-screen calibration procedure and the settings will be retained on your NI Linux Real-Time target until you format or re-install software.


Calibrating your Touch Screen Monitor Remotely

  1. You must first configure your NI Linux Real-Time target to allow you to connect via a Secure Shell (SSH) session. For instructions on how to enable this, please follow Accessing the Shell on NI Linux Real-Time Devices. Note: You must also have software installed on your target to proceed. For instructions on how to install software, please follow the instructions in Getting Started with CompactRIO Hardware and LabVIEW.
  2. Once you have successfully connected to your target, you must log-in as an administrator to be granted proper permissions.
  3. To calibrate the touch screen monitor, enter the following commands in the SSH terminal window:
» export DISPLAY=:0
» xinput_calibrator | tail -6 > /usr/share/X11/xorg.conf.d/99-calibration.conf


Figure 3. SSH Session Demonstrating Touch Screen Calibration

 

  1. After the commands are entered, the touch screen monitor connected to your target will bring up the screen shown above in Figure 2. Follow the on-screen instructions to successfully calibrate the touch screen.
  2. Once you have finished calibration, the settings will persist between reboots of your target.

 

Calibrating you Touch Screen Monitor Locally

  1. You must have LabVIEW RT installed on your target to proceed. For instructions on how to install software, please follow the instructions in Getting Started with CompactRIO Hardware and LabVIEW.
  2. The embedded UI functionality of NI Linux Real-Time must now be enabled. You can enable this feature by opening MAX, selecting your target beneath the Remote Systems list on the left-hand side of the window, and selecting the "Enable Embedded UI" checkbox in the System Settings tab:

Figure 4. MAX System Settings Tab Showing that "Enable Embedded UI" is Selected.

 

For more detailed instructions on enabling the embedded UI, please open LabVIEW Help by navigating to Start » Program Files » National Instruments » LabVIEW 2014 (or later) » LabVIEW 2014 (or later) Help.
Once you have opened the LabVIEW Help, navigate to Real-Time Module » Real-Time Module How-To » Configuring RT Target Settings » Using the Embedded UI on RT Targets » Enabling the Embedded UI on RT Targets.

  1. Once you have enabled the embedded UI, restart your target for changes to take effect. Upon reboot, you should see a screen similar to this on your monitor:


Figure 5. NI Linux Real-Time Desktop with Embedded UI Enabled.

 

  1. Select the Terminal icon at the bottom of the screen.


Figure 6. The NI Linux Real-Time Menu.

 

  1. Type the following commands in the terminal to calibrate your touch screen monitor:
» su admin
» [enter your administrator password - by default, it is blank]
» xinput_calibrator | tail -6 > /usr/share/X11/xorg.conf.d/99-calibration.conf


Figure 7. NI Linux Real-Time Terminal Window Demonstrating Touch Screen Calibration.

 

  1. After the commands are entered, the touch screen monitor connected to your target will bring up the screen shown above in Figure 2. Follow the on-screen instructions to successfully calibrate the touch screen. Remember to disconnect any USB mice connected to the TSM before calibrating.
  2. Once you have finished calibration, the settings will persist between reboots of your target.