View Single Post
  #2   Spotlight this post!  
Unread 28-01-2010, 19:15
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,756
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: Programming 24v relay

Rather than save the example under your Robot project, you probably want to want to open both and copy/paste the solenoid code into your source. The first thing to do is to open Begin where you'll open and store the solenoid refnums.

Then in your code where you want to change the solenoid state, read the refnum and update the state by setting the solenoid, like in the example. Finally, in Finish, read and close.

Note that you may want to build a subVI that updates the state so that you can do it in different places in your program, auto, tele, etc.

Greg McKaskle
Reply With Quote