wlbragg wrote in Mon Nov 25, 2019 9:44 pm:So no issue if you use nasal and state system. The issue is only if you want to use JSBSim plus state system without nasal?
My problem is to make JSBSim work correctly depending on the input data, obviously if JSBSim starts when all the data are not present ... I have a problem ... Certainly NASAL is another problem, another programming language only known to those who program in FGFS, NASAL was born as an embedded language in the XML code and in my experience it is not easy to use python as an embedded language as it means having a virtual machine for each embedded process ... honestly I don't know, but it seems to me that this it was the objection on the part of those who claimed NASAL that in some respects it has a similar approach to Erlang. Java Script could be an useful alternative ... coupling Java Script to an XML is a simple thing, but I don't know how efficient it is for FGFS, Java Script is a very powerful language and sometimes it can seem like killing an ant with an elephant ....
Instead the JSBSim entry is very different, the XML is compiled and reduced to a series of calls to C ++ functions, which correspond to the modules, JSBSim has no variables, but only the output values and any hidden memory variables inside the individual blocks. JSBSim has many elements in common with a functional language, only the blocks are described in XML.
For me JSBSim is convenient as it is clear what happens and with well-defined timing, made essential in an RT (Real Time) language.
The problem is that JSBSim is an external language and therefore it must be called during the execution of the main program, theoretically (I would very much like this solution), it could be executed as a separate task, but anyway when JSBSim starts .. the simulation starts when a plane is stopped on the runway .. changes little .. but if instead the plane starts the simulation in flight, a landing gear out at 350-400 nm ... for a dozen seconds frankly it is not a beautiful thing ... Obviously there are various ways to solve it, but the simplest and most correct way for me is to start JSBSim at the right time or when the aircraft's programmer thinks the right moment has arrived.