LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Electronic comparator

So, no one has an idea about counters? and why my programm doesn't work correctly (counter part)?

Thank you,

0 Kudos
Message 31 of 45
(793 Views)

I would guess that it was more accurate to say that no-one has any idea what's wrong with your counters (describe what you have, what you get, what you want instead, attach up-to-date code), and that perhaps people are tiring of trying to find out exactly what you want in order to help you.

 

If you want help, be more descriptive of what you need and what you've tried. Please don't just type "it doesn't work" over and over - that gives no information (especially after the first time).

 

I feel like at some point in the past you wanted time values rather than indices of the threshold crossing points - to get these, simply using the index to index the array of times. Since the Indices output is an array, use a For loop with autoindexing inputs for the indices, and no indexing for the time values.

index.png


GCentral
0 Kudos
Message 32 of 45
(789 Views)

Hi ki4,

 

surely we have a lot of ideas - but it seems you don't listen to our advices.

 

There even is a function in the file functions palette giving you an unique filename to not overwrite existing files. But a simple counter using a shift register is also easily implemented!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 33 of 45
(786 Views)

No, I would do comparator as described in the picture. It is easy but when I run my programm it doesn't detect all the threshold, it detect it just for the first miliseconds.

this is my programm,

Download All
0 Kudos
Message 34 of 45
(779 Views)

Hi ki4,

 

using that PeakDetector is quite easy:

check.png

When you don't get the expected results then you need to debug your VI:

- do you read the expected waveform from DAQmx?

- does the PeakDetector give the expected result with the waveform you got?

- did you check the error output of those PeakDetectors?

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 35 of 45
(771 Views)

Ya I read the expected signal, when I use peak detector is OK, it detects all the peaks. I don't have any errors when I run the programm.

0 Kudos
Message 36 of 45
(766 Views)

but with threshold detector doesn't work correctly. You have the programm, you can see what I did.

0 Kudos
Message 37 of 45
(764 Views)

Hi ki4,

 

when I use peak detector is OK, it detects all the peaks. I don't have any errors when I run the programm.

but with threshold detector doesn't work correctly. You have the programm, you can see what I did.

I'm sorry, I used the wrong name for the function in my image. I used ThresholdDetector (instead of PeakDetector as I wrote in the message) in the same way as you did in your last VI…

 

What "does not work" when you use ThresholdDetector? In my little image it works as expected!

Can you answer my questions (after you replace the word "PeakDetector" by "ThresholdDetector")?

 

We can look at your VI, but we cannot run it due to missing your hardware. And so we also cannot reproduce your signal you are reading by DAQmx from your hardware. And you also didn't attach a typical signal so we could atleast do an "educated guess" about your "problem"…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 38 of 45
(756 Views)

My signal is sinusoid waveform [-2V; 2V] , I detected well by my DAQ BUT the threshold detector doesn't count all the threshold. I run my programm 5s, and in the threshold detected I find 1 and sometimes it shows two. It is not correct because my signal is fast and I have so many periods in 5s.

 

When I replace threshold detector by peak detector, I don't have problem. The programm detects all the peaks.

 

SOOOO,...

0 Kudos
Message 39 of 45
(753 Views)

Hi ki4,

 

My signal is sinusoid waveform [-2V; 2V] , I detected well by my DAQ BUT the threshold detector doesn't count all the threshold.

My little VI creates a sine wave with an amplitude of ±2, with lots of periods.

The ThresholdDetector detects them all:

check.png

SOOOO,...

What is the difference between my sine wave and yours?

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 40 of 45
(748 Views)