Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Analog output timeout on PXI6221 by writing one single sample per channel

Hi,

I am having trouble to get an anaolg output to run properly. Attached is a stripped down version of my vi. Basically i want to swap a mirror about two axis, using constant AO voltages. hence no waveform can be used.

I also need to check the voltages on both channels with an AI task. This runs nicely when I remove the wait until done vi on the AO task. But if I use this vi, then I get a timeout. All I need it a write one sample per channel, so this should be written very quickly. not sure why this task is not done and it time outs. Interestingly when I remove this wait until done vi everything runs fine. Can anyone please point me to my mistake in the vi? The reason why I care (even so it is running without the "wait until done" vi) is that this is only a stripped down version and later on, the same error occurs. The second attached vi is the subvi needed to run the first.

 

I also have a much more complicated version of this vi where another state is added after the initialization. Now the analog output needs to be written after a trigger (PFI0) is received. As the PXI6221 is not capable of retiggering, I am using the workaround of triggering an internal counter (retriggerable), which produces one pulse which is now the source for the sample clock of the analog out. However I am still getting now the errors on the wait until done. and if I don't use the wait until done, I notice that the  AO is not waiting for the trigger.

 

In the end the question is, how do I write a single voltage to the AO and this voltage should stay constant until the next trigger command (external trigger with about 50Hz repetition rate). In the mean time I also need to read on the two AI channels some stuff.

 

Hm it does not seem to be that complicated but for some reason I don't succeed .

Thanks for the help

Thomas

Download All
0 Kudos
Message 1 of 3
(2,915 Views)

Thomas,

   Could you strip this VI down even more so that the community can more readily assist you? 

 

How many samples are getting successfully written when it times out? I noticed not a lot of infromation is in that array to get written in at first.

 

SS-2011-02-17_11.36.31.png

Ben J.
National Instruments
Applications Engineer
0 Kudos
Message 2 of 3
(2,886 Views)

Hi Ben,

thanks for answering. I wired your suggestion a few days ago already and the one requested sample is actually written, but the task is still not done (apparently at least due to the error message).

I just solved the problem. The reason why it did not run was that apparently, it is not possible for the PXI 6221 card to write only 1 sample. I changed the data to be written to a 2D array (1 row for each channel and 2 coloumns for the 2 samples per channel), and then it worked.

Interestingly, I also had to add the write property node to write the samples with a 0 offset with respect to the first sample, otherwise I would have gotten eventualy buffer errors, dependent on the number of samples I specified in the sample clock.

 

For the full vi (with the retriggerable AO), the suggested solution in the retriggerable.vi  as suggested here: http://zone.ni.com/devzone/cda/epd/p/id/4787 did not work as writing a contuinuous sample with buffer 2 samples per channel, would also result in a timeout error. So for nwo I start and stop within the loop the AO task and this seems to work fine, at least in the current test case with 1Hz. Onece I am at the remote machine, I will set the frequency to the required 50Hz and hope that start/stop the task is still abel to keep up with the application. Would it be possibel to get some insight why the retriggerable vi does not work with the sample clock for the AO task set to continuous samples?

Here is the full vi for completeness reasons.

 

Thanks again

Thomas

0 Kudos
Message 3 of 3
(2,883 Views)