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

Writing Values in "free" FSUIPC Offsets

Recommended Posts

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

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.

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

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