LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Analog signal (voltage) comparator

Hey guys,

 

I would like to compare an incoming voltage signal with a constant value i.e. compare elememts of incoming analog signal to a contant. if the signal exceeds the reference, i would like to have a digital output to trigger an exernal LED circuit. 

 

The following method generates an array of boolean, i would like to have a single boolean value based on comparison of element-constant comparison.

 

I saw an old example, but my same program does not work.

0 Kudos
Message 1 of 10
(3,786 Views)

Use OR Array Elements


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 10
(3,770 Views)

-Did you miss step 4 in other image? 

-To split the signal to get Numeric value and do comparision as in other image.

Thanks
uday
0 Kudos
Message 3 of 10
(3,766 Views)

Hey Uday,

 

No. I think step 4 is unbundling the two waveforms. The blue wire is still a waveform signal compared to a constant. Apparently the example does not show any usage of OR etc.

0 Kudos
Message 4 of 10
(3,725 Views)

Waveform datatype has three components t0-Timestamp,dt-time difference between samples,Y-1D array of values of samples of that signal.More on wavefrom data type :http://digital.ni.com/public.nsf/allkb/B965F316364DE17B862572DF00363B10

-Now you want to compare with what?

-When you right click on blue wire(dynamic data type) did try to create indicator? What it shows? What type of indicator does it allow? : https://zone.ni.com/reference/en-XX/help/371361J-01/lvconcepts/dynamic_data_type/

Thanks
uday
Message 5 of 10
(3,718 Views)

Thanks for your suggestions uday.

Basically i am recording an analog signal and would like to generate a digital output whenever the value of analog signal crosses a certain threshold. Maybe what i am doing is not the right appraoch. Could you please suggest something?

 

thanks a lot!

0 Kudos
Message 6 of 10
(3,716 Views)

Hi zezendapuss,

 

use an "OR array" function as suggested before on your boolean array to get a scalar boolean value…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 10
(3,710 Views)

As Pointed by others, you are comparing scalar value to array of numbers: So you will have array of boolean giving the comparision of each element in array vs constant value.

-You need to use https://zone.ni.com/reference/en-XX/help/371361H-01/glang/or_array_elements/

to get the Boolean value so that if any one of boolean in array is TRUE it will result in TRUE.

Thanks
uday
Message 8 of 10
(3,706 Views)

Thanks GerdW, will do that.

slight off beat question. how fast can i trigger a digital output based on the results of comparison. is it possible to generate digital output at the rate of 200-300Hz?

0 Kudos
Message 9 of 10
(3,705 Views)

It depends on the hardware you are working with...

0 Kudos
Message 10 of 10
(3,696 Views)