Jump to content
The simFlight Network Forums

Writing to flight director offset from LUA


Recommended Posts

Dear Pete,

I am trying to switch on and off the flight director from LUA. I am trying the ipc.writeSB(2EE0,1) command but it prevents the LUA file from running. Am I missing something? 

 

I still didnt understand properly how to work with different offsets. From the FSUIPC4 Offsets Status.pdf I see that the 2EE0 offset is long "4" but how do I know which type of offset it is? Is somewhere the lehgth - to - type conversion table? I mean even if you help me with this one, how do I know which types are other offsets I will need (alternators, antiice,...)? U understand what is the length of an offset, but when I try logging them in FS I see the result of this 2EE0 is simply 1 or 0, so I would guess it will be the easiest of all the types, hm?

 

Pavel

Link to comment
Share on other sites

I am trying to switch on and off the flight director from LUA. I am trying the ipc.writeSB(2EE0,1) command but it prevents the LUA file from running. Am I missing something? 

 

Lua won't understand 2EE0. It isn't a decimal number with E's in it! You either need to precede it with 0x (so 0x2EE0) to tell it that it is a hexadecimal number,, or quote it, like "2EE0". your choice.

 

I still didnt understand properly how to work with different offsets. From the FSUIPC4 Offsets Status.pdf I see that the 2EE0 offset is long "4" but how do I know which type of offset it is? Is somewhere the lehgth - to - type conversion table? I mean even if you help me with this one, how do I know which types are other offsets I will need (alternators, antiice,...)? U understand what is the length of an offset, but when I try logging them in FS I see the result of this 2EE0 is simply 1 or 0, so I would guess it will be the easiest of all the types, hm?

 

1 byte = 8 bits = byte

2 bytes = 16 bits = word

4 bytes = 32 bits = double word, or "DWORD"

8 bytes = 64 bits = quad word or "long long"

 

Also there are two floating point formats

 

4 byte = 32 bit float = "float"

8 byte = 64 bit float = "double"

 

Please see the FAQ subforum. There's a thread there about numbers.

 

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.