02-04-2016 03:53 AM
I've following use case (project files are attached - version 2013).
Now I would like to know:
a. Is there a way I can use DVR to optimize the performance (individually or both - speed and memory).
b. What if 'Continuous DAQ' has a modification; instead of reading '100' samples, '-1' (all available samples) is wired to 'DAQmx Read'? (the change I want to highlight is, 2D array size will vary with every iteration).
c. Was looking for any online resource to understand more about DVRs with some good use cases example.
Thank you everyone.
02-04-2016 06:02 AM
To keep the exact functionality you have here and increase performance, you actually want to use a Global Variable. GVs are a lot more efficient than FGV. Shamelss plug: A Look At Race Conditions
But the real question here is "What are you doing with the data?" I see nowhere that the data is being read. Do you need to process every sample? Or do you only care about the latest values?
A DVR, GV, and FGV are all lossy: you can miss writes. They only return the latest value. This is a form of a race condition.
Personally, I would use a Queue or User Event to send the data to whoever needs it. This way all of the data is processed, it is done quickly, and efficiently.