LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I reinitialize DAQ Assistant using a State Machine?

My State Machine is driven by a menu of buttons. One of the buttons goes directly to the Data Acquisition part of the program. From this point, a DAQ Assistant is used to control 3 Analog channels and a DAQ Assistant is used to control 1 24-bit digital counter. Now, clicking on the Data Acquistion button the first time properly runs the VI. However, if I then go to another section in the State Machine and then go back to the Data Acquisition part, I get the following error:

Error - 200279 occured at DAQmx Read (Analog 1D Wfm NChan Nsamp).vi

Possible reason(s):

Attempted to read samples that are no longer available. The requested sample was previously available, but has since been overwritten.

Increas
ing the buffer size or reading the data more frequently may correct the problem.

Property: RelativeTo
Corresponding Value: Current Read Position

Property: Offset
Corresponding Value: 0


Task Name: _unnamedTask<19>

I'm not sure why this happens....

Any help would be greatly appreciated!

Thanks,
Andrew
0 Kudos
Message 1 of 3
(2,566 Views)
First of all, you might want to also post this question to the Data Acquisition forums. They will probably have more experience with this kind of stuff. However, I can hopefully add my two cents 🙂 Try writing a VI which calls your DAQ Assistant VI twice in a row. If you get the error here, then we know that some resources are not being closed. You could try generating the code for this and then making that that code is clearing everything out. To do this, right click the DAQ Assistant Express VI and select "Conver to Task Name Constant." Then, when this is finished, right-click the Constant and select "Generate Code>>Example." This will show you the code behind everything and you can modify it if you need to. Hope this gets you headed in the right direction.
J.R. Allen
0 Kudos
Message 2 of 3
(2,566 Views)
Based on your description, I'm not sure what the problem is. I'll take a guess, however, that you may have configured the DAQ Assistant Express Block to acquire samples continuously. Is this the case? If so, there are a handful of potential solutions:

1. If appropriate for your application, only acquire a fixed number of samples.

2. If this is not appropriate, continue to invoke the DAQ Assistant Express Block in order to continue to read the samples that have been acquired. If you fall behind, samples will be overwritten and the above error will be generated.

3. If you intend to start a new continuous measurement the second time you invoke the DAQ Assistant Express Block, you need to stop the previous continuous measurement that is still running. To do
this, wire a Boolean true to the Stop input of the DAQ Assistant Express Block.
--
Geoff Schmit
Huskie Robotics, FIRST Team 3061 Lead Mentor
http://team3061.org/
@team3061
0 Kudos
Message 3 of 3
(2,566 Views)