Esempio n. 1
0
        public bool DeleteBatch(string BatchId, out string errorMessage)
        {
            S2F41 deleteBatchMessage = new S2F41(CurrentToolConfig.Toolid);

            deleteBatchMessage.SetRCMD("DELBATCH  ", DataType.ASC);                   // TODO change this when S2F41 supports string sizes
            deleteBatchMessage.addCp("BATCHID", DataType.ASC, BatchId, DataType.ASC); // TODO change this when S2F41 supports string sizes

            try
            {
                MyLog.Information("Sending HCMD DELBATCH");

                deleteBatchMessage.send(EqSrv, CurrentToolConfig.CommunicationTimeout);
                if (ToolUtilities.checkAck(deleteBatchMessage.HCACK))
                {
                    MyLog.Information("HCMD for DELBATCH returned good HCACK");
                    errorMessage = "";
                }
                else
                {
                    errorMessage = "HCMD for DELBATCH returned bad HCACK " + deleteBatchMessage.HCACK;
                    Messenger.Default.Send(new EventMessage(DateTime.Now, "E", errorMessage));
                    MyLog.Information(errorMessage);
                }
            }
            catch (Exception e)
            {
                ToolUtilities.ReportMessageSendExceptions("HCMD (S2F41) START", true, e);
                errorMessage = "Error sending HCMD for DELBATCH";
                return(false);
            }

            return(true);
        }
Esempio n. 2
0
        protected override bool DoToolSpecificStartProcessing(string Port, string[] LotIds, string Recipe, string Operator, out string errorMessage)
        {
            // RCMD = START
            S2F41 hostCommandMessage = new S2F41(CurrentToolConfig.Toolid);

            hostCommandMessage.SetRCMD("START", DataType.ASC);
            try
            {
                MyLog.Information("Sending HCMD START");

                hostCommandMessage.send(EqSrv, CurrentToolConfig.CommunicationTimeout);
                if (ToolUtilities.checkAck(hostCommandMessage.HCACK))
                {
                    MyLog.Information("HCMD for START returned good HCACK");
                    errorMessage = "";
                }
                else
                {
                    errorMessage = "HCMD for START returned bad HCACK " + hostCommandMessage.HCACK;
                    Messenger.Default.Send(new EventMessage(DateTime.Now, "E", errorMessage));
                    MyLog.Information(errorMessage);
                }
            }
            catch (Exception e)
            {
                ToolUtilities.ReportMessageSendExceptions("HCMD (S2F41) START", true, e);
                errorMessage = "Error sending HCMD for START";
                return(false);
            }

            return(true);
        }
Esempio n. 3
0
        public override bool CreateBatch(string BatchId, string PPID, int ProcessTime, string TableNumber,
                                         string CarrierID, string MaterialType, int CarrierLocation, int[] SlotStatus)
        {
            S2F65 createBatchMessage = new S2F65(CurrentToolConfig.Toolid);

            createBatchMessage.SetBatchId(BatchId, 16);
            createBatchMessage.SetPPID(PPID, 16);
            DateTime dt = new DateTime(0);

            dt.AddSeconds(ProcessTime);
            createBatchMessage.SetProcessTime(dt.ToString("HHmmss"));
            createBatchMessage.SetTableNumber(TableNumber);
            createBatchMessage.SetSlotStatusType(DataType.U1);
            List <int> temporary = new List <int>();      //TODO fix this when API fixed

            temporary.AddRange(SlotStatus);
            createBatchMessage.AddCarrier(CarrierID, 20, MaterialType, CarrierLocation, DataType.UI1, temporary);

            try
            {
                MyLog.Information("H->E Sending create batch ");

                createBatchMessage.send(EqSrv, CurrentToolConfig.CommunicationTimeout);
                if (ToolUtilities.checkAck(createBatchMessage.ACK))
                {
                    MyLog.Information("Create batch command returned good ACK");
                    return(true);
                }
                else
                {
                    string message = "Create batch command returned bad ACK " + createBatchMessage.ACK;
                    Messenger.Default.Send(new EventMessage(DateTime.Now, "E", message));
                    MyLog.Information(message);
                    return(false);
                }
            }
            catch (Exception e)
            {
                ToolUtilities.ReportMessageSendExceptions("Create batch command (S2F65) failed: ", true, e);
                return(false);
            }
        }
Esempio n. 4
0
        override protected bool SendEnableAlarms()
        {
            S5F3 s5f3 = new S5F3(CurrentToolConfig.Toolid);

            s5f3.setALED("01", DataType.BOOL);

            if (CurrentToolConfig.EnableAllAlarms)
            {
                s5f3.setALIDEmptyType(DataType.UI4);
            }
            else
            {
                foreach (var alarm in CurrentToolConfig.AlarmList)
                {
                    s5f3.addALID(alarm.id.ToString(), DataType.UI4);
                }
            }
            try
            {
                MyLog.Information("H->E Sending S5F3 to enable " + (CurrentToolConfig.EnableAllAlarms ? "all" :
                                                                    CurrentToolConfig.AlarmList.Length.ToString()) + " alarms");
                s5f3.send(EqSrv, CurrentToolConfig.CommunicationTimeout);
                MyLog.Information("S5F3 returned ACKC5=" + s5f3.ACKC5);

                if (ToolUtilities.checkAck(s5f3.ACKC5))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception e)
            {
                ToolUtilities.ReportMessageSendExceptions("S5F3 enable alarms", false, e);
                return(false);
            }
        }
Esempio n. 5
0
        public override bool DoSelectRecipe(string Port, string[] LotIds, string Recipe, string Operator, out string errorMessage)
        {
            char[] trimChars = new char[] { ',' };

            if (LotIds == null || Recipe == null)
            {
                errorMessage = "HCMD for PP-SELECT cannot be run--no LotIds or Recipe were supplied";
                Messenger.Default.Send(new EventMessage(DateTime.Now, "E", errorMessage));
                MyLog.Information(errorMessage);

                return(false);
            }

            Messenger.Default.Send(new ProcessStateChangeMessage(ProcessStates.READY, "Selecting recipe"));


            StringBuilder logMessage         = new StringBuilder("Sending HCMD PP-SELECT with recipe " + Recipe + " lot IDs ");
            S2F41         hostCommandMessage = new S2F41(CurrentToolConfig.Toolid);

            hostCommandMessage.SetRCMD("PP-SELECT", DataType.ASC);
            hostCommandMessage.addCp("PPID", DataType.ASC, Recipe, DataType.ASC);
            hostCommandMessage.addCp("OPERATORID", DataType.ASC, Operator, DataType.ASC);

            // BatchID length must be <= 20, so remove leading "B_"
            string batch = "";

            for (int i = 0; i < LotIds.Length; i++)
            {
                if (i > 0)
                {
                    batch += "_";
                }
                batch += LotIds[i];
            }

            //foreach (string lotId in LotIds)
            //{
            //    if (lotId != null && lotId.Trim().Length > 0)
            //    {
            //        batch += "_" + lotId;
            //    }
            //}
            MyLog.Information($"BATCHID={batch}");

            hostCommandMessage.addCp("BATCHID", DataType.ASC, batch, DataType.ASC);

            int lotSuffix = 1;

            foreach (string lotId in LotIds)
            {
                if (lotId != null && lotId.Trim().Length > 0)
                {
                    hostCommandMessage.addCp("LOTID" + lotSuffix++, DataType.ASC, lotId, DataType.ASC);
                    logMessage.Append(lotId);
                    logMessage.Append(",");
                }
            }
            try
            {
                Messenger.Default.Send(new EventMessage(new LogEntry(logMessage.ToString().TrimEnd(trimChars))));
                MyLog.Information(logMessage.ToString().TrimEnd(trimChars));

                hostCommandMessage.send(EqSrv, CurrentToolConfig.CommunicationTimeout);
                if (ToolUtilities.checkAck(hostCommandMessage.HCACK, new String[] { "0", "00", "04" }))
                {
                    MyLog.Information("HCMD for PP-SELECT returned good HCACK");
                    errorMessage = "";
                    return(true);
                }
                else
                {
                    errorMessage = "HCMD for PP-SELECT returned bad HCACK " + hostCommandMessage.HCACK + " - " +
                                   (HostCommandAckDict.ContainsKey(hostCommandMessage.HCACK) ? HostCommandAckDict[hostCommandMessage.HCACK] :
                                    "Undefined HCACK");
                    Messenger.Default.Send(new EventMessage(DateTime.Now, "E", errorMessage));
                    MyLog.Information(errorMessage);
                    return(false);
                }
            }
            catch (Exception e)
            {
                ToolUtilities.ReportMessageSendExceptions("HCMD (S2F41) PP-SELECT", true, e);
                errorMessage = "Error sending HCMD (S2F41) PP-SELECT to tool";
                return(false);
            }
        }