Shop OBEX P1 Docs P2 Docs Learn Events
serin / wait problem... — Parallax Forums

serin / wait problem...

ArchiverArchiver Posts: 46,084
edited 2002-11-12 10:36 in General Discussion
Hello fellow stampers...
I'm using bs2sx...
I have a situaltion where I am using the serin and "wait" command to control
program flow depending on data received. If I receive "ab" I want one
option, and if I receive anything else I want another option.
The "wait" command doesnt seem to work properly if you use a timeout time
and label, as shown below...

serin serinpin,baud,1000,nodata,[noparse][[/noparse]wait ("ab"),databyte]
do something if "ab" comes in
nodata:
do something if "ab" not received after timeout period


I thought it should wait for the timeout period, and if "ab" is not
received, then go to the "nodata" label. It seems that if any data comes at
all, it will act as though "ab" has been received. The only way to get it to
go to the "nodata" label is to stop the stamp receiving data on the serin
pin.

Any thoughts would be appreciated..

Best regards, and thanks in advance if you can help,
Chris
Australind
Western Australia

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-11-11 12:50
    At 08:28 PM 11/11/2002 +0800, you wrote:
    >Hello fellow stampers...
    >I'm using bs2sx...
    >I have a situaltion where I am using the serin and "wait" command to control
    >program flow depending on data received. If I receive "ab" I want one
    >option, and if I receive anything else I want another option.
    >The "wait" command doesnt seem to work properly if you use a timeout time
    >and label, as shown below...
    >
    >serin serinpin,baud,1000,nodata,[noparse][[/noparse]wait ("ab"),databyte]
    > do something if "ab" comes in
    >nodata:
    > do something if "ab" not received after timeout period
    >
    >
    >I thought it should wait for the timeout period, and if "ab" is not
    >received, then go to the "nodata" label. It seems that if any data comes at
    >all, it will act as though "ab" has been received. The only way to get it to
    >go to the "nodata" label is to stop the stamp receiving data on the serin
    >pin.
    >
    >Any thoughts would be appreciated..
    >
    >Best regards, and thanks in advance if you can help,
    >Chris
    >Australind
    >Western Australia
    Hi Chris -

    The TIMEOUT parameter is exactly what it says it is, and no more. It's not a
    "NOT FOUND" facility, although in some circumstances it may act that way.

    Is there some reason why you can't just read in the data with no WAIT
    parameter and check the incoming data for whatever characters you wish to
    process, and loop back to the SERIN if you didn't get what you want ?

    Regards,

    Bruce Bates




    >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.
    >
    >
    >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2002-11-11 12:58
    Hello Bruce, and thanks for the prompt reply.

    No, I dont have enough time to do a serin and then process the data.
    I am actually reading data in from an RF tag ID system, and doing a QUICK
    check to see if the RF tag is still present, by looking at the first 2
    charachters in a 20 byte charachter stream.
    The second byte is different if a valid RF key is in proximity of the
    reader. The problem I have is that I am also counting reasonably fast pulses
    (80 hz) at the same time, thats why I just wanted to have a quick look for
    the "ab" that signifies an RF key is present and then get straight back to
    my pulse counting routine. I have done it for now by just looking at the
    byte following "a", but this is not really as secure as I would like, as
    there may be another "a" elsewhere in the data stream making the next
    character not the correct one to look at (I hope somehow that makes sense)

    Regards,
    Chris


    Original Message
    From: "Bruce Bates" <bvbates@u...>
    To: <basicstamps@yahoogroups.com>
    Sent: Monday, November 11, 2002 8:50 PM
    Subject: Re: [noparse][[/noparse]basicstamps] serin / wait problem...


    > At 08:28 PM 11/11/2002 +0800, you wrote:
    > >Hello fellow stampers...
    > >I'm using bs2sx...
    > >I have a situaltion where I am using the serin and "wait" command to
    control
    > >program flow depending on data received. If I receive "ab" I want one
    > >option, and if I receive anything else I want another option.
    > >The "wait" command doesnt seem to work properly if you use a timeout time
    > >and label, as shown below...
    > >
    > >serin serinpin,baud,1000,nodata,[noparse][[/noparse]wait ("ab"),databyte]
    > > do something if "ab" comes in
    > >nodata:
    > > do something if "ab" not received after timeout period
    > >
    > >
    > >I thought it should wait for the timeout period, and if "ab" is not
    > >received, then go to the "nodata" label. It seems that if any data comes
    at
    > >all, it will act as though "ab" has been received. The only way to get it
    to
    > >go to the "nodata" label is to stop the stamp receiving data on the serin
    > >pin.
    > >
    > >Any thoughts would be appreciated..
    > >
    > >Best regards, and thanks in advance if you can help,
    > >Chris
    > >Australind
    > >Western Australia
    > Hi Chris -
    >
    > The TIMEOUT parameter is exactly what it says it is, and no more. It's not
    a
    > "NOT FOUND" facility, although in some circumstances it may act that way.
    >
    > Is there some reason why you can't just read in the data with no WAIT
    > parameter and check the incoming data for whatever characters you wish to
    > process, and loop back to the SERIN if you didn't get what you want ?
    >
    > Regards,
    >
    > Bruce Bates
    >
    >
    >
    >
    > >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.
    > >
    > >
    > >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    > 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.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2002-11-11 17:17
    Hi Chris

    The timeout option is hard to use on a simple radio connection,
    because of noise. The timeout counter is reset to zero with every
    character that arrives. (Not the whole message) So your program
    gets stuck at the SERIN instruction.

    Your timeout parameter was one second. That is time for a lot of
    noise to come in, also time for a lot of BS2 processing. Is the
    Stamp sending something out to stimulate the RFiD response.

    -- Tracy


    >Hello Bruce, and thanks for the prompt reply.
    >
    >No, I dont have enough time to do a serin and then process the data.
    >I am actually reading data in from an RF tag ID system, and doing a QUICK
    >check to see if the RF tag is still present, by looking at the first 2
    >charachters in a 20 byte charachter stream.
    >The second byte is different if a valid RF key is in proximity of the
    >reader. The problem I have is that I am also counting reasonably fast pulses
    >(80 hz) at the same time, thats why I just wanted to have a quick look for
    >the "ab" that signifies an RF key is present and then get straight back to
    >my pulse counting routine. I have done it for now by just looking at the
    >byte following "a", but this is not really as secure as I would like, as
    >there may be another "a" elsewhere in the data stream making the next
    >character not the correct one to look at (I hope somehow that makes sense)
    >
    >Regards,
    >Chris
    >
    >
    >
    Original Message
    >From: "Bruce Bates" <bvbates@u...>
    >To: <basicstamps@yahoogroups.com>
    >Sent: Monday, November 11, 2002 8:50 PM
    >Subject: Re: [noparse][[/noparse]basicstamps] serin / wait problem...
    >
    >
    > > At 08:28 PM 11/11/2002 +0800, you wrote:
    > > >Hello fellow stampers...
    > > >I'm using bs2sx...
    > > >I have a situaltion where I am using the serin and "wait" command to
    >control
    > > >program flow depending on data received. If I receive "ab" I want one
    > > >option, and if I receive anything else I want another option.
    > > >The "wait" command doesnt seem to work properly if you use a timeout time
    > > >and label, as shown below...
    > > >
    > > >serin serinpin,baud,1000,nodata,[noparse][[/noparse]wait ("ab"),databyte]
    > > > do something if "ab" comes in
    > > >nodata:
    > > > do something if "ab" not received after timeout period
    > > >
    > > >
    > > >I thought it should wait for the timeout period, and if "ab" is not
    > > >received, then go to the "nodata" label. It seems that if any data comes
    >at
    > > >all, it will act as though "ab" has been received. The only way to get it
    >to
    > > >go to the "nodata" label is to stop the stamp receiving data on the serin
    > > >pin.
    > > >
    > > >Any thoughts would be appreciated..
    > > >
    > > >Best regards, and thanks in advance if you can help,
    > > >Chris
    > > >Australind
    > > >Western Australia
    > > Hi Chris -
    > >
    > > The TIMEOUT parameter is exactly what it says it is, and no more. It's not
    >a
    > > "NOT FOUND" facility, although in some circumstances it may act that way.
    > >
    > > Is there some reason why you can't just read in the data with no WAIT
    > > parameter and check the incoming data for whatever characters you wish to
    > > process, and loop back to the SERIN if you didn't get what you want ?
    > >
    > > Regards,
    > >
    > > Bruce Bates
    > >
    > >
    > >
    > >
    > > >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.
    > > >
    > > >
    > > >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    > >
    > >
    > > 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.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    > >
    > >
    >
    >
    >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.
    >
    >
    >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2002-11-11 22:31
    Hello Tracy,
    The 1 second in my example is just an example, I am actually using 50, which
    is very short with bs2sx.
    I think you have answered by saying that the timeout resets for each
    character received.
    There also is no sample in the manual for using timeout with wait, so it may
    be that its just not possible.
    I am happy to leave it as is, just waiting for the first character then
    checking the second for now, but I will continue playing with it a bit.

    Thanks for your help,
    Chris

    Original Message
    From: "Tracy Allen" <tracy@e...>
    To: <basicstamps@yahoogroups.com>
    Sent: Tuesday, November 12, 2002 1:17 AM
    Subject: Re: [noparse][[/noparse]basicstamps] serin / wait problem...


    > Hi Chris
    >
    > The timeout option is hard to use on a simple radio connection,
    > because of noise. The timeout counter is reset to zero with every
    > character that arrives. (Not the whole message) So your program
    > gets stuck at the SERIN instruction.
    >
    > Your timeout parameter was one second. That is time for a lot of
    > noise to come in, also time for a lot of BS2 processing. Is the
    > Stamp sending something out to stimulate the RFiD response.
    >
    > -- Tracy
    >
    >
    > >Hello Bruce, and thanks for the prompt reply.
    > >
    > >No, I dont have enough time to do a serin and then process the data.
    > >I am actually reading data in from an RF tag ID system, and doing a QUICK
    > >check to see if the RF tag is still present, by looking at the first 2
    > >charachters in a 20 byte charachter stream.
    > >The second byte is different if a valid RF key is in proximity of the
    > >reader. The problem I have is that I am also counting reasonably fast
    pulses
    > >(80 hz) at the same time, thats why I just wanted to have a quick look
    for
    > >the "ab" that signifies an RF key is present and then get straight back
    to
    > >my pulse counting routine. I have done it for now by just looking at the
    > >byte following "a", but this is not really as secure as I would like, as
    > >there may be another "a" elsewhere in the data stream making the next
    > >character not the correct one to look at (I hope somehow that makes
    sense)
    > >
    > >Regards,
    > >Chris
    > >
    > >
    > >
    Original Message
    > >From: "Bruce Bates" <bvbates@u...>
    > >To: <basicstamps@yahoogroups.com>
    > >Sent: Monday, November 11, 2002 8:50 PM
    > >Subject: Re: [noparse][[/noparse]basicstamps] serin / wait problem...
    > >
    > >
    > > > At 08:28 PM 11/11/2002 +0800, you wrote:
    > > > >Hello fellow stampers...
    > > > >I'm using bs2sx...
    > > > >I have a situaltion where I am using the serin and "wait" command to
    > >control
    > > > >program flow depending on data received. If I receive "ab" I want one
    > > > >option, and if I receive anything else I want another option.
    > > > >The "wait" command doesnt seem to work properly if you use a timeout
    time
    > > > >and label, as shown below...
    > > > >
    > > > >serin serinpin,baud,1000,nodata,[noparse][[/noparse]wait ("ab"),databyte]
    > > > > do something if "ab" comes in
    > > > >nodata:
    > > > > do something if "ab" not received after timeout period
    > > > >
    > > > >
    > > > >I thought it should wait for the timeout period, and if "ab" is not
    > > > >received, then go to the "nodata" label. It seems that if any data
    comes
    > >at
    > > > >all, it will act as though "ab" has been received. The only way to
    get it
    > >to
    > > > >go to the "nodata" label is to stop the stamp receiving data on the
    serin
    > > > >pin.
    > > > >
    > > > >Any thoughts would be appreciated..
    > > > >
    > > > >Best regards, and thanks in advance if you can help,
    > > > >Chris
    > > > >Australind
    > > > >Western Australia
    > > > Hi Chris -
    > > >
    > > > The TIMEOUT parameter is exactly what it says it is, and no more. It's
    not
    > >a
    > > > "NOT FOUND" facility, although in some circumstances it may act that
    way.
    > > >
    > > > Is there some reason why you can't just read in the data with no WAIT
    > > > parameter and check the incoming data for whatever characters you wish
    to
    > > > process, and loop back to the SERIN if you didn't get what you want ?
    > > >
    > > > Regards,
    > > >
    > > > Bruce Bates
    > > >
    > > >
    > > >
    > > >
    > > > >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.
    > > > >
    > > > >
    > > > >Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
    > > >
    > > >
    > > > 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.
    > > >
    > > >
    > > > Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
    > > >
    > > >
    > >
    > >
    > >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.
    > >
    > >
    > >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    > 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.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2002-11-12 01:19
    Hi Chris,

    Similar headaches can come from a modem on a noisy line. A SERIN
    command with a timeout can get locked up waiting for input that never
    comes. I ended up using a watchdog coprocessor to monitor my modem
    systems, to break in if something happens (or doesn't). I guess you
    could have a coprocessor dedicated to monitor your radio input for
    the presence of a tag.

    -- Tracy


    >Hello Tracy,
    >The 1 second in my example is just an example, I am actually using 50, which
    >is very short with bs2sx.
    >I think you have answered by saying that the timeout resets for each
    >character received.
    >There also is no sample in the manual for using timeout with wait, so it may
    >be that its just not possible.
    >I am happy to leave it as is, just waiting for the first character then
    >checking the second for now, but I will continue playing with it a bit.
    >
    >Thanks for your help,
    >Chris
    >
    >
    Original Message
    >From: "Tracy Allen" <tracy@e...>
    >To: <basicstamps@yahoogroups.com>
    >Sent: Tuesday, November 12, 2002 1:17 AM
    >Subject: Re: [noparse][[/noparse]basicstamps] serin / wait problem...
    >
    >
    >> Hi Chris
    >>
    >> The timeout option is hard to use on a simple radio connection,
    >> because of noise. The timeout counter is reset to zero with every
    >> character that arrives. (Not the whole message) So your program
    >> gets stuck at the SERIN instruction.
    >>
    >> Your timeout parameter was one second. That is time for a lot of
    >> noise to come in, also time for a lot of BS2 processing. Is the
    >> Stamp sending something out to stimulate the RFiD response.
    >>
    >> -- Tracy
    >>
    >>
    >> >Hello Bruce, and thanks for the prompt reply.
    >> >
    >> >No, I dont have enough time to do a serin and then process the data.
    >> >I am actually reading data in from an RF tag ID system, and doing a QUICK
    >> >check to see if the RF tag is still present, by looking at the first 2
    >> >charachters in a 20 byte charachter stream.
    >> >The second byte is different if a valid RF key is in proximity of the
    >> >reader. The problem I have is that I am also counting reasonably fast
    >pulses
    >> >(80 hz) at the same time, thats why I just wanted to have a quick look
    >for
    >> >the "ab" that signifies an RF key is present and then get straight back
    >to
    >> >my pulse counting routine. I have done it for now by just looking at the
    >> >byte following "a", but this is not really as secure as I would like, as
    >> >there may be another "a" elsewhere in the data stream making the next
    >> >character not the correct one to look at (I hope somehow that makes
    >sense)
    >> >
    >> >Regards,
    >> >Chris
    >> >
    >> >
    >> >
    Original Message
    >> >From: "Bruce Bates" <bvbates@u...>
    >> >To: <basicstamps@yahoogroups.com>
    >> >Sent: Monday, November 11, 2002 8:50 PM
    > > >Subject: Re: [noparse][[/noparse]basicstamps] serin / wait problem...
    > > >
    > > >
    > > > > At 08:28 PM 11/11/2002 +0800, you wrote:
    > > > > >Hello fellow stampers...
    > > > > >I'm using bs2sx...
    > > > > >I have a situaltion where I am using the serin and "wait" command to
    >> >control
    >> > > >program flow depending on data received. If I receive "ab" I want one
    >> > > >option, and if I receive anything else I want another option.
    >> > > >The "wait" command doesnt seem to work properly if you use a timeout
    >time
    >> > > >and label, as shown below...
    >> > > >
    >> > > >serin serinpin,baud,1000,nodata,[noparse][[/noparse]wait ("ab"),databyte]
    >> > > > do something if "ab" comes in
    >> > > >nodata:
    >> > > > do something if "ab" not received after timeout period
    >> > > >
    >> > > >
    >> > > >I thought it should wait for the timeout period, and if "ab" is not
    >> > > >received, then go to the "nodata" label. It seems that if any data
    >comes
    >> >at
    >> > > >all, it will act as though "ab" has been received. The only way to
    >get it
    >> >to
    >> > > >go to the "nodata" label is to stop the stamp receiving data on the
    >serin
    >> > > >pin.
    >> > > >
    >> > > >Any thoughts would be appreciated..
    >> > > >
    >> > > >Best regards, and thanks in advance if you can help,
    >> > > >Chris
    >> > > >Australind
    >> > > >Western Australia
    >> > > Hi Chris -
    >> > >
    >> > > The TIMEOUT parameter is exactly what it says it is, and no more. It's
    >not
    >> >a
    >> > > "NOT FOUND" facility, although in some circumstances it may act that
    >way.
    >> > >
    >> > > Is there some reason why you can't just read in the data with no WAIT
    >> > > parameter and check the incoming data for whatever characters you wish
    >to
    >> > > process, and loop back to the SERIN if you didn't get what you want ?
    >> > >
    >> > > Regards,
    >> > >
    >> > > Bruce Bates
    >> > >
    >> > >
    >> > >
    >> > >
    >> > > >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.
    >> > > >
    >> > > >
    >> > > >Your use of Yahoo! Groups is subject to
    >http://docs.yahoo.com/info/terms/
    >> > >
    >> > >
    >> > > 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.
    >> > >
    >> > >
    >> > > Your use of Yahoo! Groups is subject to
    >http://docs.yahoo.com/info/terms/
    >> > >
    >> > >
    >> >
    >> >
    >> >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.
    >> >
    >> >
    >> >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >>
    >>
    >> 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.
    >>
    >>
    >> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >>
    >>
    >
    >
    >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.
    >
    >
    >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2002-11-12 10:36
    Hello Tracy,
    Thanks for your responses, I hadn't thought about the problems with a noisy
    line affecting the "wait" command, but now I see it has potential to be a
    real problem. The main problem for my situation is a small enclosure to
    house the RF control unit, and my pcb with the stamp on it is only about 1"
    away from it. It is smooth now just waiyting for the first vharacter, then
    checking the second character so I guess the radio noise may not be such a
    problem for me.

    Thanks again for your reply...
    Chris

    Original Message
    From: "Tracy Allen" <tracy@e...>
    To: <basicstamps@yahoogroups.com>
    Sent: Tuesday, November 12, 2002 9:19 AM
    Subject: Re: [noparse][[/noparse]basicstamps] serin / wait problem...


    > Hi Chris,
    >
    > Similar headaches can come from a modem on a noisy line. A SERIN
    > command with a timeout can get locked up waiting for input that never
    > comes. I ended up using a watchdog coprocessor to monitor my modem
    > systems, to break in if something happens (or doesn't). I guess you
    > could have a coprocessor dedicated to monitor your radio input for
    > the presence of a tag.
    >
    > -- Tracy
    >
    >
    > >Hello Tracy,
    > >The 1 second in my example is just an example, I am actually using 50,
    which
    > >is very short with bs2sx.
    > >I think you have answered by saying that the timeout resets for each
    > >character received.
    > >There also is no sample in the manual for using timeout with wait, so it
    may
    > >be that its just not possible.
    > >I am happy to leave it as is, just waiting for the first character then
    > >checking the second for now, but I will continue playing with it a bit.
    > >
    > >Thanks for your help,
    > >Chris
    > >
    > >
    Original Message
    > >From: "Tracy Allen" <tracy@e...>
    > >To: <basicstamps@yahoogroups.com>
    > >Sent: Tuesday, November 12, 2002 1:17 AM
    > >Subject: Re: [noparse][[/noparse]basicstamps] serin / wait problem...
    > >
    > >
    > >> Hi Chris
    > >>
    > >> The timeout option is hard to use on a simple radio connection,
    > >> because of noise. The timeout counter is reset to zero with every
    > >> character that arrives. (Not the whole message) So your program
    > >> gets stuck at the SERIN instruction.
    > >>
    > >> Your timeout parameter was one second. That is time for a lot of
    > >> noise to come in, also time for a lot of BS2 processing. Is the
    > >> Stamp sending something out to stimulate the RFiD response.
    > >>
    > >> -- Tracy
    > >>
    > >>
    > >> >Hello Bruce, and thanks for the prompt reply.
    > >> >
    > >> >No, I dont have enough time to do a serin and then process the data.
    > >> >I am actually reading data in from an RF tag ID system, and doing a
    QUICK
    > >> >check to see if the RF tag is still present, by looking at the first 2
    > >> >charachters in a 20 byte charachter stream.
    > >> >The second byte is different if a valid RF key is in proximity of the
    > >> >reader. The problem I have is that I am also counting reasonably fast
    > >pulses
    > >> >(80 hz) at the same time, thats why I just wanted to have a quick look
    > >for
    > >> >the "ab" that signifies an RF key is present and then get straight
    back
    > >to
    > >> >my pulse counting routine. I have done it for now by just looking at
    the
    > >> >byte following "a", but this is not really as secure as I would like,
    as
    > >> >there may be another "a" elsewhere in the data stream making the next
    > >> >character not the correct one to look at (I hope somehow that makes
    > >sense)
    > >> >
    > >> >Regards,
    > >> >Chris
    > >> >
    > >> >
    > >> >
    Original Message
    > >> >From: "Bruce Bates" <bvbates@u...>
    > >> >To: <basicstamps@yahoogroups.com>
    > >> >Sent: Monday, November 11, 2002 8:50 PM
    > > > >Subject: Re: [noparse][[/noparse]basicstamps] serin / wait problem...
    > > > >
    > > > >
    > > > > > At 08:28 PM 11/11/2002 +0800, you wrote:
    > > > > > >Hello fellow stampers...
    > > > > > >I'm using bs2sx...
    > > > > > >I have a situaltion where I am using the serin and "wait" command
    to
    > >> >control
    > >> > > >program flow depending on data received. If I receive "ab" I want
    one
    > >> > > >option, and if I receive anything else I want another option.
    > >> > > >The "wait" command doesnt seem to work properly if you use a
    timeout
    > >time
    > >> > > >and label, as shown below...
    > >> > > >
    > >> > > >serin serinpin,baud,1000,nodata,[noparse][[/noparse]wait ("ab"),databyte]
    > >> > > > do something if "ab" comes in
    > >> > > >nodata:
    > >> > > > do something if "ab" not received after timeout period
    > >> > > >
    > >> > > >
    > >> > > >I thought it should wait for the timeout period, and if "ab" is
    not
    > >> > > >received, then go to the "nodata" label. It seems that if any data
    > >comes
    > >> >at
    > >> > > >all, it will act as though "ab" has been received. The only way to
    > >get it
    > >> >to
    > >> > > >go to the "nodata" label is to stop the stamp receiving data on
    the
    > >serin
    > >> > > >pin.
    > >> > > >
    > >> > > >Any thoughts would be appreciated..
    > >> > > >
    > >> > > >Best regards, and thanks in advance if you can help,
    > >> > > >Chris
    > >> > > >Australind
    > >> > > >Western Australia
    > >> > > Hi Chris -
    > >> > >
    > >> > > The TIMEOUT parameter is exactly what it says it is, and no more.
    It's
    > >not
    > >> >a
    > >> > > "NOT FOUND" facility, although in some circumstances it may act
    that
    > >way.
    > >> > >
    > >> > > Is there some reason why you can't just read in the data with no
    WAIT
    > >> > > parameter and check the incoming data for whatever characters you
    wish
    > >to
    > >> > > process, and loop back to the SERIN if you didn't get what you want
    ?
    > >> > >
    > >> > > Regards,
    > >> > >
    > >> > > Bruce Bates
    > >> > >
    > >> > >
    > >> > >
    > >> > >
    > >> > > >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.
    > >> > > >
    > >> > > >
    > >> > > >Your use of Yahoo! Groups is subject to
    > >http://docs.yahoo.com/info/terms/
    > >> > >
    > >> > >
    > >> > > 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.
    > >> > >
    > >> > >
    > >> > > Your use of Yahoo! Groups is subject to
    > >http://docs.yahoo.com/info/terms/
    > >> > >
    > >> > >
    > >> >
    > >> >
    > >> >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.
    > >> >
    > >> >
    > >> >Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
    > >>
    > >>
    > >> 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.
    > >>
    > >>
    > >> Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
    > >>
    > >>
    > >
    > >
    > >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.
    > >
    > >
    > >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    > 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.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    >
Sign In or Register to comment.