Matlab *.mat / LabView *.mlv

Comparison:
test code in Matlab: 
AA = [1 2 3 4 5];
save AA-matlab.mat AA; 
and test code in LabView MathScript Node
AA = [1 2 3 4 5];
save 'AA-LV-matlab.mat' AA;
Both scripts make a file, but different files.
File made using LabView is NOT readable in Matlab! Save in LabView is not same as save in Matlab. Why this incompatibility? How to make compatible files?
Check Spelling in this editor gives suggestion LabView > Labile.  True?

Danigno wrote:
VesaU,
actually what I think he tried to say is that you can still use MatLab, but save your data from LabVIEW in txt files (which can be read by MatLab later). Then you won't need to use the MathScript, just regular LabVIEW coding...
Yup, that was exactly what I was saying. Thanks for the clarification. 
VesaU wrote:
Just saving a vector to a .mat file? Yes this is
my target. Why? Let's assume that we have raw data files from two
NI6259. We may get 2 million samples/second. A short test gives me
100MB or more data. Saving data to text file for exporting to
Matlab-analysis is not very good idea. Why Matlab? Matlab is widely
used for mathematical analysis. We use Matlab and our partners use it.
I tried to say that TXT file method is not a
method for today or tomorrow. I have used that 1990's. It is almost
same as pen and paper. Something better I want for tomorrow.
TXT file is OK, if it is used once in a year or month. For daily work it is not a solution.
Solutions for tomorrow may be:
1. Matlab reading directly LabView data files.
2. Converting
LabView data files (TDM/TDX files) to MAT files. Mat file with all
relevant data from TDM/TDX file into a Matlab Struct.
You're starting to be a little defensive here for no reason. You had provided NO information as to what you were saving, or how much data you were saving, and to belittle a suggestion that was based on virtually no facts is like biting the hand that tries to feed you. Not a very good way to make friends.
As pointed out by Danigno, I wasn't telling you NOT to use Matlab, but rather to change how you were saving the file since the data was apparently (though I'm wasn't sure since you provided no information) being saved in LabVIEW. Obviously, saving data as a text file for that amount of data is not warranted. If you were still going to collect the data in LabVIEW then a binary file would be something that can be used by both LabVIEW and Matlab, though you have to watch the endianness since LabVIEW defaults to big endian, and I believe Matlab defaults to little endian. 
2. Change from NIDAQ to NIDAQmx was not a success
story. Now we have four times bigger datafiles in Matlab
because NIDAQmx uses longer numerical expression than earlier. Old
NIDAQ we use with PCI and PCMCIA cards but new USB hardware forces us
to use NIDAQmx.
I don't understand what you mean by this. What functions were you using, and how were you saving the data? 
I have asked help from MathWorks and National
Instruments to solve the problem. Both companies say that the fault is
on the other side. I think that both companies should face the truth.
It should not be end user's problem. It may happen that end user find a
third software + hardware which is working. I think that it is easier
to change DAQ than analysis package.
I'm not here to defend either NI or Mathworks, but I think that's debatable.

Similar Messages

  • MATLAB and LabVIEW Communication Optimal Performance

    I have tried my own code,  searched through forums and examples to try and figure out best method to communicate between LabVIEW and MATLAB.  Most of the information I found was over a year old and I was wondering if there was a better current solution.  My goal is to work in LabVIEW to collect the data, process in MATLAB and return the results to LabVIEW.  I have encountered some difficulty in my search and before I delve even further in to one in particular, I was wondering if anybody had an optimal solution with this communication protocol or solutions to my errors encountered thus far.
    I have looked at the following methods.
    1)TCP/IP and a very good example found here: http://www.mathworks.com/matlabcentral/fileexchange/11802-matlab-tcp-ip-code-example
    When I try to adjust even the example and communicate for my own purposes I get the following errors
    Error 63 if MATLAB server not running
    Error 66 occurs if the TCP/IP connection is closed by the peer. In this case, Windows notices that no data is returned within a reasonable time, and it closes the TCP/IP connection. When LabVIEW attempts to communicate after Windows closes the connection, error 66 is the result. 
    However, the example itself works perfectly and does not get these errors
    2)Math Script Node, works but the post below states that MATLAB Node is faster.
    "computing fft of a 1024x1024 matrix ten times (attached code). Result is that Matlab node version takes 0.5s versus 1.6s for Mathscript node version."
     http://forums.ni.com/t5/LabVIEW/Why-are-mathscript-performances-much-below-matlab-s/m-p/2369760/high...
    3) MATLAB Node, which states it uses ActiveX Technology seemingly works well, but loses time for data transfer.
    4) Trying to use the ActiveX functions or if there is other Automation potential.
    5)Other solutions that I have not found that might be better suited.
    Thank you for any help or suggestions in advance. 

    Barp and Mikeporter,
    Thank you for your assistance:
    The reason I need to do the processing in matlab is as you mentioned the processing script is coming from another person who has already developed it in matlab.  I almost have to treat it as a black box.
    The TCP/IP method was interesting is that none of the errors show up when I run the example but if I try to modify it in a new VI I get the errors.
    I have attached a simple program that just has a basic butterworth low pass filter I am trying to confirm if it works in the Matlab node.  I have done other simple codes which work, and this one does not seem the implement  the appropriate filter.  The LabVIEW signal and LabVIEW filter seem to work at the default values (but not if I change sampling rate) for the Simulation of signal, Matlab signal and Matlab filter work, but the Labview signal processed in Matlab is not working...
    Ideally it would be bandpass filtered (0.1-30) at sampling rate of 256 Hz and further processed from there, but I can't even seem to get low pass to work in the matlab to labview communication.
    Any help would be greatly appreciated.  Once I have that working I will have more of an idea of the constraints of the actual processing Matlab Code I will be using.
    Thank you again.
    -cj18
    Attachments:
    labview_matlab_filter.vi ‏70 KB

  • Script Matlab In Labview

    Buongiorno a tutti,
    sono nuovo di questo forum. Sono un tirocinante presso l'università di Napoli Federico II e sto familiarizzando con l'ambiente LabView. Mi è stato assegnato il compito di eseguire uno script Matlab mediante LabView (le macchine su cui lavoro possiedono la versione 7.0 e 8.5). Se mi sapete dare qualche informazione ve ne sarei grato o anche qualche link visto che sto agli inizi.
    Saluti.
    Sorry for my english...

    Sorry, can you move this question to italian community?
    Thanks
    Sorry for my english...

  • Ejecutar m files de matlab desde labview

    Hola!
    Me gustaría saber cmo es posible ejecutar m-files de matlab desde Labview, es decir llamar desde Labview que se ejecute un m-file ya creado y poder recuperar la información resultante como puede ser un conjunto de matrices. No se si puede hacer directamente con el labview o hace falta alguna toolkit concreta.
    Muchas gracias

    Larson09
    Si tiene el paquete completo o profesional de Labview entonces tiene el script de Matlab ( lo puede encontrar en paleta de funciones>>Análisis>>Matemáticas>>Formula>>Script de Matlab.
    Para que le funcione este script debe tener instalado matlab, y dentro del script puede ejecutar directamente código de Matlab.
    Espero que esto le ayude
    Atentamente
    Belens

  • Toolkit matlab avec labview

    bonjour à tous et merci d'avance ,
    je cherche un lien(ou bien une idée) pour télecharger le toolkitmatlab compatible avec labview 2011 (sinon 2009).
    l'objectif c'est que je veux transformer un code matlab vers labview.
    merci les ingénieurs du ni et tout les membres de forum.
    amicalement

    Hi khadija,
    You should be able to find the 2011 version of the mathscript-RT toolkit on ni.com/downloads. The download site has recently undergone a lot of changes and the search may not be up to speed yet. A direct link to the 2011 mathscript-RT toolkit is here: http://joule.ni.com/nidu/cds/view/p/id/2558/lang/en. 
    However, it sounds like you are using Matlab toolkits. The mathscript-RT toolkit re-compiles .m code into labview source code. However, the mathscript-RT toolkit will not work with any of the Matlab® toolkits, such as a vision processing toolkit. A list of commands the mathscript node can use is given here. 
    You also might try using the Matlab Script node, which is separate from the Mathscript-RT node, the Matlab Script node uses activex to call into the Matlab runtime engine. It should be able to utilize any toolkits that the mathscript-RT toolkit can't. However, the Matlab Script node will be slower and will require an installation of Matlab on each computer that your application runs on. 
    MATLAB® is a registered trademark of The MathWorks, Inc. Other product and company names listed are trademarks and trade names of their respective companies.
    Jesse Dennis
    Design Engineer
    Erdos Miller

  • Difference between the Matlab and LabVIEW Hann (Hanning) functions

    Hi All,
    I'm hoping someone out there can satisfy my curiosity. I have been porting over some code from Matlab to LabVIEW and came accross a difference in the two implementations of the Hann function. Essentially:
    LabVIEW has array length = n
    http://zone.ni.com/reference/en-XX/help/371361J-01​/lvanls/hanning_window/
    Matlab has array length -1 = N.
    http://www.mathworks.co.uk/help/signal/ref/hann.ht​ml
    (where n= N in the two implementations)
    As I'm not very clued up on signal processing I was hoping someone could explain why there is a difference in implementation and why array length was chosen for the LabVIEW implementation. According to wolfram the parameter a is full width at half maximum:
    http://mathworld.wolfram.com/HanningFunction.html
    http://mathworld.wolfram.com/FullWidthatHalfMaximu​m.html
    Is the difference just due to the interpretation of what this value should be?
    I've attached a modified version of the window comparison example to illustrate the diference.
    Thanks,
    Attachments:
    Window Comparison from example.vi ‏32 KB

    ^N wrote:
    LabVIEW has array length = n
    Matlab has array length -1 = N.
    Could part o the confusion be due to the fact that LabVIEW arrays start with index zero and matlab arrays start with index one?
    I'll look at your code later...
    LabVIEW Champion . Do more with less code and in less time .

  • How to implement Non linear Curve fitting (lsqcurvefit of matlab) in Labview

    Hi Labview Team,
    I am looking a way to implement "lsqcurvefit" command of matlab in Labview to do some curve fitting ; basically to  Solve nonlinear curve-fitting (data-fitting) problems in least-squares sense, at present I couldn't find a better way to implement it. Can you please give me some suggestion on this to how to implement this " curve-fitting: on labview.
    Thanks,
    Ankit Gupta

    You did not say you have the mathscript module. Do you? In any case, labview has a rich set of native nonlinear fitting tools. This seems like a better option.
    LabVIEW Champion . Do more with less code and in less time .

  • Connecting JADE &MATLAB with LabVIEW

    I wish to Connect JADE and MATLAB with LabVIEW,. Please provide the relevant documents.  

    For matlab, there is the matlab script node.
    For JADE, you need to be more specific, because there are several programming tools with that name (e.g. here or here).
    You need also define what you mean by "connect". In the most general case you would simply build a dll in the other language and then call it using the call library function node.
    What are you actually trying to do?
    LabVIEW Champion . Do more with less code and in less time .

  • I want to read a Matlab MAT file into labview.

    I do not have Matlab.  I have a series of *.mat files that are created by another program that I want to read into LabVIEW.  The *.mat files should contain a very long 2 dimensional array of complex numbers, with only 2 columns.  I am hoping that the *.mat format is straight forward.  I need to read this into a LabVIEW array to manipulate it.
    Has this been done?  I've found several routines that allow you to save data from LabVIEW into a *.mat file so that Matlab can read it, but I have not seen anything that goes in my direction.  Any help is appreciated.
    Mike

    Oh, yeah, that certainly makes a big difference.
    You're even luckier that I was still bored, so I whipped something together.
    See attached.
    Couple of things:
    (1) I couldn't test it for all data types so the "Parse Data" VI may need to be tweaked for some of the data types.
    (2) Your file contained multiple variables and the one matrix of complex values was a 1D array so you may need to insert a "Transpose 2D Array" function where the bundle function is for your 2D array.
    (3) A couple of the variables were character arrays but Matlab stores the individual characters as floating point numbers between 0 and 255 representing ASCII-encoded characters. These are the "XUnit" and "YUnit" arrays.
    For your reference, the MAT file format is at http://www.mathworks.com/access/helpdesk/help/pdf_doc/matlab/matfile_format.pdf
    Oh, I think I may have left breakpoints in when I saved the VI. Sorry about that. You should remove them when you run the VI so they don't become annoying.
    Message Edited by smercurio_fc on 02-09-2006 05:07 PM
    Attachments:
    Read Level 4 MAT File.zip ‏69 KB

  • Is it possible to read data from MATLAB *.mat file using LabVIEW?

    I have *.mat file from Matlab with some data. Does anybody know how to extract them from this file. I need to know the file format.
    Oleg Chutko.

    The Mathworks site is pretty good about having documentation for the formats of their file types. I recommend looking there for the format.

  • Integrating matlab into labview

    Is it possible to integrate (import) a matlab file which uses special toolbox ( like hmm toolkit and neural network) into LabVIEW??

    When you say "one motor is connected to one matab file" - do you mean one .M file, or a MAT file ?  In other words, is it a program or data?  
    The easiest way that I"ve come across to transfer data between different environments, is to write to an intermediate file.   Be sure to  write to a raw binary or text (dont use the Matlab 'save' command, that will save in MAT format, which I'm pretty sure is unreadable by LabVIEW).   There is the problem of signalling the LabVIEW program when data is available, you could handle this by having the Matlab program could write to another file to indicate that data is availalbe, and the LabVIEW program could continuously poll this file to see if a value has been written.   Then the LabVIEW program would read in the data file, and reset the signalling file.

  • How do I perform the interp3 function in matlab in LabVIEW

    I have the following data attached (DTTT.txt).  The four columns are as follows: Column 1, 2 and 3 are (fixed) measurement points and the fourth column is the resulting measurement data using these 3 points. What I need to do is find the value that should be in column 4 with the values in columns 1, 2 and 3 of (i.e. 0, 100 and 20).  Is there any base function in LabVIEW for performing this interpolation? I would be using interp3 in matlab for this, but we only want to use strict LabVIEW code in this project (i.e. no external interface to matlab allowed). Thanks for any help I can get...
    Attachments:
    DTTT.txt ‏8 KB

    There are quite a few interpolation functions in LabVIEW.
    Go to
    Function Palette
    then
    Mathematics Palette
    then
    Interp & Etrap Palette
    and choose the VI that will work from there.
    CLD | CTD
    LabVIEW 2011 SP1 | TestStand 4.5

  • Using a "fopen" call in a DLL made with MatLab for Labview

    Dear Sirs:
    My name is Juan Crespo and I write you from Spain. I answer if you could help me with a Labview problem. This is the problem.
    I want to write a DLL for being used in labview, and i want to use matlab for write this DLL. I have been searching in the web and reading the NI "using external code in labview" manual in order to know what I must do.
    I know that if I want to use MatLab, I must build a "wrapper function" to avoid the different data type between MatLab and C. I have found on the web -Thanks to Alberto Sanchez- one example about how could a DLL could be written.
    But it exist one diference: I want to read a plain text file that has the input data. so I must read the file, store
    the data in an array and then pass this array to the "interface functions" but in a simple example this dont works
    My question is ¿How could I open a text file in order to use it as input data in a DLL in Matlab?
    Attached to this message is the code I use as "wrapper function". when I compile it there is no apparent errors, but when I try to use the DLL in a VI, an error appears.
    If I change this code and the input is made "manually" (using the VI) there are no errors. So I think that problem is in the way that Labview consider "fopen" function when I build a DLL. The "num.txt" file, where the data input are, is on the same directory that dll file and VI file.
    I hope that you can help me with this problem.
    Thank you very much in advance and please sorry for my bad english
    Best Regards
    Juan Crespo
    Attachments:
    foo_wrapper.c ‏2 KB

    Dear Juan Crespo,
    normally I don't answer questions concerning Matlab because I have no experience with it. But your question was waiting a long time and had to do something with DLL I decided to look at it.
    Your C code has a serious error. You are declaring a variabale named "in1" as "double *". You do not set this pointer to point to a variable. Then you use this uninitialized pointer in the fscanf function to read in from the file. The value is written somewhere in the address space at a place where "in1" is pointing randomly. This will cause an error or crash.
    Declare "in1" as "double" like you have declared "out". You must change some other places where you have used "in1".
    Waldemar writing from Germany
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

  • Calling Matlab from Labview returns a 1047 error - what am I doing wrong

    above

    Does your script work fine in MATLAB? Do you run a VI or an .exe?
    MATLAB must be running, otherwise LabVIEW will be unable to access the MATLAB server. This will cause the 1047 error. Manually start MATLAB, and your program should run without the error.
    The following KnowledgeBase may also be useful in troubleshooting this issue
    LabVIEW 6.x and Earlier Does Not Interface Properly with MATLAB 6.1 or MATLAB 6.5
    Zvezdana S.
    National Instruments

  • Easiest way to call MATLAB from Labview

    I have a bunch of MATLAB scripts I've developed over the years. I'd
    like to have Labview collect data and pass it off to my MATLAB scripts
    for plotting and analysis as it is streaming in. What is the easiest
    way for me to do this?
    Thanks for your help,
    Matthew Little

    [email protected] (Matthew Little) wrote in message news:<[email protected]>...
    > I have a bunch of MATLAB scripts I've developed over the years. I'd
    > like to have Labview collect data and pass it off to my MATLAB scripts
    > for plotting and analysis as it is streaming in. What is the easiest
    > way for me to do this?
    >
    > Thanks for your help,
    > Matthew Little
    Matthew:
    Have you tried the Matlab script container in the Mathematics->Formula
    function palette? This node allows you to put your scripts into the
    Labview diagram. I haven't tried it myself, but it should work. Good
    luck.
    sm

Maybe you are looking for

  • TS1717 a required itunes component is not installed.(-42404)

    Hi There..I updated my itunes (running on Windows 7) to the latest version(11.0.3) then whenever i open it it gives me an error message saying that a required itunes component is not installed(-42404). Also can't sync my iphone anymore. I've tryed re

  • Infotype 0008 and 0014

    Hi all, Hi all, We have a requirement of using various fixed allowances to be paid monthly and to be prorated based on the number of days absence/attendance.  Can we prorate (factoring) the allowances used in IT0014? If not, what is the possible draw

  • Problem undeploying apps with 8.1 SP6

    we recently uprgaded our managed servers on AIX LPAR's to SP6, admin server on a different AIX LPAR is still SP4 (apparently a bea support person said this would be OK) now we can't seem to undeploy things cleanly [Deployer:149034]An exception occurr

  • Recipient address rejected: User unknown in relay recipient table

    Running GW 7.0.3 on NW 6.5.6. Can anyone tell me if this is my problem or if it is the recipients system. Other email to the same domain goes through. Thanks, Bill

  • Using ldap Network Management Functions how to get nested groups that are members of a parent group

    Using NetLocalGetMembers() I can get the users withing a group Using NetUserGetGroups() I can get the groups a user is part of. However, I cant find a function that will list the GROUPS that are part of another group. I have a group called APP_ADMIN,