07-21-2006 04:53 PM
07-24-2006
01:49 PM
- last edited on
12-02-2025
12:10 PM
by
Content Cleaner
Hello,
Thank you for posting this well written description and great small example which reproduces the problem! This seems to be only occurring with the write data like you mention. I’m not exactly sure the cause, but I filed a bug-report on it (3ZNC2Q3A), so we can investigate here. I’m betting it has something to do with user interface interactions between the controls and the write measurement file VI, as components from each could run in the UI thread and block each other. Unfortunately, I don’t see any immediate workaround without having to change a few things up with your program structure. For example, instead of a ring, you could just have one or two checkboxes for the options and see which the user has pressed. Because the write file VI is the only one that is blocked, you could conceivably separate your data acquisition thread and your file IO thread (many times it’s a good idea anyway). Using the Queue datatype, you could add all the data to the queue in the non-writing loop, and write to file in the separate file IO loop. If the write to file blocks the data will continue to queue and no data will be lost. This is known as a producer/consumer VI design pattern. Your consumer would be the file IO portion of your code. Check out the tutorial of this structure here.
Are these alternatives acceptable? Unfortunately, with the way the write VI interacts with the user interface thread I don’t see any way to avoid this problem. I apologize for any problems that have occurred as a result of this behavior.
07-24-2006 03:13 PM