From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can you convert a combo box to an Instrument Address box?

Solved!
Go to solution

Hello,

 

I downloaded the Metallic Theme environment and did not find a Visa Instrument Box in the suite.  I would like to know how to get a Visa Instrument box to match up the other front panel items.

 

Thanks,

hiNi

0 Kudos
Message 1 of 7
(2,895 Views)

When designing a set of Custom Controls, the designer might not include all of the Front Panel controls, such as the I/O Controls (like VISA).  Controls are more than "just a pretty face" -- there is LabVIEW "stuff" going on behind them, so it is pretty unlikely you'll be able to change a Combo Box into an I/O selector.

 

If you do a Web Search for LabVIEW Custom Controls, you can probably learn more, and decide if you really want to undertake such a design process for a single Control.  You can also find some additional sets of Controls that might be of interest.

 

Bob Schor

Message 2 of 7
(2,860 Views)

You can make your own control as suggested or you can try something like this: (You may have to change the filter on the Find Resource depending on what's connected, see help for further information)

 

Snap45.png

You will need to set up your program to populate the Combo box in an "Initialization" type of state; after that you can use typecast and your control is good to go.

 

mcduff

Message 3 of 7
(2,852 Views)

Very clever, McDuff!

 

Bob Schor

0 Kudos
Message 4 of 7
(2,840 Views)

Not 100% sure but you might not need to do any casting. IIRC you should be able to just feed in the string to a VISA input as long as the text is correct (at least for the open function).

Matt J | National Instruments | CLA
0 Kudos
Message 5 of 7
(2,808 Views)
Solution
Accepted by hiNI

Here is a slight modification to mcduff's VI. I got burned a few times when population a Combo Box. You need to set the value (to something) after it gets populated. Populating the StringsAndValues does not change the current value.

 

So, if the ComboBox originally contains a bad VISA reference, it will NOT be overwritten. If the bad VISA reference "looks" valid to the user, they will never know otherwise.

 

Original Value in Combo Box does not get overwritten

Bad Reference.PNG

 

 

I like to set the Value to a NULL string or to the first valid value in the list.

moMOD.png

 

Message 6 of 7
(2,799 Views)

@jamiva wrote:

Here is a slight modification to mcduff's VI. I got burned a few times when population a Combo Box. You need to set the value (to something) after it gets populated.


Agreed. Thinking state machine here, but this goes with "initializing" the control.

 

@jacobson

You are correct; I just do not like "dirty dots" in my diagram.

 

mcduff

Message 7 of 7
(2,778 Views)