I can write to, and read from, a TRENDnet TU-S9 USB to RS-232 Adapter via AppleScript and Python; not with Perl.
I cannot figure what I maybe missing or configured improperly.
Any Assistance is welcomed and appreciated.

#!/usr/local/bin/perl use strict; # Computer: iMac 2017;, USB to Serial Adapter: TRENDnet TU-S9; # Just showing the Locations of the 'SerialPort' Files. #use lib "/usr/local/lib/perl5/site_perl/5.36.0/darwin-2level/auto/Dev +ice/SerialPort/SerialPort.bundle"; #use lib "/usr/local/lib/perl5/site_perl/5.36.0/darwin-2level/Device/S +erialPort/SerialPort.pm"; use Device::SerialPort; # I tried each of the below my $port = Device::SericalPort->new ...Lin +es of Code. #my $port = Device::SerialPort->new("/dev/cu.usbserial"); #my $port = Device::SerialPort->new("/dev/tty.usbserial"); #my $port = Device::SerialPort->new("/dev/ttys0"); my $port = Device::SerialPort->new("/dev/ttys1"); # Like the three (3 +) Lines above, this Driver produces the same Result. # The below Parameters are from my AppleScript and Python Code , which + both work flawlessly via the TRENDnet TU-S9. $port->databits(8); $port->baudrate(4800); $port->handshake("rts"); $port->parity("none"); $port->stopbits(1); #$port->write_settings || undef $port; print "01"; print "\n"; $port->write("FA21050000;"); # Write "FA21050000;" Hz to Yaesu FTdx-1 +200 Transceiver to set VFO-A Frequency. # The VFO-A Frequency is NOT changed. print "02"; print "\n"; $port->write("FB;"); # Write "FB;" to FTdx-1200 to have Trans +ceiver place Frequency of VFO-B into its Buffer. my $byte=$port->read(11); # Read the VFO-B Frequency, in "FBXXXXXX +XX;" Format print "$byte"; # Print expected returned Frequency, in +"FBXXXXXXXX;" Format, where XXXXXXXX is Freq. in Hz. print "\n"; #The VFO-B Frequency is NOT retreived from the FTdx-1200 Transceiver. print "03"; print "\n"; $port->close();

Instead of seeing: 01 ... followed by the, Variable Frequency Oscillator, VFO-A change to '21050000' Hz- which does not occur.
02
FBXXXXXXXX; ... where 'XXXXXXXX' is the Frequency, in Hz, which is what ever VFO-B is set to.
03
... what is displayed is:
01 ... VFO-A is not changed to '21050000' Hz.
02

03


In reply to Cannot write to, or read from, the SerialPort by macdev

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.