ModbusInfoBuildReadWriteModbusCommand 方法 |
构建一个同时读写的命令报文,指定读取地址,读取长度,写入地址,写入的字节数据信息,然后整个命令返回读取成功的字节数据信息
命名空间:
HslCommunication.ModBus
程序集:
HslCommunication (在 HslCommunication.dll 中) 版本:12.1.2.0 (12.1.2.0)
语法 public static OperateResult<byte[]> BuildReadWriteModbusCommand(
string readAddress,
ushort length,
string writeAddress,
byte[] value,
byte station,
bool isStartWithZero,
byte defaultFunction
)
Public Shared Function BuildReadWriteModbusCommand (
readAddress As String,
length As UShort,
writeAddress As String,
value As Byte(),
station As Byte,
isStartWithZero As Boolean,
defaultFunction As Byte
) As OperateResult(Of Byte())
public:
static OperateResult<array<unsigned char>^>^ BuildReadWriteModbusCommand(
String^ readAddress,
unsigned short length,
String^ writeAddress,
array<unsigned char>^ value,
unsigned char station,
bool isStartWithZero,
unsigned char defaultFunction
)
static member BuildReadWriteModbusCommand :
readAddress : string *
length : uint16 *
writeAddress : string *
value : byte[] *
station : byte *
isStartWithZero : bool *
defaultFunction : byte -> OperateResult<byte[]>
参数
- readAddress
- 类型:SystemString
读取的地址信息 - length
- 类型:SystemUInt16
读取的地址长度 - writeAddress
- 类型:SystemString
写入的地址信息 - value
- 类型:SystemByte
写入的字节数据 - station
- 类型:SystemByte
站号信息 - isStartWithZero
- 类型:SystemBoolean
起始地址是否从0开始 - defaultFunction
- 类型:SystemByte
默认的功能码
返回值
类型:
OperateResultByte包含最终命令的结果对象
参见