将bool数组写入到设备中去,如果地址中包含了小数点,则使用字的方式读取数据,然后解析出位数据,再修改其中的位数据,然后写入到设备中去,解决那些没有位读写的功能码的设备的问题
Write the bool array into the device. If the address contains a decimal point, read the data in word form, then parse out the bit data, modify the bit data within it,
and then write it back into the device to solve the problem of devices without bit read and write function codes
命名空间:
HslCommunication.Core
程序集:
HslCommunication (在 HslCommunication.dll 中) 版本:12.3.1.0 (12.3.1.0)
语法public static OperateResult WriteBool(
IReadWriteNet device,
string address,
bool[] value,
int addressLength = 16,
bool reverseByWord = false
)
Public Shared Function WriteBool (
device As IReadWriteNet,
address As String,
value As Boolean(),
Optional addressLength As Integer = 16,
Optional reverseByWord As Boolean = false
) As OperateResult
public:
static OperateResult^ WriteBool(
IReadWriteNet^ device,
String^ address,
array<bool>^ value,
int addressLength = 16,
bool reverseByWord = false
)
static member WriteBool :
device : IReadWriteNet *
address : string *
value : bool[] *
?addressLength : int *
?reverseByWord : bool
(* Defaults:
let _addressLength = defaultArg addressLength 16
let _reverseByWord = defaultArg reverseByWord false
*)
-> OperateResult
参数
- device
- 类型:HslCommunication.CoreIReadWriteNet
设备的通信对象 - address
- 类型:SystemString
地址信息 - value
- 类型:SystemBoolean
实际写入的bool数据信息 - addressLength (Optional)
- 类型:SystemInt32
单位地址的占位长度信息 - reverseByWord (Optional)
- 类型:SystemBoolean
是否根据字进行反转操作
返回值
类型:
OperateResultbool数组的结果对象
参见