View Single Post
  #16   Spotlight this post!  
Unread 30-08-2010, 20:49
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
Re: Encoder v.s. Steering

I'll start with your "bit switch".

This could be more efficient and easier to read by bundling the boolean values into an array and using the function "boolean array to number" (found in the boolean pallette):

What would make it better still is to use the refnum registry (as opposed to allocating and deallocating the channels each time), and to put the whole thing in a subVI:


Also notice the use of the FOR loop and the string array constant make the code smaller and cleaner. If nothing is wired to the N terminal on a FOR loop but you wire an array to it, it will execute for every element in that array.
I added a comment for why the values are inverted. To someone not familiar with the digital sidecar, this would not be obvious.


Are you comfortable with all of this?
__________________
-- Marshal Horn
Reply With Quote