Пример #1
0
 public void CheckPnpPartPresent(bool bOn)
 {
     if (HSTMachine.Workcell.HSTSettings.Install.OperationMode == OperationMode.Simulation ||
         HSTMachine.Workcell.HSTSettings.Install.OperationMode == OperationMode.DryRun)
     {
         return;
     }
     else
     {
         if (bOn)
         {
             // Input EE Pnp Present 1
             try
             {
                 _diOutputEndEffectorPnpPresent1.WaitForState(DigitalIOState.On, _sensorTimeout);
             }
             catch (Exception ex)
             {
                 HSTException.Throw(HSTErrors.OutputEndEffectorVacuumPressureSensor1NotOnError, ex);
                 //End Effector1 Pnp Present1 Not On Error
             }
         }
         else
         {
             try
             {
                 _diOutputEndEffectorPnpPresent1.WaitForState(DigitalIOState.Off, _sensorTimeout);
             }
             catch (Exception ex)
             {
                 HSTException.Throw(HSTErrors.OutputEndEffectorVacuumPressureSensor1NotOffError, ex);
                 //End Effector1 Pnp Present1 Not Off Error
             }
         }
     }
     if (bOn)
     {
         try
         {
             _diOutputEndEffectorPnpPresent2.WaitForState(DigitalIOState.On, _sensorTimeout);
         }
         catch (Exception ex)
         {
             HSTException.Throw(HSTErrors.OutputEndEffectorVacuumPressureSensor2NotOnError, ex);
             //End Effector1 Pnp Present2 Not On Error
         }
     }
     else
     {
         try
         {
             _diOutputEndEffectorPnpPresent2.WaitForState(DigitalIOState.Off, _sensorTimeout);
         }
         catch (Exception ex)
         {
             HSTException.Throw(HSTErrors.OutputEndEffectorVacuumPressureSensor2NotOffError, ex);
             //End Effector1 Pnp Present2 Not Off Error
         }
     }
 }
Пример #2
0
 public void WaitInputStationPartPresent()
 {
     if (HSTMachine.Workcell.HSTSettings.Install.OperationMode == OperationMode.Simulation)
     {
         Thread.Sleep(CommonFunctions.SIMULATION_DELAY);
         return;
     }
     else
     {
         try
         {
             _diInputStationInPosition.WaitForState(DigitalIOState.On, _carrierInPositionTimeout);
             HSTMachine.Workcell.InputStationBoatPositionError = false;
         }
         catch (Exception ex)
         {
             HSTMachine.Workcell.InputStationBoatPositionError = true;
             HSTException.Throw(HSTErrors.InputStationInPositionNotOnError, ex);
         }
     }
 }
        public void CheckPnpPartPresent(bool bOn)
        {
            if (HSTMachine.Workcell.HSTSettings.Install.OperationMode == OperationMode.Simulation ||
                HSTMachine.Workcell.HSTSettings.Install.OperationMode == OperationMode.DryRun)
            {
                return;
            }
            else
            {
                if (bOn)
                {
                    // Input EE Pnp Present 1
                    try
                    {
                        _diInputEndEffectorPnpPresent1.WaitForState(DigitalIOState.On, _sensorTimeout);
                    }
                    catch (Exception ex)
                    {
                        HSTException.Throw(HSTErrors.InputEndEffectorVacuumPressureSensor1NotOnError, ex);
                    }
                }
                else
                {
                    try
                    {
                        _diInputEndEffectorPnpPresent1.WaitForState(DigitalIOState.Off, _sensorTimeout);
                    }
                    catch (Exception ex)
                    {
                        HSTException.Throw(HSTErrors.InputEndEffectorVacuumPressureSensor1NotOffError, ex);
                    }
                }
            }
            if (bOn)
            {
                try
                {
                    _diInputEndEffectorPnpPresent2.WaitForState(DigitalIOState.On, _sensorTimeout);
                }
                catch (Exception ex)
                {
                    HSTException.Throw(HSTErrors.InputEndEffectorVacuumPressureSensor2NotOnError, ex);
                }
            }
            else
            {
                try
                {
                    _diInputEndEffectorPnpPresent2.WaitForState(DigitalIOState.Off, _sensorTimeout);
                }
                catch (Exception ex)
                {
                    HSTException.Throw(HSTErrors.InputEndEffectorVacuumPressureSensor2NotOffError, ex);
                }
            }

            //Reset seaveyor
            CommonFunctions.Instance.powerOnConveyor  = false;
            CommonFunctions.Instance.powerOffConveyor = true;
            Thread.Sleep(1000);
            CommonFunctions.Instance.powerOnConveyor  = true;
            CommonFunctions.Instance.powerOffConveyor = false;
            Thread.Sleep(1000);
        }