IReadWriteNetReadInt16 方法 (String) |
读取16位的有符号的整型数据
Read 16-bit signed integer data
命名空间:
HslCommunication.Core
程序集:
HslCommunication (在 HslCommunication.dll 中) 版本:12.1.2.0 (12.1.2.0)
语法 OperateResult<short> ReadInt16(
string address
)
Function ReadInt16 (
address As String
) As OperateResult(Of Short)
OperateResult<short>^ ReadInt16(
String^ address
)
abstract ReadInt16 :
address : string -> OperateResult<int16>
参数
- address
- 类型:SystemString
起始地址
返回值
类型:
OperateResultInt16带有成功标识的short数据
示例
以下为三菱的连接对象示例,其他的设备读写情况参照下面的代码:
MelsecMcNet melsec_net = new MelsecMcNet( "192.168.0.100", 6000 );
short d100 = melsec_net.ReadInt16( "D100" ).Content;
OperateResult<short> R_d100 = melsec_net.ReadInt16( "D100" );
if (R_d100.IsSuccess)
{
short value = R_d100.Content;
}
else
{
}
参见