The interface of LabVIEW and matlab

Hello, I want to interface LabVIEW with MATLAB using the TCP/IP protocol for data transfer. Can anyone, please give me an instruction step by step how to do this? If not, can point out you where I can get them? Thank you.

Hi Gilles,.

TCP/IP is a generic protocol then you should easily be able to build enough interfaces TCP/IP for your LabVIEW and Matlab code and data transfer on ASCII or variants, etc., depending on what kind of data you are trying to transfer. I'm not too familiar with Matlab, but on the end of LabVIEW, there are a few examples of server and client very good TCP/IP provided with LabVIEW.

Another option you may want to, and the reason why I answer it is that I did recently a project through which we took some legacy code MATLAB which we wanted to transpose into LabVIEW, so that we can automate then completely a test system that we use TestStand. A big part of it, we have been able to derive equivalent LabVIEW, but some functions where LabVIEW does not have an equivalent appropriate, or where it was simply more effective, simply copy us and paste Matlab code in any event in the first instance MathScript nodes (not dependant on Matlab) or Matlab script nodes (which will return if all goes well at a later date to transpose in full) LabVIEW for that is no longer dependent on a Matlab license).

In both cases, the facility to do this was very impressive, and we were able to wrap huge amounts of code Matlab LabVIEW with very few problems. As an idea, have you considered your functionality of Matlab of packaging in this way and keeping all the customer TCP/IP and comms server in LabVIEW?

Note: If you have not found it pick up the palette "Matlab Script.

Good luck

David

Tags: NI Software

Similar Questions

  • Difference between FFT LabVIEW and Matlab FFT

    Anyone know why there is a lag in the absolute levels of the results of the function in LabVIEW and Matlab FFT?

    See the VI attached for an example of my code to LV.

    Also attached is the plot generated in Matlab, which seems to be compensated by ~ 37dB.

    This was generated by using the command "plot (10 * log10 (abs (fft (x))))", where x is the same as in the VI input array.

    Thank you very much

    Dan

    I see you are using the VI of spectrum FFT which returns a unique range of face.  To convert a transformation both sides (IE FFT) in one spectrum sided with RMS units there is a standardization of sqrt (2) / n, where N is the number of points in x (t).  You can prémultiplier your x (t) by N/sqrt (2) and get the same results as Matlab.  Or, you can use the FFT.vi so you compare transform to transform instead of spectrum to transform.

  • Communication between PCI6251, Labview and Matlab

    Hello

    I work with a Council of PCI6251, driven by an executable labview.

    I get measurements from several sensors (pressure, temperature, etc.) which are read by the executable of labview.

    I would like to know if it is possible to send these Matlab measurements at the same time.

    I mean: is the PCI6251 card can send data to Labview and Matlab at the same time of acquisition?

    Or I need to install a second PCI card for that?

    (Labview and Matlab are installed on the same PC now)

    Hi Nico974,

    If you want to transfer data from LabVIEW in MATLAB, you have to use ActiveX connection between 2 software or to add the node to MATLAB in you program LabVIEW (see http://digital.ni.com/public.nsf/allkb/2F8ED0F588E06BE1862565A90066E9BA?OpenDocument)

    Another solution is to use the of MathWorks Data Acquisition Toolbox, because the card PCI-6251 is supported by this Toolbox (http://www.mathworks.fr/products/daq/supportedio14005.html)

    But here you have a LV executable so if you can't change it you will not be able to use your exe and a Matlab Script at the same time, if you need another PCI card.

    Sincerely

  • Interface between LabVIEW and c#

    Hello

    IAM trying to send data to Labview via ithernet in a product that already have in c# .net. This means that data send LabVIEW must be posted in c#. Thus the Labview will act as the server and the product in c# will be serving the customer. I have serached in the forums to make the connection between Labview and c#. I saw a tutorial to make dlls in labview, in what they explained to hold tools > Build Application or shared Library.But I can't find in my tools although I version2009 of professional development.

    Can someone give me some instructions to send Labview data and display it in c#. IAM attaching the VI Server I made. The client in c# is a great product that has already done by others in c#. I have very less experience of programming in c#. Can someone give me some instructions or attach a few tutorials to make the connection between Labview and c#.


  • How to collect data on the programs of LabView and VC ++ at the same time?

    Hello

    There are two programs in LabVIEW and another is in VC ++. The two programs to collect hardware data.

    Therefore, for the experience, it is necessary to begin to collect data at the same time and lag must be

    less than millisecond (it is essential for the experience). How can this be achieved? BTW, I'm new to LabView.

    I think on the use of network socket to get the message for both applications.

    I was wondering if there is a better way.

    Thank you.

    MARK002-MAB wrote:

    Hello

    There are two programs in LabVIEW and another is in VC ++. The two programs to collect hardware data.

    Therefore, for the experience, it is necessary to begin to collect data at the same time and lag must be

    less than millisecond (it is essential for the experience). How can this be achieved? BTW, I'm new to LabView.

    I think on the use of network socket to get the message for both applications.

    I was wondering if there is a better way.

    Thank you.

    You do not say if two programs access the same material, but I guess not. Because if they did, you probably get conflicts when the two programs try to access the same material at the same time.

    In either case, the only really reliable way to ensure that your needs of< 1ms="" would="" be="" hardware="" triggering.="" one="" hardware="" unit="" is="" programmed="" to="" provide="" a="" hardware="" trigger,="" typically="" a="" digital="" signal="" and="" the="" other="" is="" programmed="" previous="" to="" the="" desired="" start="" point,="" to="" wait="" for="" that="" trigger="" and="" start="" automatically="" when="" it="" is="" received.="" if="" both="" hardware="" units="" are="" ni="" daq="" cards="" you="" can="" do="" that="" fairly="" easily="" using="" the="" rtsi="" bus="" or="" in="" case="" of="" pxi="" the="" pxi="" trigger="" lines.="" if="" they="" are="" different="" hardware="" then="" it="" can="" get="" more="" complicated="" to="">

  • 2012 of LabVIEW and MATLAB use

    Hello.

    I am using the Matlab data plugin (http://zone.ni.com/devzone/cda/epd/p/id/4178) with LabVIEW 2012. I installed the plugin and the installer says that the installation was successful. However, the plugin does not appear in the list of plugins in LabVIEW. I rebooted the system, but that did not help.

    Data plugins are incompatible with LabVIEW 2012? I also tried to add the plugin using the vi of the data plugin manage the palette. Although the vi does not return an error, the plugin still isn't available. Decommissioning of 2010 is not an option for me, because I need some of the new features.

    Thanks for your help.

    MATLAB does support 32-bit LabVIEW.

  • How to perform the operation in LabVIEW and c language IF condition, tat too with strings?

    Hey Hey geeks,

    I have a small doubt. I want to check if an input string is equal to 'EI202' (for example) and if it s true, a 5 v signal has b sent thro a data acquisition to a relay? juice as if the condition in c language...

    How v can interface a mind scan barcode LabVIEW? I mean I want to get a string entry to the reading of the bar code on an object with the barcode scanner?

    How can I get the number for the difference in days between two dates in LabVIEW?

    Please please please answer my questions... If you giv me the dia block of the above issues, I'll b abt very very very happy there. am not able to continue my project last year because of these...

    YEW is equal to the structure of the case, the connection string to the selector, write the text as it stands and place a write of data within the case.

    It's very basic LV

    A barcode scanner keyboard =. Activate a chain control and fire bar codes, same as type 'barcodenumber [enter]. "

    DateTime - datetime = lag.

    /Y

  • 2012 LabVIEW and Matlab script server error

    I just installed LV 2012 and upgrade the code that runs Matlab scripts. Now when I run it, it gives me an error of server script (1047). I'm using Matlab 2007. Someone at - it the same problem? Anyone know of a solution?

    I guess it has to do with the server script does not properly. But I can't exactly run the same code in LV 2011 without problem while LV 2012 gives me an error. Same computer, etc.

    Thanks in advance for any help you might be able to provide.

    Thank you "transfererror", this helped me identify workaround.

    For those who struggle with this, that's what I learned:

    1. This affects only the variables that are passed in a sub - VI in the connector pane (that is, local variables are not connected to the connector pane apparently do not have this problem).

    2. it seems to only affect as vectors 1 d or 2D paintings. The reason why the screws inserted by Sev_K example applies to this problem is that the types of data that are not arrays do not have this problem.

    3. Thus, to solve my problem, I inserted just an addition of 0 to all vectors and matrices that have been passed in the Sub - VI. I guess what it doesn't copy the variable in a local buffer and it is perhaps the reason why he fix it?

    In any case, workaround seems to work. I don't know what it costs in terms of speed or memory, but I do not have much about it for my application (some real-time applications that use Matlab scripts eventually consider it).

    Perhaps this information can help identify and fix this bug.

    Unique

  • cRIO thanks the Module NI 9237 bridge in the Interface of scanning and Anti-Aliasing

    Hello

    I have questions about the use of a Module NI 9237 bridge with CRIO and its use in Scan Interface mode. The manual speaks the data rate of the module, and a (n) parameter that can be set to adjust (to a minimum of 1613 Hz) which in turn puts across the module built in anti-aliasing filters. It seems (but not explicitly stated) that this data rate setting is available FPGA programming mode.

    Our application is currently running in mode Scan Interface, so my question is what is 'throughput' module (and therefore anti-aliasing filters) mode Scan Interface? And, if we have the analysis period the value 10msec (100 Hz), y at - it no filtering of the anti-aliasiing of software provided automatically by scanning interface itself related to the period of scanning? Or all the anti-aliasing extra something that we must build within ourselves? I looked at the example provided with Scan Interface and there is nothing more.

    I don't understand about anti-aliasing, just need to clarify what is happening for this specific module mode Scan Interface.

    Thank you

    Andy

    Hi Andy,.

    I had to have a quick sleep on this night to get my facts right, hope that the delay was too long!

    The minimum data listed in the 1613 samples/s are due to a forumla that uses the internal time base that is fairly well explained on page 20 of the Manual. The sweep period did not affect the rate of data, or to activate the anti-aliasing filter. My previous post was wrong in that sense, apologies!

    This page helps explain mode of scanning pretty well too, but the best way to explain it is that even if the frequency of the module can be attached to 1613 samples/s or higher, the compactRIO will collect only 1,000 of these samples a second, or in your case if you are using a rate of 10ms loop, 100 of these samples of 1613. The anti-aliasing cut will be based on 1613 x 0.45 as you said and so will be 725Hz (not based on the rate of loop as I mentioned incorrectly)

    In this case with these modules it is probably a good idea not to use a period of scanning slower than 1 msec for the reason you said - if you're worried about oversampling you can always you decimate readings in the software afterwards to take each readings from 1 to 10 (this page explains how do with an eerily similar situation!)

  • What are the differences between LabVIEW and LabVIEW FPGA and LabVIEW RT

    I need a comparison of LabVIEW, LabVIEW FPGA, and LabVIEW RT

    Sorry, I misunderstood.

    LabVIEW RT (LabVIEW Real-time) combines graphical LabVIEW of programming with the power of a real-time operating system, allowing you to create applications in real time.

  • suddenly, when starting InDesign, I got this window: "could not load the Indesign because it requires Layout UI.please install available to the interface plugin user and restart InDesign.» I tried to reinstall, it did not help. I use CS4 on PC windos 7. a

    indesign error.jpg

    Finaly

    I copied the plugin: layout of the user interface of another PC and pasted into my PC to: c: Program Files (x 86) \Adobe\Adobe InDesign CS4\Required

    and ii work!

  • Call the function in LabView from a DLL, and then access the global variable of DLL

    I've created a DLL in LabWindows with a function and structure.  I want to call the function from LabView and then access the overall structure.  I am able to call the function in the DLL with a "call library function node" and has access to the return value, but I can't understand how to access the overall structure.  The structure is declared in the header DLL with __declspec (dllimport) struct parameters file.

    Is it possible to access this structure without using the library of network variables?

    My guess is that you need two bytes of padding after "in_out" and another to two bytes of padding after "anin."  The reason being that ints are 4 bytes, and most of them C compilers will align on 4-byte boundaries.  The struct will naturally start to such a limit (in fact, in Windows, it will probably start to an 8 byte boundary).  If you then count bytes in your structure, you are 70 byte after "in_out."  70 is not divisible by 4, so you need 2 bytes more to reach the next 4 byte boundary.  You can also you could reorganize your struct so that "anin" follows "in_out" and this is probably the best option if it won't cause you other problems.

    Unlike most C compilers, LabVIEW compressed structures as closely as possible, without filling.  I don't know enough about the history of LabVIEW and internal parts to explain the reasons and to do this performance penalty, but, as choice of LabVIEW "endianness", it is probably a remnant of the first versions of LabVIEW that were running on the Mac.

    If for some reason you want to force your C struct to match package LabVIEW, you can use the #pragma pack (x) directive, but I wouldn't recommend that here because you can control the C and LabVIEW.

    EDIT: in the cases where it was not clear, add padding to your cluster of LabVIEW, insert appropriate size or items at the place desired in the cluster.

  • Relay control using cRIO LabVIEW and the NI 9472 c series module

    Hi all

    I try to get my program to run so far without success, and need help.

    I use the compact rio with the program on labVIEW and the NI 9472 digital output module. I enclose my VI.

    Basically, it's a test program to run an algorithm at a time. If I use a solid state format to get a time warp that dictates, time of execution of the algorithm. The operation by default, I put is for when the time channel produced a fake.

    Question 1: The problem I have is that even if the time string is true, as it does not run. It remains in State sending false so only of false signals to my relay (which is represented by the round LED - relay switch a solenoid on and outside).

    Question 2: If I can get 1 problem solved, the next step I have will be executing the same algorithm, but for more than a State of time. For example. "06:00" run algorithm. I want this algorithm to keep running as long as he sends signals REAL (which means the solenoid valve remains open until a WRONG signal). Then he will run again to say '08:00 ', execute the algorithm as long as he sends signals REAL and so on...

    In summary -.

    -I want to order a relay (which controls a solenoid)

    -L' use of components listed above

    -With the help of semiconductor in labVIEW (VI attached)

    -At different times, the execution of the algorithm UNTIL sends the WRONG signal and then return to the default state, which means that his waiting until the time channel product TRUE.

    Any help would be appreciated.

    Kind regards

    William

    something like that...

  • Circuit of Simulink connection to the controller of LABview

    I try to use my LABview VI to control the switches in a Simulink model. I do not know how to accomplish this task, but right now I'm trying to establish a connection between the two.
    I have 2015 LABview and MATLAB 2011.
    After googling how to connect a LabVIEW Simulink model, I found the following:

    1 using the model Interface tool (MIT)

    2. using controls and Simulation tools to convert a LABVIEW Simulation Model

    1. I downloaded MIT and Veristrand and followed the steps in this link: http://zone.ni.com/reference/en-XX/help/374160A-01/vsmithelp/mit_convert_model_to_dll/
    But I do not know where to go to from there.  Most of the tutorials I found using the SIT

    2. the Simulink components are not recognized in LABVIEW and are just empty boxes.

    Question: What is the best way to connect with LABview Simulink model?

    Hello

    This seems closely related to it.

    The two methods can be used, but both methods require some considerations.

    For the model interface Toolkit, you need to mind what are the features you use. Please take a look at this.

    «In the Simulink software, you can convert models that use only a Solver step-size ordinary differential equation (ODE) in compiled templates fixed.» In addition, you must disable data logging in the application of Simulink software. »

    Please refer to the following as well.

    http://zone.NI.com/reference/en-XX/help/374160B-01/vsmithelp/mit_model_from_mdl/

    http://zone.NI.com/reference/en-XX/help/374160B-01/vsmithelp/mit_model_support/

    (the same that I linked above)

    http://zone.NI.com/reference/linksen-XX/help/374160B-01/vsmithelp/mit_models_mdl/

    http://zone.NI.com/reference/en-XX/help/374160B-01/vsmithelp/mit_convert_model_to_dll/

    (is the one you linked, I just want to bring the model must be a dll to work with the model Interface Toolkit)

    http://forums.NI.com/T5/LabVIEW/importing-MATLAB-model-file-to-LabVIEW/TD-p/883625

    (the message mentions the 'SIT', that is not the model Interface Toolkit)

    The last of them brings something about the method of Simulation of design by control &: the model must be a mdl file so that the converter of Simulation Model work.

    http://www.NI.com/white-paper/11281/en/

    (this link is LabVIEW 2012, but it is still valid on later versions)

    https://zone.NI.com/reference/en-XX/help/371894G-01/LVSIM/sim_simtrans/

    It will be useful.

    MATLAB® and Simulink® are registered trademarks of The MathWorks, Inc.

    Kind regards

  • Myrio and Matlab script

    Hello

    I control my physical robot with labview and my rio. I also have a matlab (m.file) code that uses it the Robotics Toolbox in Matlab. I would like to add this m.file to my labview program. Can I create a matlab script in the program labview and matlab code inside and deploy code to myrio? It will work in this case?

    AFAIK, the nodes in script call script software MATLAB server to run scripts written in MATLAB language syntax. But I don't know about adding my rio to the loop.

    Thanks for the reply.

    I also later get to know that this can be done by establishing communication between Matlab and myrio wifi.

Maybe you are looking for