#define VALVE_TIME 190

sub left ()
{
SetPower(OUT_B,1);
OnFwd(OUT_B);
Wait(50);
until (SENSOR_2 == 1);
Off(OUT_B);
}
This section moves the carriage left one space and lines it up to move the pneumatic valve

sub right ()
{
SetPower(OUT_B,1);
OnRev(OUT_B);
Wait(50);
until (SENSOR_2 == 1);
Off(OUT_B);
}
This section moves the carriage right one space and lines it up to move the pneumatic valve

sub valve ()
{
OnFwd(OUT_C);
Wait(VALVE_TIME);
Off(OUT_C);
Float(OUT_C);
Wait(100);
}
This section moves the pneumatic valve from open on one port to open on the other port

sub rotate ()
{
OnFwd(OUT_A);
Wait(50);
until (SENSOR_1 == 1 );
Off(OUT_A);
Wait(100);
OnRev(OUT_A);
Wait(50);
until (SENSOR_1 == 1);
Off(OUT_A);
Wait(100);
}
This section rotates the dumper with the rail waggon locked on top of it

task main()
{
SetSensor(SENSOR_2,SENSOR_TOUCH);
SetSensor(SENSOR_1,SENSOR_TOUCH);
valve();-position valve
left();
valve();-Car#1 holdback valve
Wait(100);
valve();
right();
right();
valve();-Vertical engagement valve
right();
valve();-horizontal engagement valve
rotate();
valve();-horizontal engagement valve
left();
valve();-Vertical engagement valve
left();
valve();-position valve
left();
left();
valve();-car#2 holdback valve
right();
right();
/*start cycle 2
*/
valve();-position valve
left();
valve();-car#1 holdback valve
right();
right();
valve();-Vertical engagement valve
right();
valve();-horizontal engagement valve
rotate();
valve();-horizontal engagement valve
left();
valve();-Vertical engagement valve
left();
valve();-position valve
Float(OUT_C);
}


This page hosted by Yahoo! GeoCities Get your own Free Home Page


Hosted by www.Geocities.ws

1