Get a better feedback from matlab script

Hi everyone,
I'm using matlab script from LabView. It seems to work, my server receives correct data but I would like to get some useful outputs. For instance, for debugging purpose, I'd like to be able to get messages sending by fprintf. And more generally, I could see if my script is crashed or running.
Any idea?

I "improved" my program by using as often as possible LabView to let Matlab just do the computation (LV is opening image, reading data sheet and send it as input for Matlab).
And, as you've said, I split my big script into several one which is really better.
Though, the main computation lasts 2min and it s a pity to wait such a long time without being sure of what's happening.
One "solution" is to use a 'STEP' variable which is incremented along the computation under Matlab and use it as an output/indicator for LabView. So, if step didn't reach its max, it means that you can go back to debugging.
An idea for LabView 8.0: create a kind of screen able to receive the standard output of Matlab

Similar Messages

  • After using the internal mic for the first time I am getting a buzzing feedback from my audio output

    After using the internal mic for the first time I am getting a buzzing feedback from my audio output

    Go to System Preferences Sound Input and adjust the volume level down by dragging the slider to the left. With an audio app like Logic there is an option for input monitoring when recording so there might be a feedback loop if the volume is set too high. Garage Band works in a similar way. Always be careful when using headphones as the noise can be frightful and cause hearing damage. 

  • I just downloaded and instaled firefox 4. Now, everytime I institute a command I get a po[p-up from Java script that tells me to uninstal set. I cannot go on untin I press ok and then I am good for one more command and it starts with the pop-up again.

    I'm not even sure if this is an extension or plug-in and all I can tell you is what I have already stated. I can only make one command at a time and after each one I get a pop-up from Java script that says uninstal set. I must depress ok to move on, but only for one more command and it starts over again. This also happened when I tried to instal firefox 4 a couple months ago and I deleted the program and went back to an earlier version.

    Mail troubleshooting - Yosemite
    Troubleshooting sending and receiving email messages
    Troubleshooting sending email messages
    SMTP servers keep going offline

  • Matlab script outputting different data

    Hello
    Fell into the problem of getting different output on graph from matlab script node.
    I apply welch function in matlab over a data and ouput 2D array onto waveform chart.
    however the output plooted by matlab plot command has different amplitudes than the labview graph.

    alpine_t wrote:
    however the output plooted by matlab plot command has different amplitudes than the labview graph.
    There are millions of ways things can be different, so you need to be a little more specific. Is it just a scaling issue? How different are they? What are the offset and multiplier settings for the y-axis of the graph?
    You use the terms "chart" and "graph" interchangeably but in LabVIEW they mean very different things. So what is it?
    LabVIEW Champion . Do more with less code and in less time .

  • 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

  • On starting up firefox i am getting an error message from javascript application telling me that my username is an invalid username/password combination.If i continue to get this error message,try entering my email address as my username.

    Hi,on starting firefox which i have used solely as my browser for years i am now getting an error message from java script application that shows my username followed by a message saying; 'username'-Invalid username/password combination.If you keep getting this error,try entering your email address as your username'. I then press the OK button within that error message box and it dissapears and everything seems ok although hover my cursor over the mail(envelope) icon and it says not connected.
    I only started having this problem since downloading firefox 4.It also does not tell me where this problem is occuring so i do not know where to log on with this information.I would be most grateful for any help with this matter.Many thanks.

    Take a look in the Error Console for details about that.
    Tools > Error Console <br />
    Right-click the message and use '''Copy''' to get that complete message.

  • IMAQ FFT multiplication and MATLAB Script Nodes/Compact Rio

    I would like to automatically generate a frequency kernel to multiply with the FFT of my IMAQ image. I was wondering if there was a way for LabVIEW to automatically set up 2D arrays (with a lower bound, a step size and a higher bound) like what is done in MATLAB.
    I was wondering also, if someone could give me some insight as to what restrictions I face, when uploading code from MATLAB script nodes into the Compact RiO (I have a cRiO-9025).

    Hi Bilaln,
    I think you confused about a MATLAB script node and a Mathscript node.
    A MATLAB script nodes uses ActiveX to call into MATLAB, where as a Mathscript node runs in a NI built environment. The MATLAB script node requires both that MATLAB be installed and the host supports ActiveX. Since cRIO does not do either, you should use the MATHSCRIPT RT module.
    Joe Daily
    National Instruments
    Applications Engineer
    may the G be with you ....

  • Contract has run out i want a better deal from bt.

    I have evening and weekend calls from bt also i have unlimited broadband i cant remember which one but the unlimited download limit but my contract has run out and wonder if i ring them up i would be able to get a better deal or that total broadband does the total broadband mean it does not slow down torrents and things like that too?

    i found you get a better deal from options  
    options team 0800 800 030
    If you like a post, or want to say thanks for a helpful answer, please click on the Ratings star on the left-hand side of the post.
    If someone answers your question correctly please let other members know by clicking on ’Mark as Accepted Solution’.

  • Getting error when passing variable to Matlab script

    Hi
    I am using LabVIEW 2013 Version 13.0f2 (32bit) and MATLAB R2014b (Version: 8.4.0.150421) in Windows 7 Professional  Version 6.1 (Build 7601: Service Pack 1).
    I am trying to pass measured data to a matlab script to plot but I get errors.
    I have made a small program to make the problem easyer to solve and I get this error
    Error 1050 occurred at LabVIEW:  Error occurred while executing script. Error message from server: ??? Reference to a cleared variable A.
    . in MatlabTest.vi
    I tried the solution mentioned in http://digital.ni.com/public.nsf/allkb/4475BC3CEB062C9586256D750058F14B though it was intended for an older version. This gave me this error instead
    Error 1048 occurred at LabVIEW:  LabVIEW failed to get variable from the script server. Server:"??? Undefined function or variable 'num'.
    " in MatlabTest.vi
    The problem occures when I try to access the input, in other words I can have inputs to my script as long as I do not use them.
    How can I solve this?
    Attachments:
    MatlabTest.vi ‏7 KB

    Thank you so very much.
    I shold of cours have realised that that was what happened but I always use the three clearing lines (close all, clear all, clc) in the beginning of a script to make sure that no old and irrelevant data corrupts my script and did not think about when the inputs were generated.
    Again, Thank you!

  • Permission Denied Error when calling Matlab script from LabWindows​/CVI

    Hello,
    I am reading in data from a DAQ and am writing it to a .csv file in LabWindows/CVI.  I am then sending this data to Matlab to be filtered.  I would like the filtered data to be accessed by LabWindows/CVI so that I can display it as a strip chart.  I have gotten everything to work except the writing to a file in a Matlab script that is called from LabWindows/CVI.  I am basically using the shipped example in found in the activex demo. (http://zone.ni.com/devzone/cda/epd/p/id/2994). I select the script that I want to run and each time it tries to open a file with write permissions I get a "Permission Denied" error.  This occurs when using fopen() in Matlab.  I have also tried using csvwrite() as well as dlmwrite().  Each one gives me a similar error.  The script currently does not try to do any data processing.  It just opens the file, if it is successful it then prints "hello" and then closes it.  The script works well when it is run in Matlab, just not when it is called in LabWindows/CVI.  Below is the script.  Any thoughts, comments or suggestions are greatly appreciated.  I am also open to using other approaches for sending data between Matlab and LabWindows/CVI.  Thanks in advance!!
    fclose('all');
    [file, errmsg] = fopen('out.txt', 'w');
    if(file<0)
        disp(errmsg)
    else
        fprintf(file, 'hello');
        fclose('all');
    end;
    [file, errmsg] = fopen('out.txt', 'w');
    if(file<0)    
    disp(errmsg)
    else  
     fprintf(file, 'hello');    
    fclose('all');
    end;

    I am using Windows 7.  I am running CVI as an administrator and was able to get rid of the "Permission Denied" error by going into the User Account Controls in windows and changing it to "Never Notify".  However, this did not fix the problem of Matlab not being able to write to a file when the script is run from CVI.  In the Matlab code below, It now gets in to the "else", suggesting that fopen() returns a good file handle.  After getting in to the else statement, it will not actually write to the file, nor does it create it.  However, I can make changes to the plot settings and those appear.  Everything is functional when run from Matlab but when run from CVI, things get screwy with opening the file for writing.  It handles the read well.  It seems like there would have to be some file permission errors but, in the CVI program, I open and write to the file "in.csv".  Any help is greatly appreciated.
    clear;
    fclose('all');
    t = zeros(1000);
    t = csvread('in.csv');
    for i=1:1000
        t(i) = t(i)*4;
    end;
    [file, errmsg] = fopen('out.txt', 'w');
    if(file<0)
        disp(errmsg)
    else
        fprintf(file, 'goodbye');
        for i=1:1000
            %t(i) = t(i)*3;
            fprintf(file, '%f,', t(i));
        end;
        fclose(file);
        plot(t/3, t);
        ylabel('t');
        xlabel('Time (s)');
        title('Is this really working?!?');
    end;
    Thanks,
    Chris

  • I have over 40 itunes purchases all all play back fine. But my last purchase Ip Man2 keeps freezing on play back and I know it"s not y PC, get no helpful response  from apple, what can I do to get a refund on that purchase or a better copy.

    I have over 40 Itunes purchases and they all play back fine, But my last purchase Ip Man2 keeps freezing on play, I know it's not my PC because all my other itunes movies play fine, wasn't able to get a helpful response from APPLE, How can I get a refund on that purchase or a better copy.

    I own the movies and I want them to stay in my iTunes library basically forever.
    But in both cases the file name no longer shows in the movie list, so I don't know how to re-download it from the Cloud.
    iTunes prefs > Store > Show iTunes in the Cloud purchases.
    This will show all your iTunes purchases in your library with a cloud icon down arrow. Click the icon to redownload or click on Play to stream without downloading.
    Also see this , -> Download past purchases
    and techncially, you don't "own" the movie, You simply have a license to use it.
    Yet the first thing iTunes does when you hit the delete key is tell you that it will remove the movie forever from all devices and the library.
    Actually, no it does not tell you that.
    FYI: You should keep copies of all yoru iTnue spurahses as the labels/movie studios/copyright owners can pull their product at anytime and it won't be available to redownload.
    Suggestions here -> http://www.apple.com/feedback/

  • How to get the parameter from Java Script into the Parameter crystal Report

    Hi All,
    Crystal Report is integrated with Oracle 10g. I created the base SQL query for col1, col2, col3 and col4. Java Script pass parameter value (185) to Col1.
    My question is how to create crystal report to make Col1 as parameter and how to get the parameter value 185(Col1) from Java Script. Is there any additional code I need to include in the crystal report?
    FYI.
    Java script sends the right parameter value.There is no issue in java script.
    This is an automatic scheduled process when batch runs, Java script should pass the parameter value and the crystal report should get the value and produce the output report.

    Not sure if this is an application question or if you are trying to hook into Crystal Reports parameter UI? If the later then no option other than report design. If an application then I can move this to the Java Forums.
    If you are asking how to alter the parameters I suggest you remove the Java reference and post a new question so it's not confusing the issue.
    Please clarify?

  • Retrieving data from a MATLAB script node

    I am creating a VI that imports and manipulates arrays of data points and then plots them in Labview. When I run my Matlab script in Matlab there are no errors and all the assigned variables exist in the form that they should exist but for some reason Labview cannot retrieve all of them (they just show up as zeros). There are no errors in the script as far as I can tell. Do you have any idea what could be going wrong?

    Hi,
    You can use the MatLAB window opened by LabVIEW to debug your script.
    Check the values of your variables in the MatLAB window and try to find out where the data goes wrong. I've experienced many problems with LabVIEW MatLAB nodes on different PCs, and many times legal MatLAB operations would go wrong in the script node. You will need to find out which line exactly does your MatLAB code not executing correctly and try to modify the MatLAB codes from there.
    Hope this help,
    Dan

  • My Mac Mini is getting feedback from External HDD

    I am running a external WD 2T Caviar through SATA docking station. I am getting serious HDD feedback throught my speakers. I am using a sheilded Monster Analog stereo cable and it cuts the noise down a little. I have noticed that when playing audio through HDMI to TV speakers there is no feedback. Ijust got this computer and came from a PC. So I am having to get another HDD to back up the info from old drive and the reformat it to apple freindly formating. If I got FW conecting HDD  Would FW800 still have the same feedback issues?

    Just an update. Tried it and no such luck. I am still getting the same amount of feed back even with the computer and the HDD on seperate outlets. One of the options I am also looking at is since there is no feedback the HDMI is possible just getting a home theater reciever and running video and audio through the reciever. Hopefully that would get rid of the feedback. Again I don't get any feedback through the tv speakers if I run sound through that. So in theroy my afformentioned HT soultion should fix the problem. If anyone sees a flaw in my logic please feel free to speak up!

  • I can not get the right frequency out of my NI-DAQ 6062E card from Matlab

    Hi.
    My name is Johan and I want to generate an analog square waveform with 5.76 kb/s in frequency with my NI DAQCard-6062E from Matlab.
    When I run in Matlab the program below, I get the frequency of 5.747 kb/s on the output channel (even thou I have chosen 5.76 kb/s). When I try to change the sample rate, to higher values in Matlab, I get the same frequency until I choose the sample rate to 5.79 kb/s. The output signal is in that case is 5.813 kb/s.
    So my problem is that I can't get the exact frequency of 5.76 kb/s.
    How do I solve this.
    Thankful for help.
    Best regards, Johan
    Program in Matlab:
    clear all
    openDAQ=daqfind; %Detect any open DAQ channels
    for i=1:length(openDAQ), %Close any open DAQ channels
      stop(openDAQ(i));
    end
    ao = analogoutput('nidaq',1); %Create an object for analog output
    addchannel(ao, [0 1]);
    set(ao, 'SampleRate', 2*5760); %Here the sample rate is specied. 2*, because to get right samplerate
    y=[80,-80] %Sets theoutput values to 80 and -80 (As -1 and 1)
    putdata(ao, [y' y']); %Sends the values to out buffer
    set(ao,'RepeatOutput',inf) %Repeats sending in infinity
    set(ao, 'TriggerType', 'Immediate'); %Choose trigger to immediate, because sending values shall occur driect after start command.
    start(ao);
    %stop(ao)

    Hello Johan!
    Bad news I am afraid….
    I assume you are using the Data Acquisition Toolbox from the Mathworks and when it comes to support on that interface I have to advice you to contact the Mathworks for assistance. We don't provide any support on their data acquisition interface since we have nothing to do with it.
    Sorry for the inconvenience this might cause you.
    Regards,
    Jimmie A.
    Applications Engineer, National Instruments
    Regards,
    Jimmie Adolph
    Systems Engineer Manager, National Instruments Northern Region
    Bring Me The Horizon - Sempiternal

Maybe you are looking for