Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use PCI6602 4-5 cards run simultaneous via RSTI?

I use them as a simple event counter all of them must start and stop count at the same interval of time.
Now I write my VI as attachment,I already have RSTI bus,but don't know how to use it.
Every one who know please help.
0 Kudos
Message 1 of 2
(3,094 Views)
Hi credo,

First here's a few comments on what I see in your vi:

1. The loops to configure the counters are the right idea. You need those 32 distinct task id's to perform 32 channels of counting. You've already gotten over one key hurdle!

2. There's quite a bit of duplicated code to handle each of the 4 boards separately. You could make sub-vi's out of these code chunks and clean up your diagram considerably.

3. You're programming the counters for "simple" (unbuffered) event counting but are then reading them as though they are buffered. This won't work.
I can't tell whether you need buffering or not. It doesn't look like you are trying to use most of the buffered data. However, buffering *can* still help make sure that all the counter values you read represent the same instant in time. Can you describe your needs more exactly?

4. If you buffer the reads, you'll need to supply a "Gate" signal, i.e., a sampling clock. If you can spare a counter to generate one, then this alone can synchronize all your readings. Otherwise, you'll also need to configure all the counters to start on a digital trigger.

5. You've got some issues with dataflow, local variables, and race conditions. For example: inside your big loop you read from the D1,D2,D3,D4 local variables to create a graph and stuff. However, you don't write new values into those indicators until the inner reading loops end. It is very likely that they will be read before they are written. This would be a good place to simply route wires instead of using local variables.

That's plenty enough to look into for now. I would strongly recommend that you first try to work out the programming syntax and flow using several counters from 1 board. When you get it working, you can create a sub-vi from it and reuse it for the other boards. Then we can start talking about RTSI...

One little-known fact about RTSI is that it can actually be handy even when programming a single board under traditional NI-DAQ. I've used it frequently to avoid the need to hardwire connections for timing signals. I'd again recommend that when you're ready to deal with RTSI, that you first try it out on a single board. If it works for 1 it'll work for the others.

Finally, you may want to consider migrating to DAQmx. Especially if you don't have a lot of code invested into counters under traditional NI-DAQ yet. NI has been nudging us toward DAQmx for quite a while now, and it'll handle the RTSI stuff pretty much auto-magically.

-Kevin P.
ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 2 of 2
(3,088 Views)