Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Solenoid code not working (http://www.chiefdelphi.com/forums/showthread.php?t=81649)

ssmith2 01-02-2010 13:45

Solenoid code not working
 
2 Attachment(s)
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

Alan Anderson 01-02-2010 14:48

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.

Mark McLeod 01-02-2010 16:22

Re: Solenoid code not working
 
1 Attachment(s)
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.

Alan Anderson 01-02-2010 16:50

Re: Solenoid code not working
 
Quote:

Originally Posted by Mark McLeod (Post 911293)
Aren't Solenoid Channel and Solenoid Module enumerated types?

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.

ssmith2 01-02-2010 17:09

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.

Mark McLeod 01-02-2010 17:27

Re: Solenoid code not working
 
Quote:

Originally Posted by ssmith2 (Post 911343)
Believe it or not, the module number was 1-based even though the channel was zero based (such that channel 1 was really 0).

Maybe they fixed that discrepancy :)

ssmith2 03-02-2010 10:11

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.


All times are GMT -5. The time now is 11:48.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi