Shop OBEX P1 Docs P2 Docs Learn Events
SERIN Help Please — Parallax Forums

SERIN Help Please

ArchiverArchiver Posts: 46,084
edited 2004-01-12 00:42 in General Discussion
Hi Everyone!

My project is going really well! I think I am down to just one
technical hicup for my little robot.

Currently reading a DigiTape Plus electronic measuring tape. It has
a serial port on it.

Looks like I am getting probably all the information. Am having a
little problem and it is probably related to my variable and/or SERIN
formatting.

Example Input String:
" 5 ft 2 1/16 in"

I added the quotes so you would know exactly what it looks like.
Already wrote code to parse the string. Have to have it for another
part of the project.

My code looks something like:

Loop:
SEROUT .... 'Request data
SERIN TapeIn, N1200, ????????

'.... process'

GOTO Loop:

Please include how you would define the variable to hold the string.

Thanks!

Take care,
Frank

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2004-01-11 21:21
    Are you using a BS1? It would appear so from the N1200 parameter in
    your example. If that's the case, I think you're stuck. The problem is
    you just don't have enough variable space to capture the string and deal
    with. My favorite Stamp for capturing and parsing text strings is the
    BS2p or BS2pe which can capture any serial input to the Scratchpad RAM
    for processing later, without consuming any variable space.

    If you're using any of the BS2 family you can do it like this:

    buffer VAR Byte(16)

    Main:
    ' request data
    SERIN TapeIn, 17197, [noparse][[/noparse]buffer\16]
    ' process data



    -- Jon Williams
    -- Parallax



    Original Message
    From: franksmith512 [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=0UucCl9RxCONxkUJbuikf-hHl8b_o7PW6nHqfieXO4juuQ0VniSx7P3tekTf3IwBtvTdKdky5fNuvFKoig]franksmith512@y...[/url
    Sent: Sunday, January 11, 2004 2:52 PM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] SERIN Help Please


    Hi Everyone!

    My project is going really well! I think I am down to just one
    technical hicup for my little robot.

    Currently reading a DigiTape Plus electronic measuring tape. It has
    a serial port on it.

    Looks like I am getting probably all the information. Am having a
    little problem and it is probably related to my variable and/or SERIN
    formatting.

    Example Input String:
    " 5 ft 2 1/16 in"

    I added the quotes so you would know exactly what it looks like.
    Already wrote code to parse the string. Have to have it for another
    part of the project.

    My code looks something like:

    Loop:
    SEROUT .... 'Request data
    SERIN TapeIn, N1200, ????????

    '.... process'

    GOTO Loop:

    Please include how you would define the variable to hold the string.

    Thanks!

    Take care,
    Frank






    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject
    and Body of the message will be ignored.


    Yahoo! Groups Links

    To visit your group on the web, go to:
    http://groups.yahoo.com/group/basicstamps/

    To unsubscribe from this group, send an email to:
    basicstamps-unsubscribe@yahoogroups.com

    Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/




    This message has been scanned by WebShield. Please report SPAM to
    abuse@p....
  • ArchiverArchiver Posts: 46,084
    edited 2004-01-11 21:38
    In a message dated 1/11/2004 4:35:35 PM Eastern Standard Time,
    jwilliams@p... writes:


    > If you're using any of the BS2 family you can do it like this:
    >
    > buffer VAR Byte(16)
    >
    > Main:
    > ' request data
    > SERIN TapeIn, 17197, [noparse][[/noparse]buffer\16]
    > ' process data
    >
    >

    Jon, what happens if the incoming string is less than 16 bytes. I was
    getting ready to tell him the same thing, but then I couldn't answer the above
    question.

    Sid


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2004-01-11 23:32
    You can specify an ending character that will cause the rest of the
    array to be filled with zeros; if you don't SERIN will wait until enough
    bytes arrive.

    -- Jon Williams
    -- Parallax


    Original Message
    From: Newzed@a... [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=k13eCK5BGWhlkKS6W4lifZNCwfGa8m04nlD-pRIqDy7LL5ucJ9RE904c7HDvAbtiotFVbw]Newzed@a...[/url
    Sent: Sunday, January 11, 2004 3:38 PM
    To: basicstamps@yahoogroups.com
    Subject: Re: [noparse][[/noparse]basicstamps] SERIN Help Please


    In a message dated 1/11/2004 4:35:35 PM Eastern Standard Time,
    jwilliams@p... writes:


    > If you're using any of the BS2 family you can do it like this:
    >
    > buffer VAR Byte(16)
    >
    > Main:
    > ' request data
    > SERIN TapeIn, 17197, [noparse][[/noparse]buffer\16]
    > ' process data
    >
    >

    Jon, what happens if the incoming string is less than 16 bytes. I was
    getting ready to tell him the same thing, but then I couldn't answer the
    above
    question.

    Sid


    [noparse][[/noparse]Non-text portions of this message have been removed]


    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject
    and Body of the message will be ignored.


    Yahoo! Groups Links

    To visit your group on the web, go to:
    http://groups.yahoo.com/group/basicstamps/

    To unsubscribe from this group, send an email to:
    basicstamps-unsubscribe@yahoogroups.com

    Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/




    This message has been scanned by WebShield. Please report SPAM to
    abuse@p....
  • ArchiverArchiver Posts: 46,084
    edited 2004-01-12 00:10
    In a message dated 1/11/2004 6:36:06 PM Eastern Standard Time,
    jwilliams@p... writes:


    > You can specify an ending character that will cause the rest of the
    > array to be filled with zeros; if you don't SERIN will wait until enough
    > bytes arrive.
    >

    Jon, wouldn't the sending string have to have the same ending character.
    From what I understand the output of his electronic tape is cast in stone.

    Sid


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2004-01-12 00:25
    Based on his original post, he might use "n" as the ending character --
    that appears in his string and after the second portion of his
    measurement.

    -- Jon Williams
    -- Parallax


    Original Message
    From: Newzed@a... [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=IzJfS_TVm9wv8MwXcqgsgTZSiXjaAWMSTmdza7ZsK46q0c0KXHVqU4JvKmLpcdKZgj-_fPbU0g]Newzed@a...[/url
    Sent: Sunday, January 11, 2004 6:10 PM
    To: basicstamps@yahoogroups.com
    Subject: Re: [noparse][[/noparse]basicstamps] SERIN Help Please


    In a message dated 1/11/2004 6:36:06 PM Eastern Standard Time,
    jwilliams@p... writes:


    > You can specify an ending character that will cause the rest of the
    > array to be filled with zeros; if you don't SERIN will wait until
    > enough bytes arrive.
    >

    Jon, wouldn't the sending string have to have the same ending character.

    From what I understand the output of his electronic tape is cast in
    stone.

    Sid


    [noparse][[/noparse]Non-text portions of this message have been removed]


    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject
    and Body of the message will be ignored.


    Yahoo! Groups Links

    To visit your group on the web, go to:
    http://groups.yahoo.com/group/basicstamps/

    To unsubscribe from this group, send an email to:
    basicstamps-unsubscribe@yahoogroups.com

    Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/




    This message has been scanned by WebShield. Please report SPAM to
    abuse@p....
  • ArchiverArchiver Posts: 46,084
    edited 2004-01-12 00:42
    In a message dated 1/11/2004 7:28:29 PM Eastern Standard Time,
    jwilliams@p... writes:


    > Based on his original post, he might use "n" as the ending character --
    > that appears in his string and after the second portion of his
    > measurement.
    >

    Good thought, Jon [noparse]:)[/noparse])


    [noparse][[/noparse]Non-text portions of this message have been removed]
Sign In or Register to comment.