Page 1 of 2

LUAMacros Get/SetVariable in XPlane11 doesn't work with Laminar Datarefs

Posted: 08 Sep 2019, 18:37
by carse77
I have problems getting or setting Aerosoft Datarefs in Xplane 11.

When the commands are not enough, I tend to use the datarefs variables with the LUA lmc get, set or inc commands

When using these together with eg the Aerosoft B737-800 they are not connecting to the sim. I have used them with other planes such as Rotate's MD88 with no problem. Also the build-in sim/... datarefs works as intended. I have no problems when just using the Aerosoft COMMAND-xrefs.

I've e.g tried these LUA commands:
print (lmc_get_xpl_variable('laminar/B738/engine/mixture_ratio1'))
print (lmc_get_xpl_variable('laminar/B738/ice/eng1_heat_pos'))

when commencing one of the above commands the LuaMacros output-prompt states:
'No value returned from Xplane'

It looks like a spelling error in the 'laminar/....' string, but it's spelled as in the Laminar documentation.
Or maybe the LuaMacros doesn't get along with the XLua 1.0.0r in Xplane used with the Aerosoft planes???

Any suggestions appreciated.

Re: LUAMacros Get/SetVariable in XPlane11 doesn't work with Aerosoft Datarefs

Posted: 09 Sep 2019, 08:46
by admin
LuaMacros plugin uses standard xplane SDk to read/set datarefs. If it works for standards it seems that communication between luamacros (program) and plugin works well. I don't own Aerosoft plane so cannot test myself.
Are you able to read/set these datarefs e.g. in daratef editor plugin?

Re: LUAMacros Get/SetVariable in XPlane11 doesn't work with Aerosoft Datarefs

Posted: 09 Sep 2019, 15:47
by carse77
Hi Petr. Thanks for the quick reply! I'll try to find such a plugin to see. I gave Aerosoft the credits for the planes but of course it is Laminar - as the datarefs also imply - Sorry for that!! The planes are the default ones that comes with Xplane 11.

… I've got the DataRef Editor (DRE) plugin from by Sandy Barbour and Ben Supnik! What an awesome tool !!!

The specific datarefs works fine with the tool, but cannot be read by LuaMacros via the lmc_get_xpl_variable. it returns:'No value returned from Xplane' when printed to the output prompt in LuaMacros.
I've also tried the Laminar Beachcraft Kingair C90B with eg. the XRef: 'laminar/c90/gear/handle_detent' and the failure also applies to this
The command works for the same plane with other Xrefs than the laminar - eg. the 'sim/cockpit2/engine/actuators/mixture_ratio_all' gets the variable as suspected.
Could it be because of some single/double parsing error??

Re: LUAMacros Get/SetVariable in XPlane11 doesn't work with Laminar Datarefs

Posted: 10 Sep 2019, 09:23
by admin
Double/single quotes should not play a role.
So I'll try to read "non-standard" variables from some custom plane and see if I have the same behavior.

Re: LUAMacros Get/SetVariable in XPlane11 doesn't work with Laminar Datarefs

Posted: 11 Sep 2019, 16:24
by carse77
Thanks. I've also tried removing the custom Zibo-mod B737-800 from the Installation and this doesn't help either.

Re: LUAMacros Get/SetVariable in XPlane11 doesn't work with Laminar Datarefs

Posted: 29 Sep 2019, 19:59
by admin
I think I found the problem - when dataref was declaring multiple data types (float, double and int) the lmc plugin couldn't read such value as it was expecting only one type.
I did experimental build of plugin which solves problem with laminar/c90/gear/handle_detent.
Download it at http://www.hidmacros.eu/win.xpl and let me know if it helps with other custom aircrafts

Re: LUAMacros Get/SetVariable in XPlane11 doesn't work with Laminar Datarefs

Posted: 26 Oct 2019, 13:22
by carse77
Well I couldn't get it working at first, not even your test on the C90. But after updating the whole luamacro it certainly works - at least the c90 "test".

I'm out of time for now so I'll give the Zibo'mod a try tomorrow.

Re: LUAMacros Get/SetVariable in XPlane11 doesn't work with Laminar Datarefs

Posted: 27 Oct 2019, 12:09
by carse77
I've tested a little bit further. The link you gave is probably not linked to the same file as original, because it doesn't work at all. The current LuaMacro version on GitHub is working to some extent though. I've tested it, both on the laminar/c90/gear/handle_detent XREF and the laminar/B738/engine/mixture_ratio1. The lmc_get_xpl_variable function is working on both, but the lmc_set_xpl_variable doesn't connect to the XREFs. Nothing happens. I've watched the DATAref editor. As I understand your last post, it is because the values are nested inside the XREFs (like in eg. C++ Structs or Classes). Is this rightly understood?

Re: LUAMacros Get/SetVariable in XPlane11 doesn't work with Laminar Datarefs

Posted: 27 Oct 2019, 13:47
by carse77
I found this post on the X-plane.org forum:
https://forums.x-plane.org/index.php?/f ... -readonly/

It implies that some of the laminar XRefs are readonly. I just don't know how they can be controlled and used by the Dataref editor.

Re: LUAMacros Get/SetVariable in XPlane11 doesn't work with Laminar Datarefs

Posted: 28 Oct 2019, 17:51
by admin
In the meantime I fixed other things and uploaded complete package so yes, don't use that link I gave you but download complete thing.
If you think that some set dataref isn't working then please
- give me again some example of standard aircraft (I can test myself)
- first make sure the dataref is writable (in documentation or using some other plugin that can write to datarefs)