From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

Using a boolean to select a single [double] value from a waveform datatype

Hello,

By using a while loop, I'm measuring a voltage input signal comming from an LVDT.
The read value (Type = Waveform double) is multiplied by a numeric factor, which results in an amplified waveform.

What I'm trying to do next, is using a boolean to select the waveform value at that specific time (this proces is repeated with different buttons). I connected the boolean to a case structure.
If true, the index array selects the value I need, which is displayed for a very short moment, but I'm not able to keep this single measurement value for further use in the program.

After pressing the button, the case structure changes back to the false-statement (which is normal), and the rest of the waveform elements are not important for that single measurement (the program still needs to run though). Since the false statement needs to be processed to, I tried to collect all data (true and false) into an array, which contains the one value I need and the (irrelevant) repeatedly measured constant I used as false-value (= 1000). It should become an array like this: 1000 - 1000 - ... - 1000 - x - 1000 - 1000 - ...
Since I know the value of x will be a lot smaller then 1000, I implemented the 'Array max & min' to select the single minimum value so I would get x, but I don't. The value in the disabled indicators will always return to the 1000-value, like the array I become only reads the last implemented value. Placing some of the elements outside the while-loop doesn't help, changing the dimension size of the initialized array works neither.

What exactly is it I am doing or interpreting wrong?

0 Kudos
Message 1 of 5
(3,102 Views)

You can right click and change boolean from Latch action type to Switch when pressed. Then, while boolean is on indicator value will be updated.

In general you would use event structure to process user interface actions.

PS. I am at LabVIEW 2011, so can not look at VI.

0 Kudos
Message 2 of 5
(3,091 Views)

I'm afraid changing the properties of the boolean switch won't do the trick, it'll give me a series of results instead of the 1 I need. It may be useful if I needed a series of recordings, but the actual problem I tried to describe will remain the same: being able to save and use the specific value when the case structure is in 'true' mode. 

As for your suggestion about using an event structure, I'll take a look at that right now.

Anyway, thank you for your reply, I can imagine it's not easy to understand if you can't open the VI.

0 Kudos
Message 3 of 5
(3,072 Views)

If you need to save one value for next loop iterations, it is Shift register  (or feedback node - in the structures palette). On condition you connect your value to store, in other cases - use old value.

0 Kudos
Message 4 of 5
(3,059 Views)

The shift register function solved my problem, thank you very much for your help!
With kind regards,
KUL_student.

0 Kudos
Message 5 of 5
(3,041 Views)