示例#1
0
 /// <summary>
 /// Returns the Device Identification String.
 /// </summary>
 /// <param name="address">Device Address. Use null to use the DefaultDeviceAddress defined on MeComQuerySet.</param>
 /// <returns>Device Identification String. Usually 20 Chars long.</returns>
 /// <exception cref="ComCommandException">when the command fails. Check the inner exception for details.</exception>
 public string GetIdentString(byte?address)
 {
     try
     {
         MeComPacket txFrame = new MeComPacket('#', address);
         MeComVarConvert.AddString(txFrame.Payload, "?IF");
         MeComPacket rxFrame = meQuerySet.Query(txFrame);
         return(MeComVarConvert.ReadString(rxFrame.Payload, 20));
     }
     catch (Exception Ex)
     {
         throw new ComCommandException(String.Format("Get Identification String failed: Address: {0}, Detail: {1}", address, Ex.Message), Ex);
     }
 }