@paul_cardinale wrote:
Why not just read the devices as you need the data?
I need to poll an Emergency Button all the time. The project is to test a product using some procedures. If the Emergency is pressed at anytime, all the Digital Output should reset to its safe state.
So since I need to read the input in parallel all the time, I thought why not just put the data inside an FGV instead to make it easier to trace (the acquisition only happen in 1 loop). And I just realize, that could result in not-real-time data (though in this project, the other input aren't that crucial). Should I change it to read the device instead of FGV?
And for the original subject, the purpose is trying to make an NI-Device class that can easily be used in N+1 condition. If I want to use Digital Input from NI-6151 and NI-9181, then I just need to drop the NI-DI class twice with a few configuration, then I can use the data anywhere in the program (including in different loops). Should I use the DVR-styled FGV for this? Because otherwise, I don't think I can't use the same instance in other loops.
I've used LabVIEW for some years now, but I just started learning the OOP (mostly from online source and the free NI training material since covid-19), so it's a little bit hard to change the mindset.
@crossrulz wrote:
Seems like you should just be using a simple Producer/Consumer.
Normally I use Producer/Consumer with QMH. But I must admit I tend to do some "duct tape" programming after the customer ask for quick and urgent improvement (and sometimes without proper documentation). I'm trying to repair that style, and people seems like OOP is recommended for more maintainable source code.