Jump to content
The simFlight Network Forums

How to get Values from a Lvar to FSUIPC Offset or SIOC.


Jackson

Recommended Posts

Hello all,

 

I would like to built my Homecockpit and have soldered my first cards from opencockpit together. I tried as well some programming with SIOC, to toggle some switches with a lua script and FSUIPC offsets.

 

But now, I have no clue, how to get values like AP Altimeter or HDG from a Lvar to the 7 segment displayor other values after initialising my Airbus X Extended within FSX.

 

If somebody cn just give me a hint, would be very useful.

 

Best Regards

Jackson

 

 

Link to comment
Share on other sites

First off, you should probably have posted this in the main forum below instead of in 'User Contributions". More folks would see it down there.

As a starting point, read the "FSUIPC Lua Library.pdf" to get an idea of what functions are available.
You will most likely want to use Lua scripts to accomplish the software to hardware interface.

For example, you would first read the current state of the L:Var into a variable.

n = ipc.readLvar(“name”)  

"n" would now contain the value of the L:Var called out by "name" ( "L:some_variable" )

Then, depending upon what the output needs to be, you scale/modify "n" and then write it out to the offset that the hardware expects it to be.

value = n

ipc.writeSB(offset, value)

ipc.writeSD(offset, value)

ipc.writeUB(offset, value)

ipc.writeUW(offset, value)

   Paul

Link to comment
Share on other sites

  • 1 month later...

Hello, to be honest, unfortunately the answer to the question providing no useful information for me. I believe the question was asked, in part "...how to get values like AP Altimeter or HDG from a Lvar to the 7 segment displayor other values..." First, let me begin in that I am a novice but I may be able to provide information that might be helpful. Second, any Lvars to be sent to hardware I would assume would be provided by the hardware provider. But then again, when I asked Captainsim for Lvars for CS757 (FS9) so I wouldn't have to use the mouse and use my homemade MCP (since offsets and FS's parameters don't work), they told me there was no way to access them. They either lied, are lazy or incompetent. They are indeed accessible. I got access to them in 3 ways. 1) I looked at the cs.b757.cab and looked at the xml's. 2) There is a free program on the Internet called "Blackbox3" that helps and there is FS Panel Studio. The latter was the most helpful yet costs but it makes it very easy.  I have not delved into outputs yet but there are 2 examples provided by the installation of FSUIPC called "gfdDisplay.lua" that I am assuming, not sure, is for GoFlight. Code in part, the Lvar is: ...testdisplay(gfd.SetDisplay, id, "888888").... In GFpower.lua, the Lvar is...gfd.SetBright(m, u, 15- b ).... Hopefully your hardware provider would supply Lvars such as this.

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.