Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

configuring pfi pins as counter

Solved!
Go to solution

I want to configure pfi pins of daq max 6229 card as a counter. What pfi pins should i use and can anyone help in providing some information regarding the pfi pins used and their connections.

 

Can anyone provide elaborate information on this?

 

Thanks

0 Kudos
Message 1 of 6
(2,065 Views)
Solution
Accepted by topic author gurman312

1. You seem to have some concepts backwards.  PFI pins are just terminals made available  at the board's connector.  NI DAQ devices tend to offer quite a bit of flexibility in how one routes signals to or from PFI pins, but they are just terminals.

 

2. Counter circuitry and functionality is embedded in the board's internal structure.  Your 6229 is an M-series device with 2 internal counters.   You can configure a counter to do any one of a variety of things (edge count, frequency measurement, pulse generation, quadrature encoder decode, and more), *and* you'll have quite a bit of flexibility for declaring which PFI pins should be used for the input or output functions.

 

3. NI's "Measurement and Automation Explorer", aka MAX, has a handy feature related to this.  Select your 6229 device and find the tab at the bottom right for "Device Routes".  This gives you a visual map of the possible options for routing signals between external PFI pins and the internal counters (as well as some other things).

 

4. Also in MAX, you can right-click your 6229 device and select "Device Pinouts".  This will show you which PFI pin is used by *default* for various purposes by each counter.  If you don't explicitly configure the counter otherwise, then these are the PFI pins to physically wire up for your signals.

 

5. In summary, there's a lot of options and no one clear answer.  You can choose to learn the defaults and physically wire accordingly.  Or you can learn what existing wiring has already been done and configure your counter tasks accordingly. 

 

6. LabVIEW ships with many examples that demonstrate some basic counter functionality.  Examples can be found for other languages too, I just don't know where to point you for those.

 

 

-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 6
(2,043 Views)

From how much i have understood is that i can generate single pwm signal from a single counter, and there are two counters in 6229 card.

 

My Question is that can i generate more that two pwm signals or any complementary pwm signal from the two available counters in 6229 card? Or can i just generate 2 signals?

0 Kudos
Message 3 of 6
(1,984 Views)

With a 6229 you can directly generate 2 continuous pulse trains to act as to serve a PWM function.  Note that you can change the duty cycle on the fly, but you will have to re-write the unchanging frequency to make the duty cycle change "take hold".  Some devices allow you to use DAQmx Write to write both at once, others require you to use a DAQmx Write property node.  If using the p-node, it *might* be important to write the new duty cycle first.  Property nodes execute from top to bottom so keep the duty cycle write above the frequency write.

 

When you say "complementary pwm", do you mean same freq & duty cycle but opposite polarity?  If so, a simple external inverter circuit could be used.  Beyond that, independent control of 3 or more PWM signals isn't generally possible with M-series 62xx devices.  The newer X-series 63xx devices could support up to 4.

 

 

-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 6
(1,963 Views)

Can you please also tell the connections i have to make to configure the pfi pins as a counter.

 

Thanks

0 Kudos
Message 5 of 6
(1,945 Views)
Solution
Accepted by topic author gurman312

Please re-read my msg #2.

 

PFI pins are NOT used AS counters.

 

Tasks can be configured to USE PFI pins to route external signals to the counters residing inside the circuitry of the DAQ device.

 

More info readily found in MAX, as previously described in msg #2.  One "missing piece" might be the programming aspect.  In LabVIEW, I typically use a DAQmx Export Signal property node.  There's also a DAQmx Export Signal vi, which would be sufficient in many situations, but the property node provides more access to detailed config settings when you have special requirements.

 

 

-Kevin P

 

 

-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 6 of 6
(1,938 Views)