Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a task with NI9472 and counter from cDAQ9178 for PWM

Hello,

 

For a project I need to create a DAQmx task for PWM in my project library.

I have the NI 9472 Digital Out module with no counters, and a NI compactDAQ 9178 with 4 counters.

 

How can I configure the task so that I can use the counter from the cDAQ to output PWM from the digital out module?

 

Thank you and as always, kudos will be given! Robot Very Happy

 

0 Kudos
Message 1 of 7
(5,455 Views)

Giant,

 

I'm guessing you are programming this in LabVIEW? Either way, you really shouldn't have much trouble with this, the example I point out are in LabVIEW. You will natively be able to access the 9178 counters from your 9472 module. I simulated something similar to what you have:

 

max.png

 

From there, you just need to specify the Counter and Output Terminal in your program. There is an example in LabVIEW 2012 in the Example Finder called "Counter - Continuous Output" that I am using.

 

Channel Settings.pngblock diagram.png


This will allow you to route your signal to the line you want. Now as for changing the duty cycle of the PWM, NI has a good white paper on the topic.

 

Pulse Width Modulation (PWM) Using NI-DAQmx and LabVIEW

http://www.ni.com/white-paper/2991/en/

 

Hope this helps.

Aaron W.
National Instruments
CLA, CTA and CPI
Message 2 of 7
(5,445 Views)

Aaron_W thank you for your awesome reply!

0 Kudos
Message 3 of 7
(5,440 Views)

Hello,

 

I work with the NI 9472 Digital Out module with 4 counters assembled in a NI compactDAQ 9178.

I see in the default allocation of the module that:

- CTR 0 OUT is working on PFI3

- CTR 1 OUT is working on PFI7

- CTR 2 OUT is working on PFI1

- CTR 3 OUT is working on PFI5

 

Is it possible to modify this allocation with the following settings:

- CTR 0 OUT to work on PFI0

- CTR 1 OUT to work on PFI1

- CTR 2 OUT to work on PFI2

- CTR 3 OUT to work on PFI3 ?

If yes, what tool do I have to use to perform this operation?

 

Regards,

 

Xavier

0 Kudos
Message 4 of 7
(3,529 Views)

Hello Xavier,

 

I don't think that the cDAQ is flexible enough to allow you to choose to which output a counter is connected to. I'm not 100% sure how this work, but the backplane of the cDAQ would need an expensive switching matrix to allow this. 

0 Kudos
Message 5 of 7
(3,524 Views)

Hi Xavrocg,

 

As previously mentioned it is possible based on the device to route to different locations on the device. Some if not all of this routing is possible. I have attached a couple of articles outlining the method you can do this:

 

Internally Routing Counter Signals:

http://digital.ni.com/public.nsf/allkb/8A85E97855EDADC98625730C00065F58

 

How Can I Know What internal routes are available on my device:

http://digital.ni.com/public.nsf/websearch/E539D226A643C1CE8625715E007C23C8

 

Kind Regards,

 

Matt Fergusson

Message 6 of 7
(3,516 Views)

Iqnore my previous answer, I was obviously wrong. Sorry about that.

0 Kudos
Message 7 of 7
(3,513 Views)