drjdpowell Posted May 11, 2015 Report Share Posted May 11, 2015 I have a request to make an EXE be able to dynamically call a .m file with Mathscript. The .m file is User supplied and not knowable at build time. But my understanding is that the EXE compiles in the Mathscript, so this cannot work, and that other dynamic mathscript options (such as “evalâ€) do not work in an EXE. Has anyone encountered this issue before? Quote Link to comment
Rolf Kalbermatter Posted May 11, 2015 Report Share Posted May 11, 2015 I have a request to make an EXE be able to dynamically call a .m file with Mathscript. The .m file is User supplied and not knowable at build time. But my understanding is that the EXE compiles in the Mathscript, so this cannot work, and that other dynamic mathscript options (such as “evalâ€) do not work in an EXE. Has anyone encountered this issue before? Yes, when developing the LabPython interface which also has an option to use a script node. That is why I then added a VI interface to LabPython which made it possible to execute Python scripts that are determined at runtime rather than at compile time. However not sure how to do that for Mathscript. Quote Link to comment
hooovahh Posted May 11, 2015 Report Share Posted May 11, 2015 So I've never done this exactly as you need, but I have loaded simulink models into Veristand, and prototyped using these compiled model in LabVIEW using the Model Interface Toolkit. Here's a few links. http://digital.ni.com/public.nsf/allkb/0DCC5D6CFFBED96886257DFE00626859 http://zone.ni.com/reference/en-XX/help/374160A-01/vsmithelp/mit_convert_model_to_dll/ I don't know the full workflow, but you could have a user load a .m file in your software, which runs command line tools which compiles it to a DLL that can be loaded with this toolkit. Probably a decent amount of work. Or maybe it is an option to have the full LabVIEW development environment on this PC where you could perform scripting to make the Mathscript node, import the .m file, and save it as a VI that is then loaded into your EXE. No idea if importing a .m is exposed as a scripting method or not. Quote Link to comment
drjdpowell Posted May 11, 2015 Author Report Share Posted May 11, 2015 The workflow/setup is: — User has my EXE and takes calibration data with it (no LabVIEW Dev environment installed) — imports data into “Eigenvector Solo†3rd-party App to do advanced calibration — “Eigenvector Solo†outputs a .m file — my EXE imports and runs .m file on new data. It’s the last step that I think can’t be done, because the EXE can’t dynamically load and compile a .m file. Quote Link to comment
ensegre Posted May 11, 2015 Report Share Posted May 11, 2015 How sophisticate are the .m constructs in the output file? If they are basic, like variable assignments, and if the are consistently patterned, perhaps an ad hoc text scan can do. And if they are just a bit more complex, e.g. they involve some arithmetical and mathematical functions, they may be passed with minimal transmutations to formula nodes. Formula nodes are in my experience somewhat slow, but if manual exporting steps are involved, the parsing delay may be negligible.. Quote Link to comment
ldbm Posted November 16, 2019 Report Share Posted November 16, 2019 (edited) Hello there, Exactly the same problem trying to call dynamically a .m script from a LV exe in LV 2017 (so it is run in the MathScriptNode). It works using the IDE but not as an exe. Has there been any changes from NI on this? Thx. Note: guessing no, as the .m files are interpreted & compiled at build time since the interpreter is not included in the run-time engine... Edited November 16, 2019 by LDBM Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.