LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

Avoid MathScipt Comments in EXE, Build & Run Problems - NI Please Fix these Bugs!

Hello,

 

After 4 days of intensive work, I have finally found the solution for two major MathScript Problems:

 

1) Mathscript Comments are included in your EXE File !!

    - Yes, if you do not watch your steps, the EXE will include all your % Mathscript Comments!

 

2) Problems building, but even worse: An app that builds with NO Error and NO Warnings will not RUN and creates the following misleading Erro Message:

 

    "The VI is not Executable. The full development version of LabView is required to fix the errors"

 

    With absolutely NO hint to what VI have the problem.

 

I have made myself an internal note how to avoid this problem. I am using LabView 2009, 2010 DS1 Release (I think this is 9.01) under WInXP SP2.

Rather than retyping everything, I will post the full text of my Notes below. I also mention several other LV BUG in this note, so pleae read carefully.

 

One is the TagSrv Error that occurs in LabView 2009 if I programatically deploy Shared Variables under the WinXP Development Environment. After this problem has occured, it will occur every time I restart XP, and in essense I have to restore to before I did this (thanks Nortong Ghost !!!).

 

Below you can find the full unabridged version of my Build, Run and Bug Notes for LV 2009 / 2010 DS1 (9.01). Hope they can be helpful to my fellow LabView programmers!

 

 

2010-07-03:

Building under LabView 2009 / 2010 DS1 Release (version 9.01)

Follow the steps below:

a) To successfully build an EXE that also runs

b) Avoid that MathScript Comments are included in the EXE !!!!!!!!!!!!!!!!

Before Building:


I) Recompile All  by pressing Ctrl+Shift and pressing the RUN button on the Application_References.vi
   Then Save All (about 1200 Vis are saved)

II) Make Sure that NO User Defined Mathscript (and Mathscript Nodes?) define Empty Functions:

    This seemed to cause the following problem with the built EXE: The main VI will be broken, and a dialog reports:

    "The VI is not Executable. The full development version of LabView is required to fix the errors"

    MathScitp BUG: Empty Functions causes no Build Errorm but RUN Error:

    The following User Defined MathScript .m files are candidates:
    log_write() and log_clear() whith do_log_write() and do_log_clear() commented out, these functions are empty.
    When calls to log_write() and log_clear() where removed, the problem above vanished !

   


Building the EXE:

1) Additional Exclusions:
 -"Disconnect type definitions": YES
 - "Remove unused polymorphic VI instantces": YES
 - "Remove unused members of project libraries": NO (do not know if this is important)

2) Advanced:
 - Enable Debugging: "NO"


3) Mathscript BUG: The Application Builder Includes ALL MathScript Comments in the EXE if you use the New Build File Layout:

   IMPORTANT !!!!!!!!!!!!!
   Advanced:
   
   "Use LabView 8.x file layout": YES !!!!!!!

   Using the new layout, causes ALL COMMENTS FROM USER DEFINED MATHSCRIPT .M FILES TO BE INCLUDED IN THE .EXE !!!!!!!


4) BUG: DSC Reference Problem in LabView 2010 DS1 release:

   In VI Deploy_Shared_Variables.vi we deploy alle Shared Variables using the "Deploy Libraries.vi" which is a part of the DSC option.
   As long as only deploying of Variables is used, using this VI should NOT require any DSC Runtime license.
   We have used this before with no compilation problems.

   However, starting with LV 2009 SP1 (or was it the DS1 2010 upgrade) LV will start nagging us to resolve references to tens of VIs
   in the DSC lib file ! Solution: Used press "Stop" on the dialog, and the Build will succeed and the EXE will work !


   Optionally, we could use the following Invoke node for the deployment:
   (see: http://digital.ni.com/public.nsf/allkb/04D9A85B6967EE87862571140065EEC6). Excerpt from this description:

  <<Right-click the block diagram to bring up the programming palette and go to Programming»Application Control and place the
    Invoke Node on the block diagram. Using the hand tool, click Method and select Library»Deploy Library>>

 

5) LabView BUG: Do NOT RUn the Application under the WIn XP SP2 Development Environment if the APP Deploys Shared Vars:
   This will cause the Dreaded TagSrv Error:  "TagSrv.exe: This application has requested the runtime to terminate in an unusual way".

   After this Error has occured, it will reoccur each time WinXP SP2 is restarted, and (Network) Shared Variables will NOT work any more!


 

 

Geir Ove
Message 1 of 7
(7,802 Views)

 

Hi

 

We are not sure what you you say "ALL COMMENTS FROM USER DEFINED MATHSCRIPT .M FILES TO BE INCLUDED IN THE .EXE".

Where are you seeing the comments How does you know that the comments are getting included?  Any information that you could give would be appreciated.

 

National Instruments

Application Engineering

0 Kudos
Message 2 of 7
(7,661 Views)

Hello,

 

In my .m Mathscript files I have comments preceeded by "%" like this:

 

% This is a comment

 

All such comments from ALL .m files are included in the .EXE file after compilation,

 

Too see this is quite trivial: Simply use a capable search tool (*) to search for the text in the final .exe file, and voila, there are ALL the comments that I surely do not want to give away like this !

 

(*) http://www.funduc.com/srshareware.htm

 

 

 

Geir Ove
0 Kudos
Message 3 of 7
(7,658 Views)

 

Hi

 

We compiled a VI, with a MathScript node in it and added the comments "%Please don't read this" and "%asdfasdfasdf", into and executable. Then we opened the code in Notepad++ and searched for these comments, but we did not find anything.

 

Maybe we have misunderstand what you meant and talk about different things? If you can clarify we will appreciate it.

 

0 Kudos
Message 4 of 7
(7,628 Views)

Hello,

 

I believe I specfied in previous mails to you that the comment problem only applies to User Defined Mathscript functions in .m files !

 

Notepad is not a good tool to search for text in an EXE file !!! See my link for a good tool.

 

Compile using the new compile method ( Use LabView 8.x file layout": NO),

 

Hope this helps.

 

Geir Ove
0 Kudos
Message 5 of 7
(7,622 Views)

Hello,

 

I also see that I stated in a previous postings (3 postings above this one)

 

In my .m Mathscript files I have comments preceeded by "%" like this:

 

% This is a comment

 

Please read my postings carefully, else we are waisting a lot of time on both ends, and I am already hard pressed for time...

Geir Ove
0 Kudos
Message 6 of 7
(7,617 Views)
Hello Geir,

I have tried to reproduce the behavior you are seeing where .m file comments appear in the final built executable.  However, I am unable to do so using LabVIEW 2009 SP1.  I have a caller VI with a MathScript node that calls the adder function in adder.m.  The contents of adder.m are as follows:
% ADDER This function adds 3 to its input variable
%   y = adder(x)
%   INPUT: x
%   OUTPUT: y, equal to x + 3
function y = adder(x)
y = x + 3;
I have configured the build specification as you mention in steps (1) and (2):
Additional Exclusions
 - "Disconnect type definitions" Yes
 - "Remove unused polymorphic VI instances" Yes
 - "Remove unused members of project libraries" No
Advanced
 - "Enable Debugging" No

At first, I did not include the adder.m file in the project.  I built the application and was not able to find the text "adder" anywhere in the EXE.  Then, I added the .m file to the project and put it in the "Always Included" section in "Source Files."  Again, I was not able to find the search text in the built EXE.  In step 3, you mention

geirove wrote:    

   "Use LabView 8.x file layout": YES !!!!!!!


but in the 5th post in this thread, you state


@geirove wrote:

Compile using the new compile method ( Use LabView 8.x file layout": NO),


I have tried both settings in the Advanced section, but again, I am not able to find any comments in the EXE.  I even added a call to the "path" function in adder.m.  This puts a warning glyph on the caller MathScript node and generates different code.  The EXE will return an unknown symbol error for adder (any VI with a warning glyph will not work in a built app), but I am not able to find any comments in the EXE.  This project is attached below.

 

21411i2F1FAD4B738AD5C8

As for your other item with a broken EXE if you call empty functions, I am unable to reproduce this as well.  I have taken the last attachment to your third post in this thread (the log_write function) and called it from the caller VI as well.  The EXE runs just fine and I do not find any comments in this EXE either.

Unfortunately, there was a rather serious issue in the LabVIEW 2009 MathScript RT Module, where some internal MathScript VIs could become corrupted when building executables.  Have you tried running the "Find Bad Instantiations" tool from this Knowledge Base article?  Simply installing the SP1 version on top may not have corrected any VIs that may be corrupted.

Due to our difficulty in reproducing the issues you mention, could you modify the attached project or else attach a new project, appropriately configured, that builds an EXE with .m comments embedded in it?  This way, we can uncover any minute details that we're overlooking.

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

 

 

 

Message 7 of 7
(7,508 Views)