コード例 #1
0
        public void DeployInputEEFlattener()
        {
            if (HSTMachine.Workcell.HSTSettings.Install.OperationMode == OperationMode.Simulation /*|| HSTMachine.Workcell.Config.DryRunWithoutPart*/)
            {
                return;
            }

            _doInputEndEffectorFlattener.Set(DigitalIOState.On);
            Thread.Sleep(HSTMachine.Workcell.HSTSettings.Install.FlattenerDeployDuration);
            _doInputEndEffectorFlattener.Set(DigitalIOState.Off);
        }
コード例 #2
0
        public void DoJobVacuum(bool bOn)
        {
            if (HSTMachine.Workcell.HSTSettings.Install.OperationMode == OperationMode.Simulation /*|| HSTMachine.Workcell.Config.DryRunWithoutPart*/)
            {
                return;
            }

            if (bOn)
            {
                _doInputEndEffectorPnpPurgeOn.Set(DigitalIOState.Off);
                _doInputEndEffectorPnpVacuumOn.Set(DigitalIOState.On);
                Thread.Sleep(HSTMachine.Workcell.SetupSettings.Delay.VacuumOnDelay);
            }
            else
            {
                _doInputEndEffectorPnpVacuumOn.Set(DigitalIOState.Off);
                _doInputEndEffectorPnpPurgeOn.Set(DigitalIOState.On);
            }
        }
コード例 #3
0
 public void FreeInputLifter()
 {
     _doInputStationLifterExtendUp.Set(DigitalIOState.Off);
     _doInputStationLifterRetractDown.Set(DigitalIOState.Off);
 }
コード例 #4
0
 public void InputTurnTableFree()
 {
     _doInputTurnTableTurnTo0Deg.Set(DigitalIOState.Off);
     _doInputTurnTableTurnTo90Deg.Set(DigitalIOState.Off);
 }
コード例 #5
0
        protected QState Monitoring(IQEvent qEvent)
        {
            var groundMonitorStatusWorking = true;

            //LogMessage("Monitoring", qEvent);
            if (qEvent.IsSignal(SigStateJob))
            {
                if (HSTWorkcell.terminatingHSTApps)
                {
                    return(null);
                }

                //Show alert message grounding
                try
                {
                    groundMonitorStatusWorking       = Controller.isGroundMasterWorking();
                    _workcell.GroundMonitoringStatus = groundMonitorStatusWorking;
                }
                catch (Exception)
                {
                }

                if (!groundMonitorStatusWorking)
                {
                    _workcell.SendGroundMasterStatusMessage();
                    groundMasterError.PostErrorMessage();

                    if (!_workcell.GroundMonitoringErrActivated)
                    {
                        _workcell.GroundMonitoringErrActivated = true;
                    }
                }
                else
                {
                    groundMasterError.ClearErrorMessage();
                    _workcell.SendGroundMasterStatusMessage();
                }

                if (Controller.IsCriticalTriggeringActivated && !_workcell.LoadCounter.CarrierTriggeringData.BuyoffProcessStarted)
                {
                    _workcell.SendMachinePerformanceStatusMessage();
                    performanceTriggeringError.PostErrorMessage();
                }
                else
                {
                    _workcell.SendMachinePerformanceStatusMessage();
                    performanceTriggeringError.ClearErrorMessage();
                }

                if (HSTMachine.Workcell.HSTSettings.ResistanceCheckingConfig.ResistanceCriticalActivated && !HSTMachine.Workcell.OffAlertMessage)
                {
                    _workcell.SendFunctionalTestStatusMessage();
                    probeFunctionalTestTriggeringError.PostErrorMessage();
                }
                else
                {
                    _workcell.SendFunctionalTestStatusMessage();
                    probeFunctionalTestTriggeringError.ClearErrorMessage();
                }

                if (HSTMachine.Workcell.LoadCounter.CarrierTriggeringData.SamplingTriggeringOverPercentageActivate && !HSTMachine.Workcell.OffAlertMessage)
                {
                    _workcell.SendSamplingOverTargetTriggeringStatusMessage();
                    samplingOverLimitTriggeringError.PostErrorMessage();
                }
                else
                {
                    _workcell.SendSamplingOverTargetTriggeringStatusMessage();
                    samplingOverLimitTriggeringError.ClearErrorMessage();
                }

                if (TowerLightAndDoorStatusEvent != null)
                {
                    TowerLightAndDoorStatusEvent(this, new TowerLightAndDoorLockStatusEventArgs(enableAmberTowerLight, enableRedTowerLight, _controller.isDoorLocked()));
                }

                if (_controller.isAutomationStopButtonPressed() || ((_controller.isAutomationPrepareToStop()) && _controller.isAutomationEnabled()))
                {
                    HSTWorkcell.disableBoundaryCheck = false;
                    if (HSTMachine.Workcell.Process.IsRunState)
                    {
                        PublishSignal(new QEvent(HSTWorkcell.SigStopMachineRun));
                    }
                    preparetoStopAutomation = true;
                    if (HSTMachine.Workcell.HSTSettings.Install.EnableDebugLog)
                    {
                        Log.Info(this, "preparetoStopAutomation. isAutomationStopButtonPressed: {0}, isAutomationPrepareToStop: {1}", _controller.isAutomationStopButtonPressed(), _controller.isAutomationPrepareToStop());
                    }
                }

                if (HSTMachine.Workcell.Process.IsRunState)
                {
                    conveyorCongestionTimer.Start();
                    conveyorCongestionTimer.Elapsed -= conveyorCongestionTimer_Elapsed;
                    conveyorCongestionTimer.Elapsed += conveyorCongestionTimer_Elapsed;
                }
                else
                {
                    conveyorCongestionTimer.Stop();
                    conveyorCongestionTimer.Elapsed -= conveyorCongestionTimer_Elapsed;
                }

                DetermineButtonsLEDState();
                DetermineTowerLightState();

                if (HSTMachine.Workcell.HSTSettings.Install.OperationMode == OperationMode.Simulation)
                {
                    mainDoorIsNotLocked.TriggerError = false;
                }

                if (_controller.isEMOPressed())
                {
                    emoTriggered.TriggerError = true;
                    CommonFunctions.Instance.powerOnConveyor = false;
                }
                else
                {
                    emoTriggered.TriggerError = false;
                }

                if (prepareEMOReset && _controller.isPowerOn())
                {
                    prepareEMOReset = false;
                    if (EMOReset != null)
                    {
                        EMOReset(this, new EventArgs());
                    }
                }

                if (!emoTriggered.TriggerError && emoTriggeredPrev)
                {
                    prepareEMOReset = true;
                    CommonFunctions.Instance.powerOnConveyor  = true;
                    CommonFunctions.Instance.powerOffConveyor = false;
                }

                if (preparetoStopAutomation && !HSTMachine.Workcell.Process.IsRunState)
                {
                    preparetoStopAutomation = false;
                    stopAutomation          = true;
                }

                if (HSTMachine.Workcell.HSTSettings.Install.OperationMode != OperationMode.Simulation)
                {
                    if ((Controller.isAutomationStopButtonPressed()) || stopAutomation)
                    {
                        _controller.EnableAllEndEffectorAxes(false);
                    }
                }

                DateTime currentTime = DateTime.Now;
                TimeSpan diffTime    = currentTime.Subtract(_lastConveyorCongestionTime);

                if (HSTMachine.Workcell.HSTSettings.Install.ConveyorCongestionToleranceTimeLimit > 0)
                {
                    conveyorCongestion.TriggerError = ((int)diffTime.TotalSeconds >= HSTMachine.Workcell.HSTSettings.Install.ConveyorCongestionToleranceTimeLimit) ? true : false;
                }
                else
                {
                    conveyorCongestion.TriggerError = false;
                }

                List <string> errorList = _controller.getErrorList();

                if (errorList.Count > 0)
                {
                    // KA Gan: shouldn't line below be safetyControllerPresentError.TriggerError = true;  ?
                    safetyControllerPresentError.TriggerError = false;

                    string errorInfo = "";
                    for (int i = 0; i < errorList.Count; i++)
                    {
                        errorInfo = errorInfo + errorList[i] + Environment.NewLine;
                    }

                    safetyControllerPresentError.SetErrorInfo(errorInfo);
                }
                else
                {
                    safetyControllerPresentError.TriggerError = false;
                }

                if (HSTMachine.Workcell.HSTSettings.Install.OperationMode != OperationMode.Simulation)
                {
                    MonitorErrorMessage.Checking();
                }

                if ((mainDoorIsNotLocked.TriggerError && !mainDoorIsNotLockedPrev) ||
                    (emoTriggered.TriggerError && !emoTriggeredPrev) ||
                    HSTWorkcell.stopSystemDueToAxisError)
                {
                    // KA Gan: Change system state to Stopped if the EMO button has been pressed.
                    if (HSTMachine.Workcell.HSTSettings.Install.EnableDebugLog)
                    {
                        Log.Info(this, "stopSystemProcess. mainDoorIsNotLocked.TriggerError: {0}, emoTriggered.TriggerError: {1}, stopSystemDueToAxisError: {2}, ", mainDoorIsNotLocked.TriggerError, emoTriggered.TriggerError, HSTWorkcell.stopSystemDueToAxisError);
                    }
                    if (HSTMachine.Instance.MainForm != null)
                    {
                        HSTMachine.Instance.MainForm.getPanelCommand().stopSystemProcess();
                        try
                        {
                            if (emoTriggered.TriggerError || mainDoorIsNotLocked.TriggerError)
                            {
                                _doSoftStartUp.Set(DigitalIOState.Off);
                            }
                        }
                        catch (Exception ex)
                        {
                        }
                    }
                    HSTWorkcell.stopSystemDueToAxisError = false;
                }
                mainDoorIsNotLockedPrev = mainDoorIsNotLocked.TriggerError;
                emoTriggeredPrev        = emoTriggered.TriggerError;

                if (enableSiren)
                {
                    SirenCount++;
                }

                if (SirenCount == 2)
                {
                    enableSiren = false;
                    SirenCount  = 0;
                }

                isDoorLockPrev = _controller.isDoorLocked();

                try
                {
                    _controller.SendRequestToSafetyController(enableAmberTowerLight, enableRedTowerLight, enableSiren,
                                                              enablePowerLED, enableAutomationRunLED, enableAutomationStopLED, stopAutomation,
                                                              CommonFunctions.Instance.powerOnConveyor, CommonFunctions.Instance.powerOffConveyor);

                    if (stopAutomation)
                    {
                        stopAutomation = false;
                    }
                }
                catch (Exception ex)
                {
                }

                ////Get axis status
                try
                {
                    bool   erroractive = false;
                    string erroraxis   = string.Empty;
                    string errormsg    = string.Empty;
                    var    thetaStatus = _workcell.Process.PrecisorStationProcess.Controller.GetThetaAxisStatus(HSTIOManifest.Axes.Theta);
                    var    xStatus     = _workcell.Process.PrecisorStationProcess.Controller.GetThetaAxisStatus(HSTIOManifest.Axes.X);
                    var    yStatus     = _workcell.Process.PrecisorStationProcess.Controller.GetThetaAxisStatus(HSTIOManifest.Axes.Y);
                    var    z1Status    = _workcell.Process.PrecisorStationProcess.Controller.GetThetaAxisStatus(HSTIOManifest.Axes.Z1);
                    var    z2Status    = _workcell.Process.PrecisorStationProcess.Controller.GetThetaAxisStatus(HSTIOManifest.Axes.Z2);
                    var    z3Status    = _workcell.Process.PrecisorStationProcess.Controller.GetThetaAxisStatus(HSTIOManifest.Axes.Z3);

                    # region Get axis status
                    if (!thetaStatus.None)
                    {
                        erroractive = true;
                        erroraxis   = String.Format("[{0}] Axis ", HSTIOManifest.Axes.Theta.ToString().ToUpper());
                        errormsg    = thetaStatus.ToString();
                    }

                    if (!xStatus.None)
                    {
                        erroractive = true;
                        erroraxis   = String.Format("[{0}] Axis ", HSTIOManifest.Axes.X.ToString().ToUpper());
                        errormsg    = xStatus.ToString();
                    }

                    if (!yStatus.None)
                    {
                        erroractive = true;
                        erroraxis   = String.Format("[{0}] Axis ", HSTIOManifest.Axes.Y.ToString().ToUpper());
                        errormsg    = yStatus.ToString();
                    }

                    if (!z1Status.None)
                    {
                        erroractive = true;
                        erroraxis   = String.Format("[{0}] Axis ", HSTIOManifest.Axes.Z1.ToString().ToUpper());
                        errormsg    = z1Status.ToString();
                    }

                    if (!z2Status.None)
                    {
                        erroractive = true;
                        erroraxis   = String.Format("[{0}] Axis ", HSTIOManifest.Axes.Z2.ToString().ToUpper());
                        errormsg    = z2Status.ToString();
                    }

                    if (!z3Status.None)
                    {
                        erroractive = true;
                        erroraxis   = String.Format("[{0}] Axis ", HSTIOManifest.Axes.Z3.ToString().ToUpper());
                        errormsg    = z3Status.ToString();
                    }

                    #endregion

                    if (erroractive && !motionError.TriggerError && !_isInMotionAlarmProcess)
                    {
                        _isInMotionAlarmProcess = true;
                        ButtonList lst = new ButtonList(ErrorButton.NoButton, ErrorButton.NoButton, ErrorButton.NoButton);
                        motionError = new MonitorErrorMessage(_workcell, true, String.Format("Aerotech {0} error", erroraxis), lst);
                        motionError.Format(errormsg);
                        motionError.SetWorkInstruction("Please verify motion axis status by using <A3200 Motion Composer>, reset the error and continue run");
                        motionError.IsAutoClearError = true;
                        motionError.TriggerError     = true;
                        motionError.PostErrorMessage();
                    }
                    else
                    {
                        if (!erroractive && motionError.TriggerError)
                        {
                            motionError.ClearErrorMessage();
                            _isInMotionAlarmProcess    = false;
                            motionError.IsErrorCleared = true;
                        }
                    }
                }