Archive for the ‘vi’ Category

The VI Analyzer allows you to programmatically inspect your LabVIEW code for issues related to performance and style:




One of the best ways to learn about all the VI Analyzer has to offer is to join the VI Analyzer Enthusiasts group on In addition to discussions about potential feature ideas, there are also over 30 custom tests that have been written by the VI Analyzer Enthusiasts community. Note that these custom tests do not require a purchase of the VI Analyzer Toolkit. They can be used with any LabVIEW installation.


But if you do install the VI Analyzer Toolkit, you will have over 80 tests at your disposal for programmatic code analysis. There are tests that will identify sloppy wiring configurations and tests that will identify performance problems related to handling large arrays. The Hidden Objects in Structures test will find objects you can't even see, and the Wires Under Objects test will find terminals that you forgot to wire. There is even a Spell Check test!


So if you're a long-time VI Analyzer user, or if you're just now hearing about it for the first time, join the VI Analyzer Enthusiasts group on to start learning how to use this code analysis tool to improve your LabVIEW development.

If you are still learning about control systems, the control functions showcase is a simple VI that can be a big help. Input a control function, select which data you want to view, and then the front panel will quickly display a graph and data for that particular response. 



>>Download the code here

TDMS files can store large amounts of test and measurement data. However, when a channel contains an extremely large amount of files, your system can get overloaded. If you want to free up some space and keep your front panel from locking up, this example code can help divide these large channels into smaller segments and add them back together for a more efficient system. Your computer shouldn’t get stuck opening and closing a file 50,000 times just because you have 50,000 samples in one channel.




>>Download the code here.

This VI simulates converting ladder logic (PLC) code into LabVIEW code. PLC code is known for operating in real time and updating based on the logic at that moment. The easiest way to translate this into LabVIEW is by using multiple while loops. This code updates logic based on a certain time frame, and then saves the current logic and time to a file. The code can be modified based on the user's needs and expected time frame.


>> Download code



Commmunity member DBiel has submitted an example showing how to programmatically determine what cDAQ modules are in a chassis. This example uses LabVIEW and built-in DAQmx property nodes to communicate with a chassis and return an array of module information. This can be really useful during the startup phase of an application to make sure that the chassis is configured correctly before starting any data aquisition or other activities.


The example in the NI Community is called Get cDAQ Module Types in LabVIEW.