A Potential Solution to the "Engineer Crunch"
John Bergmans, Feb 21 2014
LabVIEW is a graphical dataflow programming environment from National Instruments Corp. (NI). The relative ease with which complex software can be developed using graphical programming techniques, combined with the hardware devices offered by NI and others, has made LabVIEW a popular programming tool with scientists and engineers for decades. Typical applications for LabVIEW are data acquisition and control systems for manufacturing and laboratory testing.
LabVIEW applications are written, or more precisely, drawn, on a "Block Diagram" and the user interface is created by dragging and dropping controls and indicators onto the "Front Panel". The Front Panel and Block Diagram are two parts of an entity defined as a "Virtual Instrument" (or "VI") and saved together in a single file.
The Front Panel and Block Diagram for a very simple logic application are shown below. The figure also includes the Front Panel and Block Diagram palettes which contain a large selection of User Interface elements and software functions and structures.
LabVIEW applications are typically written and executed on Windows platforms, though Mac OS and Linux platforms may also be used.
(Click to enlarge)
Power of Graphical Programming
The potential of graphical programming to address the issue of developer scarcity is evident when considering a basic math quiz application written in LabVIEW. The front panel and a snippet of the block diagram of the quiz are shown below. (Access to the quiz in a web browser will be discussed in more detail momentarily.)
The code snippet shows the logic used to process the results of the two simple math questions that are presented to the user in the quiz. On the left side of the snippet is an array of references to string indicators that display the results of each question in the quiz. Within each iteration of the For Loop, the correct answer and user's answer are input into a comparator. The output of the comparator then determines how the user interface and the score data are updated:
Upon exiting the For Loop, the user's score is also updated on the User Interface.
This code snippet illustrates one of the most notable benefits of a graphical data flow language such as LabVIEW - the code for a moderately complicated task (eg. data processing; UI updates; and, state management) is easy to develop, understand and modify. This code can be easily understood by even a novice programmer and could be created from scratch by someone with modest programming skills and a basic level of familiarity with LabVIEW.
Extending this capability to developing a web application only requires the use of the LabSocket system, as described in the next two sections.
Extending LabVIEW to the Web Using LabSocket
The LabSocket System is an add-on package for LabVIEW that enables remote access to a LabVIEW application from desktop or mobile web browsers. To access a LabVIEW application, or "Target Virtual Instrument (VI)", over the Web, the LabSocket software operates on the LabVIEW Host Platform in parallel to the Target VI, as shown in the figure below. The LabSocket Support VIs operate unobtrusively and perform two key functions:
Messages between the browser and Support VI pass via a Message Broker on the LabSocket Server platform. Of special note is the WebSocket interface between the browser and Message Broker that enables continuous, bi-directional communication with the browser. The use of this interface contributes to the system name: "LabSocket = LabVIEW + WebSocket".
LabSocket: A LabVIEW-based Web Authoring Tool
The original purpose of the LabSocket system was to simply allow LabVIEW developers to make applications available over the web. A new version of the system named "LabSocket-MultiClient" now exists in which each browser client is connected automatically to a unique instance of the LabVIEW Target VI. With this one-to-one mapping between browser and Target VI instance, the combination of LabVIEW and LabSocket permits the easy and rapid development of dynamic web applications.
The following figure illustrates the LabSocket-MultiClient system in action as a web authoring tool. In this figure, the simple math quiz application described earlier is used as the Target VI and three browsers have been pointed to the URL for the VI. Note that the browsers are operating independently from each other as evidenced by the fact that the quiz data, and the user scores, in each browser are different. Each browser shows the same time stamp value since the quiz VI always displays the current time on the front panel.
Distinctly different application states are also evident in this figure - the browser in the center is waiting for the user to enter quiz data and press the "Submit" button while the left and right browsers are waiting for the user to press the "Next" button to begin another round of the quiz.
Three Browsers Each Connected Simultaneously to Unique Instances of Quiz Application
(Click to view in new window)
On-line Quizzes for Engineering Students
The LabSocket system is an attractive solution to this customer primarily because the professors developing the quizzes are comfortable with creating LabVIEW applications, but do not have the resources to rapidly create web applications. The system therefore enables the professors to create on-line quizzes and auto-grading algorithms themselves without the help of scarce web developer talent.
In the bigger picture, this application serves as a good example of the use of the LabSocket system as a solution to the "Engineer Crunch" problem. It shows that the system can enlarge the pool of talent available to create web applications by allowing non-web experts to create sophisticated, dynamic web applications.
Additional information about the use of LabSocket in this application will be released after the system enters production.
SportJury - Ski Competition Judging Application
The comments of Daniel Kölliker, owner of Dynasys, D. Kölliker echo the above-mentioned benefit of LabSocket as a productivity enhancing tool for web application development:
This White Paper (PDF, 0.3 MB) provides details of the use of the LabSocket in the SportJury application.
If you have any questions about the LabSocket system and how it could be used to address the "Engineer Crunch" or would like to arrange for a live on-line demo, please contact me or leave a comment below.
© 2011-2016 Bergmans Mechatronics LLC