LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Use Text Ring to Set Parameter; Need Reverse Text Ring to Read?

Using the manufacturers manual I have managed to program a number of simple programs to interface with one of the pieces of lab equipment I am using. To set the sensitivity of the device I used a text ring to allow the user to select the sensitivity visually, while using the number to program the device. Essentially the internal programming had a text ring in mind. To program a sensitivity of 1 nV I use SEN 0. For 3 nV SEN 1. This continues until 3 V with SEN 15. 

 

Now, In order to read the values from the device properly I need to be able to read the sensitivity. The SEN command returns the numeric value but how do I convert the number into a string (much like a text ring in reverse) for each possible outcome? 

 

Subsequently I could just read the numeric value, but I need to treat each sensitivity differently. For example. Reading a 10mV source at the 30mV sensitivity the output voltage is .333V, indicating 1/3 the full range.  At each sensitivity I have to multiply the reading by the sensitivity to get the true value. 

 

What is the most compact way to program this? I could set up 16 if equals comparisons and 16 separate branches of code, but that seems highly inefficient. 

 

Nukem

0 Kudos
Message 1 of 12
(3,112 Views)

This is what I ended up with: 16 nested case structures. Surely there has to be a more elegant solution that I am just not thinking about. I am a relatively new LabVIEW User, so any and all help is appreciated. 

 

Nukem

 

0 Kudos
Message 2 of 12
(3,086 Views)

I'm not completely clear on what you're reading versus sending to the device. If you have sensitivity levels of 0-15, where all the values are integers and no values are skipped, then use an enumeration instead of a text ring. Create an array of the sensitivity levels (0.3, 1, 3, whatever values you have in the correct order). Then you can simply use the enumeration to index into that array, and you'll get the right multiplier.

 

If when you execute the SEN command you simply get a number, then you can use that number as the array index.

0 Kudos
Message 3 of 12
(3,082 Views)

This?

 

New Bitmap Image.png

Message 4 of 12
(3,077 Views)

Help me understand what you are doing.  If your ring was setup Text/Value, are you saying 1 nV/SEN 0 or SEN0/1 nV?  I think this VI might accomplish what you are thinking but I could be wrong.

0 Kudos
Message 5 of 12
(3,075 Views)

Not sure what you are talking about with the text ring but here is a replacement way to do what the attached VI with all the case structures did. 

 

Edit: I my solution does not select the output the same as the original VI in the case that it is out of range. 

0 Kudos
Message 6 of 12
(3,074 Views)
Doesnt the sensitivity become something like 10^(-7+index/2)
/Y
G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 12
(3,054 Views)

I almost hate to do this but..

 Example_VI_BD.png

Enable the conditional terminal only if you know there are no duplicate ring strings.

 


"Should be" isn't "Is" -Jay
Message 8 of 12
(3,050 Views)

I think some of these solutions will work to clean up the use of the sensitivities, but let me be more clear on the reading and writing portion.

 

In the manual I have a table that tells me what command to send to the device to achieve a certain sensitivity level:

SEN 

0               100 nV

1               300 nV

2               1 micro V

3               3 micro V

etc.

 

 

I want the user to be able to see the sensitivities on the right, while the program uses the values on the left. Hence, I used a text ring to achieve this when setting the sensitivity level. I select 3 micro V on the front panel and the program runs with the value 3. 

 

Now, If I want to check the sensitivity level I have to do this in reverse. Have the program read a value of 3 and output the string telling me that the level is 3 micro V. 

 

It looks like I should be able to use the ring cluster Jeff Bohrer suggested to do this both forwards and in reverse. I will try this at work tomorrow when I have access to LabView again. 

 

Thanks everyone!

 

Nukem. 

 

 

0 Kudos
Message 9 of 12
(3,011 Views)

Uncheck the sequencial number and use the nV value, 100, 300, 1000, 3000 and so on. The sensitivity is the value!

Type def the Ring control and you can as easily place an indicator and show it if need be.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 10 of 12
(3,005 Views)