The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Device::Modbus::RTU - Perl distribution to implement Modbus RTU communications

SYNOPSIS

#! /usr/bin/env perl

use Device::Modbus::RTU::Client;
use strict;
use warnings;
use v5.10;

my $client = Device::Modbus::RTU::Client->new(
   port     => '/dev/ttyUSB0',
   baudrate => 19200,
   parity   => 'none',
);

my $req = $client->read_holding_registers(
   unit     => 4,
   address  => 0,
   quantity => 2,
);

$client->send_request($req);
my $resp = $client->receive_response;

DESCRIPTION

This distribution implements the Modbus RTU protocol on top of Device::Modbus. It includes both a client and a server, Device::Modbus::RTU::Client and Device::Modbus::RTU::Server.

SEE ALSO

Other distributions

These are other implementations of Modbus in Perl which may be well suited for your application: Protocol::Modbus, MBclient, mbserverd.

GITHUB REPOSITORY

You can find the repository of this distribution in GitHub.

AUTHOR

Julio Fraire, <julio.fraire@gmail.com>

COPYRIGHT AND LICENSE

Copyright (C) 2015 by Julio Fraire This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.2 or, at your option, any later version of Perl 5 you may have available.