Closed Elmatbaisaad closed 2 years ago
require DIR . '/../vendor/autoload.php';
$ip = 'tcp://127.0.0.1:12345'; $unitID = 0; $fc3 = ReadRegistersBuilder::newReadHoldingRegisters($ip,$unitID) ->int16(0,'Register:') ->build(); $reponseContainer = (new NonBlockingClient(['readTimeoutSec' => 0.2]))->sendRequests($fc3); print_r($reponseContainer->getData()); print_r($reponseContainer->getErrors());
You need to have PHP mbstring extension installed
mbstring
require DIR . '/../vendor/autoload.php';
$ip = 'tcp://127.0.0.1:12345'; $unitID = 0; $fc3 = ReadRegistersBuilder::newReadHoldingRegisters($ip,$unitID) ->int16(0,'Register:') ->build(); $reponseContainer = (new NonBlockingClient(['readTimeoutSec' => 0.2]))->sendRequests($fc3); print_r($reponseContainer->getData()); print_r($reponseContainer->getErrors());