LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

call vi from mathscript

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?

0 Kudos
Message 1 of 5
(6,694 Views)

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.

Mathew H.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(6,657 Views)

@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":

Capture.PNG

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):

Capture.PNG

 

 

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.

 

 

0 Kudos
Message 3 of 5
(6,655 Views)

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.

Mathew H.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 5
(6,635 Views)

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.  


http://www.luaforlabview.com/

Message 5 of 5
(4,700 Views)