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 , ,

A few Tips on Improving the Performance of Table Controls in LabWindows/CVI

December 31st, 2008

Here are two tips to improve the performance of table controls:

1. Try to update multiple cells at the same time with SetTableCelRangeVals function.  This reduces the overhead of updating cells greatly.

2. If you need to update a single cell at a time (as may be the case if you want to update a row with different datatypes, use the SetTableCellAttribute (…,ATTR_CTRL_VAL,…) function instead of the SetTableCellVal function.  Note: This will only make a difference if the table is not the active control on the panel.  So if it is the active control, programmatically make another control active before updating the table, and then make the table active again.  This will update the table without displaying the updates until the next call to ProcessDrawEvents or upon the exiting the current callback.  This is ideal when making repeated updates.

LabWindows/CVI , , ,

How to Change a Control or Indicator’s Label Programmatically in LabVIEW

December 30th, 2008

What I want to do in one of my LabVIEW program is: There is a numeric control and I’d like to change the Label of it programmatically.

In this program, I create a property node for the Label Text and change this to a writable node. And I wire a constant into this property. But when I run this program I get error message like this “Input unit is not compatible with the current unit”. It is weird,  the input is string as the property needs.

Read more…

LabVIEW , , , , ,

Howto: Creating a Microsoft Data Link file (.UDL) for Connecting to Microsoft Access in LabVIEW

December 24th, 2008

A Microsoft Data Link file or Universal Data Link is a universal file that links to a specific database and can be used by many different applications.

UDL File Creation

The way a .UDL file is initially created depends on your Windows installation. This can be created  desktop shortcut menu.

  1. Right-click on the Desktop, or in the folder where you want to create the file.
  2. Select “New” from the shortcut menu. If Microsoft Data Link is listed, select it.
  3. Windows 2000 will most likely not have a Microsoft Data Link listed. If this is the case, please refer to the next section. Read more…

LabVIEW , , ,

The New Features of LabWindows/CVI Version 9.0

December 20th, 2008

It’s about a month since NI released LabWindows/CVI version 9.0. And some of this version’s new features are very exciting. I think this is a milestone for CVI. The exciting new features include:

New Resource Tracking Window

Locate potential resource/memory leaks earlier in the development process with the Resource Tracking Window. This new tool records and tracks all resources allocated at run time including dynamic memory, file handles, panels, GPIB/TCP handles, and thread pools. With this tool, you can also easily go to source code, view memory, break on deallocation, and log tracked resources to disk for later review.

I think this feature is quite useful in the project development and verification process. Read more…

LabWindows/CVI , , , , ,

How to write and read Access database in LabVIEW

December 18th, 2008

There are a couple of different methods to communicate with Access in LabVIEW, and some are more difficult than others. You can use ActiveX Automation to open Microsoft Access and control many aspects of the Access Application. For actual database manipulation however, the Access automation classes rely upon the Microsoft DAO (Data Access Object) and/or ADO (ActiveX Data Object) classes. These classes can be used independently or through the Access automation classes to read and write data into an Access database. These classes can be difficult to use and may require a fair amount of SQL knowledge to accomplish a complicated task.

For more information about the Microsoft Access automation classes, DAO or ADO classes refer to the Microsoft website and Developer Network. Read more…

LabVIEW , ,

Problem with DLL import in LabVIEW

November 19th, 2008

Today, I used the Import Shared Library wizard in LabVIEW to import one dll, followed the step by step wizard of LabVIEW, everything seemed fine till the last step. The progress bar in the Import Shared Library wizard appeared to hang.

After search in the LabVIEW official site, I got such answer:

When you use the Import Shared Library wizard, LabVIEW displays a progress bar. This progress bar might appear to hang, even though the tool is working correctly.

Workaround: Wait until the generation finishes.

Reported Version: 8.5 Resolved Version: N/A Added: 09/01/2007

And this error still not fixed in 8.5.x. It looks like I’d better upgrade from 8.5.1 to 8.6 to work around this problem.

LabVIEW , , , ,