Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing number of samples written to analog output - USB-6218

I need to create a vi in which on each iteration of a loop a signal of N samples length is sent out to the analog output channel of a USB-6218 DAQ. The non-trivial part (for my ability level anayway) is that the length of the signal needs to change on each loop iteration (N will change). When using DAQ assitant (which is what I have always used up to now) this does not seem possible - the number of samples written to analog output channel seems to be dictated solely by the first iteration of the loop. Therefore I am trying (unsuccesfully) to use DAQmx functions for the first time.

 

To get started with this, I have adapted a vi from this example:

http://digital.ni.com/public.nsf/websearch/3B257B060840D86C8625750D0066F061?opendocument&Submitted&&...

 

The example deals with modifying capture rate for analog waveform input on each loop. I have adapted it to modify length of analog waveform output on each loop. My VI runs fine when I use it with a simulated USB-6218, but when I connect a physical USB-6218, I get errors and the waveform does not get written to the analog output channels. I have attached 2 versions of the VI. The only salient difference is that one has a 'configure buffer input' function because I got an error (-201025) when running the other one that alluded to setting buffer size to greater than 0 as a possible solution. However, the one with the buffer function also gives an error (-200452) indicating that buffer functions are not supported or relevant.

 

I have 2 questions:

 

1. Why does the simulated device (USB-6218) apparently not incorporate the limitations of the physical device (i.e., why does it run without giving an error)?

 

2. What modification is needed to my vi for it to work with a physical device?

 

Thanks

0 Kudos
Message 1 of 1
(3,292 Views)