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.
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.
07-29-2021 05:47 AM
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
07-29-2021 06:36 AM
07-29-2021 06:40 AM
sure, it was attached to original message then did not reload,cheers
07-29-2021 06:48 AM - edited 07-29-2021 07:46 AM
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… 🙂
07-29-2021 06:51 AM
I suggest to use In Range and Coerce:
And i can only agree to Gerd's critique...
Regards, Jens
07-29-2021 08:16 AM
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.
07-29-2021 11:31 AM - edited 07-29-2021 11:33 AM
@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.
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.
07-30-2021 07:15 AM - edited 07-30-2021 07:29 AM
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
07-30-2021 07:18 AM - edited 07-30-2021 07:19 AM
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
07-30-2021 07:28 AM
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...