Serin WAIT & Timeout
Helen C
Posts: 34
Am I correct in assuming that if you use the "WAIT" command in the following line of code and the stamp receives some serial data but not the "+" that is·waiting for then·the timeout will never execute?
SERIN RX\FLOW,BAUD,60000,No_Response,[noparse][[/noparse]WAIT ("+"),DEC value]
If this is·the case should I write all the data byte by byte to the eeprom and then read it back to find the "+" and "value"?
Thanks in advance for any sugesstions.
Helen
SERIN RX\FLOW,BAUD,60000,No_Response,[noparse][[/noparse]WAIT ("+"),DEC value]
If this is·the case should I write all the data byte by byte to the eeprom and then read it back to find the "+" and "value"?
Thanks in advance for any sugesstions.
Helen
Comments
I really don't understand your second question.· The WAIT modifier must be a part of the serin command - I don't think you can import it as DATA, if that is what you meant.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Try the Stamp Tester
http://hometown.aol.com/newzed/index.html
·
No, after the timeout time the program will jump to your No_Response label.
I use this code in one of my programs:
SERIN 16,BAUD,950,LBL,[noparse][[/noparse]WAIT("S"),UniByte]
If there is an "S" it will take a Byte as input. If it has to wait longer than 950 ms it will jump to label LBL:
I hope this will help,
Klaus
I seem to remember reading something on the old Stamp forum about this issue to the effect that if this happens the SERIN command will not timeout.· Is this correct?
Helen
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Try the Stamp Tester
http://hometown.aol.com/newzed/index.html
·
The command times out only if there is a timeout interval (60 seconds on a BS2) of complete silence on the serial line. If there is activity of any kind on the serial line (even noise) more frequently than once per minute, it may never time out.
Since you are using the flow control, it may be possible to write a loop that has a much lower timeout value and tests each byte that comes in. It depends on what it on the other end of the comm link and how it treats the flow control.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
So apparently, as long as data is coming in, the timeout counter is reset, preventing timeout.· If your data is never seen, then you will be stuck there.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Knight Designs
324 West Main Street
P.O. Box 97
Montour Falls, NY 14865
(607) 535-6777
Business Page:·· http://www.knightdesigns.com
Personal Page:··· http://www.lightlink.com/dream/chris
Designs Page:··· http://www.lightlink.com/dream/designs
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Knight Designs
324 West Main Street
P.O. Box 97
Montour Falls, NY 14865
(607) 535-6777
Business Page:·· http://www.knightdesigns.com
Personal Page:··· http://www.lightlink.com/dream/chris
Designs Page:··· http://www.lightlink.com/dream/designs
·
Thanks for the help.
Helen