コード例 #1
0
 public bool ReadOilValString(int iAddr, ref string strVals)
 {
     lock (this)
     {
         try
         {
             byte[] bBuf = GLLedProtocol.MakeCmdLedGetOilVal(iAddr);
             Write(bBuf, 0, bBuf.Length);
             Thread.Sleep(100);
             bool   bError = false;
             byte[] bRead  = Read(out bError);
             if (bRead != null)
             {
                 LogMgr.WriteInfoDefSys("recbuf bytes:" + BitConverter.ToString(bRead));
             }
             return(GLLedProtocol.AnalyeseRecGetOilValString(bRead, iAddr, ref strVals));
         }
         catch (System.Exception ex)
         {
             LogMgr.WriteInfoDefSys("读写异常" + ex.Message);
             return(false);
         }
     }
 }