LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

MathScript features

Hello!
I have problem using MathScript node in LabView 8.20.
Can Mathscript node execute formula, which is passed to input in string format.
More precise -  I write formula on my pront panel String control, then I pass it to MathScript node. Is it correct to do that?
 
Thank you in advance!
 
0 Kudos
Message 1 of 6
(8,468 Views)
Hello,

It is possible to do what you wish.  Simply wire your string to an input variable of the MathScript node.  You can then pass this string to the eval function.  It will perform a run-time evaluation of the script.  However, if you wish to have any outputs from the MathScript node, you must add those when creating the node.  For example, if you create an output variable called "a," you'll need to make sure your script always creates an "a" variable or an error will occur when trying to read "a."

Note, however, that this is a very inefficient way to run MathScript.  Since we are unable to work with the script until run-time, we have to perform code generation at that time.  Also, since the script could possibly change with each execution, we need to generate code every time.  With code typed directly in the node, it is compiled once and then simply run each successive time.

Grant M.
Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments
Message 2 of 6
(8,448 Views)
Can you give some code example how to handle this?
Thanks in advance


Aivars Severdaks
0 Kudos
Message 3 of 6
(8,432 Views)
Hello Aivars,

I have attached a screenshot illustrating what I had previously mentioned.  Note that I need to create the output variable "a" on the MathScript node even though I have no indication that such a variable will be created by the script.  If the script does not always create all output variables requested by the node, you will see an error condition.

Grant M.
Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments
Message 4 of 6
(8,404 Views)
I can use mathscript with LabView Full Development System on the board Blackfin BF537?
0 Kudos
Message 5 of 6
(8,311 Views)
Hello,

At this time, LabVIEW MathScript can only be targeted to the desktop PC.  However, LabVIEW RT and the Blackfin are on our roadmap.

Grant M.
Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments
Message 6 of 6
(8,301 Views)