Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

synchronization of digital output to analog output

Hello,

 

I´m trying to synchronize a digital output signal (in the end it should be a short TTL pulse) to an analog output. With this I want to tag the beam position change. I the already existing program there are the detector counters already synchronized (counter inputs) and this works, Adding in the same manner the digital output leads to the following error:

 

Error -200462 occurred at DAQmx Start Task.vi:4

 

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. Changing the Sample Mode or configuring retriggering also empty the buffer.

 

I use an PCIe 6343 device with a Windows 7 32-bit computer.

What´s my error?

 

I attached the VI.

 

Thanks a lot!

 

0 Kudos
Message 1 of 6
(4,821 Views)

I can't open your attachment currently (computer trouble on my end), but I would put money on the fact that you need to write to the buffer before you start the task.

If you're just writing static data, move the DAQmx Write function before the DAQmx Start.

If you're going to update what is written, just add an extra DAQmx Write before the Start.

 

I image you have it set to trigger immediatly as well, so if you set a trigger and then write before the trigger signal comes, that would work as well.

 

-Jim

-Jim
CLD
0 Kudos
Message 2 of 6
(4,801 Views)

Thanks for your hints. Beside the fact, that the synchronisation of the TTL pulse has to me made outside the loop (only one line and not 4 counters), I generate now an output buffer and there is no longer an error message, BUT:

 

1. The TTL pulse only occurs once at the start of the acquisition (first pixel) and not with every change of the AO value of the beam position. This I still do not understand. I aim to tag every beam position change in the Scanning Electron Microscope with a short pulse output.

2. If I look at the TTL pulse in the oscilloscope, I have the impression, that "dt" in my "Build waveform.vi" does not determine the pulse length. It´s much wider. How can I handle this? Are these short pulse lengths possible with the PCIe-6343 device?

 

I attach again the revisited sub-vi. Thanks for every help!

0 Kudos
Message 3 of 6
(4,784 Views)

Hello,

I´m back in the office again and still I have no real idea how to handle the two aforementioned problems...

Thanks!

0 Kudos
Message 4 of 6
(4,717 Views)

Hmmm, how does digital output task even work... you do not write data to generate, but start task. Does setting zero length of the buffer help? It does not have data to generate, starts and immediately stops the task. Then DAQmx write has autostart - it starts task one more time and generates data. Mr. Frankenstein?

 

>> pulse width

Digital output is capable up to 1 MHz according to the specs, also its timing is determined by sample clock Rate. Waveform takes only data.

>> single pulse

Digital output task starts once, nobody says it should restart. I am not sure if trigger propery Start -> More -> Retriggerable is supported for this board for digital output tasks.

 

Use counter output instead of digital output: implicit (counter) sample clock, finite generation, 1 sample to generate, set retriggerable start trigger.

It is capable down to 20 ns pulse width (2 ticks with 100 MHz clock).

0 Kudos
Message 5 of 6
(4,495 Views)

Hello and thanks for your answer!

 

Output.BufSize is already set to 0.

If I use the retriggerable option, I get error 201320:

 

Possible reason(s):
Retriggering can only be enabled for finite task with a  Start trigger configured.

 

As you can see in this entry in the Labview submenu, it is retriggered without this option, but only every forth time independent of dwell time on a pixel:

http://forums.ni.com/t5/LabVIEW/synchronization-TTL-pulse-to-analog-output/td-p/3267025

 

I would like to use one of the counters, but they are already occupied...

 

Looking for further help!

Thanks in advance!

0 Kudos
Message 6 of 6
(4,288 Views)