I am using Raspberry Pi to acquire data from USB 1808 device. I am using 3 AI channels. I want to get data continuously and save it in background. But i am not able to manupulate buffer so that I may not loose data or take same data twice.I want to do this in Background so that I can do data Analysis in realtime. I am using python along with UL Linux. Any Support will be appericiated. I Need to do this as part of my Thesis work. waiting for support
- Job Title: Student
- Industry: R&D
- Application: integration of sensors with system
56 months ago
Zaki
Germany
Answers
Please see the knowledgebase Python example demonstrating streaming continuous data and writing it to file with no missing samples and no duplicate samples.
Search knowledgebase article ID: 50760
55 months ago
Was this answer helpful?
Yes (4) /
No
(0)
The a_in_scan.py example demonstrates 4 channels sampled into a circular buffer that holds 10 seconds of data. This circular buffer will "roll over" (begin to be overwritten) every 10 seconds. The UL for Linux will fill this buffer forever, and if it (or the DAQ hardware) falls behind, it will throw an error. The example program demonstrates checking the status about every 100 mS, though each time copying out just the 4 newest samples (one per channel). Your responsibility is to copy the data out of the buffer before it gets overwritten. Our driver cannot detect if you have copied the data out, or not, or twice. A good strategy is to copy out a fixed percentage of the buffer (say exactly half). Once you are done with your data analysis on that half, immediately check the status of the scan to see if the index has advanced by more than the amount you copy each time. If it did, then you have fallen too far behind.
56 months ago
Measurement Computing
Was this answer helpful?
Yes (6) /
No
(0)