PINK SERIN weird problem.
Can anybody tell me why this works perfectly fine:
But this CAUSES a timeout:
Nothing changes except I try to add some error trapping by including a time to wait for data and a label to handle that event.
Every single time with the error trapping in I get a time out, and only when talking to the PINK. Without the error trapping the program completes just fine, unless the data was invalid (which is why I need to handle errors).
It doesn't matter what time I put in either, a wait time of 5000 still times out.
I am very, very confused.
Other than this little issue, the PINK modules have been great! I've got three Stamps talking back and forth via UDP and it's very cool.
Thanks in advance,
Roger
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Roger Pierson
Senior Electronics Technicain
DTI Assoicates
SEROUT Pink_Out,Pink_Baud,[noparse][[/noparse]"!NB0RBM"] SERIN Pink_IN,Pink_Baud,[noparse][[/noparse]DEC2 NBVAR,STR NBVAR2\7\CLS]
But this CAUSES a timeout:
SEROUT Pink_Out,Pink_Baud,[noparse][[/noparse]"!NB0RBM"] SERIN Pink_IN, Pink_Baud , 5, Bailout, [noparse][[/noparse]DEC2 NBVAR,STR NBVAR2\7\CLS]
Nothing changes except I try to add some error trapping by including a time to wait for data and a label to handle that event.
Every single time with the error trapping in I get a time out, and only when talking to the PINK. Without the error trapping the program completes just fine, unless the data was invalid (which is why I need to handle errors).
It doesn't matter what time I put in either, a wait time of 5000 still times out.
I am very, very confused.
Other than this little issue, the PINK modules have been great! I've got three Stamps talking back and forth via UDP and it's very cool.
Thanks in advance,
Roger
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Roger Pierson
Senior Electronics Technicain
DTI Assoicates
Comments
·
·· My guess is your Timeout Value is too small…That’s only 5 mS to respond.· It is probably timing out before the module can respond with the data.· Try a larger value.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
It doesn't matter what value I put in, it always times out. I once put 4000 in just to see if it would work and it still times out.
Thanks,
Roger
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Roger Pierson
Senior Electronics Technicain
DTI Assoicates
·
·· I will see if I can test this before Monday…If not, I will test it Monday and see what I get.· In your timeout routine, are you debugging the values to see if you still got what you expected, even though the routine timed-out?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
I would be interested to know what you come up with if you test this.
Thanks,
Roger
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Roger Pierson
Senior Electronics Technicain
DTI Assoicates
If anyone cares to test this out, here is the test code I am using. It sets the test up by writing data to the UDP message content variable and to web variable 21. Then it reads each of these twice, once using error trapping and once without. Then it reads the status byte, just to prove that it works.
Also, I'll attach the file.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Roger Pierson
Senior Electronics Technicain
DTI Assoicates
·
·· What could happen is that you could be getting some of the data in your list…If that was the case it could still timeout, but some of the variables would contain the expected data.· Let us know.
EDIT: Looks like while revising my message you already tried this.· I will try your code myself and post my results back later today.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Post Edited (Chris Savage (Parallax)) : 11/6/2006 4:17:07 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Roger Pierson
Senior Electronics Technicain
DTI Assoicates
·
·· I didn’t have time to analyze your code today but I did change the pins and baud rate to match mine, and the thing I noticed is that yes the Timeout test fails, but then it hangs at the other.· Which means for me it’s not working either way.· I think the better way to test this will be for me to create an example tomorrow and go from there.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
The first SERIN is looking for a UDP message that begins with two digits followed by any type of value (7 bytes long). The second SERIN is looking for a one digit value in web variable 21. The third SERIN is the status byte, which I have no trouble with.
I really appreciate your help with this!
Thanks,
Roger
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Roger Pierson
Senior Electronics Technicain
DTI Assoicates
·
·· When in doubt, start with something simpler.· In my case I think I will use a simple variable read and add the timeout code during a subsequent read in a demo similar to yours.· I will attach it and you can try that one.· I should have something posted soon.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
·
·· As promised I got a chance to try using the timeout feature of SERIN with the PINK Module.· I always start with a simple example, especially when dealing with someone else’s code.· This way I know what results to expect.· See the attached files.· The first gets a variable from the PINK Module and displays it on the DEBUG screen.· This is right from our documentation.· The only thing different is that I am using the default baud rate of 9600.· The second example adds a timeout to the SERIN command.· Regardless of what values I specify there is no timeout occurring.· Because of this I would recommend breaking down the order of events and the expected data and try to figure out what is happening based on that.· The fact that I couldn’t get either of your examples to work means the expected data is dependant on some other event I cannot easily duplicate.· What ever that is may be the source of your problems.· I hope this helps.· Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support