LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview Matlab Exchange Data

Hi pippo2tan,

 

 IMHO there are few options:

1) Most simple and slow - Create two  VI's  with shared variable on both machines, and use a matlab script to

share data. (this makes matlab some kind of "slave")

2) More advanced but still  relatively slow (Create two  VI's  with shared variable, on the Matlab machine build the .NET

dll, and it can be used on Matlab too ( at least at 2010b version, earlier version support only COM)

3) Create TCP/IP connection between two comps.

4) There is "out of the box" NI products, that communicate with Simulink models, don't remember the name...

 

...not mention the .dll here 🙂

 

Michael.

_________________________________________________________________________________________________
LV 8.2 at Windows & Linux


0 Kudos
Message 11 of 15
(2,294 Views)

pippo2tan,


Im actually using SIT to exchange data between Simulink (Matlab 2009) and LabView (2009). They are in the same PC, but you could use SIT to connect LabView and Simulink in different PC's via IP address with ease.

The procedure to set up the link is very straightforward if you have already installed the SIT Toolbox.


You could follows the instructions on the NI SIT Help, or you could read my attached PDF. I made it for my colleagues. Warning! is in Spanish (I'm from Argentina Smiley Wink), however is very easy to follow.


Basically, you must install (if not yet done) the SIT toolbox, after the MATLAB installation. Then, every time Matlab starts, the SIT "connection toolbox" is automatically initialized (opens a UDP port, adds Simulink support, etc).

To exchange data, you must add a special block in your Simulink top-most diagram. In LabView, you could map Indicators and Controls via the SIT Connection Manager, which reads the Simulink Model hierarchically and allows to select signals (for indicators) and parameters (for controls).

All of these steps are explained in the PDF.


There are, however, some caveats: As the SIT "take control" of the Indicators mapped to Simulink signals (i.e. insert them in a special WHILE LOOP), you should use "Local Variables" to link them in your owns While Loops (if any). On the other side, if you want to "write" programatically to any Control maped to SImulink's model parameter, you should use Property Nodes (Value Signaling).


Well pippo2tan, you now have some to play with! Please ask me for any problem. I'm very glad to help you.

Cheers


Gaspar


0 Kudos
Message 12 of 15
(2,287 Views)

Thanks for all the replies and helps. I have been having other problems in project and decided to postpone this issue. I will update again after trying these suggestions. Thanks.. Smiley Happy

0 Kudos
Message 13 of 15
(2,249 Views)

I've seen others mention it but I would strongly consider TCP/IP as your solution. It's relatively easy to figure out and a great way to transfer data between two programs running on the same computer or over the network/internet. There are other solutions as well but learning to use TCP/IP will pay for itself many times over.

0 Kudos
Message 14 of 15
(2,246 Views)

hi i want send x value to matlab , i dont know how to use matlab script and in matlab how call x ? please help me if u can

0 Kudos
Message 15 of 15
(1,151 Views)