This example demonstrates creating a web-based thin client to be used on CompactRIOs with Embedded UI capabilities. It showcases using web technologies and the Current Value Table Reference Library to easily create a flexible user interface for your LabVIEW code. This example involves installing Firefox onto your CompactRIO. The instructions to accomplish this are listed below. The user interface is a simple HTML document that uses AngularJS as a mechanism to communicate with a LabVIEW Web Service.
This example uses the CVT Web Add-On which allows users to read and write tags in the Current Value Table through LabVIEW Web Methods. An AngularJS service tagweb.js has been made to make communication between LabVIEW and the web thin client easy. Additionally, several AngularJS directives have been made in this example that make placing basic controls such as numerics and strings very easy.
Installing Firefox if your cRIO doesn't have an Internet connection
You can download Firefox at their website. You'll want the Linux 64-bit version and can select any language you'd like. You can extract it using a program like 7-zip it and place it into the /usr/lib directory on your cRIO via WebDAV, FTP, or a USB drive. To install libasound2, Firefox's dependency, place the two files in the attached firefox-dependencies.zip file into a temporary folder such as your /tmp directory and enter the following command:
Note: If you don't have a Linux RT CompactRIO, this can be run on the devlopment machine instead of a real-time target.
Open the attached example project
Add your CompactRIO to the project
Migrate the VI and Web Service to your target
Start the tagweb web service
Run the RT Main.vi
You can view the thin client on the embedded ui or from any computer on the network by navigating to hostname:8001/tagweb where hostname is the name or IP address of your CompactRIO
LabVIEW 2014 or greater
LabVIEW Real-Time Module
A cRIO with NI Linux Real-Time
Any attached Code is provided As Is. It has not been tested or validated as a product, for use in a deployed application or system, or for use in hazardous environments. You assume all risks for use of the Code and use of the Code is subject to the Sample Code License Terms which can be found at: http://ni.com/samplecodelicense