Exemple #1
0
 /// <summary>收到线体主控PLC的 脚踏板信号 和 放行方向 后后即尝试 读取一次RFID
 ///
 /// </summary>
 /// <param name="plcconnect"></param>
 /// <param name="b"></param>
 private static void Plcconnect_ReceData_Event(PLCConnect plcconnect, byte[] b)
 {
     Dir = Encoding.ASCII.GetString(b, 0, b.Length);
     AppMessage.Add("收到PLC消息:" + Dir, AppMessage.MsgType.飞轮岗位A1A3交互消息);
     //RFIDConnect.RFIDRead(AppConfig.RFIDSTARTINDEX, 4, AppConfig.RFIDREADTIMES);
     RFIDConnect.RFIDRead(AppConfig.RFIDSTARTINDEX, 4);
 }
Exemple #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();
 }