LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview interface with matlab (both ways)

I am working on a project that needs to send data from Labview to matlab. Labview is measuring parameters from sensors using a DAQ. These values are sent to Matlab. Matlab treates the data and sends other values back to Labview. These values are adjustments to some devices connected to Labview. This system aims at keeping a constant biological environment. How would I make Matlab and Labview interface?

 

Thanks in advance

Josh

0 Kudos
Message 1 of 7
(5,223 Views)

We are attempting to build a closed loop Bioreactor.  This bioreactor will have pressure, flow rate, load cell, linear actuator, and measuring a few other things.  We need to receive this data through labview.  Then we have ideal values we are trying to reach.  So then Labview sends the data it received to Matlab where it computes  forumals using the data collected.  So if the value we calculate is too high then we need Matlab to tell Labview to decrease flow rate or vice versa.  How do we interface Labview to Matlab and then Matlab to Labview?

0 Kudos
Message 2 of 7
(5,212 Views)

We are attempting to build a closed loop Bioreactor.  This bioreactor will have pressure, flow rate, load cell, linear actuator, and measuring a few other things.  We need to receive this data through labview.  Then we have ideal values we are trying to reach.  So then Labview sends the data it received to Matlab where it computes  forumals using the data collected.  So if the value we calculate is too high then we need Matlab to tell Labview to decrease flow rate or vice versa.  How do we interface Labview to Matlab and then Matlab to Labview?

0 Kudos
Message 3 of 7
(5,211 Views)

 

What type of NI hardware are you using?  Is this Real-time or just running on a desktop?

 

Couple of ideas:

  • If you are using Simulink (and specifically real-time): Check out the Simulation Interface Toolkit: https://www.ni.com/en-us/shop/product/labview-model-interface-toolkit.html
  • If you have the MATLAB Instrument toolBox, it is possible to transfer data (non-real-time) over TCP/IP sockets.  If you are trying to do this on one machine, I believe we have been succesfull at just sending data to the computer's loopback address (127.0.0.1).  There is a whole host of protocals that you can simulate this way

Brad

0 Kudos
Message 4 of 7
(5,206 Views)

Sounds like you don't need real-time.  Take a look at MATLAB's Instrument toolbox.  I believe LV ships by default with everything you need to setup a TCP/IP socket connection between the two of them.

 

(BTW - the Simulation Ineterface toolkit I linked needs MATLAB to have the Real-Time workshop and it's $$$)

0 Kudos
Message 5 of 7
(5,202 Views)

Couple of options I forgot:

   -If it is just "formulas" you are looking for and you are not calling a lot of built-in matlab functions or helper code, make sure you look at the Matlab Script Node in Labview.

   -You can still use matlab compiler or the realtime workshop to compile your MATLAB code to a .dll that can be called by LV.

0 Kudos
Message 6 of 7
(5,178 Views)

Hey I took screen shots of all the labview systems I have and Matlab 2012 that I am running to let you know what we are running.

0 Kudos
Message 7 of 7
(5,145 Views)