Jump to content
The simFlight Network Forums

Recommended Posts

Posted

The code below gets the Engine 1 EGT to display in a label, however it is very slow. Other calls to Eng 1 N1 are usually quite smooth. Is there anything you can see I am doing incorrectly?

Dim aInt As Integer
    Dim dwResult As Long

    While running
        FSUIPC_Read &H8BE, 2, VarPtr(aInt), dwResult
        FSUIPC_Process dwResult

        Label4.Caption = aInt / 16384 * 860
        DoEvents
    Wend

Cheers

Craig P

Posted
The code below gets the Engine 1 EGT to display in a label, however it is very slow.

I do hope you are not doing a separate FSUIPC_Process call for every variable! Each one requires a process change. Collect all of your FSUIPC_Reads and Writes together for one Process call.

What do you mean by "slow"? It simply returns the current value, just like anything else. No difference. How are you measuring the response?

Pete

Posted

I do hope you are not doing a separate FSUIPC_Process call for every variable! Each one requires a process change. Collect all of your FSUIPC_Reads and Writes together for one Process call.

Ahh I didnt know that. What do you mean by, "Each one requires a process change." When you dont expect me to call for each variable? Is the following code correct? I know its in VB6, should be easy enough to interpret :D

    Dim aInt As Integer
    Dim dwResult As Long

    While running
        FSUIPC_Read &H8BE, 2, VarPtr(aInt), dwResult

        Label4.Caption = aInt / 16384 * 860
    Wend

    FSUIPC_Process dwResult

What do you mean by "slow"? It simply returns the current value, just like anything else. No difference. How are you measuring the response?

Compared with how the N1 display updates the EGT is very slow. Updates ~5 times a second when I can read the N1 at ~18 times a second.

Craig P

  • 2 weeks later...
Posted

Sorry for the delay in replying -- as mentioned in the Announcements above, my wife and I were off touring Argentina & Chile (by steam trains where possible) immediately after I returned to the UK from the AVSIM FanCon in Seattle.

What do you mean by, "Each one requires a process change."

Each "FSUIPC_Process" call requires Windows to change from your process to FS, then back again when the response is ready. Therefore you only do one FSUIPC_Process call per update cycle, accumulating all of your different reads and writes before hand.

Is the following code correct? I know its in VB6, should be easy enough to interpret :D

    Dim aInt As Integer
    Dim dwResult As Long

    While running
        FSUIPC_Read &H8BE, 2, VarPtr(aInt), dwResult

        Label4.Caption = aInt / 16384 * 860
    Wend

    FSUIPC_Process dwResult

No, sorry, that's actually pretty awful. To start with, what is setting "running" to FALSE to get the loop stopped? Second, why add millions of reads of the same value to the one process call? Third, there is no point at all in using the value you think you are reading with the FSUIPC_Read until the Process call has been done -- all the read and Write calls to is list the request. Nothing more.

More to the point, all of your "FSUIPC_Read" calss (for all the values you want) should be grouped before one FSUIPC_Process call. It is the latter which actually does it.

Compared with how the N1 display updates the EGT is very slow. Updates ~5 times a second when I can read the N1 at ~18 times a second.

"Very" slow? 5 updates per second is too slow for your needs? Why exactly?

The requests to FS for data are prioritorised. Some things are requested more often than others in order to even the loading and prevent performance degradation and jerking.

However, that said, I'm pretty sure this one is one of those which was changed recently. What version of FSUIPC are you using? If not the latest, try updating. Note that new versions are often provided in the downloads Announcements above.

Regards

Pete

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.