05-31-2018 11:26 PM
Hi LabVIEW Programmers,
I have been dealing with issues trying to log (backup) data on USB3.0 hanging off of cRIO 9045. I have been pulling my hair out for the last few weeks trying to resolve this issue. Here is a description of the problems.
Objective:
Problem:
Writing the 200 channels of data continuously at 100Hz to the USB on the Crio, I encountered a loss of data in random location. My guess is that writing every data point continuously like this is too much on resource-strapped RT environment. So I decided to buffer the data into a queue and dump it every so often (i.e. write less often). I use a simple state machine type structure for this (see attached code). I am still losing 4 or 5 data points in between file creation. I must be missing something!
I am attaching my latest attempt. So my questions are:
Any input is appreciated. Many thanks in advance!
PS: I am using LabVIEW 2017 (32-bit).
06-01-2018 05:21 PM - edited 06-01-2018 05:23 PM
If I understood this logic correctly (it's a bit late and I'm not thinking straight):
After opening the new file you're waiting until the queue is full - so the Enqueue Element in the top loop will block until your state machine rolls into Write TDMS state. It's not a problem, but your code doesn't show where the Data comes from, other than the #Note which doesn't explain the transfer mechanism form "another loop". And depending on this mechanism, you migh be loosing data somewhere upstream due to the Enqueue Element block.
Also this one:
It's probably not the case, but what if a new element is enqueued between Get Queue Status and Flush Queue? Why not using "remaining elements" output of Flush Queue?
06-11-2018 08:41 AM
Hi PiDi,
Thanks for the quick response. I have been out of the office so sorry for the delayed response on my end. I will look at your comments this week and get back to you.
Thanks again.
Renato