Re: win32 serial port



You are using 2 constructors that may be stepping on each others toes.
Opening the port with new may lock the port from being tied later. What
is in the $configfile, since it appears as though most of the
configuration is done in the script (although that configuration would
probably be undone by the loading of the file)? I'd say drop the tie
constructor for now and use write_method to ensure that you have proper
access to the port.

Saran.j.jegan@xxxxxxxxx wrote:
Hello , am using win32::serialport module to communicate with my
serial port device, this is my code

use Win32::SerialPort;
my $serial_port;
my $return;
my $quiet = 1;

$serial_port = Win32::SerialPort->new ($port,1) die "Can't open serial
port $port: $^E\n" unless ($serial_port);
my $configFile= 'ER400TRS.conf';
print LOG "configuration file: $configFile\n";
print "$configFile";
my $baud = $serial_port->baudrate(4800);
my $par = $serial_port->parity("even");
my $rint=$serial_port->read_interval;
my $data=$serial_port->databits(7);
my $stop=$serial_port->stopbits(1);
my $hshake=$serial_port->handshake;
my $rconst=$serial_port->read_const_time(100);
my $rchar=$serial_port->read_char_time(5);
my $wconst=$serial_port->write_const_time(100);
my $wchar=$serial_port->write_char_time(5);
my ($rbuf, $wbuf)= $serial_port->buffers;

$serial_port = tie (*FOO, 'Win32::SerialPort', $configFile)
|| die "Can't tie: $^E\n"; ## TIEHANDLE ##



$serial_port->close || die "\n close problem with $port\n";

undef $serial_port;



the code works fine i can write my data to the buffer but when am try
to use file handle to tie with config file
am getting the error access denied can't tie....can any suggest me ?




.



Relevant Pages

  • Re: PDAs with RS232
    ... I don't understand what you mean by "a tie in to a single device id". ... Driver registry settings that are in place and list the port ... available and listed within the correct "Active" registry group. ...
    (microsoft.public.pocketpc)
  • Our Croatia Trip
    ... we're doing it by boat, and will tie up in a different port each day, ... the boat's crew might be helpful, and open minds (another view might ...
    (rec.travel.europe)
  • Re: Our Croatia Trip
    ... This time it's Croatia, ... > we're doing it by boat, and will tie up in a different port each ... You will be going past Omis (a pretty little port with a river ... canals full of birdlife that you can tour in a small boat). ...
    (rec.travel.europe)
  • Mail listen on different port.
    ... come through on a different port. ... I have mail comming from two sorces and ... want to tie them down on my firewall, ... listen on that port so that I can lock my firewall down. ...
    (microsoft.public.exchange.admin)
  • Mail listen on different port
    ... come through on a different port. ... I have mail comming from two sorces and ... want to tie them down on my firewall, ... listen on that port so that I can lock my firewall down. ...
    (microsoft.public.windows.server.sbs)