#!/usr/bin/perl use strict; use vars qw($ob $port1 $return); use Win32::SerialPort; $port1="COM1"; $ob = Win32::SerialPort->new($port1) || die "Can't open $port1: $!"; $ob->baudrate (9600) || die "fail setting baudrate"; $ob->parity ("even") || die "fail setting parity"; $ob->databits (7) || die "fail setting databits"; $ob->stopbits (1) || die "fail setting stopbits"; $ob->handshake ("none") || die "fail setting handshake"; $ob->write_settings || die "no settings"; system "cls"; # Read Port Configuration my $baud=$ob->baudrate; my $parity=$ob->parity; my $data=$ob->databits; my $stop=$ob->stopbits; my $hshake=$ob->handshake; print "### Projekt Plasma ###\n\n"; print "Schnittstelle: $port1\nBaudrate: $baud\nParity: $parity\nDatabits: $data\nStopbits: $stop\nHandschake: $hshake\n\n"; my $tx="L00 -k .033 -0 -8.516,0 -1 .0025%\r"; $ob->write("$tx") or die ("Could not write to PC: $!"); sleep 1; $return=$ob->input; undef $ob;