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 Items, LabVIEW, Movement, Tree Control
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 Case, LabVIEW, Loop, Queue, User Interface
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 Array, Cluster, LabVIEW, Linked List
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:
Read more…
LabVIEW Database Connectivity Toolset, LabVIEW, Note
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:
Then edit the enum’s properties as bellow:
Read more…
LabVIEW LabVIEW, LED indicator, Tri-State, VI
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 beta, LabVIEW
First, to cycle between source code files in CVI IDE, just use Ctrl-Tab;
Second, if you forget what a function’s complete name, just write a few letters that you are sure of it, then press Ctrl-P. There will be a function name list dialog which includes the letters you typed, just choose the function you want from the list;
Third, right-click anything in source code and choose “Go to Definition”, or use Ctrl-I, you can see where the variables are declared;
Fourth, you can make the project and library trees to auto hide by select menu: Options > Environment > Auto hide Project and Library Trees;
Fifth, there is a “Programmers ToolBox” shipped with LabWindows/CVI which can be used to manipulate sting and filename, you can find it in <cvidir>\toolslib\toolbox\toolbox.fp.
With them, you can make your CVI-based development much easier!
LabWindows/CVI CVI, features, IDE, LabWindows
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 DLL, LabVIEW, Parameter
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 Access, Database Connectivity Toolset, LabVIEW, UDL file
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 LabVIEW, Program Structure, Queue, State Machine, Template, User Interface