Esempio n. 1
0
 /// <summary>
 /// 读取设备的字符串数据,编码为ASCII
 /// </summary>
 /// <param name="address">起始地址</param>
 /// <param name="length">地址长度</param>
 /// <returns>带成功标志的结果数据对象</returns>
 /// <example>
 /// 以下为三菱的连接对象示例,其他的设备读写情况参照下面的代码:
 /// <code lang="cs" source="HslCommunication_Net45.Test\Documentation\Samples\Core\NetworkDeviceBase.cs" region="ReadString" title="String类型示例" />
 /// </example>
 public OperateResult <string> ReadString(string address, ushort length)
 {
     return(ByteTransformHelper.GetResultFromBytes(Read(address, length), m => ByteTransform.TransString(m, 0, m.Length, Encoding.ASCII)));
 }