Jump to content
The simFlight Network Forums

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


Paja

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)


ipc.display("testDBL="..test1.."\
testFLT="..test2.."\
testDD="..test3.."\
testSB="..test4.."\
testSD="..test5.."\
testSW="..test7.."\
testUB="..test8.."\
testUD="..test9.."\
testUW="..test10)
ipc.sleep(50)
end

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

post-51945-0-50763200-1424596894_thumb.p

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.