---MODBUS Packet details--- Slave address: 1 Read Write: 6 Start Address 1: 01 Start Address 2: 2c Value 1: ff Value 2: 9b CRC 1: 73 CRC 2: 164 ASCII characters sent: !,ÿI¤! Buff data: !,I¤! #### $data = join('',@buffor); #Modbus frame to scalar # chomp($data); print "ASCII characters sent: !$data!\n"; if ($Telnet) { $pass=$ob->print($data) or warn "Modbus client : problem with send: $!\n"; } else { $pass=$ob->write($data) or warn "Modbus client : problem with send: $!\n"; } if ($Telnet) { # Telnet $TimeOut = int($TimeOut / 1000); # Convert to seconds $ob->errmode('return'); my $i = 0; do { $Buffer = $ob->get(TimeOut => 1); print "Buff data: !$Buffer!\n"; if (defined($Buffer)) { $i = 0; $Reply .= $Buffer; } else { $i++; } } until ((! defined($Buffer) and $i >= $TimeOut) or length($Reply) >= 8);