LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Are user defined functions called from a mathscript block compiled into an EXE?

I have a Labview project with a single VI with a mathscript block that calls a user defined file "testscript.m".  When I compile this project/Vi, is the current value of "testscript.m" interpreted and compiled into the EXE?   I was wondering if, after creating the EXE, could I change "testscript.m" and expect the behavior of the EXE to change, (i.e., is there a mathscript interpreter built into the Labview Runtime Engine)?

 

 I don't have Teststand and I am looking for a way for technicians to change the sequence of a test without having to recompile the EXE.

 

 

 

0 Kudos
Message 1 of 5
(2,686 Views)
Hello,

When you build an application, the current contents of your 'testscript.m' file are put in the executable.  Unfortunately, you cannot change the .m file after this and see the result of your change in the executable.  Depending on the extent of the changes you wish to make to the file, you may be able to parameterize the file appropriately and have the technicians select different tests to run.

Grant M.
Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments
0 Kudos
Message 2 of 5
(2,657 Views)

Grant M.,

So what are my alternatives if I still want to do external test scripts without recompiling and without purchasing Teststand?

 

If I had Matlab Installed, I could use the Matlab Script block as in the MATLAB script node -Lorenz Diff Eq.vi example.

But if I don't have Matlab installed, what other options are available to me?

Is there a Script block for Scilab?

 

 

0 Kudos
Message 3 of 5
(2,651 Views)
Hello,

If your test scripts are truly external, then MathScript will not work for you.  But, if you have a set of scripts (be it 5 or 50), you can compile them all into your executable and then simply choose which one to run through a LabVIEW UI.

One alternative is to purchase a copy of LabVIEW for your test machines.  Instead of running an executable, the technicians could run a LabVIEW VI.  Since the full compiler is present, they could change the script being executed.

As you mention, another alternative is to use the MATLAB® script node.  However, both this and the previous alternative require the purchase of additional software.

There is also a Scilab script node.  It does not ship with LabVIEW, but it is available as a free download.  Go to http://www.scilab.org/ to download Scilab.  Follow the link on the Scilab homepage or go to http://zone.ni.com/devzone/cda/epd/p/id/657 to download the LabVIEW to Scilab Gateway software.

MATLAB® is a registered trademark of The MathWorks, Inc.

Grant M.
Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments
0 Kudos
Message 4 of 5
(2,637 Views)

Thanks. I'm trying to avoid the additional cost of another seat of Labview or Teststand.  I'll check out the Scilab scripts. 

 

I've thought of two other options as well, Excel Automation using VBA, and if I'm just changing Labview controls as a function of time, then I can just read in an Excel or text file as a matrix with the first column as time and the other columns as changes in specific Labview controls.  Then I could sequence a set of Labview controls.  I suppose that I could do the reverse if I wanted to learn a sequence from a real user by recording the control changes as a function of time and writing them to a file, but I currently don't currently have a "teach"  requirement.

 

Thanks for the suggestions.

0 Kudos
Message 5 of 5
(2,627 Views)