08-18-2016 11:57 AM
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.
08-18-2016 12:18 PM
08-18-2016 12:28 PM
-Did you miss step 4 in other image?
-To split the signal to get Numeric value and do comparision as in other image.
08-19-2016 02:45 AM
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.
08-19-2016 03:02 AM
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/
08-19-2016 03:17 AM
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!
08-19-2016 03:57 AM
08-19-2016 04:03 AM
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.
08-19-2016 04:04 AM
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?
08-19-2016 04:09 AM
It depends on the hardware you are working with...