fawno/modbus

Modbus RTU serial protocol in PHP

0.2.1 2022-03-10 00:37 UTC

This package is auto-updated.

Last update: 2024-12-10 06:36:08 UTC


README

GitHub license GitHub release Packagist PHP

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);