Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change default gate input for counters on 6251 PXI

Solved!
Go to solution

I am trying to program digital channel as a gate to the counter. I would like to measure pulse width on more then 2 channels. For example, the default ones are PFI4 and 9. I like to have more gate inputs.

Can I do it?

 

Thank you

0 Kudos
Message 1 of 5
(3,679 Views)
Solution
Accepted by topic author Rus_K

Hi Rus_K,

 

The 6251 only has 2 counters so you can't measure more than two channels at a time.  However, you may sequentially measure the different channels on the two available counters.  Any of the PFI lines on your 6251 should be able to be routed to the counters with a DAQmx Channel Property node:

 

2010-05-07_122426.png

 

The other APIs have similar properties that you can set to change the input terminal.

 

 

Best Regards,

John Passiak
0 Kudos
Message 2 of 5
(3,654 Views)

You also might conceivably use change detection on digital port0, but you'd have a fairly intricate task to decode all the data to figure out the individual pulse widths.  It's not so much really hard, just that the post-processing needs to pay a great deal of attention to detail.

 

If you go that route, you'd also need to setup a counter to buffer up the timestamps of "change detect events" so you would be able to correlate the samples collected in your DI task with the time represented by the samples in your counter task.

 

-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 3 of 5
(3,651 Views)

Thank you John. I was playing with that option. Have one more question. Where do you put channel property, after Virtual channel.v?

Is the picture has corect order ?

 

Thank you

 

ni.jpg

0 Kudos
Message 4 of 5
(3,646 Views)

After the create virtual channel should be fine. 

 

Also, if you want to change the input without restarting the entire program you can stop the task, call the channel property to change the channel, and restart the task.

 

 

The change detection is also a good idea, but it does get a bit complicated to efficiently program all of the logic required to compute the measurements in software.  I've played around with the idea before but ran into some problems if the pulses came too close to one another on the respective lines.

 

 

Best Regards,

John Passiak
0 Kudos
Message 5 of 5
(3,633 Views)