How to Get the Text of Enum’s Item Name in LabVIEW

By Ralph - Last updated: Thursday, July 1, 2010

In LabVIEW, if we want to get the text of an enum’s item name, we can do that as following:

These are the solution to get item name of an enum in LabVIEW for me. If there are other better ways to solute this problem, please post a comment to this blog.

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

How to Change Combo Box at Run Time in LabVIEW

By Ralph - Last updated: Tuesday, June 29, 2010

It will be very useful if we can change the strings of combo box in run time in LabVIEW. For example, if our LabVIEW application allows user to change the test sequence of UUT at run time and we store that test sequence in combo box, then we will need this.

In fact, it is not difficult to do this in LabVIEW. Here is what I do to realize it:

  1. Use property node to get the strings  array with strings[] property of the combo box control;
  2. Make change to the strings array as we wish;
  3. Write the array back to the strings[] property of the combo box control by property node.

Read the rest of this entry »

Filed in LabVIEW, VI Software • Tags: , ,

How to Ignore CR LF ASCII Codes in Serial Receive with LabVIEW

By Ralph - Last updated: Monday, March 8, 2010

In one of my recent LabVIEW projects, my application needs receive the message which send by an ECU unit, and to store the message exactly as it send. And the content of the message is hex data, every byte of this message has a specific meaning to this ECU unit, and I need these data to check if the ECU works as desired.

I programmed this application simply with the default VISA read VI. But when I debugged the application to receive the message send by the ECU, sometimes the message was not complete. When I check the send data with the received data, I found out that LabVIEW automatically breaks the message read when it receives 0x0A or 0×25, and these two hex are carriage return and line feed respectively in ASCII.

To receive the message as desired, we need to disable the read function response to the 0x0A and 0×25 in LabVIEW. Here is how to do it: place VISA Configure Serial Port VI in the diagram, there is an input which called “Enable Termination Character”, the default value of that input is TRUE, which causes the uncomplete data I talked above. To ignore CR LF ASCII codes, we just need set the input to FALSE, wiring a false constant to it.

Filed in LabVIEW, Serial & GPIB, VI Hardware, VI Software • Tags: , , , , ,

How to Run Several Instances of a VI at the Same Time in LabVIEW

By Ralph - Last updated: Wednesday, February 10, 2010

Sometimes, it needs to run several instances of a VI at the same time in our LabVIEW projects, like open pop-up dialog boxes.

How can we realize it? In fact, it is quiet simple. We just set the pop-up dialog box VI to be reentrant. In the dialog box VI’s menu, select File>>VI Properties. Then, select Execution in Category, and select Reentrant execution option. After these steps, the VI will be reentrant and can be called dynamically in our LabVIEW project and run it in several instances at the same time.

For samples of this LabVIEW VI, you can download them from NI’s site: PopUp.vi and PopUpMain.vi

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

How to Create a Programmatically Changed Text Label In LabVIEW

By Ralph - Last updated: Wednesday, February 10, 2010

In LabWindows/CVI, we can create a free label text control on the front panel and change its text and appearance in program as we wish. But, this can not be realized in LabVIEW,  because the free text label in LabVIEW can only be changed in edit mode, there is no way to change it in our LabVIEW VIs programmatically. So, if we want to have a text label that can be changed programmatically in our LabVIEW program, we have to find a way to work around it, and I use following method to make it happen.

First, create a classic text indicator on the front panel by Controls>>Classic Controls>>Classic String & Path>>Simple String;

Second, pick the coloring tool and set the foreground and background of this indicator to transparent, and left click the  indicator border to make it transparent too;

Third, right click the indicator and make the label of it invisible through the pop-up menu;

Then, you get a free text label. And you can use property node to change its text and appearance in your LabVIEW programs.

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

The Difference Between Chart and Graph in LabVIEW

By Ralph - Last updated: Sunday, January 31, 2010

We can use chart and graph to display our acquired data or waveforms. In general, they looks alike, but there still is difference between them which we should note in our VI programming.

The difference is:

Chart control has a data buffer which can be used to store some length of history data. Graph control does not have one. And with chart control, you can scroll to the left to view data in the buffer. With graph control, you have to load the old waveform and plot it on the graph by your VI.

So, chart is suitable for online data display, and graph is suitable for offline data analysis.

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