I am also glad that you got this thing working to your satisfaction! Normally, I would think that these extra delays would not be necessary. I suggested that to simplify the situation (which is always a good idea for debugging). The delay that you have gives enough time for the command to be sent and for the radio to have already decided on its response. I suspect that there is something wrong with the hardware flow control handshake. What exactly is wrong is very configuration specific - could even be a hardware defect in your USB-Serial adaptor gizmo.

I run the CAT I/F at 38400 baud to talk to a K3. A normal contest logger will keep a steady stream of commands: what freq and mode are you on? to the radio - multiple times per second. This is "background polling noise" that is continuous. When I have the spectrum display attached, I get what is called a "waterfall" display of signal strengths over a range of frequencies. With one logger, I have macros like "100" or "20" that I type in. The logger sequences my macro's radio commands in between the normal polling so that there are not conflicts. With say the "100" command, normally the frequency display will be set up with my current frequency in the middle and I will see 50 KHz on either side. However, if say I am near the lower band edge, the display will show the lower band edge on the left and show 100 KHz up from that edge with my frequency shown wherever it happens to be. Some loggers do not allow me to write my own radio macros and those commands would come from a distinct, separate application. Therefore the need for this "man-in-the-middle" box to do the command sequencing to the radio. If my friend really wants this, I may have to write it in C. Or I suppose I could build a separate hardware box with an Arduino processor as a hardware solution.

In general, using fixed delays after some hardware (or software) command is a bad idea. However, your situation is simple enough that I wouldn't worry about it.


In reply to Re^2: Cannot write to, or read from, the SerialPort by Marshall
in thread 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.