Skip to content

Commit b9079e6

Browse files
committed
Fix writeMiltipleBits for array
1 parent a09c4ce commit b9079e6

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Modbus Master-Slave Library for ESP8266/ESP32 v2.0
1+
# Modbus Master-Slave Library for ESP8266/ESP32 v2.1
22

33
This library allows your ESP8266/ESP32 to communicate via Modbus protocol. The Modbus is a master-slave protocol
44
used in industrial automation and can be used in other areas, such as home automation.
@@ -47,14 +47,13 @@ http://www.modbus.org/docs/Modbus_over_serial_line_V1_02.pdf
4747
## Last Changes
4848

4949
```diff
50-
// Internal changes
50+
// 2.0.0
5151
+ Remove memory allocation checking for small blocks as anyway firmware will fail if so low memory available.
5252
+ Change object's list implementation to *std::vector*
5353
+ Modbus class refactoring
5454
+ ModbusIP networking code refactoring and error reporting
5555
+ Global registers storage to share between multiple Modbus* instances
5656
+ Move rest of implementations from Modbus.h
57-
// Public API changes
5857
+ Modbus master implementation
5958
+ Move enum constants. E.g. MB_FC_READ_COIL => Modbus::FC_READ_COIL
6059
+ Back to marking private for onSet, onGet, addReg and Reg methods
@@ -74,15 +73,19 @@ http://www.modbus.org/docs/Modbus_over_serial_line_V1_02.pdf
7473
+ Fix readCoil\Hreg\Ists\Ireg not read value from slave
7574
+ Fix cresh on disconnect with Arduino Core 2.5.x
7675
// 2.1.0
77-
+ dropTransactions()
7876
+ Fix slave error response on write multiple Hreg\Coils
79-
+ Implement disconnect()
80-
- Modify slave task() for high query rate
81-
- Create destructor for ModbusIP
77+
+ Fix writeCoil() for multiple coils
78+
+ dropTransactions()
79+
+ disconnect()
80+
+ ~ModbusIP()
81+
+ task() cleanup
8282
- Modify examples
83-
// ToDo later
83+
// 2.2.0
8484
- code cleanup
85-
- ModbusSerial (over RS-485)
85+
- Implement Private Reg/Coil
86+
// 3.0.0
87+
- ModbusRTU (over RS-485)
88+
// ToDo later
8689
- Modbus Read/Write File Records function
8790
- Modbus Write Mask Register function
8891
- Modbus Serial line-specific functions

src/Modbus.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,8 @@ bool Modbus::writeSlaveBits(TAddress startreg, uint16_t to, uint16_t numregs, Fu
391391
_frame[5] = _len - 6;
392392
_frame[_len - 1] = 0; //Clean last probably partial byte
393393
if (data) {
394-
bitsToBool(data, _frame + 6, numregs);
394+
//bitsToBool(data, _frame + 6, numregs);
395+
boolToBits(_frame + 6, data, numregs);
395396
} else {
396397
getMultipleBits(_frame + 6, startreg, numregs);
397398
}

0 commit comments

Comments
 (0)