PHP code example of fawno / modbus
1. Go to this page and download the library: Download fawno/modbus library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
fawno / modbus example snippets
// Load autoload
38 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);