New topic: Serial port event -- comprehend
<http://forums.realsoftware.com/viewtopic.php?t=31417> Page 1 of 1 [ 1 post ] Previous topic | Next topic Author Message mb52505 Post subject: Serial port event -- comprehendPosted: Fri Dec 04, 2009 9:06 am Joined: Thu Oct 08, 2009 8:59 am Posts: 38 It's been a while since I've been programming and I don't do it often, so I need to refresh myself on some basic concepts. I need to fully understand the serialport dataavailable event. Fact is, if the port is open and you have a continuous stream of data 24/7 from a piece of hardware (as I do) then there will ALWAYS be a dataavailable event, right? I have some code that works fine right now but I'm trying to grasp what's REALLY happening. When the event fires, is there a default timeout or something that allows "do this" to execute, regardless of another dataavailable event? Or does the code take precedence over the event (and only return after the last line of code has executed) I mean, how can "do this" and "do this method" SAFELY execute without responding to the constant data that is ALWAYS there? Hope I'm being clear. Code: sub dataavailable If serial1.bytesavalable >=6 then do this End if dothis() 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]
