Sooo after a computer freeze I will try to make this post again...
I am working on refactoring some inherited software and have a question I have been mulling but haven't reached a good conclusion. I am currently not sure if I am able to post the VI or not, regarding NDA and whatnot.
The main points are a producer/consumer with an event structure in the producer. The consumer is a state machine with basically 2 states-- idle and measure/analyze/save. Previously, there was a master cluster bundled at the start of the measurement state using a mix of local variables and control terminals. I was able entirely eliminate this by moving instrument settings into action engines which get their settings updated in the event loop when they change.
However, when saving the data, we need to build a header for the files and for this, I need front panel values. Currently I am wiring a few local variables directly into the subvi which handles saving. This works, but it seems out of place in the model and I am wondering if there is a better way to handle it.
I have considered a few solutions
1) Go back to having a master cluster in the consumer which goes through a shift register and is update as needed. This results in a lot of P/C overhead though.
2) Keep the pertinent FP values in a FGV or even normal global which I can call directly inside the saving subvi. This is better than #1 imo, but really goes against data flow.
3) From within the saving subvi, extract the values from the device action engines
4) Use a User Event to pass the data into the Event Loop and handle saving there. The downside here is creating a copy of the data which seems really over the top for this
5) Just live with the local variable calls as they are.
I hope I made the situation clear enough without a diagram. I know there typically isn't a 100% correct solution for every design problem, but I'm hoping some of you more experienced LV programmers out there might have some ideas.
Thanks for all the time you regular posters put in to help us amateurs!