From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

MathScript Nugget #4: Blazing Speed

Thanks Jattas & ttrr

 

From ttrr I learned about the global def. I have used this with the Plot command to increment the line number I write to in the Plot window. 

 

At the beginning of my program I now do the following in a ms node:

 

global lineNum;
lineNum = 49;

set (axes, 'YLim', [0, lineNum+1], 'XLim', [0, 30])

 

 

Then, every place I want to "print " to the plot window, I do:

 

text(0,lineNum, 'k_V4: My Comment')
lineNum = lineNum - 1

 

I have not have time to look at how to define my own ms functions yet, but I think this could all be wrapped in a

mywrite.m file that defines the global and decrements the line number.

 

 

Geir Ove

 

 

Geir Ove
0 Kudos
Message 11 of 13
(3,468 Views)

Hi Jattas,

 

Between Mathscript node and formula node, which one is better integrated with LabVIEW, native to LabVIEW, and runs faster?  I am writing instrument driver.  If one of my customers has a only got a base-licence, he will not be able to run something writen by Mathscript.  Can he run if driver is writen by formula?

 

Thank you.

0 Kudos
Message 12 of 13
(2,970 Views)

Hello,

 

I ran a quick test in LabVIEW 2010 and you can create and run the Formula Node in the Base version. If your application must run in Base LabVIEW then you are correct that MathScript is not an option, so you're left with the Formula Node or pure G code.

 

There are many tradeoffs in the general question of Formula Node vs. MathScript Node. MathScript supports more functions (700+ vs about 40) and has more usability features like debugging and syntax highlighting. They both have excellent run-time performance but the Formula Node is often a little bit faster. As mentioned, the Formula Node is also available in the Base version and doesn't require purchasing an additional product (the MathScript RT Module).

 

I hope this helps you make your decision.

 

jattas

LabVIEW R&D

Message 13 of 13
(2,964 Views)