LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error -200609 occurred at DAQmx Write: Selected Buffer Size Too Small

Solved!
Go to solution

I have a USB6001 DAQ. I would like to have two synchronous analog signal from my DAQ (AO0 and AO1).  I was able to form the signal in an array but I have been having issues for taking it out from the DAQ port. 

In this VI (attachment), as a first step I'm trying to get one signal from one of the AO. But I get the error in the title.

Any help is greatly appreciated.

Best

0 Kudos
Message 1 of 11
(4,349 Views)

Hi msoembl,

 

what do you expect when you try to output a waveform using DAQmxWrite set to "1channel 1sample" mode?

 

(Why do you need to create those waveforms in such a Rube-Goldberg way? :D)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 11
(4,337 Views)

Hi GerdW,
I didn't get the Rube joke but that's fine.
This signals will be used for raster scanning. And I want both signal to be a step function. In later stage, I want to syncronise the two signal. That's the way I could think to satisfy the both.
I would appreciate any suggestion to make it more efficient.
I think I misinterpret the "1channel 1sample". Based on your suggestion I tried 

1) Analog 1D DBL (Multiple Sample) and got the following error.

Write cannot be performed, because the number of channels in the data does not match the number of channels in the task.

How can I make sure that data channels and task channels are the same.

Thanks for any suggestion

0 Kudos
Message 3 of 11
(4,270 Views)

Hi msoembl,

if you use multiple channels you should configure the DAQmx VI to multiple channels.

 

Also: A good way to get started is to not start from scratch but use examples. Use the example library located in help-> find examples. In your case you might wanna have a look at Voltage - Continuous Output. There you can see how DAQmx Tasks are properly handled. You would only need to make the adjustment to handle two instead of one channel.

 

Message 4 of 11
(4,263 Views)

@msoembl wrote:

I didn't get the Rube joke but that's fine.


Rube joke 😉 Smiley Wink

0 Kudos
Message 5 of 11
(4,260 Views)

Haha:)

Thx Mathan.

That's probably I'm still learning LV. I appreciate any more efficient way suggestions. 

For the analog output. Based on previous comment I was able to get it run by changing Analog-Single Channel-Multiple Sample-1D DBL. And the Channel to AO0 at the DAQmx Create Channel. I think if I choose AO1, LV assumes there is also AO0 assigned. 

 

Though, when connect the DAQ to my Scope I don't see any output. Any insight on that? could it be something related to Sample Clock?

Many thanks

 

0 Kudos
Message 6 of 11
(4,252 Views)
Solution
Accepted by topic author mso2017

In your attached VI the Channel constant contains a0:1. The "0:1" means you take the channels ranging from 0 to 1 so two channels. If you only want a1 type a1 instead.

Regarding your measurement: Again I recommend to start with an example to check wether your measurement result is not as expected because of the software or your hardware setup.

Message 7 of 11
(4,244 Views)

Thank you very much all for the suggestions. Especially, the suggestion for the examples saved my day.

That of course new questions. Below you will find the modified example. 

VI works exactly as I wanted and I can see the generated signal from my scope and drive the mirrors. I have two questions:

1) To change the frequency of the signal (meaning time spend for every signal step of each function), I use sampling rate on the front panel. It may be a silly way to define the frequency but it works just fine for me. My DAQ 5KS/s capability and I was able to run the signal over my mirrors with 5kHz. But I wonder if it is a proper way to define the signal frequency or any possible disadvantages.

2) Now I would like to use trigger but when I select Digital Start, I don't see any signal output. 

Any suggestions?

Many thanks

0 Kudos
Message 8 of 11
(4,231 Views)

I figured out the Q.2 above. The reason was that I was thinking PFIx as an internal trigger but instead it is a pin that accept a trigger signal. When I connect a square wave to it then it operated as expected. So when the VI sees a a rising edge (I defined it for "Rising") it started generating the signal.

My Q.1 still yet to be figured out, though.

Thanks

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

Yes you can set the sampling rate in the front panel, but changes won't affect the output while the programm is running except if you are going to use loops which include the step of configuring the rate

0 Kudos
Message 10 of 11
(4,177 Views)