LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Digital Output Timing

Solved!
Go to solution

I keep running myself around in circles. I need to figure this out because it seems so simple.

 

I have a digital waveform with an arbitrary clock rate. I want to send this waveform out of a USB-6259 device. I was able to do this with an analog signal, but the digital signal is giving me some problems.

 

For instance, If I want to send out a 7500Hz digital waveform, I need to have the hardware do this, since the On-Demand timing only seems to get me up to about 1kHz. But when I try to set up the timing, it never seems to work. I'll get errors like this...

 

"External sample clock source must be specified for this application."

 

How do I set things up so this thing can clock the stuff out at a particular rate. The analog side of the device does not seem to have a problem doing this, I don't understand why the digital side needs an external clock.

 

Attached is a modified version of one of the examples. 

 

 

 

 

--

Brian Rose
0 Kudos
Message 1 of 10
(9,631 Views)

Hi,

Looks like you're just trying to write to the ports. I think you should be using the hardware timer in your device. Look in the examples, under 'Hardware Input and Output, DAQmx, Generating Digital Pulses'

There's a few there that should work with your device. Just check what pin the timer output comes out on.

Richard

0 Kudos
Message 2 of 10
(9,614 Views)

The "Generating digital pulses" vi's all manipulate a counter to produce a waveform. They do not have a Digital Waveform as an input. I'd like to be able to write an arbitrary digital waveform out the device, but I can't figure out how to make it happy. I would think that there would be some VI somewhere that takes in a digital waveform and a DAQmx channel and sends the waveform to the channel for playback at the rate specified in the waveform.

 

I try to execute  "Write Dig Chan-Int Clk-Dig Start.vi" But I cannot figure out which magical combination of parameters actually makes it play on my USB-6259. This would be a good starting point, if I could get it to work.

 

Strangely enough, I can convert my digital waveform to an analog waveform and send it out one of the AO ports, but that seems silly to me.

--

Brian Rose
0 Kudos
Message 3 of 10
(9,601 Views)

Mister Rose wrote:

The "Generating digital pulses" vi's all manipulate a counter to produce a waveform. They do not have a Digital Waveform as an input. I'd like to be able to write an arbitrary digital waveform out the device, but I can't figure out how to make it happy. I would think that there would be some VI somewhere that takes in a digital waveform and a DAQmx channel and sends the waveform to the channel for playback at the rate specified in the waveform.

 

I try to execute  "Write Dig Chan-Int Clk-Dig Start.vi" But I cannot figure out which magical combination of parameters actually makes it play on my USB-6259. This would be a good starting point, if I could get it to work.

 

Strangely enough, I can convert my digital waveform to an analog waveform and send it out one of the AO ports, but that seems silly to me.


 

Why does it seem silly to convert your digital waveform to an analog waveform?  DAQmx fucntions are primarily for use with analog signals. So conversion to analog doesn't seem silly to me.

 

What kind of problems are you having to execute theWrite Dig... vi you are mentioning?  Do you get errors?  Does your 6259 output anything at all?  Post your code so we can look at it.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 4 of 10
(9,588 Views)

 

I think I have solved it!

 

I have to use the  "Correlated Dig Write With Counter.vi". As I was researching everything, I found out that the DIO on the USB-6259 cannot use the sample clock directly. It must be tied to a counter. So to send a digital signal, you need to configure a digital counter as a clock source for the digital output pin. This example seems to be working.

 

--

Brian Rose
Message 5 of 10
(9,577 Views)

Attached is my "fixed" "Correlated Dig Write With Counter.vi".

 

Fixes are 

 

1) Runs finite samples, which runs the waveform once.

 

2) To make this work, you need to connect the number of samples on the counter timing vi. Otherwise the counter stops after 1000 samples and if you have more, they will never be sent and you program will sit in the loop forever waiting for the Digital Output task to finish (which it never will since it's clock has stopped!).

 

 I should be able to replace the "CreateDigitalWaveform.vi" with my own stuff to get what I am looking for.

 

 

--

Brian Rose
0 Kudos
Message 6 of 10
(9,567 Views)
Solution
Accepted by topic author Mister_Rose
0 Kudos
Message 7 of 10
(9,566 Views)

Hi Brian,

 

You're absolutely correct that M Series devices only support HW-timed digital operations through the use of an external sample clock (external meaning a clock from outside of the digital task itself).  There are actually a number of clock sources other than counter outputs that may be used for digital lines.  From the 625x Specifications:

 

 

Untitled.png

For "many other signals" I would refer to the device routes tab in MAX to get the full list. 

 

 

622x, 625x, and 628x M Series Devices all have "correlated digital I/O" on port 0, meaning they must use an external sample clock.  The 621x and 623x devices can only perform software-timed digital tasks.

 

X Series DAQ Devices (63xx) have a dedicated sample clock for both DI and for DO tasks so using an external clock is not necessary on these boards.  E Series DAQ Devices only support static digital tasks.

 

 

Best Regards,

John Passiak
Message 8 of 10
(9,540 Views)

Are there any examples of how to do this using the .net assemblies ?

 

I understand the concept of having to generate a new task, set its timing parameters, and then use that timing to drive the DigOut task , but cannot for all the money in the world, find an example of how to do this in c# ?

 

Thanks

Tom

 

 

0 Kudos
Message 9 of 10
(7,038 Views)

This could be of help possibly...

 

https://decibel.ni.com/content/docs/DOC-15500

 

 

------------------------------------------------------------------------------------------

Jon F.
Technical Support Engineer
National Instruments
0 Kudos
Message 10 of 10
(6,987 Views)