Archive

Posts Tagged ‘LabVIEW’

Move Up and Down Tree Control Sub-items Programmatically in LabVIEW

July 10th, 2009

In my current project, I’m using a tree control to store the test items and the test operations are taken in sequence following the tree control’s top to down order. To make the test more flexible, the test sequence(here is the tree control’s items order in this program) should be able to modified by the user. The user should be able to move test item up and down in this test sequence tree control.

LabVIEW provides the basic tree item move VIs, but in the actual test project, there is more to be considered and much more work to do. In my project, I use a two level tree to store the test sequence, the top level is the test item’s category and the sub-level is the test items as the following picture.

Read more…

LabVIEW , , ,

Transfer More Than Text Message in Queue Between Loops in LabVIEW

April 20th, 2009

As in one of my previous post: A Way to Improve User Experience in Complicated Applications in LabVIEW, I used two loops in my program. One loop works as user interface events interpreter and another loop processes test operations. I use a message queue to transfer user command from the user event loop to the test operation loop. Right now, a few test operations need to be performed with a set of voltage values to the same UUT, but the test routine is the same. I don’t want to create more cases to different voltages, I want to use only one case to process the same test routine.

Below is how I realize it. As in the following image shows:

Read more…

LabVIEW , , , ,

How to Create Linked List in LabVIEW

March 16th, 2009

Linked list is not a standard data type in LabVIEW, but we can create it in LabVIEW with cluster arrays.

First, what is linked list? It is defined as following in wikipedia:

In computer science, a linked list is one of the fundamental data structures, and can be used to implement other data structures. It consists of a sequence of nodes, each containing arbitrary data fields and one or two references (“links”) pointing to the next and/or previous nodes. The principal benefit of a linked list over a conventional array is that the order of the linked items may be different from the order that the data items are stored in memory or on disk, allowing the list of items to be traversed in a different order. A linked list is a self-referential data-type because it contains a pointer or link to another datum of the same type. Linked lists permit insertion and removal of nodes at any point in the list in constant time, but do not allow random access. Several different types of linked list exist: singly-linked lists, doubly-linked lists, and circularly-linked lists.

Linked lists can be implemented in most languages. Languages such as Lisp and Scheme have the data structure built in, along with operations to access the linked list. Procedural or object-oriented languages such as C, C++, and Java typically rely on mutable references to create linked lists.

Here is what we can do to create linked list in LabVIEW: Create a cluster, which has at least one element which is an integer numeric. We can use this element as the link to other list items in the list. Then, create a array which use this cluster as data type. The linked list is created. We can use it as we wish.

LabVIEW , , ,

A Note about Using Database Connectivity Toolset in LabVIEW

March 8th, 2009

The Database Connectivity Toolset is a great add-on toolkit for LabVIEW, it makes the database operation within LabVIEW so easy that you can operate database even without sound knowledge of database.

I used this toolkit in one of my projects to record the test results of UUTs into MS Access database. I created a save results to database subVI with this toolkit. The subVI looks like this:

Origin LabVIEW subVI 

Read more…

LabVIEW , ,

Build a Tri-State LED Indicator in LabVIEW

February 22nd, 2009

When using the default LED indicator in LabVIEW in my test projects, I found that the two statuses of it is not enough. For example, we can use a LED with red False status to indicate test failed and green True to indicate test passed, then what we can do with the LED before the test finish? The test result is still unknown, red and green are not proper. In this situation, we need a yellow Unknown status with the LED indicator.

The following is how I build a tri-state LED indicator:

First create a new VI, place a enum control and a LED indicator on the front panel as below:

VI's front panel

Then edit the enum’s properties as bellow:

Read more…

LabVIEW , , ,

NI Announcing the LabVIEW 2009 Platform Beta Program

February 16th, 2009

Just noticed that NI LabVIEW’s new version number will be 2009 for this year, and it will not use 8.7 or 9.0 anymore. This naming method likes Microsoft Windows’ naming method. Following is from NI’s official forum:

You are invited to register for participation in the LabVIEW 2009 Platform beta program.  

You can register by visiting http://www.ni.com/beta and selecting "LabVIEW 2009 Platform" from the list of beta programs.  Please complete the profile questions that will help us understand your experience and use cases with LabVIEW.  Make sure you agree to the T&C of the beta program so that you can be approved.

What software is planned to be available?  Note: not all software will be available during the first beta period.

  • LabVIEW (32-bit)                                               Windows / Mac / Linux
  • LabVIEW (64-bit)                                               Windows Only
  • LabVIEW RT Module                                         Windows Only
  • LabVIEW FPGA Module                                    Windows Only
  • LabVIEW DSC Module                                      Windows Only
  • LabVIEW Touch Panel Module                         Windows Only
  • LabVIEW Microprocessor SDK Module            Windows Only
  • LabVIEW Control Design & Simulation Module Windows / Mac / Linux
  • LabVIEW Statechart Module                             Windows Only
  • LabVIEW Mobile Module                                    Windows Only
  • Vision Development Module                              Windows Only
  • Application Builder for Windows                       Windows Only                    
  • VI Analyzer Toolkit                                             Windows Only
  • Report Generation Toolkit                                 Windows Only
  • Database Connectivity Toolkit                          Windows Only
  • Internet Toolkit                                                   Windows Only
  • RT Execution Trace Toolkit                              Windows Only
  • Desktop Execution Trace Toolkit                      Windows Only
  • Digital Filter Design Toolkit                               Windows Only
  • Advanced Signal Processing Toolkit                Windows Only
  • Motion Assistant                                                Windows Only
  • PID Tookit                                                          Windows Only
  • Simulation Interface Toolkit                               Windows Only
  • System Identification Toolkit                             Windows Only
  • Adaptive Filter Tookit                                         Windows Only
  • LabVIEW Signal Express                                  Windows Only
  • Unit Test Framework                                         Windows Only

There is always a major LabVIEW upgrade every year. It seems in this year LabVIEW will not only be a programming tool but also a platform that can accomplish more jobs at the same time. Hope it will make my daily programming work much easier!

LabVIEW ,

A Strange Problem When Calling External DLL with LabVIEW

February 2nd, 2009

Currently I am using a third-part MIL-STD-1553 card in one of my projects. The vendor of this card provides only a DLL file as the driver for it which is build with Visual C++. To control this card in LabVIEW, I have to use the Import Shared Library wizard in LabVIEW to build all the VIs that corresponding to every functions in this DLL. After that, I used these VIs in my program to control this 1553 card. Everything is fine with the card initialization and reset function, but when it comes to send data function, a strange problem happens.

The problem is as follows, when I use the send data function as in the manual provided by the vendor, set special values to parameter A and parameter B, and run this function after that, there is no responses. But with the demo program provided by the vendor which is in Visual C++, call this function as in the manual, everything is fine. At last, I try to set the special values to the parameters that follow A and B, for example, if A is the first parameter, then assign the value that should be assigned to A to the second parameter. After this operation, everything is fine now. I don’t know what is the reason to this strange problem. It seems that the parameters of this VI which is converted by LabVIEW are not correctly corresponding to the function parameters in the DLL.

I don’t know what caused this problem to happen, maybe someday I can find it out.

LabVIEW , ,

Access Different Access Database Files Programmatically in LabVIEW with Database Connectivity Toolset

January 16th, 2009

One of my project needs to save test results to different Access database files for different units to be tested. The database files’ name is automatic generated based on UUT’s serial number. Currently, I’m using the LabVIEW Database Connectivity Toolset, and the default method to access a database file by it is UDL file. The UDL file contains only one static database file and it is quite hard to change it programmly without manually select a database file and click the confirm button.  And it will be a nightmare to create each UDL file for each UUT before the test is taken.

To change the UDL file’s content in LabVIEW programmly is not easy too. Because UDL file  is unicode-formatted, and LabVIEW is quite limited in support to unicode. I had tried several ways to change the database file name in UDL file and save the UDL file to hard disk. And when I open the changed UDL again, I got “File corrupted” message. It seemed that it is not a good way. Read more…

LabVIEW , , ,

A Way to Improve User Experience in Complicated Applications in LabVIEW

January 13th, 2009

LabVIEW 8.x comes with the User Interface Event Handler template by default to process user interface events. But in some complicated applications, there will be so many jobs to do at the same time, and this default template is not enough. For example, in one of my projects, UUT’s power supply monitor and serial communication with UUT is running all the time while some tests are performed. If only with the default template in this case, the user interface will freeze when the application is performing some time-consuming jobs like serial communication or DAQ.

Read more…

LabVIEW , , , , ,

How to Make a Bar Graph without Joining Lines in LabVIEW

January 5th, 2009

In one of my project, I’ll use a bar graph to display a 1D array. In the plot legend, I changed the plot properties and set one of the bar plots. But when I finished, the graph showed as bar plot but it joined the values of the plot with lines. I did not want the lines, after tried for a few times, I got what I want. The detail of how-to is as follows:

First, click on the Plot Legend, select ‘Common Plots’ and then the bottom right option from the drop down list.

Second, select ‘Bar Plots’ lower down in the plot menu, make the appearance change.

Last, in the ‘Interpolation’ menu specifically select the first item(the top-left one, which has no lines).

And after that, job get done.

LabVIEW , ,