LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

starting counter (6025E)

I'm using 6025E board for my application,

In my vi, the counter is called immediately after the acquire waveform.vi to start the counter (source set to 100Khz internal timebase) the vi looks as if the counter start counting immediately after the data acquisition, however in actual fact, there is some delay when the program flow from acquire waveform.vi to counter control.vi

the 2 signals that i had acquired by analog acquisition and digital signal are suppose to be in phase. hence a delay by msec in starting the counter can be a big problem.

1. it is possible to start the counter " immediately" after the analog acquisition of 20mesc.

2. what should i do to start both digital and analog acquisition at the same time.

from my tes
t results, the time delay that i'm getting is not consistent, why is this so, since i'm running the same software with the same input. Because if i'm able to get a consistent delay, then the delay in starting the counter will not be a problem as i can offset the delay.

thks,lyn
0 Kudos
Message 1 of 5
(3,119 Views)
This seems to be the same question as the post entitled, "starting counter immediately after analog acquisition," which also contained the actual VI in question. So I am posting nearly the same reply in response to this question:

It was helpful to see your VI in order to get a better understanding of your application. From looking at your VI, I am assuming that the digital acquisition your question refers to is actually buffered event counting.

I will address your two questions separately:

1. The counter can be configured before the analog acquisition if you wish, so then it would start counting as soon as it received a pulse on its gate signal. If you can control the external signal so that it begins as soon as your analog acquisition is comp
lete, then that might work for you.

In terms of software, it is not possible to configure the counter after the analog acquisition completes and have it begin "immediately". The software that configures the counter requires time to execute.

This time is inconsistent because it depends upon how quickly your computer executes your application. The execution time depends on the resources currently available to your CPU. Therefore, the delay will be inconsistent.

2. The best way to be certain of your timing is to rely upon hardware, rather than software, to control the timing. You can do this if you use the same external signal to start your analog acquisition and buffered event counting at the same time.

It looks as though you are basing your VI off of the Count Buffered Edges (DAQ-STC).vi shipping example. You can combine this with the Acquire N Scans Digital Trig.vi shipping example. Then connect the external signal which you are routing to the counter's gate in the C
ount Buffered Edges example to the digital trigger input (PFI 0) for the analog acquisition. The analog acquisition will then start at the same time your counter receives its first pulse to count.

I hope that this helps!

Sonya
Message 2 of 5
(3,118 Views)
Thanks sonya,

i had replace the AI acquire waveforms with the acquire N scans Digital trigger, however it always prompt me with an error.
"no DMA channel is available for use"

1. y is this so??

everytime when i faced this problem( running another vi that do handshaking), i used to boot up my PC and this problem will be solved, however this time this don't solve my problem.

what cause this error?

thks lyn
0 Kudos
Message 3 of 5
(3,118 Views)
I'm sorry i should attach this file
0 Kudos
Message 4 of 5
(3,118 Views)
The error 'No DMA Channel Available' is due to the fact that your application is trying to use more than one DMA channel at once. However, the PCI-6025E only has one DMA channel available for use, as you can see either in Measurement and Automation Explorer (MAX) or in the KnowledgeBase linked below:

How Many DMA Channels Does My E Series Data Acquisition (DAQ) Device Have?

The solution is to use interrupts (IRQs) rather than DMA. By default, your application will try to use DMA. Whichever operation is configured first in your application will acquire the DMA channel (either the counter or the analog input). For the second operation
, you will need to use the "Set DAQ Device Info" VI to specifically select to use an interrupt for that operation. The location of this VI is described in the folllowing KnowledgeBase:

How do I set my DAQ device to use Interrupts instead of DMA?

I hope this helps!

Sonya
0 Kudos
Message 5 of 5
(3,118 Views)