Subject:
|
Re: preventing IR tower shutdown
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Wed, 14 Apr 1999 13:18:36 GMT
|
Original-From:
|
Laurentino Martins <lmartins@marktestSTOPSPAMMERS.pt>
|
Viewed:
|
1117 times
|
| |
| |
At 13:17 14-04-1999 Wednesday , Antony Furneaux wrote:
> This just might explain a problem I am having with a VB program.
> After a while my battery meter function stops getting a reply from
> the RCX. It calls the RCX every 10 secs from a Timer control
> event. Then all of a sudden, while the RCX is still on and doing
> things, the VB program can't get a response. When this has
> happened, even a ALiveOrNot call doesn't get a response.
> However, motor control commands do get sent to the RCX because
> the RCX does what it was told to do.
>
> The only way I could get back return values from the RCX when this
> has occurred, is to restart my VB program. Then all is well even
> without switching the RCX off and on.
I had a problem that happened a lot to me in Visual C++ and that might be or not be related with your problem.
Simply put, what happened was that a simple FOR/WHILE cycle waiting for a response of the unit was so processor intensive, that the timer would never get executed (since the timer it's a lot priority call).
I fixed it by pumping the system messages while running that FOR/WHILE cycle so that the timer would work.
You can pump the messages in C++ like this:
while( ::PeekMessage( &msg, NULL, 0, 0, PM_NOREMOVE ) )
AfxGetThread()->PumpMessage();
The VB code should be similar (?).
Laurentino Martins
[mailto:lau@mail.telepac.pt]
[http://www.terravista.pt/Enseada/2808/]
--
Did you check the web site first?: http://www.crynwr.com/lego-robotics
|
|
Message has 1 Reply:
Message is in Reply To:
| | Re: preventing IR tower shutdown
|
| (...) I'm going to go at it from the other direction, I am writing an IDE (32 bit windows) for the pbFORTH system. My intention is to send a keepalive character every now and then to stop the tower going to sleep, at the moment I am debugging FORTH (...) (26 years ago, 14-Apr-99, to lugnet.robotics)
|
6 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
Active threads in Robotics
|
|
|
|