vanislepilot Posted June 12, 2023 Report Posted June 12, 2023 Hi: As per offset page 8 of your "Offset Mapping for PMDG 737-700" manual, I am trying to read the powered status of AC Transfer Bus 1. I believe you have it in spot 7 of offset 64D6. I am just wondering the syntax for how I would call a function when it changes, and also read its value within that function. Something along the lines of: function NAME(offset, value) -- need syntax to read bit 7 from 64D6 end event.offset(0x64D6, "UB", "NAME") Many thanks Troy
John Dowson Posted June 13, 2023 Report Posted June 13, 2023 12 hours ago, vanislepilot said: -- need syntax to read bit 7 from 64D6 To do this you use the Logic library, e.g bit7 = logic.And(value, 0x80) -- bit 7 = 2^7 = 128 = 0x80 However, looking at offset 64D6, it is an array of 16 bytes/booleans, not bits, so you do not need bitwise logic. Just set your event on byte 7, i.e. 0x64D6 + 7 = 0x64DD, so event.offset(0x64DD, "UB", "NAME") John
vanislepilot Posted June 13, 2023 Author Report Posted June 13, 2023 Thanks so much John! I appreciate the back-to-back help.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now