SOLVED - Breaking HSERIN into separate parts


+ Reply to Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,139


    Did you find this post helpful? Yes | No

    Default Re: SOLVED - Breaking HSERIN into separate parts

    The stop character in the Hserin command is needed if you do not know the length of the string.

    Since you define the length at the beginning of the transmission, and then use it in the STR modifier, what is the point of "]" in that modifier? It will never engage!

    Ioannis

  2. #2
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: SOLVED - Breaking HSERIN into separate parts

    Quote Originally Posted by Ioannis View Post
    ... what is the point of "]" in that modifier? It will never engage!

    Ioannis
    That was one area that had me overthinking USART. STR ArrayVar\n{\c}, receives a maximum of n bytes, unless it receives character c.

    If I misinterpreted the manual, I'd definitely appreciate being corrected before I code my entire project.


    Initially I was copying what Pedja was doing, but I've since dropped the Length parameter and use only the StartOfData and EndOfData delimiters. I have a LOT of different Data Layouts, and calculating Length was becoming tiresome, and a possible source of human error. It's also cumbersome when you modify the Data Layout.

    I am using variables in HSEROUT, an array (equal to the longest data layout) in HSERIN, which is then moved into variables depending on Header values; it's much more simple (for me).
    Last edited by Demon; - 19th September 2024 at 18:25.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,139


    Did you find this post helpful? Yes | No

    Default Re: SOLVED - Breaking HSERIN into separate parts

    OK, if you drop length then makes sense.

    Using length variable in the STR modifier on the other hand, is very clever.

    Ioannis

  4. #4
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: SOLVED - Breaking HSERIN into separate parts

    Quote Originally Posted by Ioannis View Post
    OK, if you drop length then makes sense. ...

    Yeah, I updated my post with a comment to clear that.


    Quote Originally Posted by Ioannis View Post
    Using length variable in the STR modifier on the other hand, is very clever. ...
    I didn't field particularly clever after racking my brains trying to find the most efficient way to move data around.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

Similar Threads

  1. Replies: 3
    Last Post: - 14th October 2016, 22:07
  2. Replies: 3
    Last Post: - 22nd June 2015, 16:15
  3. Breaking out of for loops
    By Kamikaze47 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 17th March 2008, 00:49
  4. Replies: 5
    Last Post: - 28th June 2006, 21:32
  5. Breaking through pages in PIC16 Series
    By crematory in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 1st August 2005, 13:49

Members who have read this thread : 10

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts