LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using a comparison to run a case structure

Solved!
Go to solution

Hello,

 

I'm trying to write a simple program but I can't seem to figure out how to write it.

 

I have a dynamic series of data (about 16,000 values) running inside of a while loop.  

 

I want to add 180 to a value if that value drops below 30.

 

My idea was to:

  1.  Do a comparison:  "x < 30" to get a true or false value.

  2.  Send the Boolean along with Use a case structure to say if true

  2.  Then,if "true" x = x + 180, If "false" x = x (just passes straight through the case structure)

 

However, this always adds 180 to the value.

 

Please Help!!!!

 

Thanks, Jake

0 Kudos
Message 1 of 4
(3,292 Views)
Solution
Accepted by topic author Jake Earp

Hi,

 

If my uderstanding is correct, this should help you..Please refer the attached image..

 

Accept as sollution if solved the problem.... Smiley Wink

 

Thanks,

Yogesh

0 Kudos
Message 2 of 4
(3,269 Views)

Thanks for that you're a legend.

 

However, whenever I change the dynamic data to an array like that, I loose my time values (sampling at 1000 hz).  That causes heaps of issues with other parts of my programme, is there any way around this?

0 Kudos
Message 3 of 4
(3,254 Views)

You can retain the time values also. Since the sampling rate is 1kHz, the DBL array and the dt (1/1kHz) can be used to buid the waveform again.

Please refer the attached VI.

 

Regards,

Yogesh

0 Kudos
Message 4 of 4
(3,239 Views)