Eagle_For Posted January 28, 2014 Report Posted January 28, 2014 Hello Pete I would use a byte for the status of a ten pushbuttons from several variables like :L:AB_MPL_FD" in order to recover in an FSUIPC offset. So I wrote the following LUA script : if (ipc.readLvar ("L:AB_MPL_FD") == 1 then ipc.clearbitsUB(0X66C0,1) else ipc.setbits(0X66C0,1) end This unfortunately does not work. Can tell me here I am wrong. I use masks in decimal (1,1,4,8,.....) Tank you for your reply. Raymond
Pete Dowson Posted January 28, 2014 Report Posted January 28, 2014 I would use a byte for the status of a ten pushbuttons from several variables like :L:AB_MPL_FD" in order to recover in an FSUIPC offset. So I wrote the following LUA script : if (ipc.readLvar ("L:AB_MPL_FD") == 1 then ipc.clearbitsUB(0X66C0,1) else ipc.setbits(0X66C0,1) end This unfortunately does not work. Two errors to start with. A byte contains 8 bits, not 10. "UB" means "Unsigned Byte". You need UW (Unsigned Word). ipc.setbits(0X66C0,1) isn't valid. there's no "ipc.setbits". You forgot to put the size in (UB or UW). Please ALWAYS check the FSUIPC log file when developing a plug in. it would show this error. Can tell me here I am wrong. I use masks in decimal (1,1,4,8,.....) I assume you mean 1, 2, 4, 8 ...? I don't see any other than your test for setting the 1 bit, bit 0. Pete
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