LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

anybody has example code of a multichannel analyzer using counters?

I'm using a DAQ-STC chip on a 6713 trying to read counts/channel but the count keeps incrementing and I don't know how to reset before the next channel is read.
0 Kudos
Message 1 of 6
(3,382 Views)
I'm a little confused and so you might need to explain your application more thoroughly.

Are you trying to use one counter to count multiple signals? From your statement, it seems that you have multiple TTL pulses coming in and you want to use a single counter to count each pulse.

What frequency do the digital signal(s) have that you are trying to measure? If their frequencies are fairly fast, you won't be able to reconfigure (reset) the counter before getting the next count. This is because, resetting the counter will happen in software and that will be system dependent.

If you are needing to count muliple TTL signals, I would suggest to look at one of our counter/timer devices (NI 6601, NI 6602) linked below. Using a counter for each signal would be the
optimal way to count multiple counters.

I hope this helps. Let me know if I'm completely off-base.

Counter/Timer Devices
http://sine.ni.com/apps/we/nioc.vp?cid=4553〈=US

Regards,

Todd D.
0 Kudos
Message 2 of 6
(3,382 Views)
Hi Toddd

I am using one counter to provide time and gating for a second counter that counts buffered TTL rising edges.
The "counting" counter counts between gates and to get only the counts that arrived within each window I set up a shift register to subtract current minus previous counts. I then build a running counts array, cluster it with the time and plot it in an XY plot.

What I'm wondering is how well am I synchronizing both counters. I'm using a 100KHz time base for the timer but how do I know both counters are really in sink?

I hope that clarifies things a bit.
0 Kudos
Message 3 of 6
(3,382 Views)
Since you are using one counter to gate the other, they will be somewhat synchronized. Whenever the gating signal is received, data will be latched from hardware to software.

There isn't a way to trigger both counter operations to start at the same time with this device. Our NI 660x devices allow for triggering counter operations.
0 Kudos
Message 4 of 6
(3,382 Views)
I mean to trigger them in software. Seems like you tie them together by the error stream to sync them. Is that correct?
0 Kudos
Message 5 of 6
(3,382 Views)
Using the error cluster helps you use LabVIEW's data-flow programming paradigm to control in what order your VI executes.

So, if you have the VIs for one counter (let's say counter 0) output the error cluster to the VIs of the other counter (let's say counter 1), the VIs for counter 0 will execute first.

One way to use the error cluster to make sure the counters are triggered in software to start at the same time would be to use a single-framed sequence structure. You could place both Counter Start VIs within the sequence structure and pass both error clusters as inputs to the sequence structures (and to the Counter Start VIs). This will ensure that the Counter Start VIs won't execute until both error clusters are received by
the sequence structure. I hope this helps.

Regards,

Todd D.
0 Kudos
Message 6 of 6
(3,382 Views)