public void ConveyorIn(int timeoutSec = 30) { _mc.Jog(MotorConveyor, MotorConveyor.Velocity, MoveDirection.Positive); var state = false; var stopwatch = new Stopwatch(); stopwatch.Start(); do { if (stopwatch.ElapsedMilliseconds > timeoutSec * 1000) { _mc.Stop(MotorConveyor); throw new Exception("Conveyor In timeout V laod tray station."); } state = GetInsideOpticalSensor(); } while (state == false); _mc.Stop(MotorConveyor); }
private double TouchAndFindPressureSensor(double touchPointHeight, int timeoutSec = 60) { double needleHeight = 0; //Max down 0.5mm touchPointHeight -= 0.5; _mc.MoveToTarget(MotorZ, touchPointHeight); var stopwatch = new Stopwatch(); stopwatch.Start(); do { //if (_mc.IsMoving(MotorZ) == false) //{ // _mc.MoveToTargetRelative(MotorZ, -0.1); // if (GetPosition(MotorZ)<=touchPointHeight) // { // throw new Exception("Find needle height timeout, maybe need to lower sensor: " + _coordinateId); // } //} if (GetPressureValue() > NeedleTouchPressure) { _mc.Stop(MotorZ); Delay(800); needleHeight = _mc.GetPosition(MotorZ) + NeedleOnZHeightCompensation; SetSpeed(1); _mc.MoveToTargetRelativeTillEnd(MotorZ, 2); return(needleHeight); } if (stopwatch.ElapsedMilliseconds > timeoutSec * 1000) { throw new Exception("Find needle height timeout, maybe need to lower sensor: " + _coordinateId); } } while (true); }
public void WaitTillInterpolationEnd() { _mc.WaitTillInterpolationEnd(_coordinateId); Delay(200); _mc.Stop(MotorX); }