Inter-instrument communication

Help creating logic scripts for Air Manager Instruments

Moderators: russ, Ralph

Message
Author
Toddimus
Posts: 34
Joined: Wed Feb 17, 2021 6:01 pm

Re: Inter-instrument communication

#31 Post by Toddimus »

Keith Baxter wrote: Mon Oct 25, 2021 12:54 pm @Toddimus @Detlef

When you guys added your instruments to your panel. Did you add the instruments with the <var_id = si_variable_create(variable,unit,initial_value)> before the instruments with the si_variable_subscribe(variable,unit,callback_function) ?


Just want to clarify if that is your issue. The SI guy's took some valuable time out of their busy schedule and fixed the CTD which was caused by incorrect instrument starting order in the panel. This is for AM4.1 beta 12. So you issue might also soon be resolved in the next beta if it is not a oops in your code.

Keith
I'll check that out when I start the sim rig later tonight. That's a possibility but it worked fine with the exact same panels in version 4.0.2 with v3.7 plugin. I copied the whole settings (not program) folder over to the beta folder, so presumably it wasn't reordered. I'll verify though. Good detective work!!
Simstrumentation Instrument developer
Check us out http://www.simstrumentation.com or https://github.com/Simstrumentation/Air-Manager

User avatar
Keith Baxter
Posts: 4685
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Inter-instrument communication

#32 Post by Keith Baxter »

Todd,

If that is the case, Do not go changing anything if it is lot of work. It should be fixed in the next beta.

Simply wanting to know if your case is related.

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

Toddimus
Posts: 34
Joined: Wed Feb 17, 2021 6:01 pm

Re: Inter-instrument communication

#33 Post by Toddimus »

Thanks Keith. Went and checked. The instrument that creates the si_var is actually the very last one in the list of instruments and panels that actually uses the value. Go figure. :)
I tried re-arranging things and putting it at the top of the list of the (relatively to the other CJ4 instruments that are active and using the si_var), and it didn't fix the issue. Still no firing of the callback after changing a button press that should cause the variable to be written and associated callbacks fired. Here's how it looked before I moved things around. The one highlighted with red is the one that does the create and writing of the si_var.

Glad to hear it will be fixed! I'm just hoping this isn't an issue with the MSFS version of the plugin and you guys were chasing another bug with the X-plane version (if that's how it works internally).

@Corjan and @Ralph , please let us know when a new beta is available to test. It's tricky to see if anything new is available. THANKS!!
createLast.png
Simstrumentation Instrument developer
Check us out http://www.simstrumentation.com or https://github.com/Simstrumentation/Air-Manager

User avatar
Keith Baxter
Posts: 4685
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Inter-instrument communication

#34 Post by Keith Baxter »

@Toddimus

Did you delete ALL the instrument that has the subscribe and then re-add to the panel after the instrument with the dataref create?
Do not just move and shuffle in the panel. That will not fix.

Remember to shut down AM and then restart after your rework.

SI indicated that a new beta is expected sometime Thursday if all go's well. Could be sooner or later. From experience it takes a bit of time to push through.

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

Toddimus
Posts: 34
Joined: Wed Feb 17, 2021 6:01 pm

Re: Inter-instrument communication

#35 Post by Toddimus »

Aha, I did not delete then re-add. I actually had to delete one of them to make it go lower in the list (which seems like another bug of sorts) but the other, I just re-organized to put the create/write si_var instrument at the top. I'll try cloning and then deleting the original panels to move them to the bottom of the list with re-organized instruments to put the creater/writer at the very top of all things that involve the si_var.

EDIT: So I did reload the 3.8 beta2 plugin and AM v4.1 beta. Cloned my panels to place the creater/writer of the si_var instrument at the top of the CJ4 instruments (and panels). Got a couple of immediate crashes of Air Manager but the third try Air Manager did load up. Still not firing the callbacks when the si_var is changed. Again, totally works in v4.0.2 with v3.7 plugin.
Simstrumentation Instrument developer
Check us out http://www.simstrumentation.com or https://github.com/Simstrumentation/Air-Manager

User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Inter-instrument communication

#36 Post by Sling »

@Toddimus If you can narrow it down to 2 instruments in the panel only I can take a look for you when I get time.

@Keith Baxter This is not related to Rob’s knobster query. That’s more of a request for consistent behaviour with and without knobster.

Great work by the way on this. Only just read through this thread.
Last edited by Sling on Tue Oct 26, 2021 11:38 am, edited 1 time in total.

User avatar
Keith Baxter
Posts: 4685
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Inter-instrument communication

#37 Post by Keith Baxter »

Sling wrote: Tue Oct 26, 2021 2:59 am @Toddimus If you can narrow it done to 2 instruments in the panel only I can take a look for you when I get time.

@Keith Baxter This is not related to Rob’s knobster query. That’s more of a request for consistent behaviour with and without knobster.

Great work by the way on this. Only just read through this thread.
Hi

@Toddimus Probably best to just wait for the new beta. If that does not fix the issue then we can take it further. I do not have MSFS2020 but Tony does.

@Sling Yes the Knobster issue is probably not related. Just a long shot.

Thank you for the kind words. Appreciated.

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Ralph
Posts: 7923
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Inter-instrument communication

#38 Post by Ralph »

It working with 3.7 can also just be luck. It doesn't necessarily mean that your script is correct.

It is probably good to have a very good look at your script, to see if it is implemented correct.

User avatar
Corjan
Posts: 2939
Joined: Thu Nov 19, 2015 9:04 am

Re: Inter-instrument communication

#39 Post by Corjan »

Hi,

The crash has been solved and the fix is available in the latest AM BETA 17.

Corjan

User avatar
Keith Baxter
Posts: 4685
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Inter-instrument communication

#40 Post by Keith Baxter »

Corjan wrote: Tue Oct 26, 2021 1:58 pm Hi,

The crash has been solved and the fix is available in the latest AM BETA 17.

Corjan
Yup,

That fixes the CTD for me.
Thank you @Corjan and @Ralph for pushing the AM4.1 (Beta 17) through in express time.

Hope that sorts out the OP's issues and others.

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

Locked