Log in

View Full Version : programming pneumatics problem


program1
18-02-2008, 15:55
we tried to load this program and after it finishes, the program does nothing, the spike we set the double compressor turns green but nothing happens,

heres our code we used:

char flag00 = 1;
char flag01 = 1; //set at top of program

if(p2_sw_trig == 1 && flag00 == 1)
{
relay6_fwd = 1;
relay6_rev = 0;
flag01 = 0;
}
else if(p2_sw_trig == 1 && flag00 == -1)
{
relay6_fwd = 0;
relay6_rev = 1;
flag01 = 0;
}
else if (p2_sw_trig == 0 && flag01 == 0)
{
flag01 = 1;
flag00 = flag00 * -1;
}

is there any problems within the program?

Jon Stratis
18-02-2008, 16:13
If the spike turns green when it's supposed to be doing something, i'd say the code is working fine... check the wiring.

slavik262
18-02-2008, 16:34
Agreed. All the code does is change the state of the spike. After that, the problem lies within the wiring or the pneumatics themselves.

Kevin Sevcik
18-02-2008, 17:14
Just checking, but you do realize your relay never turns off, correct? It'll always either be red or green once you hit your trigger.

But yes, check your solenoid wiring. Also, the solenoids are piloted, so it won't want to switch if there's not enough air pressure in the system.

program1
18-02-2008, 17:35
Found out the problem. I didn't check the entire code and found that the orginal kevin's code was kinda conflicting the code I wrote for the pneumatics. Hehe my bad.... -_- I WANT COFFEE