franko has asked for the wisdom of the Perl Monks concerning the following question:
The serial monitor shows that my program is initializing the serial port and able to set baud, etc. However, the write command does not cause any serial output at all. I replaced the hex pack string with a simple text string as a test with a \n and a \r, but again, the command does nothing. I set perl.exe to run as administrator but that did not matter. It almost seems as if Windows is preventing me from writing to the serial port in some way. I turned off Windows Firewall but that did not help. Any ideas on how I can debug this one?#! C:\perl\bin\perl.exe use strict; use warnings; use Win32::SerialPort ; my $PortObj = new Win32::SerialPort ("COM1") || die "Can't open port\n"; $PortObj->baudrate(9600); $PortObj->parity("none"); $PortObj->databits(8); $PortObj->stopbits(1); $PortObj->write_settings || undef $PortObj; my $stt = pack 'H16', 'FF010003005F630A' ; $PortObj->write($stt); $PortObj->close || warn "Close Failed!\n"; undef $PortObj;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: can't write-Win32::SerialPort
by kschwab (Vicar) on May 15, 2014 at 18:28 UTC | |
by franko (Initiate) on May 15, 2014 at 20:44 UTC | |
by Anonymous Monk on May 15, 2014 at 21:51 UTC | |
by franko (Initiate) on May 15, 2014 at 22:50 UTC | |
by franko (Initiate) on May 15, 2014 at 22:34 UTC | |
|
Re: can't write-Win32::SerialPort
by Anonymous Monk on May 15, 2014 at 18:26 UTC |