Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

PWM-signal generation using Digital Out on PCI 6254

Hello,
I would like to use the digital Output ports of the PCI-6254 to generate Pulse Width modulated signals. The task is to generate 4 independent rectangular signals (about 20000 Hz, different duty cycles), and there are only 2 counters on the card so that I need to choose the DIO.

I´ve been trying to acomplish this for a while, having to admit that I´m a complete Labview-starter. I tried to find existing examples but mainly they base on other platforms so I can´t use them.

I then look up the NI-Examples but only found ways to generate a likewise signal with counters (Gen Dig Pulse.vi)

My intent was to use the counter to produce a timing signal for the single Digital Outs, but doing this I can only produce PWMs with the length of 1 cylce of the Counter and 100% duty-cycle. But there should be 4 independent ones with different phase and frequency.

Is there a posibility to send me an example or hints how to acomplish this? In the enclosure there is a copy of my programme.

Thanks a lot,

Alex
0 Kudos
Message 1 of 4
(3,733 Views)
 

Dear Alex,

I found an interesting paper that explains you the Steps to generate PWM signal in Labview. It is called Advanced Data Acquisition Series – Pulse Width Modulation in NI LabVIEW Using NI-DAQmx.

The second is an example that shows how to generate PWM using an analog output rather that using a counter.

 

 

 
0 Kudos
Message 2 of 4
(3,714 Views)
Hi Nick,

thank you for your response. I´m right now not at work but I will try the example out when I arrive there. The problem is that I would really like to use the digital outs to generate the signals because I think the sample rate should be a little higher on the DIO in comparison to the analog Outs. The objective is to produce 4-6 signals with frequency of about 6kHz, but there should be the possibility to define the phase between the different signals very fine (high resolution). Do you have a hint how to generate the signals with an DIO ? The problem has been the timing signal, I guess I have to use at least one Counter to produce a master time signal?!?!

Thank you again,

Alex
0 Kudos
Message 3 of 4
(3,699 Views)
Alex,

You should be able to use the correlated digital lines on your 6254 to produce the waveforms you want.  There are a few examples under digital generation about continuously writing to a digital port using an external clock.  The clock will clock out one bit of your digital wave form every clock cycle.  To provide the clock you can either produce one with a counter and use that signal as your clock or you can route one of the internal clocks like the 100kHz timebase.

Good luck,

Marshall

0 Kudos
Message 4 of 4
(3,682 Views)