Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronized Digital output (internal clock) NI-6259

Hey there,

I am trying to output a number of digital signals using the NI-6259. I don't have an external clock to use so the only one I was able to use without error is the 100KHz timebase one. How do you guarantee that all the digital signals are synched? One of the digital signals is my clock signal. I would like to see all of the signals on my digital scope but for some reason, when i probe one digital signal (clock) it is not consistent, instead of being an array of 0 and 1s, I end up getting an extra signal overlapping the clock signal so you see it like flashing on the scope. Therefore, I tried to read in the digital signal by manualy wiring the digital output to an input digital signal but I don't think it is right because I only get one bit read.

My question is:

1 - Whats the right mechanism of outputting synched digital outputs using the NI-6259 with no external clock
2 - How do you read multiple digital signals without ext clock?
3 - Is there an internal clock to use for outputting digital signals? is the frequency constant or can be changed?

I attached a file I used to generate a clock signal and also read it from a digital line.
0 Kudos
Message 1 of 11
(6,176 Views)

Hello. 

Thank you for posting to the NI Discussion Forums. 

What method are you using to output the digital signals?  Are you using waveform generation so the outputs can be hardware timed?  If so, I invite you to check out the M Series User Manual located at:

M Series User Manual
http://www.ni.com/pdf/manuals/371022g.pdf

I found pages starting at 6-5 very helpful.  A few passages that may be helpful are:

"You can generate digital waveforms on the Port 0 DIO lines. The DO waveform generation FIFO stores the digital samples. M Series devices have a DMA controller dedicated to moving data from the system memory to the DO waveform generation FIFO. The DAQ device moves samples from the FIFO to the DIO terminals on each rising or falling edge of a clock signal, do/SampleClock. You can configure each DIO signal to be an input, a static output, or a digital waveform generation output."  So, all digital signals will be moved to all lines of Port 0 at the same time if you provide all lines data.  This also points out that do/SampleClock is the clock that controls this output.

In regards to question 3, "Use the DO Sample Clock (do/SampleClock) signal to update the DO terminals with the next sample from the DO waveform generation FIFO.  M Series devices do not have the ability to divide down a timebase to produce an internal DO Sample Clock for digital waveform generation.  Therefore, you must route an external signal or one of many internal signals from another subsystem to be the DO Sample Clock."

Finally, refer to page 6-4 for an answer to question #2. 

If you wish to know how to program this in LabVIEW, I would invite you to look at our Example Finder.  This can be accessed by clicking on Help>>Find Examples when on the Front Panel or Block Diagram.  Here you will see a directory structure of examples.  Please click on Hardware Input and Output>>DAQmx>>Digital Measurements or Digital Generation.  There are a lot of great examples here that will help get you started. 

Let me know if there is anything else we can do for you.  Have a great day!

Brian F
Applications Engineer
National Instruments

Message Edited by Brian F. on 05-09-2007 08:51 AM

0 Kudos
Message 2 of 11
(6,162 Views)
Brian,

Thanks for your reply. I read through the manual and I understand that you can use ao/sampleclock or do/sampleclock to trigger output digital signals on port0 but how do you configure such channels(ao/sampleclock and do/sampleclock)?
I opened the example called write dig channel-int clk-dig start and tried to change the trigger source to either ao/clock or do/sampleclock but I get this error when i run it:

error -200452 occurred at property node DAQmx Trigger (arg 1) in DAQmx Start trigger (digital Edge).....

Reason: Specified property is not supported by the device or is not applicable to task.

I attached the file
0 Kudos
Message 3 of 11
(6,153 Views)
Hello. 
 
The reason that the error is occuring is that using the do/sampleclock as a trigger is not supported with M Series cards.  Furthermore, this is unnecessary because this is the clock that controls when DO is performed whether or not a trigger is configured.  So, in other words, if we have no triggering in our program, and output a digital signal, by default, we will use the do/sampleclock.  By selecting the same signal as your sample clock source, you are in fact routing that signal to itself and this is not allowed. 
 
So, in order to sync digital outputs, you must use an external clock.  There is no way to output sync'ed digital outputs without one. 
 
Brian F
Applications Engineer
National Instruments

Message Edited by Brian F. on 05-10-2007 03:04 PM

0 Kudos
Message 4 of 11
(6,142 Views)
Hey Brian,

Just to confirm with you this: to generate multiple digital signals in synch using the NI-6259 series needs an external clock, there is no way a daq internal clock can do the job?
Is there any other daq cards that support this internal clocking thing?  Is that what PXI cards can do?

Thanks
0 Kudos
Message 5 of 11
(6,138 Views)
Hello. 

You are correct in your last statement: you must use an external clock.  As far as DAQ cards that would support the internal clocking, the 653x series of cards can do this.  These include the PCI-6533, PXI-6533, PXI-6534, PCI-6534, PCIe-6536, PCIe-6537.
 
Brian F
Applications Engineer
National Instruments
0 Kudos
Message 6 of 11
(6,125 Views)

Although this topic is long time ago, I hope it is still active.

 

My question is: can I create 2 digital outputs (port0/line0, and port0/line1:5), write 2 different waveform patterns(line0 is configured by sampling clock AO, line1:5 is configured by sampling clock AI)?

 

If yes, how could I do it? (I got the error message -50103 with the writing of second digital output).

 

Thanks a lot.

0 Kudos
Message 7 of 11
(4,601 Views)

Hey,

 

What device are you using?  With most of our devices, you will not be able to use two different timing engines (AI and AO) with your two digital tasks.  I am guessing that is the reason you received this error message.  Why do you need to use both the AO and AI timing engines?

Regards,

Sara Lewandroski
Applications Engineer | National Instruments
0 Kudos
Message 8 of 11
(4,556 Views)

I use usb-6259.

 

I want to continuously acquire signals from AI, which is connected to a multiplexer. Therefore, I used 5 digital outputs to control this multiplexer and synchronized them to the AI sampling clock.

 

In the mean time, I want to send some waveform from AO, which should be started at certain delay with AI and can be repeated after certain time. The AO is connected to a switch, which will be closed and opened following certain shape of AO. For example: it will be closed for 400 us and opened for 10s if the waveform signal from AO last for 400 us and is repeated after 10s.

 

If it is not possible to configure two digital output timings, can I use counter to generate this slow signal?

 

Thank you.

0 Kudos
Message 9 of 11
(4,547 Views)

Hey,

 

With your device, you will not be able to use the AO sample clock and the AI sample clock with some of the digital lines used by the same port.  You would have to use the same sample clock source for both tasks.

 

You can use a counter to generate the signal, and depending on the turn-on voltage that your switch requires, it may be the preferred method for your application.  You can use a Counter Output Pulse Time task to specify the high and low times of your signal.  If you are using LabVIEW, check out the Gen Dig Pulse Train VIs located in the NI Example Finder (Hardware Input and Output»DAQmx»Generating Digital Pulses).  This will give you an idea of how to set up your counters to generate digital pulses.

Regards,

Sara Lewandroski
Applications Engineer | National Instruments
0 Kudos
Message 10 of 11
(4,526 Views)