|
Re: Get/Set Refnum vs Global
Our code the first year of LabVIEW was weird, with shift registers and accidental feedback nodes and wires looping all over the place. The second year, we used global variables. Then we used the RefNum Registry. A few years ago we did a hybrid, using a collection of global constants to programmatically create all the various motors, sensors, pneumatic actuators, etc.
Last year we used a different kind of functional global. We combined all the RefNum values for each subsystem into a bundle in a VI full of cases for Begin, Teleop, 100 ms repeat, etc. That let us select the desired resource from a menu instead of having to spell it exactly each time we wanted to use it. We found that doing a RefNum Set was still necessary in order for Test Mode to work. RefNum Get was not used in our main code.
I'm looking forward to finding out what suggestions were implemented in the framework this year, and what unexpected improvements are waiting for us.
|