Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading 3 channels simultaniously from PCI6602.

Hello.
I employ a PCI6602 which has 8 channels and 3 DMA channels.
I wrote a VI for period measurement of a digital TTL signal. Using the NIDAQmx 7.3 I created a task with the DAQ Assistent with one channel and the program works great. The problem is that I want to connect 3 channels to the PCI6602 and read all 3 channels simultaniously via DMA. The channel properties (measurement method, max value, min value etc.) are all the same. Unfortunately I can't add more counterchannels to the task. Which are the possibilities to implement this problem?
Thanks a lot!
0 Kudos
Message 1 of 7
(4,075 Views)
Basa,

Hi again. You're correct that you can only assign one counter channel to a task. To make 3 measurements, you'll need to generate 3 separate tasks. The driver should know to use DMA by default even if you don't explicitly specify it.

Considering that you're measuring 3 channels, not 1, I've amended a response I gave to your earlier question: Trigger & Measure same signal?

-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.
0 Kudos
Message 2 of 7
(4,075 Views)
Hello.
I created 3 separate tasks with the DAQ Assistent, each with the following attributes:

Max input: 130µs
Min input: 50µs
Starting edge: Rising
Measurement method: Two counter (wide range)
Divisor: 18
Number of samples to aquire: 3200

In LabVIEW I added them to the blockdiagram and automatically generated code with the option from the right mouse click menu. Finally I wired the three DAQmx Read outputs to a single graphic display to display the three waveforms in one diagram.
Unfortunately the VI doesn't work.
I'd be very glad for any example VI.
Thanks for your efforts!
0 Kudos
Message 3 of 7
(4,075 Views)
I haven't really used the DAQ Assistant -- can you post your code and describe the nature of what doesn't work?

A couple possible thoughts in the meantime. When you choose the two counter measurement method, each DAQmx task will use 2 counters. In addition to the one you specify, another will also be used, probably the one considered the "adjacent counter." The counter pairs that are considered "adjacent" are (0,1), (2,3), (4,5), (6,7). So if you set up the task by specifying counter 0, the DAQmx driver would also need counter 1 for that task. You'd need to setup your next task on, say, counter 2 and the DAQmx driver would also consume counter 3.

The other alternative is to use the 1 Counter measurement method. I believe t
he wide range is only needed when your time intervals might exceed the rollover time for your counter. Even with an 80 MHz source you can accomodate nearly a minute between pulses. Given your min and max specs above, I doubt you need to use the 2 counter method.

-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.
0 Kudos
Message 4 of 7
(4,075 Views)
Hello. Thanks to your advice with the "adjacent" counters I made the VI work properly. However, another problem occured. 🐵
A simple example to explain this problem:
Imagine two digital signals connected to two channels:

Signal_1 with a period of 1ms
Signal_2 with a period of 2ms

I want to perform finite period measurement simultaneously on both signals and display both frequency in one graphical display. The signals are wired to the gate input. So the measurement time for one single sample is 1ms and 2ms respectively. The number of samples per channel is 3000. So the total measurement time is 1ms*3000=3s and 2ms*3000=6s respectively. So far so good.
The problem occurs when displaying the frequencies in the graphical display. The
unit of the x-axis is 'number of sample', the range that's why 0...3000. So the measured frequency values are assigned to the corresponding sample numbers. Any time information is lost! You can't read off the display that one measurement took 3s and the other 6s.
But time information is crucial in my case for I have to measure signals with varying frequencies. The measured frequencies have to be assigned to time values, not to sample numbers.
How can I implement this in LabVIEW?
I already changed the scale of the x-axis to 'relativ time' but without success.
Thanks for help!
0 Kudos
Message 5 of 7
(4,075 Views)
Sorry I didn't see this earlier. Here's a simple utility to convert arrays of measured periods into a cumulative time, suitable to use for an x-axis of an XY Waveform Graph.

-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.
0 Kudos
Message 6 of 7
(4,075 Views)
Thanks for your support. In the meantime I had the same idea and was able to solve the problem on my own. I used a FOR-loop as well, but instead of a shift register I employed a feedback node (I hope you know what I mean for I use a german LabVIEW version and translating is sometimes difficult *g*).
Again, thank you very much!
0 Kudos
Message 7 of 7
(4,075 Views)