点击或拖拽改变大小

HslHelperWriteBoolAsync 方法

将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 Task<OperateResult> WriteBoolAsync(
	IReadWriteNet device,
	string address,
	bool[] value,
	int addressLength = 16,
	bool reverseByWord = false
)

参数

device
类型:HslCommunication.CoreIReadWriteNet
设备的通信对象
address
类型:SystemString
地址信息
value
类型:SystemBoolean
实际写入的bool数据信息
addressLength (Optional)
类型:SystemInt32
单位地址的占位长度信息
reverseByWord (Optional)
类型:SystemBoolean
是否根据字进行反转操作

返回值

类型:TaskOperateResult
bool数组的结果对象
参见