Exemplo n.º 1
0
 public static void Init_Server(PLCConnect as_plcconnecct, RFID_And_IO_Connect as_rfidconnect)
 {
     //if (当前为服务端模式)
     //{
     plcconnect = as_plcconnecct;
     plcconnect.ReceData_Event += Plcconnect_ReceData_Event;
     RFIDConnect = as_rfidconnect;
     RFIDConnect.Open();
     RFIDConnect.RFID_Event += new RFID_And_IO_Connect.RFID_Dele(RFIDConnect_RFID_Event);
     //}
     //else
     //{
     //    new Thread(new ThreadStart(OpenClient)) { IsBackground = true }.Start();
     //}
 }
Exemplo n.º 2
0
 public static void Init(RFID_And_IO_Connect as_rfid, PLCConnect as_plcconnect)
 {
     plcconnect = as_plcconnect;
     rfid       = as_rfid;
     //if (rfid != null)
     //{
     //rfid.RFID_Event += Rfid_RFID_Event;
     //}
     new System.Threading.Thread(() =>
     {
         while (true)
         {
             System.Threading.Thread.Sleep(AppConfig.RFIDAUTOSCANINTERVAL);
             if (WorkMode == WorkModeEnum.以扫描作为夹具号来源)
             {
                 rfid?.RFIDRead(AppConfig.RFIDSTARTINDEX, 4);
             }
         }
     })
     {
         IsBackground = true
     }.Start();
 }