public void WriteFolaRFID()
        {
            //SetAction(9);
            if (HSTMachine.Workcell.HSTSettings.Install.OperationMode == OperationMode.Simulation ||
                (HSTMachine.Workcell.HSTSettings.Install.OperationMode == OperationMode.Bypass && HSTMachine.Workcell.HSTSettings.Install.BypassRFIDAndSeatrackWriteAtOutput == true))
            {
                Thread.Sleep(CommonFunctions.SIMULATION_DELAY);
                return;
            }
            else
            {
                try
                {
                    if (HSTMachine.Workcell.HSTSettings.Install.DataLoggingForRFIDAndSeatrackRecordUpdateEnabled)
                    {
                        if (HSTMachine.Workcell.HSTSettings.Install.EnableDebugLog)
                        {
                            XyratexOSC.Logging.Log.Info(this, "Write RFID tag at Output Station for Carrier: {0}", _writeFolaTagData.CarrierID);
                            XyratexOSC.Logging.Log.Info(this, "Carrier Size: {0}", _writeFolaTagData.CarrierSize);
                            XyratexOSC.Logging.Log.Info(this, "Current Process Station Code: {0}", _writeFolaTagData.CurrentProcessStep.StationCode);
                            XyratexOSC.Logging.Log.Info(this, "Current Process Recipe: {0}", _writeFolaTagData.CurrentProcessStep.ProcessRecipe);
                            for (int x = 0; x < _writeFolaTagData.CarrierSize; x++)
                            {
                                XyratexOSC.Logging.Log.Info(this, "HGA {0} Serial Number: {1}, Status: {2}, HGA Process Recipe: {3}, HGA Station Code: {4}", (x + 1), _writeFolaTagData.HGAData[x].HgaSN, _writeFolaTagData.HGAData[x].Status.ToString(), _writeFolaTagData.ProcStep[x].ProcessRecipe, _writeFolaTagData.ProcStep[x].StationCode.ToString());
                            }
                            XyratexOSC.Logging.Log.Info(this, "Last Step: {0}", _writeFolaTagData.LastStep);
                            XyratexOSC.Logging.Log.Info(this, "MaxProcStep: {0}", _writeFolaTagData.MaxProcStep);

                            XyratexOSC.Logging.Log.Info(this, "Work Order: {0}", _writeFolaTagData.WorkOrder);
                            XyratexOSC.Logging.Log.Info(this, "Work Order Version: {0}", _writeFolaTagData.WorkOrderVersion.ToString());
                            XyratexOSC.Logging.Log.Info(this, "Write Count: {0}", _writeFolaTagData.WriteCount);
                        }
                    }


                    _state = RFIDState.Writing;
                    _RFIDScanner.WriteRFIDTag(RFHead.Head2, _writeFolaTagData, false);
                    _state = RFIDState.Idle;
                }
                catch (Exception ex)
                {
                    _state = RFIDState.Idle;
                    HSTException.Throw(HSTErrors.OutputRFIDWriteError, ex);
                }
            }
        }
        /// <summary>
        /// Read RFID
        /// </summary>
        public void ReadFolaRFID(RFHead RFIDHead)
        {
            _isReflowRequired = true;
            _rfidError        = RFIDErrors.NoError;
            if (HSTMachine.Workcell.HSTSettings.Install.OperationMode == OperationMode.Simulation)
            {
                Thread.Sleep(CommonFunctions.SIMULATION_DELAY);
                return;
            }


            _state = RFIDState.Reading;
            if (RFIDHead == RFHead.Head1)
            {
                try
                {
                    _readFolaTagData = _RFIDScanner.ReadRFIDTag(RFHead.Head1);  // Read RFID from Input Station
                    _state           = RFIDState.Idle;

                    if (HSTMachine.Workcell.HSTSettings.Install.DataLoggingForRFIDAndSeatrackRecordUpdateEnabled)
                    {
                        if (HSTMachine.Workcell.HSTSettings.Install.EnableDebugLog)
                        {
                            XyratexOSC.Logging.Log.Info(this, "Read RFID tag at Input Station for Carrier: {0}", _readFolaTagData.CarrierID);
                            XyratexOSC.Logging.Log.Info(this, "Carrier Size: {0}", _readFolaTagData.CarrierSize);
                            XyratexOSC.Logging.Log.Info(this, "Current Process Station Code: {0}", _readFolaTagData.CurrentProcessStep.StationCode);
                            XyratexOSC.Logging.Log.Info(this, "Current Process Recipe: {0}", _readFolaTagData.CurrentProcessStep.ProcessRecipe);
                            for (int x = 0; x < _readFolaTagData.CarrierSize; x++)
                            {
                                XyratexOSC.Logging.Log.Info(this, "HGA {0} Serial Number: {1}, Status: {2}, HGA Process Recipe: {3}, HGA Station Code: {4}", (x + 1), _readFolaTagData.HGAData[x].HgaSN, _readFolaTagData.HGAData[x].Status.ToString(), _readFolaTagData.ProcStep[x].ProcessRecipe, _readFolaTagData.ProcStep[x].StationCode.ToString());
                            }
                            XyratexOSC.Logging.Log.Info(this, "Last Step: {0}", _readFolaTagData.LastStep);
                            XyratexOSC.Logging.Log.Info(this, "MaxProcStep: {0}", _readFolaTagData.MaxProcStep);

                            XyratexOSC.Logging.Log.Info(this, "Work Order: {0}", _readFolaTagData.WorkOrder);
                            XyratexOSC.Logging.Log.Info(this, "Work Order Version: {0}", _readFolaTagData.WorkOrderVersion.ToString());
                            XyratexOSC.Logging.Log.Info(this, "Write Count: {0}", _readFolaTagData.WriteCount);
                        }

                        if (OnRFIDFolaReadInputStationDone != null)
                        {
                            OnRFIDFolaReadInputStationDone(_readFolaTagData);
                        }
                    }
                }
                catch (Exception ex)
                {
                    _state     = RFIDState.Idle;
                    _rfidError = RFIDErrors.RFIDReadError;
                    HSTException.Throw(HSTErrors.InputRFIDReadFailed, ex);
                }
            }
            else if (RFIDHead == RFHead.Head2)
            {
                try
                {
                    _readFolaTagData = _RFIDScanner.ReadRFIDTag(RFHead.Head2);  // Read RFID from Output Station
                    _state           = RFIDState.Idle;

                    if (HSTMachine.Workcell.HSTSettings.Install.DataLoggingForRFIDAndSeatrackRecordUpdateEnabled)
                    {
                        if (HSTMachine.Workcell.HSTSettings.Install.EnableDebugLog)
                        {
                            XyratexOSC.Logging.Log.Info(this, "Read RFID tag at Output Station for Carrier: {0}", _readFolaTagData.CarrierID);
                            XyratexOSC.Logging.Log.Info(this, "Carrier Size: {0}", _readFolaTagData.CarrierSize);
                            XyratexOSC.Logging.Log.Info(this, "Current Process Station Code: {0}", _readFolaTagData.CurrentProcessStep.StationCode);
                            XyratexOSC.Logging.Log.Info(this, "Current Process Recipe: {0}", _readFolaTagData.CurrentProcessStep.ProcessRecipe);
                            for (int x = 0; x < _readFolaTagData.CarrierSize; x++)
                            {
                                XyratexOSC.Logging.Log.Info(this, "HGA {0} Serial Number: {1}, Status: {2}, HGA Process Recipe: {3}, HGA Station Code: {4}", (x + 1), _readFolaTagData.HGAData[x].HgaSN, _readFolaTagData.HGAData[x].Status.ToString(), _readFolaTagData.ProcStep[x].ProcessRecipe, _readFolaTagData.ProcStep[x].StationCode.ToString());
                            }
                            XyratexOSC.Logging.Log.Info(this, "Last Step: {0}", _readFolaTagData.LastStep);
                            XyratexOSC.Logging.Log.Info(this, "MaxProcStep: {0}", _readFolaTagData.MaxProcStep);

                            XyratexOSC.Logging.Log.Info(this, "Work Order: {0}", _readFolaTagData.WorkOrder);
                            XyratexOSC.Logging.Log.Info(this, "Work Order Version: {0}", _readFolaTagData.WorkOrderVersion.ToString());
                            XyratexOSC.Logging.Log.Info(this, "Write Count: {0}", _readFolaTagData.WriteCount);
                        }

                        if (OnRFIDFolaReadOutputStationDone != null)
                        {
                            OnRFIDFolaReadOutputStationDone(_readFolaTagData);
                        }
                    }
                }
                catch (Exception ex)
                {
                    _state     = RFIDState.Idle;
                    _rfidError = RFIDErrors.RFIDReadError;
                    HSTException.Throw(HSTErrors.OutputRFIDReadError, ex);
                }
            }

            return;
        }