|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Solenoid code not working
Hi. I am hoping you all can help me. I have coded up a real simple solenoid for this year's robot and I did it just like I did last year and it just doesn't seem to work.
Details: In the begin.vi I have code (see attachments) to open the solenoid and to assign it to the registry. I then get it from the registry in the teleop.vi and set the "value" of it based on joystick button value. When we deploy it and run it, it just does not trip the solenoid nor do any of the lights on the 9472 (the thing that plugs into the cRIO) come on. I have even tried removing the button value and just hard coded a boolean constant of "true" to the solenoid value input of the "solenoid set" but to no avail. Any thoughts or help? -Team 1737 programming mentor |
|
#2
|
|||||
|
|||||
|
Re: Solenoid code not working
The code looks good at first glance. Do the vi front panel indicators work as you expect?
Do you have power to the solenoid breakout? How are you deploying and running this? Describe your process step by step, and maybe we'll notice something you're leaving out or something you can do more simply. |
|
#3
|
|||||
|
|||||
|
Re: Solenoid code not working
Aren't Solenoid Channel and Solenoid Module enumerated types?
Using a direct index like you do it seems like one or the other (module/channel) would be 1 off from what it should be. e.g., an index of 8 might be interpreted as Module 9 if you start index counting at zero. Last edited by Mark McLeod : 01-02-2010 at 16:26. |
|
#4
|
|||||
|
|||||
|
Re: Solenoid code not working
Oh, good catch! I'm so used to right-clicking on the input and choosing "create constant" from the popup menu that I didn't even consider that someone might have made a numeric constant and wired it to the input. Check out those little red dots where the constants are wired to the input of the solenoid open. They're telling you that there's a data type mismatch that is being coerced into shape.
|
|
#5
|
|||
|
|||
|
Re: Solenoid code not working
Thanks, I will try it out with the enumerated constants. It worked like this last year but since the framework has changed some maybe it won't now. Believe it or not, the module number was 1-based even though the channel was zero based (such that channel 1 was really 0).
I will change it and try it out and let you know. It will probably be tomorrow night before I can get my hands on the physical system to test it though. |
|
#6
|
|||||
|
|||||
|
Re: Solenoid code not working
Quote:
![]() |
|
#7
|
|||
|
|||
|
Re: Solenoid code not working
Believe it or not, they must have fixed that discrepancy. After simply changing from the hard coded numeric constants to the built-in enumerations it works!!!!
Thanks to all for the help. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| C++ Sample Code not working... | hm29168 | CAN | 5 | 27-01-2010 20:59 |
| Solenoid Not Working | professorX | Pneumatics | 7 | 15-02-2009 23:20 |
| Camera Code not Working in Autonomous? | Mikesername | Programming | 6 | 28-01-2009 10:14 |
| Incrementation Code not working | benhulett | Programming | 6 | 12-02-2007 17:39 |
| Camera code not working.... | DemonYawgmoth | Programming | 5 | 11-02-2006 09:21 |