FIRST Robotics Competition Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

On/Off Relay Controller Program using LabVIEW

Hey, 

I am trying to control 6 individual relays with the same button in labview and I cannot figure it out. I am extremely new to labview and all of my knowledge of it has relied on the internet. 

I am using the old 2012/2013 labview software because I am using a CRio on my robot. I began my project by using the FRC basic robot code. 

Basically what I am trying to do is activate each relay when I press the button x amount of times. 

For example, shoot relay one when i press the button the first time, then I press a different button to switch to the next relay, then press my first button to shoot the next relay I switched to. The second button would go through all of the relays 1-6 and then go back to 1 once I pressed the button again and the first button would shoot whatever relay I have chosen. 

I might be overthinking this, in Begin. Vi I have set up for a regular relay function and in Teleop.Vi I have it setup for button 1. I setup a "cascading" mechanism where it goes through 6 "select" values and adds one variable before it continues to the next then finishes in the set values port of the relay setup. 

Please understand I need a lot of help and I am very new to labview.

I have looked all over the internet for the past week searching for an answer, I must be the only crazy person trying to do this. 

Side note: I have no idea how to put in multiple relay inputs. 

0 Kudos
Message 1 of 3
(2,624 Views)

I've attached a file that might help you along, backsaved to 2012.

Essentially it uses two shift registers to track the index (and reset as needed) and the array of current values, because I implemented this to have a "toggle" button.

 

Let me know if you need help extending it to something else.

 


GCentral
0 Kudos
Message 2 of 3
(2,584 Views)

I do not have any of the WPI Robot libraries loaded on my work PC so I can't create a complete example for you so you will need to fill in some of the missing parts.

 

You have 2 buttons on the JOY Stick that you wish to use.

1 button to FIRE the relay?

1 button to rotate through 6 relay?

The event structure will not work on the Robot. I have created some "one shots" to be used on your JOY sticks button with feed back nodes. Paste this code in your Teleop.vi.

Maybe post your code that you have done so far.

 

 

Omar
0 Kudos
Message 3 of 3
(2,557 Views)