From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to perform Real-Time Digital Out

I am trying to output a digital waveform in a real-time application for control purposes. I have a PXI-8186 real-teim board with PXI-6733 output board and labview 8.0. Is it possible to produce and output a digital waveform and be able to change the frequency and phase of the digital wave within a loop? If so, how? Since I have a control appliciation the I need to be able to change the pulse frequency at realtaviely high rates. I also need to write to one port, but send out a digital pulse on multiple lines. I have tried to find examples that reference such an application, but have been unsuccessful. The main trouble I am having is setting-up/configuring the digital output to work for such an application - I keep getting error -200462 when trying to start the DAQmx write, and have been unable to find a reference to what this error means. I have attached a simple version of what I am trying to do: I need to send one of three continous signals independately to different digital outputs: either a pulsing signal or a constant high or constant low.
0 Kudos
Message 1 of 6
(2,925 Views)
NO@UC,

It looks like you have a pretty good start on implementing your application. Here is an explanation of the error you are getting:

Generation cannot be started, because the output buffer is empty. 

Before starting a buffered generation, write data. Unreserving a task empties the buffer. Changing the size of the buffer or setting the Regeneration Mode property will result in the buffer being unreserved and emptied.

This information can be found in LabVIEW by selecting "Help->Explain Error." Basically, you need to perform a DAQmx Write before calling DAQmx Start. This gives the card data to begin generating as soon as the output clock begins. I also noticed that the task you are using is called "AOv-0-1-2," which I assume is an analog output task. You also specify your sample clock as the AO sample clock. With this task setup, you will not be able to call a DAQmx Write on digital channels. For digital I/O, your device requires either an external digital clock, or you can use another periodic signal internal to the 6733. The simplest way to do this would be to use a continuous pulse generation task on one of your counters, and for the task's sample clock, select "/DevX/CtrYInternalOutput/." This will effectively use the counter's signal as your sample clock. A great exaple of this process, available in the LabVIEW example finder (Help->Find Examples), is the "Multi-Function-Synch Dig Read Write With Counter.vi" VI. This example perfoms digital input and output, so you would need to modify it a bit, but it seems to be what you are looking for.

Hope this helps,
Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments
0 Kudos
Message 2 of 6
(2,910 Views)
hello,
I'm trying to generate a jitterless pulse. The required range is 1ms to 60 sec. I have a DAQ6008, using labview. I thought I could use the internal counter, but it seems that the counter state can only be read by software: hence windos-dependent jitter. 

What extra hardware would I need?
TIA
maurice gueron
mg@pmc.polytechnique.fr
0 Kudos
Message 3 of 6
(2,864 Views)

Maurice,

The 6008 can only be used for basic event counting, not pulse generation. For a USB solution to your problem, I would recommend one of our new, portable M Series USB devices. These have the ability to generate hardware-defined pulses of 2^32 counts, based off of the 100kHz, 20MHz, or 80MHz, internal timebases. Please let me know if you have any additional questions.

Hope this helps,

 
Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments
0 Kudos
Message 4 of 6
(2,849 Views)
Thank you Ryan. But the M series is definitely not in the same price range as  the 6008!
maurice gueron
0 Kudos
Message 5 of 6
(2,846 Views)

Maurice,

You may then want to consider some of our Low Cost M Series devices. While they are still more expensive than the 6008, they have much, much greater functionality and are perhaps closer to your price range.

Regards,

 
Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments
0 Kudos
Message 6 of 6
(2,830 Views)