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: 

How to link specific voltage output to specific string output

Hello all, I am a newer user of Labview still in school and I have a problem.  I have a weather vane directional out put of 16 specific non-linear voltages that I am trying to link to a string dispay of the specific 16 compass directions. Any suggestions of a clean and quick whay to link these up.  I am thinking two arrays, one of voltages and one of strings, possibly going through a case structure, but I am not sure how to implement my concept.  Any help would be appreciated.

0 Kudos
Message 1 of 6
(2,697 Views)

Hi, I am learning LabView myself too.  Are your voltage outputs steady?  Have you learned about "enum" in LabView yet?  You could enter your voltage values in the enum and also create a string array in the corresponding order.  Connect the output of the enum to an index array, connect a string indicator to the output of the index array, and put the codes in a while loop.  So when you change your voltage on the enum, your string output should also change.  This might not work with your applications.  I know others might have a simpler way to approach this.  Hope I understood your questions correctly and hope it helps.

 

Lynniz

0 Kudos
Message 2 of 6
(2,680 Views)

Try looking at Threshold 1D Array

 

The input array will be the ranges of the voltage the compass points

 

The output will the the index of which voltage range the threshold value is in.

The you can index a 2nd string array with the compass points text in them or could use an enum but you will have to watch your type casing and data types.

Omar
0 Kudos
Message 3 of 6
(2,676 Views)

If you have them saved as an array or are taking them in real time, than these are two ways to give them names. One uses a Ring Indicator and other a String Indicator. Used the index array function for arbitary value selection(you can use a for loop for sequential extraction and cut off the index array function and the numeric control). The other one implements your thoughtout solution.

LabVIEW 8.2,8.6,2009...still learning 😛
0 Kudos
Message 4 of 6
(2,665 Views)

I assume your are talking about the cardinal direction.

 

The question I have is what is the relationship between the voltage and the direction.

What is the scaling of voltage to direction.

 

If it is a one to one then try this

 

CardinalDirection.png

 

 

Omar
0 Kudos
Message 5 of 6
(2,658 Views)

for real world signals with noise it might be wise to add a slight hysteresis to get a stable output near a boundary.

hyst.png

 

the attached program show one way to do it. By adding the hysteresis after the 1D threshold vi it is also 'scaled' to the range 🙂

classify with hyst.png

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 6 of 6
(2,623 Views)