View Single Post
  #14   Spotlight this post!  
Unread 31-12-2006, 15:01
6600gt's Avatar
6600gt 6600gt is offline
Registered User
AKA: Lohit
FRC #0226 (Hammerhead)
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Troy, MI
Posts: 221
6600gt is a jewel in the rough6600gt is a jewel in the rough6600gt is a jewel in the rough
Re: Visual C++ 2005 Designer

Quote:
Originally Posted by esquared View Post
The idea you've come up with seems pretty useful, the only question will be the overhead on the serial port/quantity of interrupts if your RC is interrupt heavy. It was somewhat difficult to tell from the GUI screen, but how many bytes of data will be sent per "GUI update"? And this will be called every "slow loop" to update or every "fast loop"?
I made this to help reduce the load on the RC by not having to do printf statements, where it has to output every character as a byte. It uses a semi-dynamic communication protocol.

The RC has to only read 2 bytes every program loop unless some value has been changed on the GUI. This just to make sure there is a link, otherwise after 20 program loops it will completely stop the robot. If something is touched another 20 bytes have to processed that program loop.

The RC is probably going to be sending about 21 to 50 bytes a program loop depending on your needs. No reprogramming required to change the variables watching. I could lower the bytes send by making it even more dynamic but it will put more processor overhead(Checking which values changed so as to send only that one). So its a choice between more processor overhead or more serial port work; in the end it is about the same load on the processor. If you just want the DataView functionality then the RC only has to send about 21-22 bytes(16 bit values and 1 or 2 starter bytes) per loop to fill all 10 columns.




About the Problem:

It seems to be only happening(returning a null reference) when I call the serialPort1 from the another form

Main^ main = dynamic_cast<Main^>(this->MdiParent);
main->serialPort1->ReadByte();

If I call it in the main form(where it resides) with just, serialPort1->ReadByte(), it working and reads fine.

I have been using the debug features in the Visual Studio and though it has gotten me close, it hasn't exactly helped me pinpoint the source.

Last edited by 6600gt : 31-12-2006 at 15:11.