Jump to content
The simFlight Network Forums

FSUIPC and EPIC : how to write negative value.


Recommended Posts

Hi Peter.

I use PM, FSUIPC and EPIC system in my flightdeck.

How can I sent a negative value to offset 04E6 ?

EPIC can't handle it with nqw. To sent +2000 fts/min, no pb, but to sent -2000fts/min, it is impossible. But, when using pigeon holes for this 04E6 offset, I can get the sign of the value with the mask 0X8000. But it is from a code I get on the internet, so I don't understand it.

By the way, this offset is told to be read only, but I can write it and it works.

So Can you tell me the format of the value in this offset, by exemple, for a VS of -2000 or -700. Something in hex format ? I will figure how to make it and sent if via my EPIC code.

RE

http://remont.free.Fr/cockpit

Link to comment
Share on other sites

I use PM, FSUIPC and EPIC system in my flightdeck.

How can I sent a negative value to offset 04E6 ?

Whether a value is positive or negative is all in the interpretation, not the value. In 16-bits, for example, a value 65535 looks identical to a value of -1, depending whether you treat it as signed or unsigned. In hexadecimal they both look like FFFF.

EPIC can't handle it with nqw. To sent +2000 fts/min, no pb, but to sent -2000fts/min, it is impossible.

If this is in a 16-bit (2-byte) word, then send 63536. It is the same. Calculate it as 65536 + (the negative value). In EPIC you would need to do

65535 - (your positive value, eg 2000)

then add 1. The 1 difference is needed because 65536 cannot be accommodated in 16 bits.

Regards

Pete

Link to comment
Share on other sites

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.