Discussion:
How do I generate a pulse of variable frequency using digital I/O to output thro usb 6229 in LabVIEW?
(too old to reply)
Ed W
2007-06-15 20:10:12 UTC
Permalink
Hi vinoth002,

 

Is there a specific reason that you have for trying to use digital outputs?  I would recommend using a counter to achieve this type of functionality.  There is an online document that describes how to do this.

 

<a href="http://zone.ni.com/devzone/cda/tut/p/id/2991" target="_blank"> Pulse Width Modulation (PWM) Using NI-DAQmx and LabVIEW</a>

&nbsp;

On the other hand, if you need to use a digital output, there is a Knowledge Base entry that describes how to do this as well.&nbsp; However, this approach is more complex and less deterministic than the counter approach.&nbsp;

&nbsp;

<a href="http://digital.ni.com/public.nsf/allkb/1561D31534F07D608625727900391114?OpenDocument" target="_blank"> Software-Timed PWM Using a Digital Output Line</a>

&nbsp;

I hope this helps ? post back if you have further questions.

&nbsp;

Regards,

&nbsp;

Ed W.

Applications Engineer

National Instruments
vinoth002
2007-06-18 05:40:09 UTC
Permalink
Hey Ed,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Thanks a lot...that was helpful.But will this digital i/o pulse still work at high frequencies? Also, I have attempted to write a pulse as a digital waveform...very straightforward really.Can you have a look and tell me if it will serve the purpose? Thanks again..I really appreciate the help.
Vinoth.
&nbsp;Message Edited by vinoth002 on 06-18-2007 12:24 AM


digout9.JPG:
Loading Image...
Ed W
2007-06-18 20:10:10 UTC
Permalink
Hi Vinoth,

&nbsp;

All digital I/O on the M Series devices, like your 6229, is software-timed, so the output rates will not work at very high frequencies.&nbsp; How high are the frequencies that you?re trying to use?&nbsp;

&nbsp;

On the other hand, the counter outputs are not limited by software timing to generate pulse trains.&nbsp;

&nbsp;

As far as your example is concerned, it will work, but it will be very difficult to determine the exact frequency of your output.&nbsp; Since there is no timing associated with the digital I/O, the software will just push the data out as fast as apossible.

&nbsp;

Regards,

&nbsp;

Ed W.

Applications Engineer

National Instruments
vinoth002
2007-06-19 03:10:08 UTC
Permalink
Hi Ed,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The frequencies I am planning to use are around 50 kHz.
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Regarding my example, is it posible to incorporate timing into it? I guess only 'Sample clock' has to be used as 6229 doesnt seem to support pipelined or handshaking . In which case, what can I use as the source ?
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I also have a USB 6009. But I am unable to simulate it on MAX.The option itself isnt there.Can you throw some light on this?&nbsp;Also, will I be able to run your digital output pulse generation on an USB 6009 ?
With thanks,
Vinoth.
Ed W
2007-06-19 13:40:19 UTC
Permalink
Hi Vinoth,

&nbsp;

Since you?ll be using software timing for the digital outputs, you will be limited by your operating system?s ability to generate and output the pulses.&nbsp; Usually this limits your output frequency to about 1kHz or less, but it will vary from computer to computer.&nbsp; Instead, I would recommend using a counter to generate these pulses.&nbsp; You can still change the frequency on the fly, and the pulses will be hardware timed giving it much higher and deterministic output abilities.

&nbsp;

As far as the USB-6008 is concerned, this device is just not available for simulation.&nbsp; Although you can simulate most of NI?s devices, there is a short list of devices for which this option is unavailable.&nbsp; The following Knowledge Base entry describes this.

&nbsp;

<a href="http://digital.ni.com/public.nsf/websearch/4B20AD64F650D2D5862572C2005779A7?OpenDocument" target="_blank"> Why Can't I Simulate my DAQ Device in Measurement &amp; Automation Explorer?</a>

&nbsp;

Regards,

&nbsp;

Ed W.

Applications Engineer

National Instruments

Loading...