02-20-2002 11:40 AM
02-21-2002 09:56 AM
12-20-2007 02:25 AM
12-20-2007 08:35 AM
I only have time for a few brief comments:
1. On missing the specific value of 1024: Very likely, both count values 1024 and 1025 (plus perhaps some others) are being registered in between sample clock edges. The value that gets buffered is whatever is in the count register at the instant of the sample clock edge. Your counter sees #1024 and counts it, but it *also* sees and counts #1025 before the next sample is taken.
2. Counting not in sync: Given your description, I believe that the samples *are* in sync. However, your method of reading the samples may not be carefully maintaining that synchronization.
The counts are incrementing instantly with input edges and the data acq buffers are being updated simultaneously with sample clock edges. However, the function calls to READ the data are governed in part by software timing. The software calls to read the 2 counters must happen sequentially, with some amount of time (probably small) elapsing between them.
In these situations, I suggest that you be careful to read the SAME # of samples from each data acq task rather than using the unwired default of "read all available samples." Because your hardware is sync'ed, you can keep your read data sync'ed by reading the same amount of data from each task. You could read all available from the 1st task, then query the size of the data array to determine how many samples to read from the 2nd task.
3. You may not need the PXI_Trig1 start trigger at all, depending on other aspects of your app. If your two edge-counting tasks are started *before* the sampling clock signal is started on PXI_Trig0, then they will be hardware-sync'ed even without using an arm start trigger.
-Kevin P.
02-04-2008 05:46 AM
02-05-2008 03:25 PM
Hi Counter.
I assume you are asking how to synchronize two counters on the same device. If not, can you please clarify your question?
You can easily synchronize two counters to by configuring a digital start trigger for each of the counter tasks and then use the same trigger source at the trigger pulse. Please see Gen Dig Pulse Train-Continuous-Dig Start.vi in the Example Finder (Help>>Find Examples). This example starts one counter on a digital trigger, if you create an identical counter task within this VI, and then pass it the same start trigger, both counters will start at the same time, and will be synchronized as long as they share the same frequency and pulse width.
Hope this helps.
Chris_K
08-20-2008 03:57 PM
I have a similar problem to Achim I think.
I posted a possible solution here...
http://forums.ni.com/ni/board/message?board.id=40&thread.id=2779
But still not sure if it would work though...
Cheers,
Kris