From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Read Multiple counter input edges

Solved!
Go to solution

Hey all,

I have perfectly working vi (you can find it in attachments) where I am using two DAQmx Read (Counter 1D U32 1chan Nsamp).vi to read counter input edges of two terminals (PFI9, PFI10). Now I am trying to figure out how to use a single DAQmx Read (Counter 2D U32 Nchan Nsamp).vi to read counter input edges of same terminals (PFI9, PFI10). The main objective of doing so is to ensure the synchronization of the two arrays read. 

 

My DAQ device is USB-6351, if anyone is familiar with how to get started with this situation, ANY help would be greatly appreciated. 

 

Please let me know if you need any sort of additional information from me to understand what I am doing.

0 Kudos
Message 1 of 4
(1,387 Views)
Solution
Accepted by topic author Dileep2628

As far back as I can remember, any NI DAQ devices I've used do not support multi-channel counter input tasks.  (Caveat: I've never used a dedicated cDAQ counter/timer module).  That includes X-series devices like yours.

 

But although the software calls to the Read function can't be perfectly synchronized, your measurements *can* be.  In fact, a quick look at your code suggests that they already *are*.

- both counter input tasks use the same signal as their sample clock

- that signal is the output of another counter that you control and it isn't started until after the input tasks are started

 

The device samples the two counts simultaneously and the driver delivers those samples to the tasks' buffers.  You're also correctly reading the same # samples from both tasks, so the corresponding counts can be known to have been sampled at the same time.

 

So you actually already solved your own problem, I'm just giving you the assurance that the two tasks' data are in fact sync'ed already.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 2 of 4
(1,370 Views)

Thank you so much Kevin, for confirming the synchronization of the two arrays. I am still curious about the use cases of the DAQmx Read (Counter 2D U32 Nchan Nsamp).vi. I assumed using it instead of two read counter vi can reduce the complexity of my code.

0 Kudos
Message 3 of 4
(1,364 Views)

Well, it was a reasonable assumption and worth a try.  Maybe multi-counter input measurements are supported on some NI DAQ device I'm not familiar with?   I know there's a dedicated counter/timer module for cDAQ that supports some unique things, but am not sure what they are.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 4 of 4
(1,357 Views)