xxallrounderxx Posted September 20, 2013 Report Posted September 20, 2013 Hi there! I wanted to create a lua file for writing values from Airbus X Extended in the free Offsets 66C0-66FF, for further output to my "Arcaze Board" via "Arcaze FSUIPC Connector". I tried, but failed :( a = 0 while a < 255 do b = 0 c = 0 d = 0 e = 0 --IAS b = ipc.readLvar("L:AB_AP_Speed_Select") --HDG c = ipc.readLvar("L:AB_AP_HDG_Select") --ALT d = ipc.readLvar("L:AB_AP_ALT_Select") --VS e = ipc.readLvar("L:AB_AP_VS_Select2") --Writing Speed ipc.writeUB(0x66C0,b) --Writing Heading ipc.writeUB(0x66C1,c) --Writing Altitude ipc.writeUB(0x66C2,d) --Writing Vertical Speed ipc.writeUB(0x66C3,e) ipc.sleep(800) end The code should write the values of Speed, Heading, Altitude, VS in the Offsets. I put the Script in the Modules Folder of FSX. Any ideas why it down't work? Thanks, Philipp PS: Sorry for my english
Pete Dowson Posted September 23, 2013 Report Posted September 23, 2013 The code should write the values of Speed, Heading, Altitude, VS in the Offsets. I notice you are only using 1 byte for each. Is that enough? That range of an unsigned byte is only 0-255. I put the Script in the Modules Folder of FSX. Any ideas why it down't work? How are you running it? Just puting it in the folder won't run it. Pete
xxallrounderxx Posted September 24, 2013 Author Report Posted September 24, 2013 Hi Pete! So, if it wouldn't be enough a range of 0-255 for heading example, what do i have to write instead of "ipc.writeUB"? For Vertical Speed I will need something bigger for negative values... I don't know how to run the lua file after starting fsuipc/fsx. How do I? Thanks Philipp
Pete Dowson Posted September 24, 2013 Report Posted September 24, 2013 So, if it wouldn't be enough a range of 0-255 for heading example, what do i have to write instead of "ipc.writeUB"? For Vertical Speed I will need something bigger for negative values... Oh dear. It is in the documentation! UB = Unsigned Byte. UW = Unsigned Word Look at the FAQ subforum. There is a guide there to bits and bytes and numbers. Byte = 8 bits, 0-255 unsigned or -128 to +127 signed Word = 16 bits (0-65535 unsigned or -32768 to + 32767 signed. Et cetera. Don't forget also the offsets are at 1 byte intervals (normal memory addressing. So for a 2-byte spacing you need 66C0, 66C2, 66C4 etc. You list 1 byte spacing. I don't know how to run the lua file after starting fsuipc/fsx. How do I? You really have not read any of the documentation, have you? :-( Run it by assigning to a button or keypress, then using that button or keypress, OR Run it by naming it ipcReady.lua, OR Run it by executing it like a macro in an [Auto] section in the INI file. Please please please use some of the documentation. It was hard work writing it. i don't want to have to do it all again here. Regards 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