Esempio n. 1
0
 public void ReadData(PLCCom _Com)
 {
     ReadMark = CommUtil.GetDevice(AmountDevice, _Com);
     if (ReadMark > 0)
     {
         GetBoxCode(_Com);
         GetAmount(_Com);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// get amount data from device
 /// </summary>
 /// <param name="_Com"></param>
 public void GetAmount(PLCCom _Com)
 {
     try
     {
         Amount = CommUtil.GetDevice(AmountDevice, _Com);
         Log.Info(String.Format("数量读取成功. 软元件地址:[{0}]. 数量:[{1}].", AmountDevice, Amount));
     }
     catch (System.Exception ex)
     {
         Log.Error("数量读取失败.", ex);
         throw;
     }
 }
Esempio n. 3
0
        public void ReadData(PLCCom _Com)
        {
            try
            {
                ReadMark = CommUtil.GetDevice(ReadMarkDevice, _Com);
                if (0 != ReadMark)
                {
                    Log.Info(String.Format("检测读取标志已设置为 [{0}]. 开始读取数据.", ReadMark));

                    GetPlateCode(_Com);
                    foreach (Record record in Records)
                    {
                        record.ReadData(_Com);
                    }

                    Processed = false;
                }
            }
            catch (System.Exception ex)
            {
                Log.Error("数据读取失败.", ex);
            }
        }