setTransmitBuffer()
Description
Sets the value of the private array writeData
in the ModbusMasterNode
class. writeData
is the content of the Modbus packet using the Write function code.
Syntax
node1.setTransmitBuffer(index, value, mode)
Parameters
node1
: ModbusMasterNode
object.
index
: Index value of the writeData
array.
value
: The value to be filled in the writeData
array, i.e. the content of the Modbus packet to be sent.
mode
: The mode for reading data from the writeData
array. Its argument is MODBUS_DATAMODE_BIT
or MODBUS_DATAMODE_UINT16
. If no argument is given, it will be preset to MODBUS_DATAMODE_UINT16
.
Return
int
: If successful, return MODBUS_SUCCESS
, otherwise return EXCEPTION_CODE .
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
|
See Also
- clearTransmitBuffer()
– writeSingleCoil()
– writeSingleRegisters()
– writeMultipleCoils()
– writeMultipleRegisters()
– readWriteMultipleRegisters()
Library Reference Home Page
The text in the 86Duino reference is modified from the Arduino reference and is licensed under the Creative Commons Attribution-ShareAlike 3.0 License. The code examples in the reference have been released into the public domain.