New topic: 

Serial.Readall  where am I going wrong?

<http://forums.realsoftware.com/viewtopic.php?t=29696>

       Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic         Author  
Message       shane           Post subject: Serial.Readall  where am I going 
wrong?Posted: Sun Aug 23, 2009 7:44 am                        
Joined: Sun Jun 21, 2009 1:32 am
Posts: 19
Location: Australia              I am building a program that reads inputs from 
a controller, I issue ASCII code commands and recieve ASCII code responses back 
which sends a value to a progressbar and textfield. I use this code to send and 
recieve data
Code:Serial1.Flush
Serial1.XmitWait
Serial1.Write chr(254)
Serial1.Write chr(151)
result=Serial1.Readall
Serial1.XmitWait
result1=asc(result)
edit1.text=str(125/result1)
bar1.value=125/result1

The result I get in the textfield is:  1.#INF00e+
The result should be: 1.865672
I am supposed to get 1 byte of data back but this looks like 8 bytes (I'm a 
newb at bytes of data)

If I click the button that executes the code 3 times in quick succesion I get 
the right answer, If I use a timer to execute the code with a 1000 delay all I 
get is the "1.#INF00e+" result.

Anyone able to tell me what I'm doing wrong?

Thanks     
_________________
... Shane  
                            Top            Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]     
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to