From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

stop daq automatically

Solved!
Go to solution

I want to stop DAQ assistant automatically after a period of time, so I created this VI.

When I start the program, it run and after reaching the specific time value 50, the graph indicator 'looks'' stop, but after wait for 9999 second, the graph indicator suddenly show lots of data which seems to be taken during the 9999 secs, What happen? after that, it gives error, saying

 

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: RelativeTo
Corresponding Value: Current Read Position
Property: Offset
Corresponding Value: 0

Task Name: _unnamedTask<100>

 

 

The DAQ cannot be stopped that way?  😞

 

thanks

0 Kudos
Message 1 of 11
(3,151 Views)

You need to stop the task after reading it 50 times. Also, some advice, you can just use a for loop instead of of using a while loop and checking the iteration.  It is alot of un-neccessary code.

 

Acquire.png

0 Kudos
Message 2 of 11
(3,144 Views)

Change the Acquisition Mode to "N Samples".  Set N to however many total samples you want.  Remove the FOR loop.


EDIT:  Sorry, your original code has a WHILE loop.  That isn't needed when you set the acquisition mode to N Samples.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 11
(3,128 Views)

thanks, I removed the for loop, and now there is another error. it says:

 

Possible reason(s):

LabVIEW:  End of file encountered.
=========================
NI-488:  Invalid argument or arguments to function call.

 

I step in one by one to see what happen, but cannot find it 😞

 

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

That is most likely from the Read Measurement File.  But I don't see a need for that node since you already have the full data when you write.  And what is the point of the scaler indicator?  It will only show the first data point.  Remove the read and the scaler indicator.  They are just making your life more difficult.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 11
(3,114 Views)

ok, let me try

0 Kudos
Message 6 of 11
(3,112 Views)

I am sorry, I forgot to put a data analyzer between the scalar indicator and the read from measurement file.... I just want to take some measurement and do statistic analysis such as mean, mode, stdev etc.

 

Is my way correct? I still got the same error

 

In the picture, what's the difference between choosing/not choosing that box? How does the statistic analyzer calculate mean if I dont check that box?

Download All
0 Kudos
Message 7 of 11
(3,107 Views)
Solution
Accepted by topic author ivy037

Not quite.  Like this.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 11
(3,103 Views)

you are so great, problem solved actually 🙂 finally...

and since i connect to my daq device which is 6009, the graph indicator only shows one 'dot' no matter how many daq and wait case has been done, it just stay there. Can I ask the graph indicator to move along. thanks

0 Kudos
Message 9 of 11
(3,098 Views)

I think I know to do, just change the waveform chart to waveform graph is it right ?

0 Kudos
Message 10 of 11
(3,091 Views)