02-26-2016 01:03 PM
There are limits to mathscript. It can be slower. It is interpreted. It sometimes does not do things that a VI would do well. I can make a "percentile" function in LabVIEW (better than the current built-in) that runs much faster than the non-existent on in MathScript RT. It will not require a MatLab toolbox in order to run.
In MatLab I can call an exterior executable. I used this to improve performance. Can I do it in MathScript?
Is there a (stunningly friendly) way in LabVIEW that I can make mathscript call an "exterior" vi within the same project? If not, can I call the built-in LabVIEW functions?
02-29-2016 11:27 AM
Are you trying to call an executable file that you've made in LabVIEW or are you just wanting to make a SubVI to use in multiple places of your project?
If it's the latter, you could refer to this tutorial on SubVIs: http://www.ni.com/white-paper/7593/en/
Just save the VI file in the project and drop it wherever it's needed on other VIs.
02-29-2016 11:56 AM
@scmave - I have made subVI's before. I don't want "any" subVI.
I want a subVI that I can access from MathScript code.
Let's say I wanted to be creative and use a different norm than the classical one.
I could put something like this together in LabVIEW and called it "mynorm.vi":
This is going to run pretty quickly. I think it would run much faster than the interpreted version in MathScript.
I want to be able to make a line of text like this (except for the error):
And get an answer from it.
I might hear that there is all sorts of headaches about typing or unhappy-path-prevention except, maybe we could require the inputs to be initialized as inputs into the MathScript structure. Maybe we can put locks on type there, so that the MathScript treats it well, and doesn't modify it in a bad way.
03-01-2016 11:57 AM - edited 03-01-2016 11:57 AM
I don't believe there is a way to call a subVI from a MathScript node. The best you can do is call custom .m function files within your MathScript node.
For what you want to do, it would be best to create output from the MathScript node with the parameters to your subVI, and then create another MathScript node after the subVI if necessary.
10-20-2017 10:08 AM - edited 10-20-2017 10:15 AM
I use Lua for Labview to give my apps scripting capability that can interact (both ways) with vi's. One creates appropriate wrapper VI's for your existing Labview VIs or built in functions and then they can be accessed from scripts with a conventional function call syntax. Very handy. My goal is to provide the user with easy run time scripting, so I build an GUI around it, but that's not necessary, nor is it necessary to do it at run time. But my application is a little different from yours.