Sample code to reach registers on Schneider IEM3355 Modbus energy meter

Although registers are well documented, I was unsuccessful using pymodbus3 and my own C client to read modbus data. Finally a stable version in perl:

use Device::Modbus::RTU::Client;
use warnings;
use Data::Dumper;

my $client = Device::Modbus::RTU::Client->new(
port => '/dev/ttyUSB0',
baudrate => 38400,
parity => 'even',

sub read_string
#where:as in the documentation
$where= shift;
$length = shift;

my $req = $client->read_holding_registers(
unit => 3, #might be different for you!
address => $where-1, #although it is 30 in doc, it is 29 in reality
quantity => $length,

my $resp = $client->receive_response;
my $t=$resp->values;

while ($i<$length) { $s.=chr($t->[$i]/256);
return $s;




boldi@supercell$ perl
name:Energy Meter
manufacturer:Schneider Electric

edit no. 4: I'm github publisher right now. I have to update my CV with new skills.

This entry was posted on February 23, 2018 at 7:00 pm and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply

You must be logged in to post a comment.