We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 26f6780 commit b170320Copy full SHA for b170320
examples/rtu.php
@@ -10,6 +10,13 @@
10
->setPort(502)
11
->setHost('127.0.0.1')
12
->setReadTimeoutSec(3) // increase read timeout to 3 seconds
13
+ ->setIsCompleteCallback(function ($binaryData, $streamIndex) {
14
+ // Do not check for complete TCP packet structure. Default implementation works only for Modbus TCP.
15
+ // Modbus TCP has 7 byte header and this function checks for it and whole packet to be complete. RTU does
16
+ // not have that.
17
+ // Read about differences here: https://www.simplymodbus.ca/TCP.htm
18
+ return true;
19
+ })
20
->build();
21
22
$startAddress = 256;
0 commit comments