How to Change Axis Name of Graph Control in LabWindows/CVI

By Ralph - Last updated: Tuesday, March 24, 2009

We can use the SetCtrlAttribute function to change an Axis name programmatically in LabWindows/CVI. Just set the ATTR_XNAME or ATTR_YNAME attribute to any name you’d like to use in this function.

For example, change the top X-Axis name of a graph, we can use the following code.

// Make the top x-axis the active one
SetCtrlAttribute (panel, PANEL_GRAPH, ATTR_ACTIVE_XAXIS, VAL_TOP_XAXIS);    
// Set the name
SetCtrlAttribute (panel, PANEL_GRAPH, ATTR_XNAME, "Axis Changed");
Filed in LabWindows/CVI, VI Software • Tags: , ,

A Few Documents about Communication between Real-time and Host PC

By Ralph - Last updated: Tuesday, March 24, 2009

I have to admit that NI’s support is very helpful. Because I need to make real-time machine to communicate with Windows based desktop PC in my recent project, I try to find a few tips in NI’s website, and I get everything I need about this problem.

The following are the documents about RT communication. Maybe I’ll need them later.

Real-Time VI to Host VI Communication Methods

Real-Time FIFO for Deterministic Data Transfer Between VIs

Real-Time FIFO Example

Filed in LabVIEW, Network, VI Software • Tags: ,

Three Ways to Find SubVI in a LabVIEW Project

By Ralph - Last updated: Friday, March 13, 2009

If we change a subVI’s connector after used it a lot in a huge LabVIEW project, it’ll be a nightmare to open every VI in this project one by one and find the subVI in the diagram by hand. In fact, there are ways to find this subVI easily as following.

First, use menu View then select vi_Hierarchy, we can see VIs’ relationship, and which VI in this chart calls this subVI, and double click the corresponding VI to open the calling VI and edit it.

Second, maybe the easiest way to do it. If the connector of the subVI is different from previous. We just open the top-level VI. The top-level VI will show a broken run arrow. Just click the broken run arrow, it will popup a list of broken VIs. And this list is the subVI we want to find, just click the list items one by one to edit VIs.

Third, open top-level VI and open the subVI. Right click the subVI’s icon on the right-top of the subVI’s front panel or diagram window, and select Find All Instances. A window will pop up with the list of this subVI’s locations. We can click the items in this list to edit corresponding VIs.

Filed in LabVIEW, VI Software • Tags: , , , , ,

How to Change Waveform Charts’ Scales Programmatically In LabVIEW

By Ralph - Last updated: Friday, March 13, 2009

First, disable auto-scaling property of the waveform chart by editing Chart Properties Scales->Y-Axis and the uncheck Autoscale ;

Then, in the VI’s diagram, use property Y Scale –> Range –> Maximum and Minimum.  We can change these values in program and by this way, we can change waveform chart’s scales during runtime.

Filed in LabVIEW, VI Software • Tags: , , ,

Change the Color of a Picture Control’s Border Programmatically in LabVIEW

By Ralph - Last updated: Monday, March 2, 2009

In one of my project, there are about 24 pictures on the front panel. When the user selects one of these pictures, I want there is an interactive way to show which picture has been selected. And I think to change the picture control’s border color is a nice solution.

I can change the border color by using color tool in development mode, but there isn’t a property to change the border’s color programmatically. Finally, I found a way to work this around. Following is how to make this work:

Put a slightly bigger Boolean indicators or color boxes behind the picture indicators. When the picture is clicked or selected, we can change the color of the underlying Boolean indicators or the color boxes. By this way, the interactive effect is realized, and it looks great for me!

Filed in LabVIEW, VI Software • Tags: , , , ,

How to List Files within Subfolders in LabVIEW

By Ralph - Last updated: Monday, March 2, 2009

In LabVIEW, we can list all the files in a folder using the list folder.vi function. But, if we want to list all files including files in subfolders, should we use this function on each subfolder?

In fact, we can use only one VI that shipped with LabVIEW since version 7.0 to get this job done. The VI is vi.lib\utility\libraryn.llb\Recursive File List.vi. And this VI has been added to the palettes since LabVIEW version 8.2.

Filed in LabVIEW • Tags: , , ,
Pages: Prev 1 2 3 4 5 Next