FIRST Robotics Competition Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Cant get relay output to work

I have tried everything from the compressor example VI to the Relay output example VI to creating my own VI to run the compressor on the bot. I cannot get the compressor to turn on. I tried putting 5 volts across the Spike input leads (from the power distro board) and the compressor turns on. I have tried running the VI's in the "light bulb" mode and watching things. The best I can tell, labview thinks the compressor is on, but I get no LED on the digital sidecar, and the compresor doesn't run. I have tried the other sidecar and cable, no luck. The PWM outputs work, because the basic bot program runs and I can drive the bot in arcade and tank drive. I am plugged into relay 1 and DIO 1 in the sidecar connected to the module in slot 4. I have set all that on the VI (several times) and no luck.

One of the kids is a C++ guru, and I have heard (but not seen) that he was able to turn on the compressor with some C++ code, but it did not turn off with the pressure switch (had to turn off the bot to stop the compressor). I don't think there is anything wrong with the cRIO, but I don't what else to do. Any help?

0 Kudos
Message 1 of 7
(8,029 Views)

You've told us everything about the output, but nothing about the input.

Ignoring the input for a moment, have you tried just adding a toggle switch to the Labview Front panel and using that to turn the relay on and off.

This is probably the simplest approach to just test basic relay function.

This would eliminate input wiring problems.

Once you get that working, make sure you wire the pressure switch inputs across the 0V and Input pin

Get a life? This IS my life!
0 Kudos
Message 2 of 7
(2,900 Views)

Is one of the LEDs associated with the Relay 1 coming on?   I don't know which one, but I believe one should be on when the compressor is on.

Just to make sure, Spike to Relay 1 - white toward the center of the DSC, switch to DIO 1 - white toward center of DCS.

0 Kudos
Message 3 of 7
(2,900 Views)

Yes, I have tried using the "simple relay example". In this VI, there is only a relay driver. On the front panel you can select which relay, slot etc, and there is a toggle to turn the relay on and off. The code seems to think the relay is on (when I probe the wire I get a "true" condition), but I get no LED on the side car, and the compressor does not run.

0 Kudos
Message 4 of 7
(2,900 Views)

Hi Martin,

Have you tried recycling power to the driver station? We faced a similar problem here with one of our digital sidecars, though not with the compressor. From what it looks like, the PWM is not communicating with the sidecar. Try recycling the battery and if it does not work we wil test it out here with hardware.

Ipshita C.

National Instruments
Applications Engineer
0 Kudos
Message 5 of 7
(2,900 Views)

We were also having the same issue.  We tried to get a relay to work using two different sidecars.

We tried just using setRelay.vi to toggle the different states and do not receive the 5v across any of the pins.

The lights next to the relays do not light up.

Our problem turned out to be we were not enabling the robot on the Driver Station when testing the relay.

0 Kudos
Message 6 of 7
(2,900 Views)

Have you read all the documents on wiring?  Can you take a picture of all your wiring and attach it for us to take a look at?  Often times this type of trouble is due to a module or breakout missing the 12V power connection.

0 Kudos
Message 7 of 7
(2,900 Views)