To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 4547
4546  |  4548
Subject: 
Re: preventing IR tower shutdown
Newsgroups: 
lugnet.robotics
Date: 
Wed, 14 Apr 1999 13:18:36 GMT
Original-From: 
Laurentino Martins <lmartins@marktest.STOPSPAMpt>
Viewed: 
956 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:
  Re: preventing IR tower shutdown
 
(...) In VB you would probably want to put a DoEvents in such a tight loop. -- Did you check the web site first?: (URL) (25 years ago, 15-Apr-99, to lugnet.robotics)

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 (...) (25 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
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR