Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hi guys,

as the FSUIPC Documentation or FS interrogate says, i extract the offset &H07F2.

The results are ok as far as i have a positive climbrate in the FS (like 2200). But when i change the rate to a negative value, the offset delivers a value like for example 65436 for a descentrate of -100 ft.

Has anyone a idea how to work with that?

Thanks

Stefan

Posted

Hi guys,

as the FSUIPC Documentation or FS interrogate says, i extract the offset &H07F2.

The results are ok as far as i have a positive climbrate in the FS (like 2200). But when i change the rate to a negative value, the offset delivers a value like for example 65436 for a descentrate of -100 ft.

Has anyone a idea how to work with that?

Thanks

Stefan

Posted

Hi Mark,

i have tried that out, copying the value from the offset to a long variable (int is too short) and it is not working.

How would you copy? may i have an example?

thanks

stefan

Posted

Hi Mark,

i have tried that out, copying the value from the offset to a long variable (int is too short) and it is not working.

How would you copy? may i have an example?

thanks

stefan

Posted

Or you could do (pseudo code):

if value from IPC > 32737 then VS := value - 65535 else VS := value;

... in the absence of knowing what the VB equivalent of a signed word is. It's a bit crude but it'll do the job.

Chris

Posted

Or you could do (pseudo code):

if value from IPC > 32737 then VS := value - 65535 else VS := value;

... in the absence of knowing what the VB equivalent of a signed word is. It's a bit crude but it'll do the job.

Chris

Posted

Why the long? The var is 2 byte long. I think that if you pass a long the two most signigficant bytes will be 0 on return (or something that is on 0z7f4 0x7f5 I don't know) and the negative numbers will be intrepreted as positive like in the word. If you need a long for after processing you must cast the result to it after retrieving.

Best

José

Posted

Why the long? The var is 2 byte long. I think that if you pass a long the two most signigficant bytes will be 0 on return (or something that is on 0z7f4 0x7f5 I don't know) and the negative numbers will be intrepreted as positive like in the word. If you need a long for after processing you must cast the result to it after retrieving.

Best

José

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.