DLT645With1997OverTcpReadDouble 方法 (String, UInt16) |
读取双浮点数据的数组
Read double floating point data array
命名空间:
HslCommunication.Instrument.DLT
程序集:
HslCommunication (在 HslCommunication.dll 中) 版本:12.1.2.0 (12.1.2.0)
语法 public override OperateResult<double[]> ReadDouble(
string address,
ushort length
)
Public Overrides Function ReadDouble (
address As String,
length As UShort
) As OperateResult(Of Double())
public:
virtual OperateResult<array<double>^>^ ReadDouble(
String^ address,
unsigned short length
) override
abstract ReadDouble :
address : string *
length : uint16 -> OperateResult<float[]>
override ReadDouble :
address : string *
length : uint16 -> OperateResult<float[]>
参数
- address
- 类型:SystemString
起始地址 - length
- 类型:SystemUInt16
数组长度
返回值
类型:
OperateResultDouble带有成功标识的double数组
实现
IReadWriteNetReadDouble(String, UInt16)IReadWriteNetReadDouble(String, UInt16)备注
地址可以携带地址域信息,例如 "s=2;B6-11" 或是 "s=100000;B6-11",关于数据域信息,需要查找手册,例如:B6-30 表示: 瞬时有功功率
示例
以下为三菱的连接对象示例,其他的设备读写情况参照下面的代码:
MelsecMcNet melsec_net = new MelsecMcNet( "192.168.0.100", 6000 );
double[] d100_139 = melsec_net.ReadDouble( "D100", 10 ).Content;
OperateResult<double[]> R_d100_139 = melsec_net.ReadDouble( "D100", 10 );
if (R_d100_139.IsSuccess)
{
double value_d100 = R_d100_139.Content[0];
double value_d104 = R_d100_139.Content[1];
double value_d108 = R_d100_139.Content[2];
double value_d112 = R_d100_139.Content[3];
double value_d116 = R_d100_139.Content[4];
double value_d120 = R_d100_139.Content[5];
double value_d124 = R_d100_139.Content[6];
double value_d128 = R_d100_139.Content[7];
double value_d132 = R_d100_139.Content[8];
double value_d136 = R_d100_139.Content[9];
}
else
{
}
参见