Discussion:
Problem with stop-input on output-DAQ
(too old to reply)
ssboisen
2007-02-20 10:40:11 UTC
Permalink
Hello,
 
I have a VI where I'm using two DAQ, one for input and one for output. Following some calculations (detecting a trigger) on the input I need to stop the output VI without stopping the loop they are both in.
 
I tried using the stop (T) input but with no luck, when I link the result of the trigger to the stop(T) input I get an error after running the VI for a few seconds.
 

Error -200279 occurred at DAQmx Read (Analog 1D Wfm NChan NSamp).vi:2
Possible reason(s):
Attempted to read samples that are no longer available. The requested sample was previously available, but has since been overwritten.
Increasing the buffer size, reading the data more frequently, or specifying a fixed number of samples to read instead of reading all available samples might correct the problem.
Property: RelativeToCorresponding Value: Current Read Position
Property: OffsetCorresponding Value:
Task Name: _unnamedTask<14>
 
If I link the result of the trigger to the stop-loop (Loop Condition) input it stops when the trigger is found, but I would rather have it just stop the output DAQ and not the main loop.


Gemme5_test.vi:
http://forums.ni.com/attachments/ni/170/230960/1/Gemme5_test.vi
Morini
2007-02-21 08:40:09 UTC
Permalink
Hi,
 
I can see from your attached VI, that you are doing "N-samples" Task Timing at the output. That means the output stops when "N-samples" are reached, and restarts again at the next While Loop iteration. The default is Ture on this input with non continues operations.
You can't use the Stop(T) input on the DAQ assistant 2 in such way, the DAQ Assistant 2 stops while the rest of your code is stille running. In DAQ assistant help-->
Stop input: ".....For continuous tasks, this input is FALSE by default, meaning the task continues to run until the application stops. To stop the task so you can use the device again in the same application, wire this input to the same stop control you wire to the conditional terminal of the while loop. For single-point and finite tasks, this input is TRUE by default, meaning the task stops after all samples are acquired. To optimize single-point performance when using this Express VI in a loop, wire this input to the same stop control you wire to the conditional terminal of the while loop."
 
If you want to only stop the output, you may consider a case structure, where you place DAQ assistant 2 in on case, and somthing else in another case....
 
I hope it all makes sense..
 
Best Regrads
ssboisen
2007-02-21 10:40:09 UTC
Permalink
Hello, thank you for your answer.
 
I tried changing the DAQ2 Assistant to run continious, first it worked I thought, but now i'm getting this error:
 

Error -200547 occurred at DAQmx Write (Analog 1D Wfm NChan NSamp).vi:9
 
Possible reason(s):
DAQmx Write failed, because a previous DAQmx Write automatically configured the output buffer size. The buffer size is equal to the original number of samples written per channel, so no more data can be written prior to starting the task.
Start the generation before the second DAQmx Write, or set Auto Start to true in all occurences of DAQmx Write. To incrementally write into the buffer prior to starting the task, call DAQmx Configure Output Buffer before the first DAQmx Write.
Task Name: _unnamedTask<21>
This happens when the trigger is found and the stop (T) input signal is activated.
 
I tried using a case structure but without any luck, using that the output seems to never stop (testing with a Oscilloscope)
 
Thank you in advance
 
Best Regards
 
Simon, Denmark
 


Gemme5_test.vi:
http://forums.ni.com/attachments/ni/170/231190/1/Gemme5_test.vi
Morini
2007-02-21 12:40:23 UTC
Permalink
Hi,
 
I think the solution to your problem is to add a second While Loop structure to your code. Then move the DAQ assistant 2 into the new loop. Create a local variable from "Hydrofon tærskel detekteret?" indicator and use that to stop the second While Loop.
 
See attached .jpg file.
 
Regards!


ScreenDump.JPG:
Loading Image...

Loading...