fawno / modbus
Modbus RTU serial protocol in PHP
0.2.1
2022-03-10 00:37 UTC
Requires
- php: >=7.4.0
- ext-dio: >=0.2.0
- fawno/php-serial: >=2.0.0
README
Modbus RTU serial protocol in PHP
Install
composer require fawno/modbus
Example
<?php // Load autoload require 'vendor/autoload.php'; // Pre-load Modbus DDS238 implementation use Fawno\Modbus\ModbusDDS238; // Configure port and open it $dds238 = new ModbusDDS238('COM4'); $dds238->open(); // Read parsed data $data = $dds238->read(); // Read data as raw $data_raw = $dds238->read(); // Parse raw data $data = $dds238->parse($data_raw);