View Single Post
  #7   Spotlight this post!  
Unread 26-09-2011, 22:12
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Parameters file for quick code updates

Begin is called once each time your app starts up. If you want to put the code in Begin, you only need to reboot the cRIO, not repower the robot.

If you wish to redo the globals more often, I'd recommend putting it in a subVI. Then you can call the subVI whenever you like, such as in disable.

If you want to simplify the code needed to update the globals, you may want to consider grouping globals together into larger groups, then look to using XML or another format to encode the values. Then you can use the Unflatten from XML to set all of the global cluster elements at once. The downside is that they are grouped and you'll need to use a named unbundle or similar to be able to access the elements of the global.

An alternate pattern for this is to use something like the refnum registry uses. You need to determine what the output types are and group globals by type, but then you can decide to use the runtime name and replace the globals entirely.

Greg McKaskle
Reply With Quote