Jump to content

LabVIEW <> Matlab/Simulink


GSR

Recommended Posts

What do you think about them?

I think (My information may not be right, just for discussion)

LabVIEW

  • A few small/middle size companies specifically do LabVIEW programming business
  • Easy to use to communicate to hardwares, especially NI hardware
  • Relative easy to interact with other programming language (talk to Matlab, etc)
  • The language itself has the same tones for all it toolboxes
  • Those sale people are extremely hard sale (e.g. we have a toolbox do exactly what Matlab does; and the price is only 20% of Matlab)
  • technical support people are nice
  • Graphical control is unknown. I am not sure how to use LabVIEW to do some graphic control, like draw a sun and a house. Can we do that??

Matlab/Simulink
  • I could not find any companies specifically do Matlab/Simulink programming business
  • Easy to use to communicate to many different company hardware IF the cards are support (I have an NI card which is not support by Matlab)
  • Not sure how to interact with other language. I did use it to interact with Java2D which was OK. However, Simulink only allow to use C++ to do real-time graphic which needed to do many setting to communicate in between each others (I still don't know how to do that)
  • In term of the tone of the language, Matlab is fine. Simulink is........... (I will need a $2000 toolbox to do running average under realtime window target. Stupid)
  • Those sale people are ....... (They processed my thousands of dollar business two months after my request.)
  • technical support people are too too nice. I thought I was talking to my maid. It is good if you have any unhappy thing happened, then you can called them

Link to comment

What do you think about them?

I think (My information may not be right, just for discussion)

LabVIEW

  • Easy to use to communicate to hardwares, especially NI hardware
  • Relative easy to interact with other programming language (talk to Matlab, etc)
  • Graphical control is unknown. I am not sure how to use LabVIEW to do some graphic control, like draw a sun and a house. Can we do that??

Matlab/Simulink
  • Easy to use to communicate to many different company hardware IF the cards are support (I have an NI card which is not support by Matlab)
  • Not sure how to interact with other language. I did use it to interact with Java2D which was OK. However, Simulink only allow to use C++ to do real-time graphic which needed to do many setting to communicate in between each others (I still don't know how to do that)

GSR, I can't comment on all your points, but I can make a few remarks based on personal experience:

You can interface MATLAB with a lot of hardware, but in my experience this can be done more easily, with more hardware, in LabVIEW. We had an NI counter/timer card which was listed as supported by the MathWorks data acquisition toolbox. So we bought the toolbox, only to discover that only the digital I/O functions of the card were supported but not the counter/timer functions (because there are no counter/timer functions in the toolbox). The only reason for using the data acquisition toolbox is if you are a primarily MATLAB user who doesn't want to buy LabVIEW and needs to import data directly to the MATLAB workspace. Despite having a significant MATLAB code base, we bought LabVIEW.

Picture controls allow you draw objects in the LabVIEW front panel. Is this what you meant?

There are a variety of ways of interfacing MATLAB with other programming languages/code, e.g. Java, C, C++, I think FORTRAN and DLLs. You can also use ActiveX.

For data acquisition, I would almost always go for LabVIEW, because of the easier hardware interfacing, more sophisticated GUI design, better multi-threading/timing control and memory management.

For data analysis, I would tend to go for MATLAB in most cases, because of the ease of doing exploratory data analysis, which can then be captured into code, and the better graphics and extensive libraries. Having said that, I recently wrote a data analysis GUI in LabVIEW because I can run this without being connected to my company's network (license server needed for MATLAB and toolboxes).

I'm still wrestling with the various ways of communicating or data transfer between the two environments...

Cheers

Alex (Biometrology)

Edited by Biometrology
Link to comment

For data analysis, I would tend to go for MATLAB in most cases, because of the ease of doing exploratory data analysis, which can then be captured into code, and the better graphics and extensive libraries.

This is really interesting. As some of you may know, I'm having memory issues with LabVIEW and data analysis/display. Any comments on how efficiently MATLAB handles memory - specifically when working with large data sets? Does anyone else out there think MATLAB is better for this than LabVIEW?

Cat

Link to comment

Having said that, I recently wrote a data analysis GUI in LabVIEW because I can run this without being connected to my company's network (license server needed for MATLAB and toolboxes).

This depends on your Matlab license. I have a named-user license, so I can work on any computer on which I have an account (with Matlab installed, of course) without being connected to the company network. I regularly use Matlab in the field with no network connections at all.

This is really interesting. As some of you may know, I'm having memory issues with LabVIEW and data analysis/display. Any comments on how efficiently MATLAB handles memory - specifically when working with large data sets? Does anyone else out there think MATLAB is better for this than LabVIEW?

Cat,

We've been using 64-bit Matlab on a WinXP-64 system, as well as on a 64-bit Linux system. While careless coding can certainly get me to a point where I'm spending WAY too much time waiting on the system swapping virtual memory, I have never seen an "out of memory" error on the 64-bit systems. Matlab under Linux (CentOS) seems to be a bit more efficient than WinXP-64. We have a dual boot Core i7-920, and the same code running on the same data seems to be about 10% faster in Linux than WinXP.

32-bit Matlab can occasionally have problems releasing memory from execution to execution. It does have a very useful function that tells you how much memory you have available. The output looks like this:

Maximum possible array: 1357 MB (1.423e+009 bytes) *

Memory available for all arrays: 1553 MB (1.629e+009 bytes) **

Memory used by MATLAB: 238 MB (2.497e+008 bytes)

Physical Memory (RAM): 3062 MB (3.211e+009 bytes)

* Limited by contiguous virtual address space available.

** Limited by virtual address space available.

GUI creation in Matlab feels a bit primitive compared to LabVIEW, but it certainly can be done.

I agree with Biometrology's comment about "exploratory" data analysis. One of the really useful features of Matlab, especially when you're doing data analysis, is the ability to put a breakpoint in the code, then create various plots from the command prompt. I also think it's easier to do complicated number crunching in Matlab (I find the text based expressions easier to read and therefore debug/modify than the wire-based ones), and I find Matlab's plotting capabilities (especially 3D) to be much better than LabVIEW's.

Gary

Edited by Gary Rubin
Link to comment

This is really interesting. As some of you may know, I'm having memory issues with LabVIEW and data analysis/display. Any comments on how efficiently MATLAB handles memory - specifically when working with large data sets? Does anyone else out there think MATLAB is better for this than LabVIEW?

Cat

I didn't say that MATLAB was better than LabVIEW at memory management! - In fact often the reverse...

Actually, it depends on what you are trying to do. One of the problems in MATLAB is importing integer data without it being converted into double.

But once you have the data in MATLAB, there are a number of things you can do to manage memory efficiently. You might want to take a look at this webinar: http://www.mathworks...=32517&p2=32518.

Cheers

Alex

Link to comment

What do you think about them?

I think (My information may not be right, just for discussion)

LabVIEW

  • A few small/middle size companies specifically do LabVIEW programming business
  • Easy to use to communicate to hardwares, especially NI hardware
  • Relative easy to interact with other programming language (talk to Matlab, etc)
  • The language itself has the same tones for all it toolboxes
  • Those sale people are extremely hard sale (e.g. we have a toolbox do exactly what Matlab does; and the price is only 20% of Matlab)
  • technical support people are nice
  • Graphical control is unknown. I am not sure how to use LabVIEW to do some graphic control, like draw a sun and a house. Can we do that??

Matlab/Simulink
  • I could not find any companies specifically do Matlab/Simulink programming business
  • Easy to use to communicate to many different company hardware IF the cards are support (I have an NI card which is not support by Matlab)
  • Not sure how to interact with other language. I did use it to interact with Java2D which was OK. However, Simulink only allow to use C++ to do real-time graphic which needed to do many setting to communicate in between each others (I still don't know how to do that)
  • In term of the tone of the language, Matlab is fine. Simulink is........... (I will need a $2000 toolbox to do running average under realtime window target. Stupid)
  • Those sale people are ....... (They processed my thousands of dollar business two months after my request.)
  • technical support people are too too nice. I thought I was talking to my maid. It is good if you have any unhappy thing happened, then you can called them

The only thing I use Matlab (Simulink) for instead of Labview is if I need to generate C code for something. And that is only because I dont have the embedded toolkit for Labview.

Edited by Daryl
Link to comment

The only thing I use Matlab for instead of Labview is if I need to generate C code for something. And that is only because I dont have the embedded toolkit for Labview.

I think it really depends on your application. Last year I rewrote most of my LabVIEW analysis tools in Matlab. It would probably be safe to say that I do my data acquisition-related code in LV, and my analysis/processing code in Matlab.

Link to comment

I think it really depends on your application. Last year I rewrote most of my LabVIEW analysis tools in Matlab. It would probably be safe to say that I do my data acquisition-related code in LV, and my analysis/processing code in Matlab.

My code needs to be an exe wrapped up in one nice package to distribute to multiple users. Is it possible to do this with a "LV for data acq and Matlab for analysis" scenario? Can I "call" a Matlab library (or some other mechanism) from LV and build it all into a single application?

(Sorry, I'd usually be looking all of this up for myself but I'm in the midst of packing gear for 2 back-to-back trips.)

Cat

Link to comment

My code needs to be an exe wrapped up in one nice package to distribute to multiple users. Is it possible to do this with a "LV for data acq and Matlab for analysis" scenario? Can I "call" a Matlab library (or some other mechanism) from LV and build it all into a single application?

(Sorry, I'd usually be looking all of this up for myself but I'm in the midst of packing gear for 2 back-to-back trips.)

Cat

I have no experience with Mathscript, so I can't comment there.

Matlab does have an add-on Compiler (kind of like LV App Builder). I've used it to generate standalone EXEs. It can also be used to generate a shared library (.dll), but I've never tried that. I'm not sure how you would pass your data from LabVIEW to compiled Matlab. I'm sure it can be done, but not knowing your application/CONOPS, I don't know what the best way would be.

Link to comment

I have no experience with Mathscript, so I can't comment there.

Matlab does have an add-on Compiler (kind of like LV App Builder). I've used it to generate standalone EXEs. It can also be used to generate a shared library (.dll), but I've never tried that. I'm not sure how you would pass your data from LabVIEW to compiled Matlab. I'm sure it can be done, but not knowing your application/CONOPS, I don't know what the best way would be.

Thanks, Gary. I'll check it out when I get back from travel.

And my apologies to GSR for kinda hijacking this thread.

Link to comment

Thanks, Gary. I'll check it out when I get back from travel.

And my apologies to GSR for kinda hijacking this thread.

There's also the Math Interface Toolkit, which lets you call Labview from MATLAB. Not sure how that would work in a compiled application though.

I briefly looked into the possibility of calling a MATLAB-generated DLL from LabVIEW. Turns out not to be so easy (Translation: I gave up).

Mathscript might be the way forward, if your code doesn't need any of the MATLAB toolboxes.

Cheers

Alex

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.