View Single Post
  #3   Spotlight this post!  
Unread 30-09-2015, 11:34
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
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.
Reply With Quote