Shop OBEX P1 Docs P2 Docs Learn Events
SERIN: SKIP without WAIT? — Parallax Forums

SERIN: SKIP without WAIT?

xanatosxanatos Posts: 1,120
edited 2013-04-28 09:47 in BASIC Stamp
Normally I'd just breadboard this and test but I'm not able to do that at the moment - quick question - Can SKIP be used without WAIT in a SERIN command?

Right now I have this:

SERIN Ctx, T9600, [WAIT("R"), SKIP 3, STR serStr\10]

Will this work:

SERIN Ctx, T9600, [SKIP 24, STR serStr\10]

This is of course assuming the datastring being SERIN'd is a guaranteed fixed-length with data positions being absolutely fixed within the stream...

The editor doesn't reject the format when I go to look at the memory map, so I'm guessing it should work. I've just never seen a skip without a wait :-)

Thanks!

Dave

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2013-04-28 09:29
    Sure, if you're good with disregarding the first three characters that come along after issuing that command, regardless, and then whatever happens happens.

    [ May I ask why you're asking? ]
  • Mike GreenMike Green Posts: 23,101
    edited 2013-04-28 09:43
    SKIP and WAIT each do what they're defined to do ...

    SKIP ignores the number of characters specified ... without looking at them ... with complete disregard for what they are

    WAIT ignores all incoming characters that do not match the specified character(s). Once a match occurs, the WAIT terminates with the next character processed normally
  • xanatosxanatos Posts: 1,120
    edited 2013-04-28 09:47
    Hi all, thanks. Sounds like what I was hoping to hear. PJ - the system I'm receiving the data from - newer units being added that have a different letter in their serial number. I've been being lazy and just listening for the R in the s/n, skipping the next three characters and just grabbing the last three digits of the s/n to ID which unit is sending. But to the best of my knowledge, data lengths and positions are fixed, so all I should need to do is skip the specified number of characters.

    Thanks!

    D
Sign In or Register to comment.