Matlab script in executable won't run

I'm having trouble with getting a VI with a MATLAB script to run reliably, specifically when built into an executable.
I'm using LV8.0, Matlab R2006a.
The VI (not executable) runs properly when I start the computer fresh (i.e. just after a reboot)
The MATLAB command window opens as soon as I open the VI.
If I build an executable and run it, it works, so long as I haven't closed LabVIEW and the VI.
If instead, I attempt to close out LabVIEW and run the executable alone, the MATLAB command window does not start, and the MATLAB functionality is ignored.
I have updated all of my dlls, and I have checked the box enabling the ActiveX server (though I don't know what to name the server).  I have also read all the associated Knowledge Bases, and found their solutions did not apply.
I also have intermittent issues running the VI once I have tried running the executable.
If I make a change to my MATLAB script, I can get the VI to run again, but if it has failed once, the MATLAB command window no longer opens when the VI is opened.
I can solve this problem by rebooting too, but it seems like there should be a better way.
Any ideas?

Hi tblir,
Can you try to run and build into an
executable one of the shipping examples (i.e.  MATLAB Script – Fractal.vi)?  Let me know if this exemplifies the same behavior.
Ecleamus Ricks, Jr.
National Instruments
Applications Engineer

Similar Messages

  • MATLAB script in executable

    I made an exe out of a VI that uses a Matlab script. When I run the exe, I get a 1047 error (failed to send variable to script server) even though that error does not appear when I run the VI. I looked at the knowledge base document 1JNEPGU0 and did what it suggested, even though I shouldn't have to since I am on LabVIEW 6.1. I also am using the updated matscript.dll, per knowledge base document 300A6NDT (the VI did not run until I updated this.)
    My software is Windows XP, LabVIEW 6.1, Matlab 7.0.4 (R14)
    Thanks!

    Hi Nick,
    I think you are well aware that you indeed CAN interface with MATLAB 7.0 (R14) from LabVIEW 6.1 - that is part of what the KnowledgeBase 300A6NDT
    covers. Since you already got that working in the Development System,
    the issue must be caused by the fact that you are using an executable
    in stead of a VI. Did you follow the instructions specific for executables:
    "If using the MATLAB or Xmath Script Nodes
    in built applications you will need to also replace the appropriate
    DLLs located in the National Instruments\Shared\LabVIEW Run-Time\VERSION\script directory."
    If you already did that, we must look elsewhere for a solution. The
    following KnowledgeBase also covers an issue with executables and
    MATLAB:
    Why Does My Executable Hang When It Is Opened When I Use A MATLAB Script Node?
    If this doesn't work, please let me know the following:
    Are you running the executable on the computer that has the Development System installed?
    Is MATLAB open when the executable is called?
    What instructions  are you using to build the executable?
    Hope this helps!
    - Philip Courtois, Thinkbot Solutions

  • Matlab scripts that function properly when run in matlab generating errors in labview

    Hi, I'm running LabView 7.1 and trying to use some matlab scripts in my lab view script.
    The code runs fine in matlab, but when I run it in lab view I get errors as follows:
    "LabVIEW:  Error occurred while executing script. Error message from server: ??? Error using ==> mrdivide
    Matrix dimensions must agree.
    Error in ==> extract_inl_NI at 46
     in array_test.vi"
    There is no division in line 46 (in fact it's a blank line).  Are there syntax changes that I may not know?  Or perhaps a way to compile my code to ensure it runs correctly?

    Hello,
    Can you post your code (VI) here, or better yet a simplified version of it which still causes a problem.  If you can also post a simple version which functions as you expect, that would be nice, but it sounds like the plotting problem is intermittent.  This should work, per the following document, but perhaps there's an issue:
    http://digital.ni.com/public.nsf/websearch/57FE03DA9C357E9486256A0D00739CA6?OpenDocument
    Hopefully after seeing the code I will have more ideas about what may be going wrong.  As a final thought, are there any parameters to the plot function which can be passed to make it show the plot or make it the active window... could this be a very strange UI feature?  I guess it will make more sense when I see the VI(s).
    I look forward to your repost!
    Best Regards,
    JLS
    Best,
    JLS
    Sixclear

  • Executable won't run

    I have a main application calling a sub VI 'Sub Al getest2.VI" into a sub panel. When I include a 'display message to user' from the functions palette in de sub VI, the whole program runs fine in developer mode. After building an application, the sub VI opens in the main applications sub panel, but it won't run. The same if I add another custom VI to the "Sub Al getest2 VI" it also won't run after building the full application.
    The fun part is: If I create a new project with the sub Al getest2.VI as the main program (and including embedded sub VI's) I can build an executable and it will run fine on it's own.
    In the main application build I include all project files as 'Always included'.
    Do you have a suggestion what could be wrong?
    Attachments:
    Sub Al getest2 runs not.vi ‏34 KB
    Sub Al getest2 runs.vi ‏20 KB

    Putting a VI in a subpanel is not the same thing as calling it. If you want the VI that you're going to put in the subpanel to start running after you open the reference to it, you have to tell it to run by using something like the Run VI method an asynchronous call node.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Calculation Script... won't run after restart of acrobat

    I added a custom calculation script to a field. Works like a charm.
    However if I restart acrobat the script refuses to run. I go in and confirm the script is there.
    If i go in an just add a space or a comment to the script it will start running again.
    Any ideas?
    I also saved the PDF and opened it in reader on another machine. Won't run there.
    So I attached it to an onfocus event and that seems to work fine after saving??
    So I then tried adding a "simplified field notation" and the same behavior exists there. If i restart acrobat the only way i can get the simple notation to run is if I remove it and then re-add it. Otherwise it does nothing.
    Am I missing something obvious?
    Thanks in advance.

    George,
    I wasn't clear enough. The script does nothing. Editing values of text boxes that would trigger the calculation to occur will not run until after I have edited the script. (something as silly as just adding a comment will cause it to work again)
    For the simple calculation I need to remove it completely and add it again before it will work
    Here is an example for a net worth box:
    Add to "simple field notation"
    assets - liabilities
    Then I hit ok and whenever I add in some liabilities or assets those 2 fields are updated and my networth field is updated. Thats works great
    I save the file and then open it back up and add some liabilies/assets and the fields I used the built in "sum" function on continue to work (assets and liabilities) however my "simple field notation" does not update my networth field.
    I go back into field designer and verify that the simple field calculation radio box is still selected and that it still says
    assets - liabilities
    It continues not to run. I then go back in and edit it to remove the calculation.
    I then open it up again and select "simple field notation" and type in
    assets - liabilities
    This then works immediately and i am happy again until i save/restart acrobat (or try to open the PDF on another PC)
    Then I am sad again because the script doesn't run.
    I tried all these same steps with a JavaScript too. It will work until acrobat is restarted. If i edit the script by adding a space or comment it will start running again.
    So frustrating! Any help is appreciated.

  • 7.0 executable won't run on xp with new pci-gpib.

    This executable ran on previous version of windows. Automation explorer talks to gpib and instruments ok. GPIB version 2.2 installed. Executable doesn't seem to try to talk to gpib, ie. doesn't hang up.

    Hello,
    If you can talk to your instrument from Measurement and Automation Explorer then it means that the driver and hardware are installed properly. So it has to do with the application itself.
    Make sure that you are using the correct device name, because this new board might have gotten a different device number and also check the primary address.
    If you have LabVIEW installed in the computer sometimes the problem is because it was installed after the driver, so you might want to reinstall the driver.
    If you don�t have LabVIEW but only the .exe and the run time engine, then you can open NI-SPY and see if the application is trying to talk to the instrument at all.
    You can find NI-SPY in Start»Programs»National Instruments. Enable the capture a
    nd then open the LabVIEW application and run it. You should see some GPIB or VISA commands in the capture.
    Hope this helps.
    Ricardo Santa Olalla
    National Instruments.

  • Executable won't run on target PC

    Hi
    I have written an application to control a 'Data Translation' PCI data acquisition card (DT302) using LabVIEW (8.6.1). I have used Data Translations 'LVLink' VIs in the application. It works perfectly on the development PC as a VI and as an executable.
    The problem arises when I try to run the executable on a target PC. The program fails to recognize the DT302 card. I believe I have the necessary extra files/software installed:
    LabVIEW RTE (8.6.1)
    DT Open Layers for .NET Class Library
    LVLink2.dll
    Driver for DT302 card
    I know the card is installed correctly as it can be recognized by other (non Labview) programs. I think I may require an additional file or .dll but I'm not sure.
    Any help would be greatly appreciated
    Thanks
    Stuart

    Suspect this is due to a relative path call to the dlls being created by the calling VIs when you compile.
    It may be due to a version difference in the files mentioned on your PC and the ones used on the "blank PC".
    Recommend you make an installer which includes the dlls and re-installs them to the PC - it is possible that the NI calls to the dlls are modifying them or the registry.
    James
    Edit:
    Compare the Path between your LabVIEW PC and your blank one
    Also check the correct params are inserted in the path for any calls to functions external to LabVIEW, this could be causing breaks if %PATH% has not got the required files in it.
    Message Edited by James W on 05-18-2010 04:31 PM

  • Vi outside executable won't run - Labview 8.0

    Hello.
    I have a main program including a set of vi:s. I then have modules that hook into the program using vi:s in the main program.
    I call the module from the main program with a open vi reference + invoke node.
    #1 Main <- #2 module
    And it works great. I then build my main program to a executable and
    when I launch the executable (main) there is a popup searching for vi:s
    and then it dissapears. The module is not executed.
    I logged the error output on the open vi reference in the main program and it states: "Error 1003, could not find subvi:s".
    In application.ini i have:
    [application]
    viSearchPath="/path/path/application/*"
    Even if i remove the viSearchPath line the main vi looks for the sub
    vis, but Im not sure if its actually looking for the vi:s in my
    executable. Is there a way to check that the application is actually
    using the application.ini file? Am I doing something wrong? This is
    possible right? =)
    I'm running Labview 8.2, Linux version.
    Any help is more then appreciated.

    "Fox_Mccloud" <[email protected]> wrote in message news:[email protected]...
    Hello.
    I have a main program including a set of vi:s. I then have modules that hook into the program using vi:s in the main program.
    I call the module from the main program with a open vi reference + invoke node.
    #1 Main &lt;- #2 module
    And it works great. I then build my main program to a executable and
    when I launch the executable (main) there is a popup searching for vi:s
    and then it dissapears. The module is not executed.
    I logged the error output on the open vi reference in the main program and it states: "Error 1003, could not find subvi:s".
    In application.ini i have:
    [application]
    viSearchPath="/path/path/application/*"
    Even if i remove the viSearchPath line the main vi looks for the sub
    vis, but Im not sure if its actually looking for the vi:s in my
    executable. Is there a way to check that the application is actually
    using the application.ini file? Am I doing something wrong? This is
    possible right? =)
    I'm running Labview 8.2, Linux version.
    Any help is more then appreciated.
    Well, it's clear that the exe cannot find some subvi's used by the subvi. Some vi lib vi's are not included in the runtime (e.g. some of the picture control stuff). To be sure, you can save the sub vi as development llb, and include vi library vi's. That should include everything it needs.
    Under windows, you can start a VI with the executable. When the exe is running, you can use the command prompt to start a vi in the exe (e.g. c:\test.exe "c:\vi with missing subvis.vi"). This does almost the same as starting a vi dyamically, from the exe. A big difference is that you get a list with all the vi's that are missing in a dialog. Don't know if this works with Linux, but usually this work better...
    Another thing is when you use type defs. The exe, by default disconnects the type defs. The vi that is started doesn't. That will conflict. So untag the "disconnect from type defs and polymorphic vis" tag in the app builder (if it's in the linux builder).
    Regards,
    Wiebe.

  • Labview 8.5 executable won't run on Runtime Machines

    Created an .exe from my Labview Project TS_playback.lvproj.  I am running Labview 8.5.  Target computers have Runtime Engine 8.5.  Windows XP mostly (and 2000).  When I run the .exe I either get a quick flash of the loading vi box , or nothing at all.  If I have task manager open, I do see the exe open briefly before disappearing. 
    When creating the exe, I use my main vi as the startup vi.  
    I don't use any other files in 'Always included' 
    All subvi's and dependencies are 'Included if referenced' 
    Custom vi properties of startup vi are basically default, except - turn off run when open,  turn off allow debugging.   
    Note - the vi has locked subvi's associated with LockinPLL and LockinDemodulator.  
    The code itself is a torn down version of a much more complicated real-time version. This version is simply to post-process data, mainly for a client to fiddle with, so it is meant to function and not be pretty.  Sadly, now it only functions on our office machine.  
    Any help would be great.  
    Thanks
    Attachments:
    TS_Playback.zip ‏3064 KB

    Lokis wrote:
    Target computers have Runtime Engine 8.5. 
    There are two flavors of the runtime engine and you need the 97MB one. Could it be that you installed only the 24MB web browser version
    See this page for details.
    LabVIEW Champion . Do more with less code and in less time .

  • Matlab Script doesn't execute code

    Hi
    I'm using LabView 6.1 and Matlab 6.5. I have a VI that starts a simulator made in Matlab/Simulink. I need to execute a function in a matlab m file, and I'm using the Matlab Script node to do this. The problem is that the code only executes occasionally. Is there no guaranty that all code in Matlab Script is executed, or am I using it wrong?
    Thanks
    Petter

    You may want to take a look at this Knowledge Base on NI's website. It providess an update for using Matlab 6.5 scripts with LabVIEW 6.x.
    J.R. Allen

  • Error occured while executing Matlab script

    Hello!
    I want to run a Matlab script under LabVIEW, but there is always
    a error message which says "Error occured while executing script".
    Should I install Matlab on the same computer at first? if yes, do
    I need to configure Matlab under LabVIEW?
    Thanks!
    Le

    Yes No
    Eric P. Nichols
    P.O. Box 56235
    North Pole, AK 99705

  • PHP script won't run in the background

    Hi all
    Hope someone can help me with a weird issue I have...
    I am trying to run a php CLI script in the background and it just won't run - it has a status of Stopped SIGTOU (Trying to write output) - Here are the details
    OS
    Mac OS X Lion 10.7.2
    PHP
    PHP 5.3.6 with Suhosin-Patch (cli) (built: Sep  8 2011 19:34:00)
    Copyright (c) 1997-2011 The PHP Group
    Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
    I created a basic script  test.php
    <?php echo 'Hello world'.PHP_EOL; ?>
    Here are the results of various tests:-
    Test 1) php -f test.php  (Hello world gets displayed)
    Test 2) php -f test.php >test.log 2>&1 (Hello world gets put into test.log)
    Test 3) php -f test.php >test.log 2>&1 & --- I get [1]+  Stopped(SIGTTOU)        php -f test.php > test.log 2>&1 -- and the job just sits there doing nothing nothing gets logged however lsof shows the log file is open
    It has to be something to do with Apple's php build because a similar bash shell script gets executed no problems in the background...
    This has me stumped ... any ideas? What can I do to find out what is going on ...?
    TIA
    Rich

    Just realized your trying to load the php files by using the File->Open menu item in the Browser.  That won;t work.
    You have to load the php file by placing it in the Sites folder and entering http://localhost/file.php
    (or if you have user Sites enabled http://localhost/~user/file.php)
    The reason it is grayed out is that the browser doesn't run (or know of) php files. The web server runs those (via php) and the output of the file goes to the web browser.
    This page How to enable Web Sharing in OS X Mountain Lion does a pretty good job of explaining it. (as does the user tip I lonked to before)

  • I have some software problems of running matlab script node in the LabVIEW program.

    Hi there,
    I wrote a simple matlab code, like x= 1, y = x*2. Then I tried to put them into matlab script node in LabVIEW.
    However, when I ran the program, I couldn't run and Labiew show some error. 
    Then I tried the method talked before on this forum. Please see the following link.
    http://forums.ni.com/ni/board/message?board.id=Mat​hScript&thread.id=571
    I followed the instruction and open the "command prompt," type some commands then I could run the program, and simultaneously, the LabVIEW program open "Matlab command line window" and run my labview code. However, if I didn't use the command prompt, the  "matlab command window" will not be opened by running the labview program. It would just show some error. And even if I turn on the matlab program in advance, I still couldn't run the labview program.
    Is there any effecient way to deal with this problem without using "command prompt?" Because I try another PC with both matlab and labview installed on it, I "can" run my simple matlab script node on it, and it will open the matlab command line window automatically by running my code. Therefore, I thought there might be some software linking problems in the previous PC I used . Do you have any ideas?
    Thanks in advacne.  

    This board is for Mathscript, but you seem to have a matlab problem. You should probably post in the LabVIEW forum instead.
    What is your LabVIEW version? What is you matlab version?
    LabVIEW Champion . Do more with less code and in less time .

  • Matlab syntax errors are not caught and reported when code is executed in a LabVIEW Matlab script node

    I want to be able to catch errors that occur during the execution of Matlab code in a LabVIEW Matlab script node. According to my understanding of the documentation, errors of this type should be available at the "error out" signal point on the Matlab script node. I have noticed that even deliberately generating matlab syntax errors will not produce an error output. See the attached vi for an example.
    Attachments:
    matlab.vi ‏13 KB

    I ran your example VI and the is what I got in the Error Out cluster:
    "Code 1050
    Error occured while executing script. Error message from server: ??? This is an error
    . in matlab[1].vi"
    If you are generating custom error messages in Matlab I would suggest passing them back to LabVIEW through output variables in the script node.
    Chris_Mitchell
    Product Development Engineer
    Certified LabVIEW Architect

  • I cannot run the matlab script node in the labview

    Hi there,
    My LabVIEW version is 8.5, and matlab version is R2008a.
    I wrote a simple matlab code, like x= 1, y = x*2. Then I tried to put them into matlab script node in LabVIEW.
    However, when I ran the program, I couldn't run and Labiew show some error. 
    Then I tried the method talked before on this forum. Please see the following link.
    http://forums.ni.com/ni/board/message?board.id=MathScript&thread.id=571
    I followed the instruction and open the "command prompt," type some commands then I could run the program, and simultaneously, the LabVIEW program open "Matlab command line window" and run my labview code. However, if I didn't use the command prompt, the  "matlab command window" will not be opened by running the labview program. It would just show some error. And even if I turn on the matlab program in advance, I still couldn't run the labview program.
    Is there any effecient way to deal with this problem without using "command prompt?" Because I try another PC with both matlab and labview installed on it, I "can" run my simple matlab script node on it, and it will open the matlab command line window automatically by running my code. Therefore, I thought there might be some software linking problems in the previous PC I used . Do you have any ideas?
    Thanks in advacne.  

    Hi, and thanks for the post! I hope your well today.
    This may help,
    MATLAB® version 2006b (7.3) and version 2008a do work with LabVIEW
    8.20. This problem can occur if a new version of the MATLAB® software
    is installed along with a previous installation, which is then
    uninstalled. The uninstallation of the older MATLAB® software results
    in removing the ActiveX/COM components LabVIEW uses. This can cause the
    MATLAB® script node in LabVIEW to stop working. There are three
    solutions to this problem.
    Uninstall the MATLAB® software and reinstall it. This should install the necessary ActiveX component.
    Restore the MATLAB® automation server. Browse to the \bin directory (e.g. MATLAB\R2006b\bin) and type matlab -regserver ,
    which will reset the registry settings and start the server. The server
    can then be closed and the MATLAB® script node will work properly again
    in LabVIEW. LabVIEW may need to be restarted if VIs are open that
    contain MATLAB® script nodes.
    Leave both versions of the MATLAB® software installed.
    MATLAB® is a registered trademark of The MathWorks, Inc. Other
    product and company names listed are trademarks and trade names of
    their respective companies.
    Did you have an older version of MATLAB before 2008a?
    Kind Regards,
    James.
    Kind Regards
    James Hillman
    Applications Engineer 2008 to 2009 National Instruments UK & Ireland
    Loughborough University UK - 2006 to 2011
    Remember Kudos those who help!

Maybe you are looking for

  • HT5699 There was an error in the App Store. Please try again later. (100)

    This Message Apper When I Buy OS x 10.8.5 There was an error in the App Store. Please try again later. (100)

  • Fonts not showing up in CS4

    Leopard 10.5.8 CS4 6.06 fontAgent 4.140 All was well until a well meaning person swiped my hard drive by mistake. I have reloaded everything. My system had been fine for a year, no font problems. FontAgents plugsins are loaded and appear listed in pr

  • New MacBooks, No Firewire???!!!

    I am a support Technician for a School District in the Phoenix area and our Technology Department is VERY concerned about Apple's decision, NOT to include a firewire port in their new MacBooks. THIS IS A MAJOR MISTAKE. Our District owns and purchases

  • Edit published folders?

    Hello I'm trying out uploading with Goliath (having had no luck publishing iWeb>.Mac direct). I've published my site to a local folder and it's uploading now. I just wondered, when I edit my site, how do I open this new published local folder? Will i

  • ERMS - Factbase not determined correctly

    Hi All, I am facing an issue with ERMS, when I debug into the action handler services I can see that the BP number and Email Body is not being determined. Although during normal execution the process works fine. My Service Manager profile has the fol