Jump to content
The simFlight Network Forums

Recommended Posts

Hi all,

I want to add two offsets to FSUIPC in order to save the value of two Q400 variable. These two offsets will be read by Spad.neXt.
So I wrote a LUA script that reads variables value (could be 0 or 255) and writes they to FSUIPC offset 66C0 and 66C3.
I need to read both variables continuously so I thought of writing a C# program that every 50ms would write to the 0x0D70 offset, and pass the Lua command with the name of my lua script. 
From what I understand when the 0x0D70 offset is written FSUIPC executes the indicated script via the indicated command, so I expect to have FSUIPC offset 66C0 and 66C3 filled every 50ms with the value of Q400's variables and ready for Spad.neXt.

Any comment/criticism/suggestion about this flow?

Cheers,

Alessandro

Share this post


Link to post
Share on other sites

It's very inefficient having a Lua plug-in loaded, compiled and executed repeatedly -- especially so often.

As John says, you can design you Lua plug in to operate at regular time intervals easily by using event.timer. You only have the plug-in loaded and compiled for you just the once that way -- loaded probably by an [Auto] section command.

Are these Q400 values obtained from L:Vars? If so then just use the event.Lvar function instead, one for each of the LVars you need to monitor.  The minimum monitor time there is currently set to 100 mSecs, not 50, but with two of them operating you might meet your 50 mSecs target.

Pete

 

Share this post


Link to post
Share on other sites

Hi,

excellent suggestion from both of you (I haven't no doubts about...).

Fortunatly the flow is written on paper at the moment so I could easly modify it. I woul read more in deep the documentation in order to reach the best performance of the module.

Many thanks,

Alessandro

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.