ModbusRtuReadInt64Async 方法 (String, UInt16) |
命名空间: HslCommunication.ModBus
public override Task<OperateResult<long[]>> ReadInt64Async( string address, ushort length )
MelsecMcNet melsec_net = new MelsecMcNet( "192.168.0.100", 6000 ); // 以下是简单的读取,没有仔细校验的方式 long[] d100_139 = (await melsec_net.ReadInt64Async( "D100", 10 )).Content; // 如果需要判断是否读取成功 OperateResult<long[]> R_d100_139 = await melsec_net.ReadInt64Async( "D100", 10 ); if (R_d100_139.IsSuccess) { long value_d100 = R_d100_139.Content[0]; long value_d104 = R_d100_139.Content[1]; long value_d108 = R_d100_139.Content[2]; long value_d112 = R_d100_139.Content[3]; long value_d116 = R_d100_139.Content[4]; long value_d120 = R_d100_139.Content[5]; long value_d124 = R_d100_139.Content[6]; long value_d128 = R_d100_139.Content[7]; long value_d132 = R_d100_139.Content[8]; long value_d136 = R_d100_139.Content[9]; } else { // failed }