ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ring with string value

Solved!
Go to solution

I would like to know if there is a way to make a single control (either a ring or otherwise) where a string that is displayed to the user has a string as its output value.

 

For instance, I have a power laser with a serial communication port and the command to turn on the laser diodes is LASER1;

 

I want to display the string "DIODES ON" to the user, but have the control provide the value "LASER1;" when selected.

This is easy to do with two controls, for example, I can have an enum with the user display strings and a matching enum with the laser command strings, but then I have to ensure that any change affects both controls.

If it is a single control, it is less likely to have an error when a change is made.

 

Any help is greatly appreciated.

 

I am using LabView 2009

 

0 Kudos
Message 1 of 6
(5,227 Views)

you could use the property node string[]

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 Kudos
Message 2 of 6
(5,220 Views)
Many ways to do this, but the most direct seems to just use a button, whose Boolean Text (when on) reads "DIODES ON" and sends the "LASER1;" command via a Select function, or wire it to a case that sends the command.
Richard






0 Kudos
Message 3 of 6
(5,212 Views)

Perhaps I should have been more clear.

 

There are approximately 20 commands to be sent to the laser from which the user can select.

Each string to the user has a corresponding command.

 

Since this is programmatic for automatic operation; as well as single commands for manual operation, I would like to have a single control with 20 strings and corresponding commands.

 

For example:

 

User                 Laser

Diodes On         Laser1;

Diodes Off         Laser;

Mode Current    Opmode0;

Mode Power      Opmode1;

Gate Open        Gate1;

Gate Closed      Gate0;

 

A single button or a caption string is not adequate.

 

0 Kudos
Message 4 of 6
(5,187 Views)

Wire the ring control to a case structure.

Then you can label each case accordingly (where it normally says "true", "false", etc).

 

You can create a case for each option:
"user"

"diodes on"

 ... etc

 

Then put a string constant in each case and pass the constant out of the case structure.

Cory K
0 Kudos
Message 5 of 6
(5,184 Views)
Solution
Accepted by jspaarg
Ever hear of the Combo Box?  Could be a winner, just uncheck Values Match Items.
Message 6 of 6
(5,178 Views)