#!/usr/bin/perl -w use strict; use Device::SerialPort; my $rs485_port = Device::SerialPort->new("/dev/ttyUSB1",1); $rs485_port->baudrate(256000); $rs485_port->parity("none"); $rs485_port->databits(8); $rs485_port->stopbits(1); $rs485_port->handshake("xoff"); $rs485_port->write_settings; $rs485_port->stty_echo("off"); $rs485_port->lookclear; $rs485_port->purge_rx; my $antwort = ""; my $zeichen = ""; my $count=0; while ($count<10000) { $count=$count+1; $zeichen=$rs485_port->read(1); $antwort=$antwort.$zeichen; if ($zeichen eq ";") { print "$antwort\n"; my $antwort = ""; my $zeichen = ""; } }