in reply to Re^2: Need help with Modbus
in thread Need help with Modbus
The $req variable gets the modbus reply.
#!/usr/bin/perl -l use strict; use warnings; use Protocol::Modbus; $|=1; my $modbus = Protocol::Modbus->new( driver => 'TCP', transport => 'TCP', ); my $trs = Protocol::Modbus::Transport->new( driver => 'TCP', address => '192.168.0.57', port => 502, timeout => 3, ); my $req = $modbus->request( function => 4, address => 1, quantity => 75, value => 0x0000, ); print "=" x 60; print "Response: ", $req; print "=" x 60; $trs->disconnect;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Need help with Modbus
by raulpena (Initiate) on Apr 26, 2013 at 18:24 UTC | |
by Khen1950fx (Canon) on Apr 27, 2013 at 03:31 UTC | |
by olibo (Initiate) on Aug 17, 2013 at 14:46 UTC | |
by Khen1950fx (Canon) on Aug 18, 2013 at 05:32 UTC | |
by olibo (Initiate) on Aug 20, 2013 at 19:28 UTC |