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: 

on the fly signal conditioning

hello, I have this simple filter in order to condition input data for further use. Any suggestions why it does not work as expected and is still leaking vals <0.

Thanks for comments, J

0 Kudos
Message 1 of 19
(1,368 Views)

Hi Joan,

 

it would help to attach "this simple filter"…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 19
(1,356 Views)

sure, it was attached to original message then did not reload,cheers

0 Kudos
Message 3 of 19
(1,353 Views)

Hi Joan,

 

next time please attach real code (VI or snippet) instead of an image of code…

 

Which output value do you expect in case you read a value smaller than 0 from that DLL?

Why do you wire that DLL output also to the "N" input of the loop?

 

You really need to explain the code with more details!

 

(It often also helps to describe the algorithm you want to implement instead of the algorithm you actually implemented - sometimes there might be a huge difference between both!)

 

"On the fly" reminds me on this old message🙂

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 19
(1,344 Views)

I suggest to use In Range and Coerce:

JensG69_0-1627559438711.png

And i can only agree to Gerd's critique...

 

Regards, Jens

Kudos are welcome...
0 Kudos
Message 5 of 19
(1,340 Views)

I have to agree here.  I have no idea what this code is supposed to do.  Right now it seems to not do anything useful.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 19
(1,318 Views)

@Joan80 wrote:

hello, I have this simple filter in order to condition input data for further use. Any suggestions why it does not work as expected and is still leaking vals <0.

210729_Cond loop.PNG

 


 

It does not work because you don't quite understand dataflow yet. Have you done all the LabVIEW tutorials?

 

It makes no sense to repeat the same operation over and over using a loop, especially since we don't even know the value wired to N (could be fractional, negative, zero, infinite, NaN, etc. Once is sufficient.

 

  • Please explain what you mean by "leaking", "condition", and what kind of "further use" is intended.
  • Please attach a simple VI with a control as data source (instead of some cryptic dll).
  • Please explain what you want as output based on input ("leaking" is not a programming term).
  • What output do you want if the input is zero or smaller? NaN? Previous good value? (You cannot have "no value", unless you make the input an array with one element, in which case you could return an empty array).
  • ...

 

 

0 Kudos
Message 7 of 19
(1,302 Views)

hi Folks, 

 

thanks for you answers.

This part of the code and as headline suggest, is supposed to condition data on the fly, meaning, check if incoming data is bigger than zero and if yes proceed to plot data stream and trigger other parts of the code to do their part. If data is smaller then it ignores it and moves to next data. Data that are less than zero, val=-4, are artefacts from the device.  All operation runs as long as input data is provided, thus conditioning on N for the data stream (perhaps there is better way of doing that). To anticipate further suggestions, I am not intend to make it as a postprocessing on a data array, I want to use live data stream.

 

i tried solutions such as filer from signal processing toolbox but there are only meant to remove noise not conditioned on the data.

 

Cheers,J

0 Kudos
Message 8 of 19
(1,237 Views)

Jens, thanks, I tried your solution but it does not skip data points out of range but rather replaces than with other vals what introduces errors to data stream. It is not what I am intended to do

0 Kudos
Message 9 of 19
(1,235 Views)

Hi Joan,

 


@Joan80 wrote:

Check if incoming data is bigger than zero and if yes proceed to plot data stream and trigger other parts of the code to do their part. If data is smaller then it ignores it and moves to next data. Data that are less than zero, val=-4, are artefacts from the device.  All operation runs as long as input data is provided, thus conditioning on N for the data stream (perhaps there is better way of doing that, it is not my main concern right now). To anticipate further suggestions, I am not intend to make it as a postprocessing on a data array, I want to use live data stream.


When you don't want to plot those data then why do you plot a value in each iteration of the loop???

 

As has been said: Think DATAFLOW!

 

IF value is valid THEN plot value ELSE do nothing...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 19
(1,230 Views)