LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

Mathscript compiling speed

How slow is the compiling of Mathscript supposed to be? I am calling an m-file of only about 100 lines from a VI,  yet the compiling can often take over a minute. Is there any way to speed it up? If not, then how do I disable the auto-compiling everytime the VI is saved? Thanks.
 
 
 
0 Kudos
Message 1 of 4
(8,939 Views)
Umm, so I thought Labview offers lifetime support to its users? Has anything changed? Should I be calling the Labview office to ask instead? Why set up a discussion forum then?
0 Kudos
Message 2 of 4
(8,923 Views)
Hi,

Sorry about the delay in getting back to you on your question. (I thought I had configured myself to get alerts when new posts arrived here.)

To answer your question:

As you've noticed, the compile time performance of LabVIEW 8 MathScript increases exponentially as you increase script length. (The compile time performance here means the time that it takes to start to execute a script after you've made a change to the script.) We are working to improve this issue in a future release, but for now, one thing you can do to improve the compile time performance of your VI is to work to break up your script into smaller chunks of about 15-20 lines each. There are several ways you can do so:
  • Use multiple MathScript Nodes in your VIs, each with sections of your code. Because each separate MathScript Node will have a unique variable namespace, you will want to share variables and data between nodes by using the Global command or by running wires between the nodes.
  • Create user-defined functions that encapsulate parts of your script and call these from your main script.
Breaking up your scripts into smaller chunks can speed up compile time because it can localize any changes that you make to separate MathScript Nodes or user defined functions. When you make a change the LabVIEW MathScript compiler will only recompile the Node or function that contains the change.

You also asked if there is a way to disable auto-compiling every time a VI is saved. The MathScript Compiler does not actually recompile the m-file scripts with every save, it only does so when the script has been changed since the last save or run. With this release, there is no explicit switch configuration switch to set to disable this behavior, but a workaround to consider is that you can avoid a complete recompile by entering a temporary syntax error in the script that you want to disable the recompile for.

Finally, you might be interested in several other posts related to performance:
How fast is MathScript?
and
MathScript in LabVIEW 8 is Slow

I hope this helps and again, sorry about the slight delay in getting back to you.
Sam Shearman
0 Kudos
Message 3 of 4
(8,903 Views)
Thanks for the tips!
0 Kudos
Message 4 of 4
(8,896 Views)