MqttRpcDeviceReadUInt16Async 方法 (String) |
异步读取16位的无符号整型
Asynchronously read 16-bit unsigned integer
命名空间:
HslCommunication.MQTT
程序集:
HslCommunication (在 HslCommunication.dll 中) 版本:12.1.2.0 (12.1.2.0)
语法 public Task<OperateResult<ushort>> ReadUInt16Async(
string address
)
Public Function ReadUInt16Async (
address As String
) As Task(Of OperateResult(Of UShort))
public:
virtual Task<OperateResult<unsigned short>^>^ ReadUInt16Async(
String^ address
) sealed
abstract ReadUInt16Async :
address : string -> Task<OperateResult<uint16>>
override ReadUInt16Async :
address : string -> Task<OperateResult<uint16>>
参数
- address
- 类型:SystemString
起始地址
返回值
类型:
TaskOperateResultUInt16带有成功标识的ushort数据
实现
IReadWriteNetReadUInt16Async(String)示例
以下为三菱的连接对象示例,其他的设备读写情况参照下面的代码:
MelsecMcNet melsec_net = new MelsecMcNet( "192.168.0.100", 6000 );
ushort d100 = (await melsec_net.ReadUInt16Async( "D100" )).Content;
OperateResult<ushort> R_d100 = await melsec_net.ReadUInt16Async( "D100" );
if (R_d100.IsSuccess)
{
ushort value = R_d100.Content;
}
else
{
}
参见