Calibrating your Touch Screen Monitor with LabVIEW
Using LabVIEW 2015 or later:
- Create a new project containing your target, and add a new VI under the target.
- On the block diagram of this VI, add RT Calibrate Touchscreen.vi located in the Real-Time » RT Utilities pallet.
- Run the VI and perform the on-screen calibration procedure on your touch screen monitor.
- Note: Disconnect any USB mice attached to the TSM
Using LabVIEW 2014 SP1 or earlier:
- Download the attached tpm_calibration.zip and extract the contents to a known location.
- 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
- 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
- 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
- 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.
- Once you have successfully connected to your target, you must log-in as an administrator to be granted proper permissions.
- 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
- 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.
- Once you have finished calibration, the settings will persist between reboots of your target.
Calibrating you Touch Screen Monitor Locally
- 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.
- 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.
- 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.
- Select the Terminal icon at the bottom of the screen.
Figure 6. The NI Linux Real-Time Menu.
- 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.
- 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.
- Once you have finished calibration, the settings will persist between reboots of your target.