protected override void InitializeProcessStates() { // From Brock's log comments: Equipment Status values //0 : Setup (VF-1000/VF-3000) //1 : Ready (Common) //2 : Run (Common) //3 : Hold (VF-1000/VF-3000) //4 : End (VF-1000/VF-3000) //5 : Int-Run (VF-1000/VF-3000) //6 : Int-End (VF-1000/VF-3000) //7 : Test (Common) //8 : Alarm (VF-1000/VF-3000) //11 : Ready_ALARM (RSC) //12 : Run_ALARM (Common) //13 : Hold_ALARM (VF-1000/VF-3000) //14 : End_ALARM (VF-1000/VF-3000) //15 : Int-Run_ALARM (VF-1000/VF-3000) //16 : Int-End_ALARM (VF-1000/VF-3000) //17 : Test_ALARM (RSC) ## //TODO - verify for Koyo specific (VF3000)... ProcessStateDict.Add(0, new ProcessState(ProcessStates.NOTREADY, "Setup")); ProcessStateDict.Add(1, new ProcessState(ProcessStates.READY, "Ready")); ProcessStateDict.Add(2, new ProcessState(ProcessStates.NOTREADY, "Run")); ProcessStateDict.Add(3, new ProcessState(ProcessStates.NOTREADY, "Hold")); ProcessStateDict.Add(4, new ProcessState(ProcessStates.NOTREADY, "End")); ProcessStateDict.Add(5, new ProcessState(ProcessStates.EXECUTING, "Int-Run")); ProcessStateDict.Add(6, new ProcessState(ProcessStates.NOTREADY, "Int-End")); ProcessStateDict.Add(7, new ProcessState(ProcessStates.NOTREADY, "Test")); ProcessStateDict.Add(8, new ProcessState(ProcessStates.NOTREADY, "Alarm")); ProcessStateDict.Add(11, new ProcessState(ProcessStates.NOTREADY, "Ready_ALARM")); ProcessStateDict.Add(12, new ProcessState(ProcessStates.NOTREADY, "Run_ALARM")); ProcessStateDict.Add(13, new ProcessState(ProcessStates.NOTREADY, "Hold_ALARM")); ProcessStateDict.Add(14, new ProcessState(ProcessStates.NOTREADY, "End_ALARM")); ProcessStateDict.Add(15, new ProcessState(ProcessStates.NOTREADY, "Int-Run_ALARM")); ProcessStateDict.Add(16, new ProcessState(ProcessStates.NOTREADY, "Int-End_ALARM")); ProcessStateDict.Add(17, new ProcessState(ProcessStates.NOTREADY, "Test_ALARM")); }
protected override void InitializeProcessStates() { ProcessStateDict.Add(0, new ProcessState(ProcessStates.NOTREADY, "Off")); ProcessStateDict.Add(1, new ProcessState(ProcessStates.READY, "Setup")); ProcessStateDict.Add(2, new ProcessState(ProcessStates.READY, "Ready")); ProcessStateDict.Add(3, new ProcessState(ProcessStates.EXECUTING, "Executing")); ProcessStateDict.Add(4, new ProcessState(ProcessStates.WAIT, "Wait")); ProcessStateDict.Add(5, new ProcessState(ProcessStates.ABORT, "Abort")); }
public override bool QueryProcessAndControlState(out Globals.ControlState newControlState, out Globals.ProcessState newProcessState) { //TODO - look at evatec example - this could possible be moved to Tool.cs newControlState = new ControlState(ControlStates.UNDEFINED, "Undefined"); newProcessState = new ProcessState(ProcessStates.UNDEFINED, "Undefined"); S1F3 s1f3 = new S1F3(CurrentToolConfig.Toolid); s1f3.addSVID(CurrentToolConfig.ControlStateSVID.ToString(), DataType.U4, "ControlStateSVID"); s1f3.addSVID(CurrentToolConfig.ProcessStateSVID.ToString(), DataType.U4, "ProcessStateSVID"); try { MyLog.Information("Sending tool status query for SVID " + CurrentToolConfig.ControlStateSVID + ", " + CurrentToolConfig.ProcessStateSVID); s1f3.send(EqSrv, CurrentToolConfig.CommunicationTimeout); int controlState; int processState; if (s1f3.SV.Count != 2) { MyLog.Warning("Status query response did not include expected values."); return(false); } if (s1f3.SV[0].Type == DataType.L) { MyLog.Warning("The configured SVID '" + CurrentToolConfig.ControlStateSVID + "' for Control State is not recognized by the tool"); return(false); } else { controlState = Int32.Parse(s1f3.SV[0].Value); } if (s1f3.SV[1].Type == DataType.L) { MyLog.Warning("The configured SVID '" + CurrentToolConfig.ProcessStateSVID + "' for Process State is not recognized by the tool"); return(false); } else { processState = Int32.Parse(s1f3.SV[1].Value); } if (ControlStateDict.ContainsKey(controlState)) { newControlState = ControlStateDict[controlState]; if (newControlState.State != currentControlState) { Messenger.Default.Send(new ControlStateChangeMessage(newControlState.State, newControlState.Description)); MyLog.Debug("Control State changed to " + newControlState.Description); currentControlState = newControlState.State; } } else { MyLog.Warning("Control State changed to undefined state " + controlState); currentControlState = ControlStates.UNDEFINED; } if (ProcessStateDict.ContainsKey(processState)) { newProcessState = ProcessStateDict[processState]; if (newProcessState.State != currentProcessState) { Messenger.Default.Send(new ProcessStateChangeMessage(newProcessState.State, newProcessState.Description)); currentProcessState = newProcessState.State; } } else { MyLog.Warning("Process State changed to undefined state " + processState); currentProcessState = ProcessStates.UNDEFINED; } MyLog.Debug("Status query returned Control State '" + controlState + "' Process State '" + processState + "'"); return(true); } catch (BoundMessageTimeoutException) { MyLog.Warning("Tool status query (S1F3) timed out."); } catch (BoundMessageSendException e) { MyLog.Warning("Tool status query (S1F3) failed - " + e.Message); } catch (Exception e) { MyLog.Warning("Unexpected error in tool status query (S1F3); " + e.Message); } return(false); }