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

Use OR Array Elements

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

-Did you miss step 4 in other image? 

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

0 Kudos
Message 3 of 10

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

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 :

-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? :

Message 5 of 10

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

Hi zezendapuss,


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

Best regards,

using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 10

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

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

Message 8 of 10

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

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

0 Kudos
Message 10 of 10