03-28-2022 05:43 AM - edited 03-28-2022 06:04 AM
Hello,
Can someone help me solve the problem of data refreshing?
I have to continuously acquire the temperature data till I click the stop button.
But my data is refreshing after every 7.5 seconds(Rate=20hz, No.of samples per channel=150).
How to add or collect the previous data continuously without refreshing for say complete graph for 2 minutes but not only for 7.5 seconds.
Thanks,
Rawoof
03-28-2022 06:27 AM
1. Use a chart instead of a graph for display
2. Write results to a file for future use.
If you open the file before the loop and write to it inside the loop using a file refnum (not a path), you can read something more like 5 samples per loop to keep your UI more responsive to your Stop button clicks.
-Kevin P
03-28-2022 07:23 AM - edited 03-28-2022 07:26 AM
Hello Kevin,
Thanks for the response, but still I'm collecting the data only for 7.5 sec as mentioned,
Also while using the waveform chart I'm not getting X-axis in seconds as in the waveform graph.
If possible can you please share the code?
Is it possible to get the output continously as shown below?
Thanks,
Rawoof
03-28-2022 07:37 AM - edited 03-28-2022 07:54 AM
You are using finite samples and depending on auto start to retrigger the next acquisition.
Better practice would be to use continuous samples, set samples to read at "-1" and throttle the loop with a 200msec wait for next ms multiple. Your users will thank you.
And as Kevin mentioned, enable TDMS LOGGING! with concurrent read to save the data you worked so hard to collect.
Do you know about the shipping examples and how to use the example finder?
03-28-2022 11:26 AM
Getting charts to display "time since start of acquisition" in seconds starting from 0 is a very-commonly-wanted but still-not-natively-supported feature.
Here's one imperfect example.
And here's another.
The imperfections:
1. The first one isn't careful enough about identifying the true acquisition start time. It's likely pretty close though.
2. The second one isn't careful enough about identifying the *actual* sample rate used rather than the one requested. It could be substantially wrong, depending on the specific DAQ device and requested rate.
-Kevin P
03-29-2022 04:47 AM - edited 03-29-2022 04:48 AM
@jay I have implemented as you suggested to use continuous samples, set samples to read at "-1" and throttle the loop with a 200msec wait for the next ms multiple, but it is just refreshing at from 0 to 0.15 and also i can just save only three vales
@kevin,I have also followed the suggestion you made but still, there is not much change, also i have implemented the second example you sent, after everything it is still refreshing the data.(For N samples and Continous samples).
Can someone send me a screenshot of your code if possible to acquire the continuously without refreshing.
Thanks,
Rawoof
03-29-2022 07:45 AM
Looks like you're still using a *graph* when it sounds like you'd want to be using a *chart*. As previously mentioned in my initial response, msg #2 in this thread.
-Kevin P