View Single Post
  #9   Spotlight this post!  
Unread 15-02-2010, 23:02
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,795
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Buttons on Joystick

Sorry, I've taken so long. I had a nice dinner and a productive night in the shop.

The Solenoid Refnum vi is actually the same vi no matter how many times you see it pasted onto the block diagram. So it's really only getting called once at a time.
It is just making an entry for solenoids in a registry of all open devices. What you initially see in the various fields are just the default values. When the code actually executes those default values get overridden by the inputs you gave to the Open, e.g., the name you chose and the particular solenoid pin number, etc.

There is an option under File -> VI Properties that allows you to make a vi reentrant. That means every time you paste it into the code you get a different unique copy of it. Then those reentrant copies do run independently of each other. We use that for when we have to preserve unique data stored inside the vi between calls and don't want it being called in another place and replacing the data we've preserved in the vi. For instance, if you make a vi that ramps up the speed of a motor and you want to use it for both the drive motors and for an arm motor. You'd be calling it every time you came back into Teleop, but you wouldn't want the last arm motor speed to get mixed up with the last drive motor speed when you ramp up one more step.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 16-02-2010 at 08:22.
Reply With Quote