GithubHelp home page GithubHelp logo

itonylee / phpmodbus Goto Github PK

View Code? Open in Web Editor NEW

This project forked from krakorj/phpmodbus

0.0 1.0 0.0 115 KB

Modbus library for PHP (Google code follower)

License: Other

PHP 88.62% Batchfile 1.66% HTML 9.72%

phpmodbus's Introduction

PayPayl donate button

phpmodbus

Implementation of the basic functionality of the Modbus TCP and UDP based protocol using PHP. This is the Google code project follower at https://code.google.com/p/phpmodbus/

Implemented features:

  • Modbus master
  • FC1 - Read coils
  • FC2 - Read input discretes
  • FC3 - Read holding registers
  • FC4 - Read holding input registers
  • FC5 - Write single coil
  • FC6 - Write single register
  • FC15 - Write multiple coils
  • FC16 - Write multiple registers
  • FC23 - Read/Write multiple registers

Example:

require_once dirname(__FILE__) . '/Phpmodbus/ModbusMaster.php'; 

// Modbus master UDP
$modbus = new ModbusMaster("192.168.1.1", "UDP"); 
// Read multiple registers
try {
    $recData = $modbus->readMultipleRegisters(0, 12288, 5); 
}
catch (Exception $e) {
    // Print error information if any
    echo $modbus;
    echo $e;
    exit;
}
// Print data in string format
echo PhpType::bytes2string($recData); 

For more see [http://code.google.com/p/phpmodbus/downloads/list documentation] or [http://code.google.com/p/phpmodbus/wiki/FAQ FAQ].

Note:

  • The PHP extension php_sockets.dll should be enabled (server php.ini file)

Bitdeli Badge

phpmodbus's People

Contributors

krakorj avatar bitdeli-chef avatar

Watchers

TonyLee avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.