kenazo
-
Posts
3 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Gallery
Downloads
Posts posted by kenazo
-
-
Hi Paul.
Thanks alot for sending me into the right direction. I've done everything as u said and now program does very well. My invistigation into FSUIPC will continue then. BIG THANKS :) . PETE u were right to use timer. Thanks to both of u.
Now. small question to pete. In ur program that comes with SDK "fslook2.exe" when u press autorefresh, which i think updates more then 100 variables every 200 milliseconds or so u managed to keep RAM usage to about 3500kb and CPU usage to about 5% (PentiumIII 3.2GHz RAM 512)
while my program is taking only 1 variable and has 16000kb.... do u somehow delete unneeded variables from fcuipc protocol?
-
Hi.
I want to create a simple program that can read AIRSPEED (for example) and update it in real time.... lets say every 300 ms. The program im writing is in C#, but the principles are all same everywhere.
My problem is - i wrote the program that does excatly what i said but the program flow is wrong i suspect bcause it takes 16000kb of RAM, and while the program runs i cant press any buttons in it since the sand clock is showing as a cursor. Here is the part of the code:
bool result = false; // Return boolean for FSUIPC method calls int dwFSReq = 0; // Any version of FS is OK int dwOffset = 0x02BC; // Indicated airspeed memory offset int dwSize = 4; // Indicated airspeed memory size int token = 0; // Variable to hold returned token index int dwResult = 0; // Variable to hold returned results int loop = 1; int ias = 0; public Form1() { InitializeComponent(); this.Show(); Fsuipc fsuipc = new Fsuipc(); fsuipc.FSUIPC_Initialization(); result = fsuipc.FSUIPC_Open(dwFSReq, ref dwResult); do { this.Refresh(); fsuipc.FSUIPC_Read(dwOffset, dwSize, ref token, ref dwResult); fsuipc.FSUIPC_Process(ref dwResult); fsuipc.FSUIPC_Get(ref token, ref dwResult); ias = dwResult / 128; Thread.Sleep(300); SUPDATE(ias); } while (ias > 40); fsuipc.FSUIPC_Close(); } public void SUPDATE(int a) { this.label1.Text = a.ToString(); }
PLease tell if my program flow is wrong or maybe i should use someother function instead of Thread.Sleep. How should i do it right?
Thanks in advance, if it is easier for u, u can give me suggestions in C++.
P.S. im not very expirienced in programing but i think sufficient enuf. :)
Help on Program Flow
in FSUIPC Support Pete Dowson Modules
Posted
Pete, you are right! even HelloWorld takes 14,000kb RAM!! :lol:
anyways. thanks for your quick responses... haha.. do u ever sleep?
with respect, Denis.