05-15-2019 07:24 AM
So, no one has an idea about counters? and why my programm doesn't work correctly (counter part)?
Thank you,
05-15-2019 07:33 AM - edited 05-15-2019 07:39 AM
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.
05-15-2019 07:38 AM
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!
05-15-2019 07:59 AM
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,
05-15-2019 08:27 AM
Hi ki4,
using that PeakDetector is quite easy:
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?
05-15-2019 08:31 AM
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.
05-15-2019 08:42 AM
but with threshold detector doesn't work correctly. You have the programm, you can see what I did.
05-15-2019 09:26 AM - edited 05-15-2019 09:28 AM
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"…
05-15-2019 09:33 AM
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,...
05-15-2019 09:49 AM
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:
SOOOO,...
What is the difference between my sine wave and yours?