Jump to content
The simFlight Network Forums
Sign in to follow this  

LUA file which helps you decide which data type your offset is

Recommended Posts

I have never been completely sure about which of those "DBl, FLT, DD, SB, SD, etc) types should I read so I have done this small LUA file which will help you to decide. You just need to change the offset ID on the second line and then simply run this LUA in your FSX - you will see your offset being read as all the available types and you can decide which of them fits your individual needs.

while 1 do
offset = "132C"   --write the Offset ID from FSUIUPC4 Offsets Status.pdf (eg. "132C")

test1 = ipc.readDBL(offset)
test2 = ipc.readFLT(offset)
test3 = ipc.readDD(offset)
test4 = ipc.readSB(offset)
test5 = ipc.readSD(offset)
--test6 = ipc.readSTR(offset, 4)   -- Not used
test8 = ipc.readUB(offset)
test9 = ipc.readUD(offset)
test10 = ipc.readUW(offset)


Attached you can see the result for testing NAV/GPS switch offset reading. I need 1 or 0 regaring the switch position so I will use probably the UB type which is the "simplest" format of the offset which yet matches my need to be 0 or 1 - however all those except DBL, FLT and DD give the same result so technically this is completely up to me which of the remainings I will use.


Pavel Brodsky


Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • 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.