Thanks for such speedy input!
1. Serial monitor: I see output from the dotnet program so the monitor is working.
2. I opened a privileged command prompt and still get the same problem.
3.I reassigned the com port to 1 and am using it successfully with the dotnet program. I don't get an open error on Com 1. It did not work on com 3, which as you point out, was the initial default.
I updated the program and have some error messsges output:
#! C:\perl\bin\perl.exe
use strict;
use warnings;
use Win32::SerialPort ;
my $count_out = 0;
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->handshake("none");
$PortObj->write_settings || undef $PortObj;
my $stt = pack 'H16', 'FF010003005F630A' ;
# $PortObj->write($stt);
$count_out = $PortObj->write($stt);
warn "write failed\n" unless $count_out;
warn "write incomplete\n" if $count_out != length($stt);
$PortObj->error_msg(1);
$PortObj->user_msg(1);
$PortObj->close || warn "Close Failed!\n";
undef $PortObj;
# output from program:
# C:\Users\Frank\Desktop>micro-2.pl
# Write failed
# Use of uninitialized value $count_out in numeric ne (!=) at C:\Users
+\Frank\Deskttop\micro-2.pl line 34.
# Write incomplete
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.