LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem running application using odeoslver in Mathscript

Solved!
Go to solution

Good day.

So, my objective is to create a Labview application (will be used in other computer) which allows me to run a mathscript code which in turns calls a function to solve an ode problem.

I don't understand why it doesn't work... I use the 'current directory' function to see where Labview is searching for the function and I introduce it afterwards in that directory (manually).

The application returns the paths but doesn't return any results besides those...

The program works fine when I dont use it in the application...

The function script is presented as an image.

 

Thanks in advance...

 

 

0 Kudos
Message 1 of 17
(1,970 Views)

Hello PAlmeida6,

 

Can you also share the .m file that you have introduced in that area?

 

Are you aware that there are ODE Solvers in MathScript itself available and that you don't need to create a new one yourself?
http://zone.ni.com/reference/en-XX/help/373123C-01/lvtextmath/msfunc_ode/

Kind Regards,
Thierry C - CLA, CTA - Staff R&D Engineer, RF Semiconductor Test - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 2 of 17
(1,926 Views)

Hi ThiCop.

I'm using the ode15s of mathscript.

The m file (presented as an image, fsystem12.m) is just a simple function that defines the derivatives as being equal to 1.

Thanks

 

Regards

Pedro Almeida

0 Kudos
Message 3 of 17
(1,911 Views)

Hello Pedro,

 

You're right!

 

I always seem to forget that ode_bdf15 has also a legacy name ode15s:

http://zone.ni.com/reference/en-XX/help/373123C-01/lvtextmath/msfunc_ode_bdf15/

 

The reason I asked for the m-file is because I didn't see any reason why it should not work.

Why are you actually not setting your search paths through the Development Environment Options?

http://zone.ni.com/reference/en-XX/help/373123C-01/lvtextmath/msfunc_path/

This will allow you to define in advance in which folders will be added as search paths in the ini-file of your executable.

 

What might even be easier is to just have a llok at the ini-file of your application/executable and add a line like this, that mentions all the paths that should be added:

mathScriptPath="C:\Users\blcoppet\Documents\LabVIEW Data;C:\Users\blcoppet\Desktop\SRs\Forum\ODESolver\Builds"

 

Does this resolve the issue?

 

Kind Regards,
Thierry C - CLA, CTA - Staff R&D Engineer, RF Semiconductor Test - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 4 of 17
(1,894 Views)

Hi ThiCop

Thanks again for your reply.

I tried to input the line you said (after changing it to my current folder) and it didn't work.

I also tried using the Application Directory node (which outputs PATH_NAME) and adding 'path(PATH_NAME)' to the mathscript node and it also didn't work...

 

'Why are you actually not setting your search paths through the Development Environment Options?'

I'm not sure where in the builder I can specifiy that? Is it under a certain tab in the 'My Application Properties' menu?

 

Weird thing is the program runs with no problems when I execute the LabView code but the application doesn't...

Thanks for the help so far.

 

Regards

 

 

0 Kudos
Message 5 of 17
(1,885 Views)

Hello PAlmeida,

 

You normally shouldn't have to use any application directory node or path node to follow the steps mentioned above.

You should be able to just add the line mentioned above in the ini-file that is in the same "Build"-folder as your executable.

 

In this case I was not talking about the Application properties of you Build Specification, but about the Options about the Development environment itself.

 

Can you share with me the project and all depending files (VIs, .m-file, ...)  you are using at your side?
This way I can check where it exactly is going wrong and try to correct it.

Kind Regards,
Thierry C - CLA, CTA - Staff R&D Engineer, RF Semiconductor Test - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 6 of 17
(1,870 Views)

Hello ThiCop

 

I tried first including the line in the ini file and then the directory node as separate tests.

You can find in attachment all the files that I'm using for the application formation.

The ini file has been changed according to my systems folder path. I run Windows 7 32bit as Administrator.

Thanks in advance

 

Pedro

 

0 Kudos
Message 7 of 17
(1,867 Views)

Just to add that I tried to run an installer including the RTs and the application in another computer and basicaly the VI does nothing...

 

0 Kudos
Message 8 of 17
(1,833 Views)

Just more info on the problem...

The next script clearly shows the problem is at the function calling. It doesn't find the path to the m function...

In the zip file I have, the files, project and application... The ini file was changed to include the path (I tried all combinations possible to no avail...even with the originial ini file)

Regards

0 Kudos
Message 9 of 17
(1,814 Views)

Hello PAlmedia6,

 

It looks like the only search path that's been defined for the application context is the default one:

 

Untitled.png

 

If you want to auto-load a given path for this application space (not a "standalone" VI outside of a project), you'll want to define it there- right-click on the target (My Computer) in the project and select the Properties option to configure this.

 

The VI you provided is failing because it is looking in the application directory (\Project) rather than the file location (\Files), if the path is changed or your files are included in the "project" directory, then the node executes successfully.

 

The issue in the built executable you provided is because the "path" function isn't supported (with inputs) in the LabVIEW Run-Time Engine- the error is getting swallowed because there isn't an indicator or error handler and automatic error handling is disabled by default in built executables.  From the help:

 

"This function is not supported in the LabVIEW Run-Time
Engine
if you specify an input for the function. Either do not specify an
input or remove these functions from your scripts before you build a stand-alone
application or shared library."

 

I was able to get this to run by adding the "files" path to the application instance (which also fixes the development environment error), removing the path function, and rebuilding the executable.  Hope that helps!

 

Regards,

Tom L.
Message 10 of 17
(1,802 Views)