Including a Matlab Script in a VI I got the error "Failed to send variable to script server." How do I solve it?

I´m using LabVIEW 6.1 and Matlab 6.5

Hi Dunns
There were some problems interfacing labview 6.x and matlab 6.5
Take a look at this link. Probably, you will have to download the patch for your versions.
http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/ce309627064a3d5686256a9c005b0a5f?OpenDocument
Hope it solves your problem.
Alipio
"Qod natura non dat, Salmantica non praestat"

Similar Messages

  • Error 1047 in LabVIEW 8.2: LabVIEW failed to send variable to the script server. Server:""

    I am working with the evaluation version of labVIEW as well and I have run into another error.  I am using a MATLAB script node within a for loop and attempting to pass the for loop counter variable into the script.  When I run the code it brings up a 1047 error and says "LabVIEW failed to send variable to the script server. Server:"" ".  I looked up the error online which seems to have roots in a failed auto initialization of MATLAB.  Is there something that I can do in labVIEW to fix the problem or is it strictly a MATLAB error?  
    I really appreciate your help.

    I'm using Labview 8.6 and Matlab 7.9 2009b on windows 7 (64bit)
    when I tried to open the Lorenz Diff Eq.vi....it woes not work and gives the error
    Error 1047 occurred at LabVIEW:  LabVIEW failed to send variable to the script server. Server:"" in MATLAB script node - Lorenz Diff Eq.vi
    I think there is no inital communication for opening the MATLAB server
     any can help?
    A.Hakim

  • Variables not correctly sent to Matlab script server

    When using a Matlab script node in my LabVIEW code, I've noticed that variables are sometimes improperly sent to the script server. What happens is an m-by-n matrix in LabVIEW arrives in Matlab as a 0-by-n or 0-by-0 empty matrix. Typically the affected matrices are large -- 500 to 20,000 elements.
    Unfortunately, we haven't been able to recreate the error intentionally. On the other hand, when the error does occur by chance, it frequently continues to show up until the system is rebooted.
    This error has appeared using the same code on multiple systems, all of which are running Matlab 6.1 and LabVIEW 6.0.2.
    If anyone has encountered similar problems or has any insight into this problem, your help would be
    greatly appreciated.
    Zach Lerner
    OnWafer Technologies, Inc.

    I encountered this problem several times too.
    I passed a 'real vector' of size ~80 to a MatLAB input node, and it turned out to be a 0-by-0 empty matrix in MatLAB. This happens nearly every time after I reboot the computer.
    What I do is first to find out which variable is empty (from the MatLAB command window). Then stop the VI and rewire that input node.
    p.s. I have LabVIEW 6.0.2 with MatLAB 6.0.
    Dan

  • Error 1047 w/ Labview 8.20: Labview failed to send variable to the script server

    Hello,
    I have found similar questions, but with previous versions of Labview and Matlab and no resolution. Could someone please enlighten me? I'm using Matlab 7.4.0 (2007a) and Labview 8.2 and this is the error I get when I try to input a 1D array into a matlab script node.
    Thank you much.
    Message Edited by johng3 on 02-11-2008 01:20 PM

    Hello Johng3,
    Regarding error 1048 you are getting, please refer to this knowledgebase, which explains why this happens.
    Eli S.
    National Instruments
    Applications Engineer

  • 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

  • Compiling VIs with Matlab scripts

    Hi everyone,
    I need to build application for a VI with some matlab scripts included in the block diagrams using the Matlab scripts node. I've been searching for related topics and I'm hoping someone can help me understanding the big picture here.
    Background info: I'm using LV2012, Matlab 2013. I DON'T USE MathScript RT Module.
    Question:
    1. To build a stand-alone application for the use on a PC with Matlab software but no LabVIEW, do I just simply build the application in LabVIEW project?
    2. To build a stand-alone application for the use on a PC wthout Matlab and LabVIEW, do I need to create a DLL from Matlab and modify my VI to use "Call library function node" and then build the application in LabVIEW project?
    Thanks for answering my questions!

    Question:
    1. To build a stand-alone application for the use on a PC with Matlab software but no LabVIEW, do I just simply build the application in LabVIEW project?
    Yes,  Assuming it is a windows machine and the Licensed version of Matlab is version 6.5 or later the LabVIEW Run-Time engine knows how to call the Matlab script server through Active X.
    2. To build a stand-alone application for the use on a PC wthout Matlab and LabVIEW, do I need to create a DLL from Matlab and modify my VI to use "Call library function node" and then build the application in LabVIEW project?
    You cannot use a Matlab math script node without a licensed version of Matlab 6.5 or later resident on the target and the target must support Active X so, Windows only.
    Jeff

  • Error 1048 Matlab Script depends on string length

    Using: Labview 8.2, Matlab 2007a, Windows XP (AMD X2 4200+ 3GB RAM).
    I'm having an issue with MATLAB script server, Error 1048 failed to get variable from script server.  I've read the forums, but most posts are years old and don't address variable size issues.  I have no problem with these strings inside the MATLAB command window.  I'm somewhat inexperienced with LabView, so maybe this VI could have been simplified.
    I'm writing data files with a tab header, using MATLAB to perform some operations on data (I have a library written to do certain things and can't really spend the time to recode in Labview).  When I try to pass out the new header string, I get error 1048 only when the string length goes above a certain size range.  I have iterations because I want to process hundreds of files in a similar fashion to this VI.
    Header length ~ 1300 chars has always been fine, regardless of number of iterations within the VI.
    Header length ~ 2600 chars presents some errors; not deterministic.
    Header length ~ 5200 chars has many errors; not deterministic.
    Header length ~ 7800 chars has many errors, fails almost all the time.
    Also, timing delay after reading in the file seemed to do nothing to help.  Pausing at the end of the MATLAB script did not seem to help. Clearing MATLAB/restarting LabView did not seem to help.  Is there a way to catch variable-specific errors from the script window?  Notice that the output variable is not cleared when it fails to be obtained from the MATLAB window.  I could wrap the whole thing in a while loop until there are no errors, but that doesn't help when the length is so large none of them succeed.   I can split the string inside matlab, but I'd have to create n strings and then concatenate them outside, which still gives me a lack of scalability.  Is there any better way to handle this kind of non-deterministic error?
    Thanks very much for reading.
    Attachments:
    header6001.txt ‏8 KB
    Matlab Script Server Test1.vi ‏38 KB
    header1001.txt ‏2 KB

    Does NI monitor these forums for bug reports to fix?  Here's a non-scalable hack solution I mentioned earlier, creating n string outputs and concatenating them in Labview.  I've checked this in Matlab using the code below.  I've included the VI if anyone has the same issue and wants it.
    Note that I chose to throw the size error if the string is too large for the n you choose.  I prefer this to trying to check the string output to see if it was truncated.
    hcols = size(hstring,2);
    for k = 1:8
        hvar = strcat('h', sprintf('%d',k));
        if( hcols >  k*1000 & k < 8 )
            hcom = sprintf('%s = ''%s'';', hvar, hstring(1, ((k-1)*1000+1):k*1000 ));
        %if size < k*1000, or we're at the end with leftovers, copy what's left
        elseif( hcols >= (k-1)*1000+1  &  (hcols <= k*1000 | k == 8 ))
            hcom = sprintf('%s = ''%s'';', hvar, hstring(1, ((k-1)*1000+1):end));
        else
            hcom = sprintf('%s = '''';', hvar);
        end  
        eval(hcom);
    end
    %Matlab validation code.  Do not use strcat, as it will chop tabs at the endpoints.
    newh = sprintf('%s%s%s%s%s%s%s%s', h1, h2, h3, h4, h5, h6, h7, h8);
    strcmp(hstring, newh)
    Attachments:
    Matlab Script Server Test2.vi ‏40 KB

  • Matlab script in LV6.1 built app fails after upgrade to Matlab 7 (R14).

    The LV6.1 built app, running under LV6.1 runtime, successfully invokes Matlab script server, R13. After Matlab upgrade to R14, the script server fails to activate. Use of the newest matscript.dll download is not a satisfactory solution, since it fails on systems still running Matlab R13. Is there a universal fix for this problem? I have already checked the related postings.

    voraciousniuser wrote:
    > Hey Joxyl! I think the reason why we are not able to do this on R14 is
    > because Mathworks has modified its ActiveX interface -- I dont know if
    > NI has a fix for it yet, but probably the way to go would be to use
    > the previous release. I hope NI brings out a patch for it soon. Hope
    > this helps -- Thanks VNIU
    This fix has been released just recently and announced in several
    threads on this forum yesterday.
    href="http://exchange.ni.com/servlet/ProcessReques​t?RHIVEID=101&RPAGEID=135&HOID=506500000008000000F​4E80000&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0&USEAR​CHCONTEXT_QUESTION_0=matlab+script+7.0&USEARCHCONT​EXT_QUESTION_S=0">this
    thread for more information.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Matlab Script Inputs

    I'm trying to run the example file "MATLAB Script - Lorenz Diff Eq.vi" and get the following error. Any idea why?
    Error 1047 occurred at LabVIEW: LabVIEW failed to send variable to the script server.
    Server:"Inappropriate input array sizeE" in MATLAB Script - Lorenz Diff Eq.vi
    Possible reason(s):
    LabVIEW: LabVIEW failed to send variable to the script server.
    Also, when I run the example code from the help file in a separate vi:
    a=rand(50)
    surf(a)
    it works fine, but when I add inputs and outputs to the same script, the inputs and outputs work, but it never draws the surface 'a' or seems to update 'a'.
    Thanks for your help!
    Attachments:
    matlabtest.vi ‏14 KB

    Alejandro,
    Thanks for your help. When I run the sample code for the rand() and surf() functions, Matlab runs the code properly, opens a new figure to display it, updates dynamically and even outputs the variable 'a' back to Labview correctly.
    So, outputs seem to work fine, but I haven't been able to get any inputs to work. So that leads me to believe that the Matlab server is working (as it can crunch code and send back data), but perhaps it's not enabled to take an input or I'm trying to pass the input improperly.
    Is there any trick to send an input to Matlab? In other words, if I send a constant, for example, the number '2' to Matlab, I wire a constant '2' to the input on the Matlab VI block and then set the data type as 'Real', and I get the
    error.
    Does the error have to do with the array size (as it claims, even though I'm trying to pass in a single real constant, not an array...), or is it really a communication error as you suggest? Thanks for your help!
    Neville

  • Matlab Script in LV 8.0 for 'SIM Command'

    Dear all
    I have problem using Matlab Script in LabVIEW 8.0 for 'SIM(Model, Final Time)' command.
    1. Does Matlab Script Server supports all the functions in Matlab 7.0.1?  I runned 'SIM(Model, Final Time)' on the LabVIEW Script, but no results obtained. It is supposed to get a figure output there.
    2. If I run some function in Matlab Script with input parameters. Do I have to set these parameters in Matlab Script of LabVIEW as 'Input' or I can set them in Matlab Workspace first then apply them directly. Since some of my parameters are classified as structure class. They won't allow me to use them in Script as 'Input'.
    Thanks for your help!

    Good morning,
    Thank you for posting. 
    I believe that you are using the MathScript node, but I am a little uncertain:
    If you are using Mathscript, you do not need to do anything
    with any ‘server’, but the particular function you request may not be
    implemented.  Which type of node are you
    using?  If you are using Mathscript, and
    the function is not implemented, feel free to request it – we are happy to
    consider implementing it for a future version of LabVIEW.  If you are using the MATLAB Script Node, I
    suspect the problem is with the way the node is setup, or with the ActiveX
    server.
    Again, thanks for posting-
    Message Edited by Travis M. on 07-18-2006 10:37 AM
    Travis M
    LabVIEW R&D
    National Instruments
    Attachments:
    untitled.JPG ‏62 KB

  • I get the error message "unresponsive script" when I try to open Firefox, and then I can only delete the message by going to Task Manager.

    After I downloaded the Firefox update, when I tried to open Firefox I got the error message: "Warning unresponsive script...etc". This happens every time and the choices in the message ("continue" etc) are unresponsive. Further I can't delete the error window without going to Task Manager to end the program. The problem also disabled Internet Explorer which will now simply not load. Google Chrome is working. I assume it relates to the update since the problems (for both Firefox and IE) occurred immediately after the download.

    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]
    If it does work in Safe-mode then disable all your extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    You can use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    You have to close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")

  • HT4061 I bought the ipad air for the primary use of marine navigation. I looaded both Garmin and iNAVx charts, but currently none of thecharts including apple maps can determine my location.  The error message says to turn on location services and turn of

    I bought the ipad air to be used for marine navigation and installed both garmin and inavx charts. Currently none of the charts including apple maps can identify my current location.  The error message says to enable location services and disable airport which I have done, but none of these applications work.

    I bought the ipad air to be used for marine navigation and installed both garmin and inavx charts. Currently none of the charts including apple maps can identify my current location.  The error message says to enable location services and disable airport which I have done, but none of these applications work.

  • I can't find the MATLAB script node in labview

    We are using a MAC G4 with OS 9. We also have labview 5.1. I have looked under Mathematic>>Fomula in the tools palette and I cannot find the MATLAB script node.
    Is there an extra download that I need to get this MATLAB script node?

    The HIQ and MATLAB script nodes are only available in the full and professional development systems. If you have one of these versions, these nodes should be under the Mathematics>>Formula palette.
    If you have the base package of LabVIEW, you will not have access to these script nodes. Details about which options are included in which development packages can be found at:
    http://www.ni.com/labview/devchart.htm

  • Using array as a MATLAB script input in a subVI - labview crashes

    Hello
    I am having troubles in creating a subVI that includes a matlab file which has an array as an input.
    I have created a VI, that executes a simple matlab script, having an array as an input and an array as an output. This worked fine, untill i assigned the terminals in order to use it as a subVI.
    After the terminals have been assigned, labview instantly crashes when running the file.
    I also created a VI to test the subVI, but I couldn't get it to work at all, labview always crashed...
    Does anyone know a solution to my problem? They only thing i can think of is to not use it as a subVI, but then my main file will get huge, as all the matlab code would be included in there...
    attached are both files, so that you better understand my problem. (test_... is the main file)
    any help will be greatly appreciated!
    - Jarno
    edit: I'm using labview 2013 with windows 7 and matlab 2014
    Solved!
    Go to Solution.
    Attachments:
    test_subVI_array_into_script.vi ‏8 KB
    subVI_array_into_script.vi ‏8 KB

    Hey Jarno, 
    I did some playing around with this (sorry for the delay) and another workaround we can use is adding an Always Copy to the array before passing it into the Script Node. This will allow you to continue using Double precision arrays instead of going to Singles.
    It looks like there is an issue with the array copy that is passed into the SubVI through the terminal, but we can get around it by making a new copy that the Script Node can properly work with. 
    Tim A.
    National Instruments

  • Same code gives different results in Matlab Script in Labview and Matlab

    I am implemeting a Matlab code into a LabVIEW application using Matlab script. When I import the exactly same code to the Matlab Script in LabVIEW it gives a different result than it is in Matlab. This code is a simulation code including first kind bessel functions. Using LabVIEW 7.1 and Matlab R14 service pack 3.

    Labview 8.5
    Matlab R2009b
    Attached are the graphs produced by matlab script in labview and in matlab.
    The minimum of graph produced by matlab code is below 1 and that in labview is above 1.
    Thanks a lot for your reply.
    Sorry, I haven't quantified the "sometimes" yet. 
    Attachments:
    matlabsResult.jpg ‏29 KB
    LV.png ‏84 KB

Maybe you are looking for

  • Want to learn iPhone Programming on 10.5 PPC, can i do this?

    I want to self teach my self to program iPhone applications, i have no programming experience so inwill be starting from scratch. I have got the book 'Objective-C For Absolute Beginners' but before I begin I wanted to check I can learn using my syste

  • A/V Composite cable video but no audio out

    I just bought a new A/V composite Apple cable for my iPhone. I plugged it in to an LCD tv when I got home, and it WORKED with all the videos I have on the iPhone. I then (without unplugging) tried to play a song from the iPhone (purchased from ITMS).

  • Gmail: Mails sent to myself are marked as READ when using IMAP -how to fix?

    I just started using IMAP with my Gmail account and Apple Mail. But when I send an e-mail to myself (from my imap account to my imap account), the e-mail will of course go to my inbox but it will be marked as read. I don't have the option to "mark as

  • Problem copying mp3s to SD Card

    Greetings, all... I just purchased a new phone with a SD card (4GB) and copied some MP3 songs to it. The problem is that, after copying, the MP3s are in place but so are 4K files of the same name as the "real" MP3 files. I have to go into the phone a

  • Unable to connect to hotel wifi

    I have one hotel that I visit on occasion, and always have problems with the internet wifi connection. It is a major brand name hotel, and my phone and iPad (which im writing this on),connect up just fine. I have deleted the network and  restarted it