LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PCI 6602 - 20MHz Timebase clock source

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

0 Kudos
Message 1 of 7
(3,137 Views)

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

0 Kudos
Message 2 of 7
(3,121 Views)

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

0 Kudos
Message 3 of 7
(3,109 Views)

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.

0 Kudos
Message 4 of 7
(3,106 Views)

Any help?

0 Kudos
Message 5 of 7
(3,068 Views)

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!

Tanim
National Instruments
0 Kudos
Message 6 of 7
(3,041 Views)

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

0 Kudos
Message 7 of 7
(3,023 Views)