Jump to content
The simFlight Network Forums

FSUIPC Clarification Questions


Recommended Posts

Hello,

I have a few questions about using FSUIPC and LUA:

1. What is the difference between manipulating controls using FSUIPC offsets (ipc.writeUB()) versus sending the FSX control directly (ipc.control())? Which is more efficient?

2. What is more optimized, assigning FSX controls to buttons through the FSUIPC interface or setting controls via FSUIPC offsets (ipc.writeUB()) from lua scripts or sending FSX controls directly from lua scripts (ipc.control()).

I've been doing quite a bit of programming using LUA and have discovered there are multiple different ways to interact with FSX. I'm just trying to determine what ways are better, simpler, more optimized, etc.

Thanks for any input or insight into the inner workings of FSUIPC.

Link to comment
Share on other sites

1. What is the difference between manipulating controls using FSUIPC offsets (ipc.writeUB()) versus sending the FSX control directly (ipc.control())? Which is more efficient?

It varies. For many things in FSX, and some things in FS9, writing to offsets causies FSUIPC to send the control in any case. The days of global variables inside FS being directly writeable are all but over.

2. What is more optimized, assigning FSX controls to buttons through the FSUIPC interface or setting controls via FSUIPC offsets (ipc.writeUB()) from lua scripts or sending FSX controls directly from lua scripts (ipc.control()).

Difficult to say. Buttons are being polled at intervals in any case. Action isn't instant. Lua plug-ins are being interpreted in a separate thread, but to stop them monopolising things there are plenty of Yields or Sleeps in the interpreter. I doubt you could measure any differences. Each is suited to what it is aimed at -- button assignments for buttons, Lua plug-ins for more esoteric applications.

I've been doing quite a bit of programming using LUA and have discovered there are multiple different ways to interact with FSX. I'm just trying to determine what ways are better, simpler, more optimized, etc.

It's what is best able to do what you want to do, not which is more "efficient". I doubt you could measure efficiency.

Pete

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.