private void InitTagData() { switch (TagType) { case TagType.HGA_FOLA: TagData = new FolaTagData(); break; case TagType.HGA_BOLA: case TagType.HGA_BOLA2: TagData = new BolaTagData(); break; } }
private void btnTestHgaBola_Click(object sender, EventArgs e) { //BolaTagDataForm form = new BolaTagDataForm(); //form.ShowDialog(); BolaReader bolaTag = new BolaReader(); BolaTagData bolaData = new BolaTagData(); try { // BOLA = Read/Write Bola Tag // BolaReader csRFID = new BolaReader(); // csRFID.PortSettings.PortName = "COM3"; // csRFID.Initialize(false); // BolaTag csBolaTag = new BolaTag(); // bolaTag.Simulation = true; bolaTag.PortSettings.PortName = "COM9"; // Don't need to set another values (baud rate, parity, databit, stopbit) , leave them default. bolaTag.Initialize(false); // Read bolaTag.ReadRFIDTag(0, ref bolaData); // Read from Head 0 // bolaData.TrayID <-- TrayID // ... // bolaData[0].HgaSN <-- 1st HGA Serial Number // bolaData[0].Status <-- 1st HGA Status // ..... // ..... // bolaData[19].HgaSN <-- last HGA Serial Number // bolaData[19].Status <-- last HGA Status // Write //bolaData.TrayID = "XXX"; //bolaData.WorkOrderVersion = '2'; //bolaData[0].HgaSN = "9999999999"; //bolaData[0].Status = 'B'; //bolaData.VendorCode = 8; // From machine config file , 8 = Teparuk , 9 = Korat //bolaData.PartNumber = "123433444"; // From WorkOrder , HGAPartNumber=123433444 //bolaData.Tab = 'D'; // From last digit of workorder name , WorkOrder=P012345D //bolaData.TrayType = 50; // From workOrder , TrayType=50 //bolaData.LastStep = 3; // CLU UnLoad Module is station code Q , process step = 3 <- set laststep = process step //[Process] //NumberOfSteps=3 //ProcessStep1=A //ProgramName1=SLS-1 //ProcessStep2=C //ProgramName2=SAS-1 //ProcessStep3=Q <--- CLU Unload <- Last Step = 3 //ProgramName3=SUL-1 //bolaData.LastStep = 2; //bolaData.Tab = 'U'; //bolaData.VendorCode = 10; //byte checksum = bolaTag.ReadCheckSum(0); //bolaTag.WriteCheckSum(0, 0xbf); //bolaTag.WriteRFIDTag(0, bolaData, false); MessageBox.Show("Done"); } catch (ExceptionRFID ex) { MessageBox.Show(ex.Message); } catch (Exception ex) { MessageBox.Show(ex.Message); } bolaTag.ShutDown(); }