LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding a data acquisition program

Hi,

 

I developed the VI which is attached with this post. The VI is a data acquisition program which acquires the data from a force transducer (Analog input) and a angular encoder (CI angular encoder). The program also generates TTL pulses for a camera system which is synced with the encoder and sends a TTL pulse to control a RC servo motor. The express VI in the program is to acquire a digital signal from another DAQ system. 

 

The program is designed such that when the digital signal is received, all the acquisition starts. But, when I run the program, I receive an error saying "Error 200609: Generation cannot be started, because the selected buffer is too small. Increase the buffer size". When this happens, the program is still running and the force data from the analog inputs are acquired but the encoder data is not acquired. So, I am thinking that it might be a problem with the encoder acquisition. I am using a USB 6341 data acquisition system.

 

I tried playing around with how the samples are to be read but that is not making any difference. I am unable to understand why this is happening. Can someone help me out with this issue on why this error pops up?

 

Thank You

 

Regards,

 

Abbishek

0 Kudos
Message 1 of 3
(904 Views)

Which task throws this error?  Exactly where does the error first occur?

 

The term "Generation" in the error text suggests an output task.  The only output tasks in the code you posted are counter tasks for continuous pulse generation, which don't generally need a buffer.

 

I was unable to duplicate your error with a PCIe-6341 here, but I still have a suspicion of what *might* be going on.  Try adding an explicit call to DAQmx Start for your "upper" counter pulse task before entering the loop.

 

Theory: there may be a combo of a couple subtle things happening without it.  First, your call to DAQmx Write inside the loop has a default True value for its "auto start" input.  So the task will try to follow up the write with an automatic task start.  However, it's *also* the case that the data written to the task using DAQmx Write prior to starting the task will typically establish the b....

 

Now that linked article specifically refers to the multi-sample versions of DAQmx Write, not the single sample version you're using.  But the code you're posting uses LabVIEW 2012, which isn't all that long after the initial introduction of X-series.  It seems plausible you might also be using a much earlier version of DAQmx than I am (18.6 here), and perhaps slightly different behavior on this subtle issue.  It's also possible that your USB device has certain restrictions that are different than a desktop PCIe device like I used.

 

Either way, I've a hunch you might avoid the error with an explicit Start before the loop.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 2 of 3
(851 Views)

Oops, looks like I accidentally truncated the end of the paragraph with the link.   For clarity, the text should end with "...will typically establish the buffer's size.  Here you wrote only 1 sample and 1 is an illegal buffer size."

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 3 of 3
(842 Views)