Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

mathscript in LabVIEW

I often use mathscript node and Matlab node in my Labview codes.
 
Instead of writing all the scipt file in the mathscript node, is there a way I can just call the script file name.
 
For example, I have a script file named "Proj.m" which is very  long, and will take a lot of space in the mathscript node. Is there anyway I can just type the name of the script file in the node, and it will execute the file .
 
I tried Proj.m in the Mathscript node, but gave me an error, but when I put the script codes , it worked fine.
 
Thank you.
0 Kudos
Message 1 of 7
(10,101 Views)
We have a dedicated mathscript forum:
 
 
I would recommend to post this over there. Good luck! 🙂
0 Kudos
Message 2 of 7
(10,094 Views)

This issue is with LabVIEW , not mathscript.

I am using the mathscript in the Labview enviroment. I am not asking how to use mathscript, rather I am asking how to use a particular node in LabVIEW.

I perfectly know how to use mathscript. My question relates to LabVIEW enviroment.

Thanks.

0 Kudos
Message 3 of 7
(10,092 Views)
You would still be better off posting to the Mathscript forum or at least the normal LabVIEW forum instead of the academic forum which doesn't see a lot of traffic and is not viewed by most LabVIEW users.
0 Kudos
Message 4 of 7
(10,077 Views)


@okogidi wrote:
I am using the mathscript in the Labview enviroment. I am not asking how to use mathscript, rather I am asking how to use a particular node in LabVIEW.

... and that particular node is the mathscript node, right? I am not sure if you are trying to be funny here. 😉

In any case, this is also NOT the LabVIEW forum, but the LabVIEW SE forum, which stands for "student edition". The Student edition is not that different from the LabVIEW full version so all normal programming issues that are not specific to the student edition should be discussed in the LabVIEW forum, which has much more traffic:

http://forums.ni.com/ni/board?board.id=170

Your problem is very specific to mathscript (yes it is!). I still believe that the mathscript forum would be a better option. It is regularly visited by some of the developers of mathscript and you should get a clear answer pretty quickly. Look through the old posts over there, your question might already be anwered. Good luck!

0 Kudos
Message 5 of 7
(10,073 Views)
You can call a .m file script from a MathScript node or the MathScript interactive window by:
  1. Save your .m file script as a text file with a '.m' extension in a folder that is within the MathScript search path. By default, the MathScript search path contains your 'My Documents\LabVIEW Data\' folder, so you can save your .m file script there. Alternatively, you can add more folders to search through the MathScript preferences settings available through the MathScript window or by using the MathScript commands 'path' and 'addpath'.
  2. To invoke the script from a script node, enter the name of the file without the .m extension. For instance, to invoke a script with a filename called 'contoura.m', enter 'contoura' in a script node or from the MathScript interactive window.
Hope this helps,
 
--Sam
 
Sam Shearman
Message 6 of 7
(10,074 Views)

Thank you sir, it worked as you indicated. I did not have to put the .m extension.

Ade

 

0 Kudos
Message 7 of 7
(10,032 Views)