01-07-2015 01:21 PM
Hi,
I am trying to count number of pulse using internal clock of DAQ device which is PCI 6602. it's my first time with counter devices and I sed DAQmax Timing vi in sample clock mode and with 20MHz Timebase source. when I run my vi I get this error:
-----
Data was overwritten before it could be read by the system.
If Data Transfer Mechanism is Interrupts, try using DMA or USB Bulk. Otherwise, divide the input signal before taking the measurement.
-----
anybody knows what the reason is?
I attached my simple vi file.
Best,
Milad
01-07-2015 03:14 PM
The way you've got the VI written, it looks like it is trying to latch the current count at each pulse of the 20MHz clock and stream it back to the application. What is happening is the driver/application are unable to keep up with the 20MS/Sec of data being returned by the device. I don't think this was your intention... I would instead take a look at this example as a starting point for using your counter to count edges:
https://decibel.ni.com/content/docs/DOC-25126
01-07-2015 03:45 PM
Hi Logan,
Thanks for your response. you're right, I was playing with this example 🙂 what I want to do is to measure number of TTL pulse in a specified time window without external triger. this example works very well in Count Reset mode with this parameters:
Counter : Dev2/ctr0
Input Terminal : /dev2/20MHzTimebase
Trigger setting: /dev2/PFI39
I also wired spring terminal with pulse symbol to PFI 39 on BNC 2121.
there is only one problem, this example does not work for time gate below 1msec (Loop Time in this example). I really appreciate it if you let me know how I can solve this problem.
Best,
Milad
01-07-2015 03:48 PM
Actually I can't use a while loop because I want to integrate this software with another software which control some other devices. I want it to start counting, and keep data every 1-2 microsec. that's why I tried to use timing vi. this example doesn't work for my application.
01-08-2015 09:39 AM
Any help?
01-09-2015 01:51 PM
Hello!
What if you use a while loop without a wait ms function at all? It will run as fast as your machine allows without waiting 1ms.
Also, you don't want to update the waveform chart during each while loop cycle. You can instead update it every 100th iteration (or any other number using a modulus method).
Good Luck!
01-09-2015 05:10 PM
Hi Tanim,
Thanks for your response. I don't want to use while loop because timing is very important in my application. I could solve my problem using edge counting by sample clock generated by another counter.
Best,
Milad