Jump to content
The simFlight Network Forums
FSEPIC

fsuipc client vs lua

Recommended Posts

Hi Paul , 

i am looking to use either fsuipc client dll , or lua 

and i noticed in one of your replies , that you suggested to a user to try lua instead of the client dll 

Is there any functional difference , as both talk to fsuipc ?

I would like to hear your take on this , ?  (   to me,  on the surface lua looks very simple to program ,  and no GBs VS download etc needed 😉  ) 

best regards , 

Peter

Share this post


Link to post
Share on other sites

Hi Peter,

The two technologies are used for different kinds of tasks, so It really depends on what your program will do.

Generally Lua can be thought of as a way of writing 'plug ins' that extend the functionality of FSUIPC. Typical uses are

  • driving hardware connected to the sim
  • monitoring the flight, looking for certain conditions then taking actions (e.g. play a cabin announcement at the right time)
  • creating functions that can be bound to buttons/keys (e.g. set fuel to 80% when a key is pressed)
  • creating simple display windows to show information from the sim. (e.g. calculate time until fuel runs out and show it in a window in real time).

Using the DLL in an external program is better (or required) if any of these are true:

  • you need a complex user interface where users need to interact with your application (selecting menus, filling out forms etc, drawing charts)
  • the application needs to do other things beside interacting with FSUIPC (e.g. has a flight planner than plans routes)
  • the application will require hundreds of lines of code (debugging and code organisation is much easier in Visual Studio)

Other considerations:

  • Lua scripts can only be run on a registered copy of FSUIPC. An external program can be used with an unregistered copy. If you want others to use your program this might be a consideration.
  • If you need to access many L:Vars (Panel Variables) Lua is much more efficient for this.

Hopefully that helps. If you're still unsure let me know what your program will be doing and I can give more specific advice.

Paul

Share this post


Link to post
Share on other sites

Hi Paul, 

- thanks for your very clear explanation ,  ( looks like your code 😉  ) 

- the task at hand is to let my arduino board talk to fsx   , the buttons and switches , and also receive  data , to set leds , and  7-segm. display ,   therefore no user interaction is necessary .  - so the lua program would be only an intermediary ,  and it can speak "serial "  very easily according to the lua docs . 

-  could you expand a bit on the öther considerations ?  Why is lua mor effiecint ?

-  i thought from your docs that the .net client also needs a copy of fsuipc installed ?

Peter  

Share this post


Link to post
Share on other sites
Quote

Why is lua mor effiecint ?

It's just the way LVARs are read and written from an external program. The FSUIPC external interface can only process one LVar at a time. So each LVar requires a complete data exchange cycle (Process() Call). This takes time so reading 20 or more Lvars in real time isn't very practical from an external program. This doesn't apply to normal Offsets of course, just LVars.

Quote

-  i thought from your docs that the .net client also needs a copy of fsuipc installed ?

Yes, both require FSUIPC. Lua needs a paid (registered) copy. External programs can use a free (unregistered) copy.

Quote

the task at hand is to let my arduino board talk to fsx 

This seems like the sort of thing the Lua system was intended for, but I can't say how easy it would be; I'm not a Lua expert and don't do anything with hardware.

If you have a registered copy of FSUIPC I would try Lua first and see if you can get a switch and a LED working.

Paul

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

×
×
  • 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.