Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I generate a pulse of variable frequency using digital I/O to output thro usb 6229 in LabVIEW?

How do I generate a pulse of variable frequency using digital I/O to output thro usb 6229 in LabVIEW? My ultimate aim is to control a servomotor using USB 6229...pls help if anyone knows...dis might be too easy for u people..im just a beginner in labview...so reply without fail if u know anything ...
0 Kudos
Message 1 of 7
(4,843 Views)

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.

 

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

 

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.  However, this approach is more complex and less deterministic than the counter approach. 

 

Software-Timed PWM Using a Digital Output Line

 

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

 

Regards,

 

Ed W.

Applications Engineer

National Instruments

Message 2 of 7
(4,832 Views)

Hey Ed,

                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.

 

Message Edited by vinoth002 on 06-18-2007 12:24 AM

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

Hi Vinoth,

 

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.  How high are the frequencies that you’re trying to use? 

 

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

 

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

 

Regards,

 

Ed W.

Applications Engineer

National Instruments

0 Kudos
Message 4 of 7
(4,800 Views)

Hi Ed,

          The frequencies I am planning to use are around 50 kHz.

           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 ?

                         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? Also, will I be able to run your digital output pulse generation on an USB 6009 ?

With thanks,

Vinoth.

0 Kudos
Message 5 of 7
(4,794 Views)

Hi Vinoth,

 

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.  Usually this limits your output frequency to about 1kHz or less, but it will vary from computer to computer.  Instead, I would recommend using a counter to generate these pulses.  You can still change the frequency on the fly, and the pulses will be hardware timed giving it much higher and deterministic output abilities.

 

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

 

Why Can't I Simulate my DAQ Device in Measurement & Automation Explorer?

 

Regards,

 

Ed W.

Applications Engineer

National Instruments

0 Kudos
Message 6 of 7
(4,783 Views)

(Sorry, I meant to type “USB-6009)

 

-Ed

0 Kudos
Message 7 of 7
(4,773 Views)