Jump to content
The simFlight Network Forums

How do I write my own FSUIPC offset with an LVAR to work with mobiflight


Recommended Posts

Hi All

I have started the process of creating replica gauges for the P-51 and B-17, with the end goal of having them work with their counterpart A2A aircraft. 

Step one was to model the gauges and work out the mechanical side which I have done, I plan to use Mobiflight and Stepper motors for most gauges, the next step it to work out what LVARS are driving the gauges in the A2A aircraft, I am hoping to achieve this via LINDA. My question is, how would I go around writing the LVAR for say the Hydraulic gauge, to one of the spare FSUIPC offsets so that it can then talk to mobiflight ?

I am quite the novice when it comes to this, I know how to use existing FSUIPC offsets with Mobiflight, but when it comes to writing my own, I wouldn't know where to start.

Thanks in advance for your help

Myles

@Pete Dowson

Link to comment
Share on other sites

22 hours ago, Myles_DJL said:

how would I go around writing the LVAR for say the Hydraulic gauge, to one of the spare FSUIPC offsets so that it can then talk to mobiflight ?

in FSUIPC6 and earlier, you need a simple lua script to write the lvar value to an offset when the lvar value changes, using the event.lvar function.  See the following post where i explained in more detail on how to do this: 


You can also enable writing to the offset to update the lvar if you like, by using the event.offset function. 

In FSUIPC7, a mechanism is provided to add lvars to offsets for both reading and writing by using the FSUIPC7.ini file. This is explained in the Advanced User guide.

John

 

Link to comment
Share on other sites

Thanks John, I get how this would work for switches, but I’m not sure how I write the code for gauges and what values/variables to have, I’m probably overcomplicating it in my head, but I just can’t get head around how to write the code, maybe if I understood what the various elements of the code did it would make it easy to understand? Would you be able to walk me through it, I’m a complete novice when it comes to this.

thanks 

Myles

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.