MathScript Node in PPL

Hi,
I am trying to compile a Packed Project Library containing every classes in my project. What I did is I created a project library, added the classes in it and made a build spec for the PPL. I got an error during the build process saying that one of my VI used a MathScript node and that this couldn't be part of a PPL. So I removed the class containing this VI from the library, as well as the classes containing VIs calling this VI, and so on... But I still get the same error for that same VI when trying to compile the PPL. Why is that??

It sounds like there must be MathScript nodes left somewhere in the application.
Try opening one of the VI's and pressing CTR+F to open the Find Dialog. In there you can select the MathScript node as the object you are searching for and keep the search scope as "All VIs in Application Instance."
You also can try building a packed project library of smaller parts of your VIs to try and isolate what section may be causing the error.
Craig H. | CLA | Systems Engineer | National Instruments

Similar Messages

  • Is it possible to define a function in the MathScript Node

    Is it possible to define a function in the MathScript Node

    You can not define a function inside of a MathScript Node, but only because it isn't necessary. The way custom functions work in MathScript is that they are saved in .m files located in paths in the MathScript path list. When the MathScript compiler receives a function that it doesn't recognize, then it searches for it in the path list, and upon finding it, compiles and loads the function. You can specify these search paths manually by going to File>>MathScript Preferences from the MathScript Window or dynamically by using the path() command within a script.
    To answer your original question, if you would like to create custom functions dynamically within a VI, then you can simply build your custom functions using strings and then save them to an ASCII file with the extension .m. You could either save the file to a path already in the MathScript path list or you could dynamically specify the path by passing the path into a MathScript Node as a string and by using the path() command at the beginning of your script to set it.
    Kind Regards,
    E. Sulzer
    Applications Engineer
    National Instruments

  • Calling a .m file from inside a mathscript node

    hello all i am hoping someone can help me out, I am in the process of converting our version 7.11 matlab node vi's to mathscript (I hope) AND I HAVE RUN INTO AN ISSUE. we have a very simple matlab script that bundled the data and sent it to another matlab sub routine. when i copy this script over to mathscript I get the following eror: Unknown symbol on line 13: Pre_Process_Function_Pulse. Is there a way I can call and run these subroutines from the mathscript node? Do i need to convert the sub routines into a mathscript file? or do i just need to change the syntax for my call? bmp of the offending line in mathscript attached. please forgive if this is an easy question, I am not really a matlab programmer, the files that we are running are provided from elsewhere, and i get to integrate them any and all help is always appreciated thanks Chris
    Attachments:
    mathscript.JPG ‏51 KB

    Hello again,
    Ok I am still having issues running the matlab script in mathscript.  I have gone back to the original scripts with all the nested sup routines.  and the mathscript code is just a call to the first .m file subroutine.  but for some reason mathscript will not recognize the function call as a call?  I recreated the original matlab node in a sequence, so the matlab node runs (successfully) and then the next sequence is the identical call in mathscript.  I have set the path in mathscript to the directory where all the .m files are located.  The pre-process_function_pulse .m file sequentially calls 6 very small .m subroutine files.  all are located in the same directory.  and this directory is the only one listed under path and working directory in Mathscript preferences.  Additionally from the last suggestions all traces of the original japanese comments have been deleted from all the .m files.  The inputs and outputs are the same for the matlab and mathscript nodes.  so i am basically at a loss here.
    Any and all help will be greatly appreciated.
    thank you
    Chris
    Attachments:
    mathscript.doc ‏138 KB

  • How to call User defined functions in Mathscript Node ?

    Hi,
    I have created a user defined function and saved it to Search path of Labview as an M file. If I run my program in Math script window, the function is recognized and the program works properly. If I do the same with MathScript node , the user defined functions are not identified.
    Kindly help me with this problem. Thanks in advance
    Cheers
    Lenord Melvix

    This page may help:
    http://zone.ni.com/reference/en-XX/help/373123C-01/lvtextmathmain/caveats_recommendations_ms_search_...
    Kevin C.

  • How to use mathscript node in server side with the parameter from the client side

    I tried to develop a server/client system with some algorithms written in matlab. So I included a mathscript node on the server side. The client will send the parameter to the server. According to these parameters, the sever will call the matlab functions to do some computings and then send the results back to the client. The server has to wait for all parameters received before the computings. How do I know this since I only connect the parameter variables to the inputs of mathscript node on the server. The sever cannot know whethere these parameters are the new ones or old ones since the client may send parameters multiple times?

    It seems to me you have two perfectly good options to start with. You could send all possible parameters in a single packet from the client to the server. This could be in the form of a cluster or an array of values. If by server/client you mean you are sending data over the network, then you could flatten this data to string before sending and unflatten it on the other side. Since all parameters come in one packet, you know all the data is valid every time you send data.
    The other option is to send the parameters individually, but include some extra information such as a timestamp or iteration count. The server keeps reading and storing parameter values until a packet arrives with the next timestamp. Alternatively, you could include some information such as an end-of-parameter-list boolean that is sent with every parameter. It would be false until the last parameter packet.
    Give it a thought. There are lots of solutions.
    Jarrod S.
    National Instruments

  • How to implement a user-defined function in a mathscript node

    I am trying to use a mathscript node that includes self-defined functions, but I always get an error. I tried to run an NI-example: MathScript using Riemann Zeta.vi ,and I got the same error I get when I run my own programmes:MathScript Node'MathScript Node' (zeta): User-defined function contains an error. I didn't change anything in that example, so what could be wrong?

    Try the Mathscript forum instead. Good luck.
    (Maybe start reading this, for example)
    Message Edited by altenbach on 11-18-2009 01:48 PM
    LabVIEW Champion . Do more with less code and in less time .

  • Changing a path dynamically in a MathScript node

    I have inherited a MatLab script that must be run in LabView. The first issue I have is creating unique paths. When a Unit Under Test runs, its data will be saved to a file based on the serial number of the UUT. The MatLab script then analyzes the data from that file and creates a new file based on the serial number with a new file extension. Therefore, I need to read in a file whose path changes and write a file whose path changes. The relative path will be the same but the unique file will not. I am looking for suggestions on how to do this since there will be hundreds of serial numbers being tested. It would be nice if the node could have an input that could configure to a path or string type instead of a scalar only. The serial numbers will be apha-numeric and this must be able to exist as a stand alone application.
    Also, the node reports a 'unexpected token: function'. I am noticing that functions must be a seperate .m file but how do you call the function after that?
    I am using LV 8.5
    Thanks - Jeff
    Message Edited by j.masse on 07-07-2008 07:57 AM

    Hello Jeff,
    Creating unique paths is not difficult in MathScript.  Simply pass in the string you want to use as the specific part of the path and have a local variable contain the base path.  For example, if you have a string input named serial to the MathScript node, the following code will build a path:
    basepath = 'c:\data\';
    filename = [basepath serial];
    You mention needing to do this for a large number of files.  The easiest way to do this is to have your loop in LabVIEW and simply pass in one string at a time to the MathScript node to do your processing.  If there is a lot of setup work involved before the work that needs to be done for each file, then it is more complicated.  There really isn't a concept of an array of strings in the language.  The closest you can get is a cell array containing many 1D character arrays.  However, LabVIEW MathScript does not yet support this construct.
    You can pass in a LabVIEW 1D string array -- the MathScript node input will adapt to the type wired to it.  What it does is create a 2D character array in MathScript.  If not all the strings are the same length, then it will pad the end of the string with zeros.  This presents a problem when you try to use the string as a filename.  However, you can use the strrep (string replace) function to replace the zeros with empty strings.  For example, assuming you have an input variable named serial that is a 1D array of strings and a loop-control variable named index, type
    basepath = 'c:\data\';
    name = strrep(serial(index, : ), char(0), '');
    filename = [basepath name];
    You cannot write a function inside of a MathScript node.  What you can do is create a .m file on disk and add the directory to your MathScript search path.  The default search path is your "My Documents\LabVIEW Data" directory.  But if you add the file elsewhere, there are three ways to set the search path for MathScript.  First, from the MathScript Window, go to "File >> LabVIEW MathScript Properties" and click on the "MathScript: Search Paths" category item.  This will set the search path for the MathScript Window only.  Second, from a LabVIEW VI, go to Tools >> Options and click on the "MathScript: Search Paths" category item.  This will set the search path for all VIs in the main application instance only.  Third, from within the project explorer, right-click on "My Computer" and select Properties.  Then click on the "MathScript: Search Paths" category item.  This will set the search path for that context only.  Since you are talking about using this in a built application, the third option will likely be what you need.
    As for using a built application generally, as long as you avoid any MathScript function that describes itself as being unsupported in the run-time engine, you should be okay.  The help for individual functions will list if they are unsupported.  You can see a list of all such functions by looking in the LabVIEW help index for "MathScript" and double-clicking on the entry for "functions not supported in Run-Time Engine."
    Grant M.
    Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments

  • How to make a text based language in mathscript node executed faster?

    Hello Everyone,
    I have build a VI contains mathscript function node, due to the big data needs to run it takes long time to finish the execution, is there any way to make the process faster, such as building shared library so it can be called by call library function node, or this only valid for c and c++ .
      any help will be highly appreciated

    smercurio_fc wrote:
    There is no way to convert the Mathscript code to a shared library.
    Please post what you're actually doing in the Mathscript node. As Gerd noted, there's probably a way to do this using native LabVIEW functions.
    While it may not be possible for a direct conversion from MathScript code to a DLL, it is possible to build a shared library using the application builder from a VI containing a MathScript node. This could be one way to get MathScript code into a shared library.
    The application builder is included with LabVIEW Professional Edition. You can setup a shared library by going to the project explorer and right clicking "Build Specifications" and selecting New->Shared Library (DLL).
    -K Scott

  • Mathscript node errors due to not being able to find .m files

    I recently installed LV 8.5.1 and tried to open a VI with a mathscript node (originally created with LV 8.2).  It got a broken arrow due to an unrecognized symbol in the node which was the name of a matscript function in a .m file of the same name.  And this worked fine with 8.2.  I updated the mathscript: search paths 'Working Directory' both in the mathscript window and the main app Tools->Options list.  I exited and re-started, but to no avail.  And I made sure to add it as a 'recursive' search folder, even though my file is right at the top.
    What am I doing wrong?

    Hello Umars,
    In LabVIEW 8.5 you won't be able to use user defined functions if you are you using a Base Package.  Regardless of which package you are using you may find the LabVIEW help file informative.
    Calling User-Defined Functions from LabVIEW MathScript (Windows, Not in Base Package)
    http://zone.ni.com/reference/en-XX/help/371361D-01/lvconcepts/calling_udf/ 
    David A
    National Instruments
    FlexRIO Product Support Engineer

  • EXE I built unable to open reference to VI with MathScript Node in it

    Hi Everyone,
    First off, I'm using Labview 8.5 on Windows XP.
    I have two VIs. One called "Main Instance.vi" and the other is called "code.vi". The Main Instance vi is very simple. It opens a reference to code.vi. Using this reference, it dynamically calls code.vi using the "Call by Reference" node.
    The code.vi is also fairly simple. On this VI's connector pane, I have two inputs "a" and "b" and one output "c". All are of double data type. These controls are wired to a MathScript Node where the code inside is simply:
    c = a + b;
    So the idea here is that I am using the Main Instance VI to dynamically call and pass two numbers to code.vi. code.vi adds these two numbers via MathScript and returns the answer back to the Main Instance VI.
    This all works fine and dandy within LabView. However, when I build Main Instance.VI as an application, I am no longer able to open a reference to my code.vi because it has a MathScript Node in it. I put error indicators on the front panel of Main Instance VI to monitor the Open reference and Call by Refernce nodes. As VIs running in Labview, I get no errors and everything works fine ("a" and "b" are added and "c" is the correct answer). When Main Instance is an exe I get errors 1003 for the open reference function.
    I have attached screenshots of the Vis as well as the VIs themselves.
    Any guidance is appreciated. Keep in mind that I have to use Labview 8.5 as this is just an example of a bigger problem that is occuring in our software while developing a solution for a customer. Right now our software is compiled in Labview 8.5.   
    Attachments:
    Main Instance.vi ‏15 KB
    code.vi ‏30 KB

    Hello,
    As you may know, MathScript is implemented on top of LabVIEW.  Consequently, there are various VIs and controls from LabVIEW's vi.lib directory that are needed for a MathScript VI to run.  A built application can run on a computer that does not have LabVIEW installed.  The LabVIEW Run-Time Engine provides support for LabVIEW's primitives, but any functionality implemented in a VI must be included in the built application.  Otherwise, the application cannot find those support VIs. 
    Basically, the problem is that in trying to run your MathScript VI, you are only giving the application the top-level VI and none of the subVIs.  A way that will likely work around this is to build a source distribution with your MathScript VI.  Create a project with your VI in it.  Create a new source distribution build specification in the normal manner.  (I don't have LabVIEW 8.5 installed at the moment, but these are instructions for 8.6)  In the "Additional Exclusions" section, uncheck the "Exclude files from vi.lib" setting.  This should pull in all the subVIs you need to run the VI.  Then, open your top-level VI from your built application.
    Grant M.
    Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments

  • Dynamically loading the MathScript Node

    Hi - Is it possible to dynamically load script into the Mathscript Node at Run time. I see that you can use define functions and paths and things . But being a newbie to Mathscript could all this hang together to make dynamic loading a possibility and how?
    thanks dht 

    Hi,
      unfortunately the node doesn't support run-time dynamic loading of scripts. You can load variable values with the load function, but not scripts.
    http://zone.ni.com/reference/en-XX/help/371361A-01/lvtextmath/msfunc_load/
    http://zone.ni.com/reference/en-XX/help/371361A-01/lvhowto/saving_loading_scripts/
    Depending on your application, you could use a case statement to decide between several pre-built (and possibly compiled) mathscript nodes, and acheive the functionality that way.
    Another option might be to use the formula vi's instead, although this will require a more complex architecture to parse the text file you'd generate.
    For more information on MathScript, please see the following link
    http://zone.ni.com/devzone/devzoneweb.nsf/Opendoc?openagent&568C773718B080F286257096005BD314
    Hope that helps
    Sacha Emery
    National Instruments (UK)
    // it takes almost no time to rate an answer

  • Are you using the MathScript Node in LabVIEW or the MathScript Interactive Window?

    Are you using the MathScript Node in LabVIEW or the MathScript Interactive Window? I am very excited with the MathScript Node inside LabVIEW. However, I would like to see what other people think.
    Avalim

    Avalim,
    Personally, I am determining that I like to use the MathScript Node in LabVIEW.  It makes it easier for me to pass my data in and out of the LabVIEW environment!!  But, like you, I am excited to see what any other users think!!
    -Jeff P
    Jeffrey P.
    LabVIEW Product Management
    National Instruments

  • Global - MathScript Node Failed To Compile Error

    I have Labview 2009 SP1 with Mathscript Module.
    While using 'global' command, I've encountered "MathScript Node Failed To Compile Error" from the first time I tried it. 
    In Mathscript window:
    'Error in line 0:  An internal error occurred while processing this MathScript. Contact National Instruments with the MathScript you used.'
    is produced for any simple 'global a' (or any other variable name used).

    Opps, one step you missed in the error code: Contact National Instruments with the Mathscript you used.
    Go ahead and attach some example code that is throwing this error and I'll see if I can reproduce it on this end. There were a bunch of updates to the Mathscript Node in the F3 Patch so make sure that or LabVIEW 2009 SP1 is installed.
    Also, are you seeing this on any other computers?
    Look forward to hearing back!
    Logan H
    National Instruments
    Applications Engineer

  • Mathscript node: an internal mathscript error has occurred: 64-bit LabVIEW 2009

    Hi Folks -
    I have an installation now of
    LabVIEW 2009 9.03f, Vision, and Advanced Signal Processing Toolkit, all
    64-bit versions on a new computer so that I can convert some code from
    32- to 64-bit.
    I figure I will address errors
    one-by-one and here's the first one.  I have a VI with a mathscript
    node and the VI, which loaded and ran fine in the 32-bit environment,
    is now broken and giving the error "mathscript node: an internal
    mathscript error has occurred."  My main concern - is mathscript not
    supported in 64-bit LabVIEW right now?
    I am attaching the VI.  Any ideas are appreciated.  I need to get this working.
    Also, NI, is there a special 64-bit forum that we should post to in the future, or create to post to?
    Sincerely,
    Don 
    Solved!
    Go to Solution.
    Attachments:
    sort.vi ‏753 KB

    From 2009 help
    LabVIEW MathScript is a text-based language you can use to write functions and scripts. You can process scripts using LabVIEW MathScript in the LabVIEW MathScript Window or a MathScript Node. When you create a LabVIEW MathScript, you must use supported data types.
    The MathScript syntax is an intuitive and logical
    syntax predominantly based on standard mathematical and computer
    programming terms, terms in widespread and common use, and/or
    descriptive abbreviations, truncations and concatenations of standard
    terms. The LabVIEW MathScript Window and MathScript
    Nodes are able to process files you create using the current MathScript
    syntax and, for backwards compatibility, files you created using legacy
    MathScript syntaxes. The LabVIEW MathScript Window
    and MathScript Nodes also can process certain of your files that use
    other text-based syntaxes, such as files you created using the MATLAB® software. Because the MathScript RT Module engine is used to process scripts in the LabVIEW MathScript Window
    and MathScript Nodes, and because the MathScript RT Module engine does
    not support all syntaxes, not all existing text-based scripts are
    supported.
    (LabVIEW 64-bit) LabVIEW MathScript is not supported in LabVIEW (64-bit).

  • Is it possible to use a file refnum as an input of mathscript node

    Hi everybody,
    I just began to use LV and mathscript recently. One problem confused me a lot.  That is,
    Is it possible to use a file refnum as the input or output of mathscript node? A picture is attached for your reference.
    Thanks a lot!
    Gary
    Solved!
    Go to Solution.
    Attachments:
    Q-001.jpg ‏45 KB

    What would you hope to do with the reference?  The Mathscript node doesn't have a file reading capability.  You need to read the file and pass the data into the Mathscript node.
    EDIT: I stand corrected.  You need to use the fopen and fclose functions inside of the MathScript node to be able to read a file inside of it.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

Maybe you are looking for

  • Adobe Photoshop CC not working

    Adobe Photoshop CC is not working today when it was working fine yesterday.  Windows says it isn't working sends a message and closes the programe down.  I am a Tafe student I do not know anything about IT all I want is for the programme to open and

  • "iTunes has stopped working..." error when I sample songs on iTunes

    Whenever I try to sample a song on iTunes, I get the an error that says "iTunes has stopped working. Windows is trying to find a resolution to this problem." After windows is done searching for a solution I am only given the option to "Close Program"

  • Refresh the display list

    Hi experts,   i am using one standard function module in my program.  i am calling this program using a submit and return statement in another program.In the standard funtion module one write statement is used.  My issue is once the function module i

  • RoboHelp for Word in RoboHelp 9

    I just upgraded from Robohelp X5 to Robohelp 9.  After installing version 9, I am unable to find where the new version of Robohelp for Word is.  All I can find is RoboHelp HTML.  How do you work on existing Winhelp projects with version 9?  We switch

  • I have cs 4 with an upgrade to 5.5. how do i go about installing it on my new computer?

    this is the worst thing i have ever done in my life. i am trying to install 5.5 on my new computer.  i have bought cs 4 in the past and bought an upgrade to 5.5. i have installed cs 4 just fine. now i would like to apply my upgrade to it. but the ins