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.
02-03-2016 09:41 AM
Hello,
How to realise comparator, where input signal is waveform-type (coming from DAQ) and threshold is a double constant.
These two types are incompatible, so some conversion should be done. Which one ?
Thanks
Pavel
Solved! Go to Solution.
02-03-2016 09:44 AM
The waveform is a cluster of 4 things: Array of DBLs, t0 (timestamp), dt (DBL), and attributes (variant). You can access the array of DBLs if you need.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
02-03-2016 09:52 AM
02-03-2016 09:55 AM
I assumed he was trying to use the "threshold" VI.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
02-03-2016 10:00 AM
Hello James,
Thank you for feedback. Here is fragment of my VI.
The signal acquired from DAQ is then transformed inside of block "Lorentz Transform" (on the "Lorentz Transform" output the data is still waveform-type) and then should be compared with threshold.
When I transform wafeform in 1D array and apply it to comparator, discrepancy persists: array cannot be properly compared with single value - connection to LED is broken.
Does exist some example, where data is acquired by DAQ and then this stream of double values is compared with a threhold: when the acquired runtime value is greater then threshold, LED is ON.
Thanks
Pavel
02-03-2016 10:01 AM - edited 02-03-2016 10:07 AM
02-03-2016 10:03 AM - edited 02-03-2016 10:06 AM
Hi Pavel,
array cannot be properly compared with single value - connection to LED is broken.
Your conclusion is: I cannot compare because I cannot display the result of the comparison?
You can compare an array to a scalar!
But you cannot display an array in a scalar boolean indicator!
Either use an array of booleans or a suitable boolean operation like "AND array elements" or "OR array elements"…
when the acquired runtime value is greater then threshold, LED is ON.
Your should check your wording: a waveform contains (usually) more than one value!
So you need to define, when the LED should be ON: when all values are above your limit or when atleast one value is above the limit?
02-03-2016 10:13 AM
Hello GerdW
My case is similar to the following setup:
Is it possible to put LED in VI, that in runtime changes to ON when SIN is more than 0.5V and OFF if it's less than 0.5V ?
Thanks
Pavel
02-03-2016 10:21 AM - edited 02-03-2016 10:25 AM
Like GerdW said, you have an array of values (multiple DBL values) that you are comparing to your threshold. You need to define the criteria that the LED will show True. Is it when all values are above threshold? When the first value is above? When the last value is above?
There are many possible ways to do this.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
02-03-2016 10:28 AM
Ok, I see.
Thanks. Probably should I redefine the problem ... for example create different acquisition branch with number of samples = 1 ?