LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

If statement problem in MathScript Node but not MathScript window

Is there some MathScript commands or syntax that are allowed in the script window but no in script nodes? Code which appears after and if block seems to run as expected in a script window but not a script node. 
The following code works as expected in the script window if I define p and mode and then run it. However in a script node with p and mode as inputs, the assignements that take place after the if block appear to never happen.

k=p(1);
R=p(3);
f=p(4);

if mode>0
k=1
end

J=p(2);
A=[-(k^2/R+f)/J 0; 1 0];
B=[k/J/R; 0];
C=[1 0];
D=0;

Anyone have any thoughts on what might be wrong?
0 Kudos
Message 1 of 3
(7,553 Views)
Hello,

To answer your question, all commands and syntax allowed in the MathScript Window are allowed in the MathScript node.  MathScript support for the LabVIEW application builder is a new feature of LabVIEW 8.20.  If you are building an application, there are certain functions that are not supported or whose behavior changes.  For more information about these commands, search the LabVIEW help for "MathScript Functions Not Supported in the LabVIEW Run-Time Engine."

I am unable to duplicate the behavior you mention in LabVIEW 8.0 or 8.20.  Can you try creating an error out indicator from the MathScript node to see if any errors are being reported?  If there are no errors, could you post a simple VI that illustrates the behavior you are seeing?

Thanks,

Grant M.
Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments
0 Kudos
Message 2 of 3
(7,546 Views)
I'm sorry. Apparently the problem was not the difference between the script node and the script window but the source of m input variables. It seems the ">" operator is not defined for integer data types and a quick typecast solves my problem.

Thanks anyway
0 Kudos
Message 3 of 3
(7,544 Views)