Bergmans Mechatronics LLC Bookmark and Share
  Home Combustion Control System HTML 5 WebSockets Project Portfolio LabVIEW Corner About BML

LabVIEW Corner

BML's "LabVIEW Corner" is a venue for introducing LabVIEW programming applications and concepts. Towards this end, several presentations by Mr. John Bergmans to the Orange County (CA) LabVIEW User's Group are available at right.

LabVIEW Corner also contains four demonstration programs.  The first program "Create Excel Plot from LabVIEW" demonstrates how to programmatically create Excel files from LabVIEW.  The second and third programs, "State Machine Demo" and "Reference Demo", will benefit programmers who are creating larger and more capable programs and are seeking to increase the readability and functionality of their programs. 

The final program, "Low Pass Filter Demo", illustrates the implementation of a Laplace Domain transfer function as a discrete time function.  This demo and the accompanying note should prove useful for designers of control systems who need to convert a transfer function to a real-time control algorithm.

Presentations by BML to the
Orange County LabVIEW User Group Meeting

"Real-Time, Closed-Loop Control of an Unstable System using CompactRIO and LabVIEW RT"(624 kB)
This presentation describes the design and implementation of a CompactRIO and LabVIEW Real-Time based digital controller for active control of the position of a steel ball on an inclined ramp.  The system employs an electromagnet as an actuator and a non-contact, optical ball position sensor. Presented Oct 29, 2009. The companion video below shows the system in action.

"ActiveX Interface Between LabVIEW and Excel" (140 kB)
LabVIEW includes an ActiveX interface which allows for control of a wide variety of external programs. This short presentation illustrates how to control Excel from LabVIEW. Presented Oct 30, 2008.

"LabVIEW-Based Instrumentation for Large-Scale Combustion Diagnostics"
(1.6 MB)
Presents the design and performance of BML's LTS-100 Laser Temperature Sensor and Laser Alignment System. Includes an overview of the LabVIEW-based software and National Instruments hardware employed by each device. Presented May 29, 2008.

"Development of Combustion Control Systems and Instrumentation using LabVIEW" (2.4 MB)
Describes the use of LabVIEW for control of a rocket motor and an oxy-fuel combustor test stand. Also, provides details on methods used to programmatically control GUI elements and multiple VIs. Presented Mar 27, 2008.


Create Excel Plot from LabVIEW

This demo program illustrates how an ActiveX-based interface between LabVIEW and Excel can be employed to automatically create an Excel file and plot data contained in the LabVIEW program. 

This software is inspired by the example program "Excel Macro" which is shipped with LabVIEW.

To use the code, download and run the program. Once the the desired options have been set, select the menu item "File>Plot in Excel" to automatically start Excel and generate the plot. The software will create, in the same directory the program, an Excel file with the name specified in the "Filename" field.

The use of the ActiveX interface can be readily extended to programmatically generate Word documents and PowerPoint presentations from LabVIEW. 



Front Panel of Create Excel Plot from LabVIEW Demo
(Click to download demo code)

Create Excel Plot from LabVIEW (Excel)
Excel Plot Generated by Demo Code


State Machine Demo

A State Machine is a LabVIEW programming architecture which allows code to be written in a compact and readable form. 

As is common for most LabVIEW programs, code written in a State Machine form operates within a main while loop.  With reference to the block diagram of the State Machine Demo program at right, a unique feature of the State Machine format is that operation at each iteration of the while loop is governed by the input to a case statement containing each of the possible operations or "states" of the program.

An integer value or, as with the Demo program, an enumerated type, is input into the case statement to determine which state is to execute in a particular iteration.  Each state also contains a commanded state for the subsequent iteration.  This new state is transmitted to the subsequent iteration via a shift register.

Each of the states of the program are contained within the case statement.  As a result, the bulk of the code for even complex programs can be contained within a compact area of the block diagram screen. 

Assigning descriptive names to the enumerated type values used for defining the states, results in highly readable code which sometimes is referred to as being "self-documenting". 

Please download the Demo program to study the software in detail.




State Machine Demo Front Panel
State Machine Demo Front Panel
(Click to download demo code)

State Machine Demo Block Diagram
State Machine Demo Block Diagram


Reference Demo

References are a powerful LabVIEW feature which allow the properties of GUI elements to be modified programmatically.  The Reference Demo is an example of how to use references to manipulate front panel objects. 

References are particularly useful for performing the same action repeatedly on different GUI objects or for manipulating a front panel object from within a subroutine.


Reference Demo Screenshot
Reference Demo Front Panel
(Click to download demo code)


Low Pass Filter Demo

Digital filtering of analog signals is often required for analysis or control purposes.  The filter presented in this demonstration is a discretization of a Laplace domain first-order low-pass filter. 

A short note on the derivation of the filter algorithm can be found here.



Low Pass Filter Demo Front Panel
Low Pass Filter Demo Front Panel
(Click to download demo code)

Back to Top of Page Top

© 2004-2016 Bergmans Mechatronics LLC







Main While loop State to be executed on program start Case statement containing all of the program states State in next iteration of While loop Stop flag for while loop.  T=Stop. F=Continue