Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Error -200288 occurs while writing to AO channel

Solved!
Go to solution

I have a usecase where the user can stop the task at any point and write different samples and start again. But I face the below error while trying the same.


Error -200288 occurred at DAQmx Write Error.vi

Possible reason(s):

Attempted to write a sample beyond the final sample generated. The generation has stopped, therefore the sample specified by the combination of position and offset will never be available.
Specify a position and offset which selects a sample up to, but not beyond, the final sample generated. The final sample generated can be determined by querying the total samples generated after a generation has stopped.

Attempted to Write Sample: 0
Property: RelativeTo
Corresponding Value: Current Write Position
Property: Offset
Corresponding Value: 0

Task Name: _unnamedTask<18>


BhaghyarajSol_0-1681997465475.png

 

 

I have noticed that, if I unreserve the task before writing the new samples, the task runs without any issues. Is this the right fix or can this be improved.

0 Kudos
Message 1 of 3
(792 Views)
Solution
Accepted by topic author BhaghyarajSol

1. Your code ran just fine for me using a simulated device (PCIe-6341) and DAQmx 20.1

 

2. Stopping the task should have been sufficient without needing an explicit unreserve.  That leads me to 2 speculative thoughts:

  • are you using a USB or network-attached device?  I'm wondering if the little extra latency involved might be getting in the way
  • what if you replace the unreserve with a simple "stall data flow" delay?  Make a front panel control for your delay time so you can easily experiment with different delays.  Try starting with ~200 msec and if that works, keep cutting it in half until you get the error. 

    I'm wondering if for your combo of device / driver version, you need to allow just a little extra time for DAQmx to fully manage the Stop even though the function call has returned outputs back to you already.  I know something like this has come up as an issue when trying to reuse a channel immediately after Clearing a task that used it.

 

3. Having said all that, an explicit "unreserve" should also be a viable workaround.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy coming to an end (finally!). Permanent license pricing remains WIP. Tread carefully.
Message 2 of 3
(773 Views)

Thanks for the inputs, Kevin.

 

I tried to simulate the same device (PCIe-6341) and tried my code, still it showed me the same error. Even with stall data flow (tried with 10s max) , still no luck.

One difference I see in my setup is that I have DAQmx 20.7.

 

Anyway, for now I'm retaining my workaround.

 

- Raj

0 Kudos
Message 3 of 3
(717 Views)