Shop OBEX P1 Docs P2 Docs Learn Events
Fix Parallax Serial Terminal so $0D can be user choice of newline or carriage return? - Page 2 — Parallax Forums

Fix Parallax Serial Terminal so $0D can be user choice of newline or carriage return?

2»

Comments

  • Jeff MartinJeff Martin Posts: 758
    edited 2013-10-11 14:31
    Chris B. wrote: »
    And, incidentally, that's what Parallax Serial Terminal does, too.

    Oh I know, that's why I said "output"... I wasn't referring to translation. PST was made to translate that way because of the original and implied intent of LF.
    Chris B. wrote: »
    ... a CR is used as a 'go back to the start of the same line' to overwrite.

    Yes, reflecting the original teletype machines. There's very little practical use for that these days.
    Chris B. wrote: »
    I prefer positive control of an app by setting preferences vs magic behavior, but that's just my two cents.

    Okay. Seems there's no nice way to solve the other direction automatically anyway. I'll reply to this thread when I have an update.
  • Dave HeinDave Hein Posts: 6,347
    edited 2013-10-11 14:44
    Jeff, I use a few programs at work that use the CR to go back to the start of the same line to overwrite. These programs use this technique to print a "progress" line without scrolling the display. It's a useful feature for the CR to not generate an automatic linefeed. So I don't believe your statement that "There's very little practical use for that these days" is correct. I would find it very useful if I could put PST into a mode that is supported by most terminal programs.
  • Jeff MartinJeff Martin Posts: 758
    edited 2013-10-11 14:55
    Okay, that's fair, I can see that it's useful in that way.

    What about line feed without moving the cursor?
  • SRLMSRLM Posts: 5,045
    edited 2013-10-11 15:17
    Shouldn't Parallax Serial Terminal, the SimpleIDE terminal, and the propeller-load terminal all behave the same way?

    propeller-load takes LFCR and will work properly with just a CR, which I like for making "live" displays like Dave Hein.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-10-11 16:36
    I don't know why the .exe has to be fixed. Try the attached replacement for Parallax Serial Terminal.spin. I've added a method, SetNewline, which lets you set the newline sequence to CR, LF, or CRLF (LFCR). Once set, if will ignore LFs if the newline is CR and vice-versa. If the newline is CRLF or LFCR, CR will return to the beginning of the current line, and LF will move the cursor down one line.

    -Phil
  • msrobotsmsrobots Posts: 3,709
    edited 2013-10-11 18:30
    @Phil,
    good idea. At least that can handle the double new line problem.

    @Heater
    yes - you where right.

    @Chris B.
    I wish I could handle the English language better than I do. But you wrote way better what I tried to explain.

    Most text based printer, teletype, and other serial device like barcode scanner use(ed?) these control codes (you named it RS232) and they do made sense.
    For text based interfaces CR to return to the beginning of the same line is very helpful.
    Even LF (without CR) is very helpful to produce intention for simple tables or printed graphs out of * or +.

    Later on terminals got smarter than that with vt52 el al. But for simplicity the only thing needed is as you stated:
    Radio button: (*) Enter button sends $0D$0A, ( ) Enter button sends $0D, ( ) Enter button sends $0A.
    Check box: [ ] Incoming $0D also moves cursor to next line (implicit LF)
    Check box: [ ] Incoming $0A also moves cursor to left margin (implicit CR)

    The defaults for these settings in preferences would mimic the current behavior, naturally.

    CR and LF should do what they are intended to by name already. And I also think that preferences are way better to deal with this as hidden magic.

    @Jeff
    I know that the LF without CR is not easy - but it would really be nice.

    Enjoy!

    Mike
  • Chris B.Chris B. Posts: 18
    edited 2013-10-14 17:55
    Jeff,

    I think this attention to users is really awesome, the other reason besides the rock-solid parts why Parallax is such a great company. I've got equipment that I've had to replace the VFD on due to fading while the BS2 driving the display is still going strong. Have been using Parallax microcontrollers to interface hardware to computers for a long time, at a minuscule fraction of the cost of a plug-in I/O board. We're not allowed to endorse--or I would. :-)

    But please, don't fix this first if you've got more awesome things to do on the plate.

    Regards,
    Chris
  • Chris B.Chris B. Posts: 18
    edited 2013-10-14 18:14
    I don't know why the .exe has to be fixed. Try the attached replacement for Parallax Serial Terminal.spin.

    Thanks for that Phil, it will be handy; what I'm wishing for in this thread is for the terminal built into the .exe to act like a Putty or Hyperterm window, and still be integrated with the Propeller Tool for the great convenience.
  • localrogerlocalroger Posts: 3,451
    edited 2013-10-14 18:48
    The issue isn't so much RS232 as ASCII, but it's closely related. It all does go back to the Model 33 teletype, which I learned on myself at the age of 10.

    CR with out LF has been used for overstriking well into the 1990's by some printout devices, but LF without CR became much less useful with the advent of dot-matrix printers which need to get the print head up to speed to print a character. However, these controls are used extensively for terminal cursor control along with more complex escape sequences dating back to the late 1970's.

    For about 10 years a major line of industrial printers which was not capable of doing CR without LF had a DIP switch option for "eat LF after CR." This handled the problem yet still allowed, for example, the value 10 to be included in escape-sequence bitmap definitions without mangling them.

    PST's insistence on double-spacing is indeed a major nuisance to those of us on the CRLF standard and I've adapted by simply never using it because I have my own self-created utilities which do exactly what I want. But for the n00bs it would probably be a good idea to make these common tools capable of handling all the standard usages.
Sign In or Register to comment.