LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a drop down menu configured with VISA write

Hi I'm using the Basic Serial Write Read example vi in LabVIEW to communicate using the serial port. Instead of having a write box on the front panel connected to the VISA Write in the program I want to create a drop down menu on the front panel to be able to choose from a variety of commands. Is there a way I can program multiple commands into the block diagram and choose one of them on the front panel to send to VISA Write? For example, the commands to choose current are I/E\s0\r for 1 A, I/E\s-1\r for 100 mA and so on. I want to be able to choose between 1A, 100mA, etc on the front panel and have the code send the corresponding function to VISA Write. Is this possible?

0 Kudos
Message 1 of 8
(3,890 Views)

sure....i use a combo box with values match items, unchecked

undefined

0 Kudos
Message 2 of 8
(3,864 Views)

where do you list the values and the codes?

0 Kudos
Message 3 of 8
(3,829 Views)

Can someone please answer me?

0 Kudos
Message 4 of 8
(3,803 Views)

Usually you right-click the control and select "Edit Items."  this pulls up the item editor.

 

However, this editor is limited because it only enables "Normal" display for strings.  So just wire array constants to the "Strings and Values[]" Property like so:

undefined


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 8
(3,797 Views)

To place a combo box on your front panel, 1. Right click on the front panel ==> go in the string & path menu ==> and select combo bo

2. Then Right click on the combo box and select edit items...

3. untick Values match Items

4. Edit your values.

 undefined

I advise you to make a type Def with your combo box. It will be easier to add elements if you need.

 

 

Alexandre
0 Kudos
Message 6 of 8
(3,796 Views)

Nevermind i figured it out thank you

0 Kudos
Message 7 of 8
(3,787 Views)

Okay, please let us know the solution you came up with, so we might be able to use it sometime.

 

Cameron

 

To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.

To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):

LabVIEW Unit 1 - Getting Started</ a>
Learn to Use LabVIEW with MyDAQ</ a>
0 Kudos
Message 8 of 8
(3,784 Views)
Products may include a surcharge. Surcharge is calculated during checkout for U.S. customers. Learn more