Thread: Begin.vi
View Single Post
  #5   Spotlight this post!  
Unread 26-02-2015, 08:44
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: Begin.vi

Quote:
Originally Posted by Levansic View Post
I'm slightly confused here. Am I interpreting correctly that you essentially have a VI for your drive and a VI for your manipulators, and you just call each with a selector for the various behaviors? I am guessing that both generate and use their own refnums.

That seems like a great idea for code organization and bringing new programmers up to speed. Instead of hop-scotching through all of the different VI's like teleop.vi and Periodic_tasks.vi, you have all related code contained in each part's VI.
That's exactly right. The other unobvious bit is that we keep all the RefNums in a shift register cluster so we never have to do a RefNum Get. We do RefNum Set in Begin just so we can use Test mode.

Quote:
If I am interpreting correctly, how do you deal with autonomous, as I assume that there has to be some sort of sequencing and communication between both drive and superstructure to complete tasks?
Autonomous is independent at the moment, using a flat sequence. If we wanted to keep it in the rest of the code, we'd probably implement state machines with a shared state variable.
Reply With Quote