LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

How to share a variable between the Mathscript windows and a Mathscript node

Solved!
Go to solution

Hello,

 

I am trying to share (simply) a variable between the Mathscript windows and a Mathscript node. I do not know why, but the use of the "global" Matlab function makes the mathscript node output formats change.

I am looking for a "Mathscript RT module V9.0.1" as it seems it exists. French technical support has some difficulties to find it ...

 

PC Vista + Labview 2009 9.0f3 (32bits) + Mathscript RT 9.0.0 + cRIO
0 Kudos
Message 1 of 7
(9,161 Views)

Hi,

 

When you make a variable global in MathScript Node, LabVIEW can determine the data type of that variable only at run time. Then, you must configure the data type of the terminal manually.

 

0 Kudos
Message 2 of 7
(9,150 Views)
I have tried but when "global' is used in the mathscript node, most of the output data type are forbidden (real double for instance). I guess this is a bug, then i am looking for an update (9.0.1 ?) of the mathscript RT module.
PC Vista + Labview 2009 9.0f3 (32bits) + Mathscript RT 9.0.0 + cRIO
0 Kudos
Message 3 of 7
(9,146 Views)

Hello,

The MathScript RT Module version 9.0.1 you speak of is the 2009 SP1 release of the MathScript RT Module.  While available internally, it has not yet shipped.  This would explain the difficulty in finding it.

As ttrr notes, you must configure the data type of the global variable manually.  You mention you are using LabVIEW 2009.  I'm not sure what you mean by the real double is forbidden.  In the screenshot below, you should be able to choose that type manually.  What do you see instead?

Grant M.
Senior Software Engineer | LabVIEW MathScript | National Instruments

 

MStypes.png

0 Kudos
Message 4 of 7
(9,134 Views)

Thank GrantM ... but I had already tried and after the modification of the data type, the answer (in french 🙂 )of the compiler is that it can not compile the mathscript node 😞

 

Image2.jpg

 

Does it work for you ?

PC Vista + Labview 2009 9.0f3 (32bits) + Mathscript RT 9.0.0 + cRIO
0 Kudos
Message 5 of 7
(9,129 Views)
Solution
Accepted by topic author patrick33

Hi patrick33,

 

The code that you attached should not report an error, so it seems like something has gone wrong with your installation of MathScript. My best guess is that it is the issue described in this knowledgebase article. Your signature says that you are using the f3 patch, which is a good start. But the KB lists some other steps to take when you see errors about MathScript being unable to compile. Can you try the steps in the article and let us know if that fixes the problem?

Thanks,

jattas

LabVIEW MathScript R&D

Message 6 of 7
(9,118 Views)

GREAT, its works!

 

Find Bad Instantiations.exe detected 11 errors. 

Then I removed the \LabVIEW Data\InstCache\9.0 folder and restart LabVIEW.

 

Now, Find Bad Instantiations.exe does not detect error and my VI with a mathscript node (with "global" inside) can be compiled.

 

Many many thanks jattas.

 

PC Vista + Labview 2009 9.0f3 (32bits) + Mathscript RT 9.0.0 + cRIO
0 Kudos
Message 7 of 7
(9,102 Views)