Decio Pedroso

LUA Engine freezing - many reloads needed

Recommended Posts

Hello Folks:

This week I got my CS 737 out of the hangar and started to fly it again. Additionaly, once I did not found any LINDA Module for her, I've taken the risky decision to begin my own one. I can tell you it is indeed on course and the main functions I use on my Saitek pannels are already working.

However, I have being facing an annoying sequence of LUA engine freezing during the flights and also while in the development process. Key commands just stop responding and I have to reload LUA Engine. It usually happens at least once every 10 min.

I have tryed many other add-on airplanes, including some from the own CS, but I only get this problem when using CS 737. So, it is very clear to me that it is an issue with that specific plane. However, I wonder to know if there is any way to avoid that problem, or any tip of what on that plane may be causing that.

Otherwise, is there a hotkey to reload the LUA Engine? It is farway to be a solution, but would help in the meantime.

Thank you!

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hi Decio

I will need to get you to follow the fault reporting thread procedure and email me your logs so I can see what is happening. You don't tell me which version of LINDA, FSUIPC, Flt Sim or Windows you are using.

I also don't recognise the CS737 aircraft. All aircraft without their own specifically written module will be treated as FSX Default. I would not recommend creating you own module unless you have experience with LUA programming for LINDA. 

The latest beta version of LINDA 3.0.0 provides the CTRL+ALT+R hotkey for restarting the LUA Engine. LINDA 3.0.0 is compatible with 32-bit (FSUIPC4) and 64-bit (FSUIPC5) Flt Sims. 

  • Upvote 1

Share this post


Link to post
Share on other sites

Hi Scotflieger:

 

Sorry by my lack of information. I will provide everything you need and send by email.

As per your suggestion, I've upgraded LINDA from 2.96 to 3.0.0.678. The issue persists but at least now I have the power of Ctrl-Alt-R. Great!

I have wrotten a couple of modules and changed some others. I am far away to be a LUA expert but I have some background on programming and I think the CS 737-200 module is going to be well. I will be glad to share it as soon as I a first version be ready.

Thank you for your outstand support.

Decio

Share this post


Link to post
Share on other sites

Hi Decio

i am pleased to help. When you say 'the issue persists' I assume it is with your own CS737 module and does not occur with default or not other aircraft. 

It sounds to me like your module is entering an infinite loop stopping other functions running. LINDA LUA runs on a timer with some events. It runs in a single thread so cannot run functions concurrently. Any function must be run to carry out an action and exit. The use of loops within functions (while do/for do) must be kept short so they do not lock up and keep looping. The same applies to conditions (if then) which will never be met. Otherwise LINDA will appear to freeze and stop working. If an action needs to operate over even a few seconds, you need to use exposed timers like AircraftTimer10Hz() to re-call your operation with global variables. 

I hope my explanation is understandable. 

  • Upvote 1

Share this post


Link to post
Share on other sites

Hi, ScotFlieger:

Yes, this issue was related only to CS-737-200. LINDA runs beautifully with any other plane.

But, as you know, because of your prompt support I was able to fix that and I am almost ready to finish my first version of CS 737 module.

In order to share the resolution of this issue with the LINDA users community, firstly I must say that actually it was not LUA Engine freezing the cause of the issue, but my misunderstandig of how to use the SHIFTED mode.

CS 737 has an issue regarding the AP Heading indicator, that makes it incompatible with Saitek Multipanel. Every other AP function as IAS, course, VS and Altitude are fully operational, but HSG.

So, I had to write an specific function to deal with this and, in order to allow it works without interfering with other AP functions, it was necessary to use the SHIFTED mode. Happens that, because of an error of mine on setting the proper modes to the Saitek function selector, LINDA was shifting to SHIFTED mode and never getting back to UNSHIFTED, where all the other functions were setted to.

As a result of that, every button or command stoped working, looking like LUA Engine itself has frozen. Specially because, after reloading it, LINDA turns back to UNSHIFTED mode and everything backs to normal.

So, my learning with that is: take special care when working with SHIFT modes.

Thank you ScotFlieger for your invaluable support.

Decio

Share this post


Link to post
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