Matlab script sever don't work in labview

in my application ,matlab script always doesn't work with a error1050,even the matlab script examples in labview help examples also can't work at all, can you
tell me the reason.

Marc,
You have one forgotten possibility to communicate LabView with remote
MATLAB - it is TCP/IP.
It is easy to realize and may be helpful in your application.
Regards,
Sergey.
"Marc" wrote in message
news:[email protected]..
> Hi Sergey
>
> Yep the files look interesting - as well as the control. The actual
> application is to make sure we have realtime data exchange along with
> 'callback' functionality. There are a variety of approaches - reading
> mat files, using DDE and COM. NetworkDDE is not supported by matlab -
> so that is one option gone. Using shared network drives is a solution
> - but still means Matlab and Labview are mutually dependant. With DC
OM
> (and Matlab in /Automation mode) it is possible to have two 'masters'
> talking independantly without shared network drives...
> I think at the end I will have to construct a new control (or cin)
> module to do this...
> Marc

Similar Messages

  • [LAVA Cross Post] CTRL+SHIFT+Alpha Shortcuts don't work in LabVIEW

    Cross-post from LAVA: http://lavag.org/topic/15619-ctrlshift-shortcuts-sometimes-not-working-in-labview/
    Bug Synopsis: CTRL+SHIFT+Alpha shortcuts do not work in LabVIEW. Most notably, CTRL+SHIFT+Z, CTRL+SHIFT+E, and CTRL+SHIFT+S
    Test setup: LV2012 32bit with f1 patch running in Win7 64bit inside a Parallels 8 VM in OS X 10.8.1
    To summarize the testing I have tried:
    Many different LabVIEW, Guest OS, and Host OS combinations all fail, including:
    LV2012f1 32 and 64 bit, and LV2009 32 bit
    Win7 32 and 64bit, and also WinXP x64
    Parallels 7 and Parallels 8
    OS X 10.7 and 10.8
    Capturing the keyboard by the VM
    Twiddling every keyboard setting possible on Parallels, Guest, and Host
    Reinstalling keyboard drivers
    Plugging in a known-good keyboard that works on a native Windows machine
    Deleting LabVIEW.ini and letting it regenerate
    Remapping the shortcuts from, e.g., CTRL+SHIFT+E to CTRL+E - in this case, "Show in Project" works, so this might indicate it's a problem registering the shortcut press, not invoking the action itself.
    Sending the keystrokes via on-screen keyboards from both Guest and Host
    Sending the keystrokes via SendInput from user32.dll WinAPI
    Testing every imaginable combo of FN, CONTROL, ALT/OPTION, COMMAND/CMD, SHIFT
    Reinstalling VMs from scratch and reinstalling LV
    Here's a kicker: CTRL+SHIFT+Alpha shortcuts work fine on other Windows programs (I've tried 4 different programs, including Chrome, Notepad++, Paint.NET), yet it does NOT work for VIPM with CTRL+SHIFT+C. This means that the only two programs where the CTRL+SHIFT+Alpha bugs exist are both LabVIEW-related.
    Here's another kicker: It's only CTRL+SHIFT+Alpha shortcuts with the prob - CTRL+SHIFT+3 properly toggles grid alignment, and the "Tools >> Options >> Menu shortcuts" will register any CTRL+SHIFT+Non-alpha shortcut; it just does not respond to the CTRL+SHIFT+Alpha shortcuts.
    Any new troubleshooting ideas are highly appreciated; please feel free to jump in here or on LAVA.
    a.lia-user-name-link[href="/t5/user/viewprofilepage/user-id/88938"] {color: black;} a.lia-user-name-link[href="/t5/user/viewprofilepage/user-id/88938"]:after {content: '';} .jrd-sig {height: 80px; overflow: visible;} .jrd-sig-deploy {float:left; opacity:0.2;} .jrd-sig-img {float:right; opacity:0.2;} .jrd-sig-img:hover {opacity:0.8;} .jrd-sig-deploy:hover {opacity:0.8;}
    Solved!
    Go to Solution.

    X. wrote:
    Still well and alive in Parallels 9 and LabVIEW 2013 SP1. Of course I could upgrade to the latest versions to check whether things have gotten any better.
    Any news on that?
    @mellroth figured out the solution :-)
    a.lia-user-name-link[href="/t5/user/viewprofilepage/user-id/88938"] {color: black;} a.lia-user-name-link[href="/t5/user/viewprofilepage/user-id/88938"]:after {content: '';} .jrd-sig {height: 80px; overflow: visible;} .jrd-sig-deploy {float:left; opacity:0.2;} .jrd-sig-img {float:right; opacity:0.2;} .jrd-sig-img:hover {opacity:0.8;} .jrd-sig-deploy:hover {opacity:0.8;}

  • Ocean Optics usb2000 don't working in LabView 2010

    I have Ocean Optics's USB2000 uv-vis and use LabView2010.
    and I searched driver and example about Labview on this site
    and installed "OOIbase32" 
    I played "Ocean Optics 2000 4000 Acquire Continuous Waveform.vi"
    but usb2000 didn't working in labview.
    example want to select port(ex: com3, LPT1 etc.)
    but my PC realized usb2000 into usb port and webcam.
    Help me.
    What can I do..
    Attachments:
    Ocean Optics 2000 4000.zip ‏525 KB

    X. wrote:
    Still well and alive in Parallels 9 and LabVIEW 2013 SP1. Of course I could upgrade to the latest versions to check whether things have gotten any better.
    Any news on that?
    @mellroth figured out the solution :-)
    a.lia-user-name-link[href="/t5/user/viewprofilepage/user-id/88938"] {color: black;} a.lia-user-name-link[href="/t5/user/viewprofilepage/user-id/88938"]:after {content: '';} .jrd-sig {height: 80px; overflow: visible;} .jrd-sig-deploy {float:left; opacity:0.2;} .jrd-sig-img {float:right; opacity:0.2;} .jrd-sig-img:hover {opacity:0.8;} .jrd-sig-deploy:hover {opacity:0.8;}

  • Has anyone done any work in Labview with a Hund enviromental monitoring unit?

    The data cable from the unit connects to a dongle that is plugged into the parallel port of the computer. The only software that work with dongle in place is the manufacturer's software, which is not adequate. I would like to create a VI using Labview to monitor the measurements taken by the unit.

    Wow. You are in a tough spot. I could not find anything on our site that mentions Hund. Since the manufacturer is using a dongle, I would be surprised if they would reveal how to communicate with the instrument. If we had that information, we could do the communication in LabVIEW.
    If the software program reveals some of its properties and methods using ActiveX, you can have LabVIEW use the software that controls the device. It is a long shot.
    Jeremy Braden
    National Instruments

  • Matlab script launched from labview

    Hi everyone,
    I need to run a matlab script controlling a network analizer from labview. I use labview to start the movement of the motors in some experiment. Then, once the movement starts, matlab should run a script to perform adquisition and treatment of the data. Could anyone give me some trick of how to launch the matlab script?
    Best

    Here is a link that looks to describe what you are asking
    http://zone.ni.com/reference/en-XX/help/371361J-01/lvhowto/creating_a_matlab_script/
    Hope that helps.

  • Possible threadsafe issues using Matlab scripts?

    Hi all,
    I'm developing an application in Labview 6.1 that makes extensive use
    of Matlab scripts.  The application executes the same set of
    scripts for multiple data sources, and keeps track of the inputs and
    outputs for each data source separately.  I've been noticing that
    the application produces the correct results when running only one data
    source, but that the results are often incorrect when I run it against
    multiple data sources.
    I've done some investigation, and have found that all Matlab scripts
    share a common memory workspace in Matlab.  That is to say that if
    I have ScriptA that takes variable X as an input, and ScriptB that does
    not, ScriptB nonetheless has access to variable X in its workspace
    (from the last time ScriptA was called).  This doesn't pose a
    problem to me directly, but it has made me wonder if there are
    potential threading issues in the scripts.
    Consider the following scenario with one script and two data
    sources.  I'm wondering if this scenario is possible in Labview:
    1.  Thread1 calls ScriptA, passing data from SourceX.
    2.  During Matlab execution (somewhere in the middle), Thread1 is suspended.
    3.  Thread2 calls ScriptA, passing data from SourceY (data have the same variable names, since it's the same script).
    4.  Thread2 finishes ScriptA execution uninterrupted with SourceY data.
    5.  Thread1 is reactivated, but now the Matlab workspace data has
    been replaced with SourceY.  So, Thread1 started with SourceX
    data, but finished with SourceY data.
    6.  An incorrect result for Thread1 is produced, because the wrong data was processed.
    Clearly I could get around this problem with a semaphore, but first I'd
    like to know if this scenario can even happen.  Are Matlab scripts
    treated as atomic operations in Labview, or can the threads be
    suspended midway through execution?
    Thanks for your help!
    cjb

    Hello,
    No. LabVIEW will definitely not compile a VI while it's running - I think that would be, even conceptually, impossible.  In fact, some properties (accessed via property nodes) are not editable at run-time for basically that reason, that a recompile would be necessary in order for the affect to take place, and the recompile can't take place at run-time!
    It is indeed strange behavior, particularly because it is intermittent (which does hint at a threading issue, or some factor outside the development environment).  Can you try moving the initialization to LabVIEW?  I have attached an example of a so-called functional global variable (a simple code module in this case).  It has two "states" (which are cases) - one is initialize and the other is the "usually executing case."  The initialize case is used to initialize the shift register to an array of 50 doubles, where the other case will compute the running average, min, and max across the 50 most recent random numbers generated.  The 50 data point code module.vi is the code module, and it is called by Use 50 data point code module.vi.  When you run Use 50 data point code module.vi, be sure to toggle the initialize boolean so that the initialize case executes once to allocate and initialize an array with 50 elements; when you toggle it back then it will execute the other case on each iteration, and begin computing the statistics noted by keeping an array with the 50 most recent random data points generated.
    I hope this helps and that you are able to incorporate a similar code module into your application to avoid the intermittent errant behavior!
    Best Regards, and feel free to post again with updates!
    JLS
    Best,
    JLS
    Sixclear
    Attachments:
    Use 50 data point code module.zip ‏27 KB

  • Using Matlab script in Labview

    Hello,
    I am trying to use matlab script in labview to post process the sampled signals from DAQ(attached is the vi I tried)
    After every 10 seconds I want to the send the sampled voltage data to matlab scritp block which does 1) detection of peaks using peakdetection function and plots the obtained peaks on the sampled signal 2) calculates standard of 10 secs data and plots on chart.
    But I am confused of 1) how to call the peakdetection function inside the matlabscript block
    2) How to send the 10secs data of voltage and time values to the matlab script block
    3) How to plot the signal and detected peaks on the same plot (which can be done in matlab using holdon as shown in the atached vi).
    Can someone suggest for implementing these .
    Thanks.
    Solved!
    Go to Solution.
    Attachments:
    Labview&Matlab.vi ‏55 KB

    Thanks  GabeG,
    Now, Labview&Matlab_TestNoAq.vi  is woking Good and for the second one  Labview&Matlab_TestAq.vi it is showing error as shown in the attached image when these ines of code are present in the matlab scrtip 
    subplot(2,1,1),plot(maxtab(:,1),maxtab(:,2),'*r');
    SDN=std(maxtab(:,1));
    and SDN output of the Matlab script
    but when I removed these it is working fine(but not showing the detected peaks).
    Can you suggest me a solution for the above and also can I know the best method to add one more channel that samples another device signal which has to be processed in this same way(Signals sampled from 2 devices have to be porcessed in this same way).
    Thanks.
    Attachments:
    Script_Error.JPG ‏133 KB

  • 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

  • How user define matlab function will work in labview

    Hi all
    iam trying to implenet the matlab function which i have wrote in Matlab 7.9(R2009b)
     function [ op ] = myimplement( ip )
     the file is attached below
    i want to use  matlab function in labview ,i have tried Matlab script node but few of function define in matlab function are not working properly
    so is any alternative way to implement matlab function in labview environment to implement my algorithm & getting same results
    thnaks
    waiting for kind reply
    iam trying from many days but not geting any results
    Attachments:
    myimplement.zip ‏2 KB

    Hi smercurio_fc nd sry if u mind my double post actually iamin last month of my post graduate research so i want to complete it urgently
    iam attaching detail file what iam facing?/
    same thing iam doing in Matlab & getting result but while doing in Labview by using Matlab script node not getting
    error 1048 is occured
    iam attaching word file kindly help me out regarding that problem
    i will be thankfull for u
    tc
    Attachments:
    my matlab function.docx ‏134 KB
    my matlab function.doc ‏154 KB

  • 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!

  • 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

  • How matlab function is work in labview

    hi all
    i have implenet a function say
    function [op]=myimplement(ip) in Matlab
    & i have used it in simulink as Matlab function
    as i have attached the both matlab file name & also Simulink file
    i want to convert the matlab function int Labview
    i have tried by using Matlab script node
    but its is not working ??
    so where iam doing any mistake??
    iam also attaching Labview file as well name funct.vi
    waiting for any kind replay
    thnaks
    Attachments:
    prog.zip ‏10 KB
    funct.vi ‏13 KB

    As it is the Matlab node can't really do anything with that. It would be no different than if you have a .m file. You need to call the function. The Matlab node does not do that automatically (and neither does the Matlab editor). Of course, it's probably simpler to just remove the "function" line and have the last line changed to say
    uk=[x_ukp1;x_ykp1;x_zkp1;thetakp1(];
    instead of
    op=[x_ukp1;x_ykp1;x_zkp1;thetakp1(];
    Note: I believe your input variable should be "ip", not "n", since you calculate "n" in the script.

  • Traité une image par matlab script sur Labview

    salut!! j'ai un programme Matlab qui fait le traitement d'image , je veux l’exécuter sous Labview et recevoir le resultas sous Labview auss . je sais pas comment faire la conversion Array to image si quelqu'un Peut m'aider Merci !!
     ci joint le programme utilise 
    Attachments:
    Matlab script.jpg ‏59 KB

    Hello !!
    sorry for being late in my answer , I had to finnish other work!! and thank you for answering 
    here are the uses of  the functions that you asked me,   from the help of Matlab !!
    IMFILTER N-D filtering of multidimensional images.
    B = IMFILTER(A,H,OPTION1,OPTION2,...) performs multidimensional
    filtering according to the specified options.
    Options are:
    'circular'        Input array values outside the bounds of the array are computed by implicitly assuming the input array is periodic.
    'conv'            IMFILTER performs multidimensional filtering using convolution.
    DECONVWNR      Deblur image using Wiener filter.
    J = DECONVWNR(I,PSF)   deconvolves image I using Wiener filter algorithm,
                                             returning deblurred image J. The assumption is that the image I was
                                             created by convolving a true image with a point-spread function PSF and
                                             possibly by adding noise. The algorithm is optimal in a sense of least
                                             mean square error between the estimated and the true images, and
                                             utilizes the correlation matrixes of image and noise. In the absence of
                                             noise, the Weiner filter reduces to the ideal inverse filter.
    Finally as you can see in the archives joined to this message , the results of Matlab and Labview are different , so i think that the problem is with the conversions of the type inLabview  from image to array and array to image where i lose information of the image.
    have a nice day !! 
    thank you !!
    Attachments:
    matlab vs Labview results.zip ‏2487 KB

  • Matlab script no longer works after upgrade of matlab

    First of all im using labview 7.1.1 to execute a vi which uses some labview scripts to do the bulk of the number crunching and  labviews excellent interface.
    The problem happened when i recently was forced to use Matlab 7.1 R14 SP3 because some of my other routines required this.  After i had upgraded matlab and tried to run the labview vi, all i keep getting is an error no. 1050 from the matlab script object.
    Now the most infuriating thing about this is that it is such a non descript error, i mean , what does it actually mean? and as such i dont even know where to start in solving this problem.
    Has anyone solved this problem or indeed had it themselves, im at the end of my tether with it now.
    Thanks for your help
    Neil

    This is a known problem between different version of Matlab and LabVIEW. Mathworks changed the Matlab interface with version 7, which broke a lot of LabVIEW code. Which version of Matlab were you using before? You can try searching these forums for "matlab error 1050 labview" and you'll see what I mean. Typically he problem is the version of the matlab.dll that's in the LabVIEW installation directory. You can try the stuff suggested in this article.

  • 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

Maybe you are looking for