Problems Working with Multiple Solenoids


We’re having an odd issue with firing solenoids. We have two solenoid objects as class members, and at some point in the code, we have this sequence:


Solenoid 1 is initialized with the arguments (8,1) and solenoid 2 is initialized with (8,2). We are using the Festo 24V solenoid (but I don’t think that’s relevant to this problem).

The behavior we are expecting is that the first solenoid is momentarily activated, then a second later, the second solenoid is momentarily activated. What actually happens is that the first solenoid is momentarily activated, then nothing else happens. I am looking at the lights on the NI9472 in slot 8 to determine if the code is working - I see the first light flash on for a split second, then nothing else happens. We tried hooking everything up (pneumatics, etc.) and we got the same result - the first cylinder fired, but not the second.

We tried different channels for the second solenoid, but nothing helped. I removed the calls to turn the first cylinder on and off, and the result was that no lights on the 9472 came on, but when I actually removed the first solenoid from the code altogether, the second solenoid started working (so only the second light was flashing on then off).

Any ideas? We’re not sure what to try next.


p.s. It just occurred to me that these long delays may affect the watchdog - do I need to feed the watchdog between these Wait() calls?

The watchdog thing depends on how long the watchdog delay is. It couldn’t hurt to do a feed between waits or even disable the watchdog completely for this test.

Also, have you properly wired the solenoid breakout board? I believe there is a power cable that needs to be running to that for it to actually work.

If none of that works try sending messages to the DS through the DriverStationLCD class. That should be working again if you have applied the Feb. 9 update

OK, I’ll try the test without the watchdog.

The solenoid breakout is completely wired, although I don’t think it has to be in order for the lights to light up (it accepts a wide range of voltages for triggering solenoids - I don’t think this voltage is actually entering the 9472). We have managed to fire the first solenoid, and we can make one light come on, but not both within the same program.

What kind of messages should I be sending to the DS?

Thanks for the help!