LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass/read/send real-time acquired data from LabVIEW to Python or Matlab?

Solved!
Go to solution

Hello,

I have the following question: I am acquiring data with a DAQ (NI USB) through LabVIEW. Then I want to pass/read those acquired data in real-time in Python or Matlab. So as the data is acquired in real-time, I want to pass/read those data in Python or Matlab. Would that be possible? Is there a specific way to save those data  and update them in real-time and read them in Python or Matlab?

Thank you!

0 Kudos
Message 1 of 6
(2,046 Views)

Hi Alexis,

 


@Alexis_Koul wrote:

I want to pass/read those acquired data in real-time in Python or Matlab. So as the data is acquired in real-time, I want to pass/read those data in Python or Matlab. Would that be possible?


Yes. Use network communication between your tools…

 

(Be aware the meaning of "realtime", which probably has a different meaning to what you want to express in your message.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 6
(2,035 Views)

Hello GerdW,

As always thank you for your reply. Would it be better to use Python or Matlab regarding the network communication? Also regarding Python, the Python toolkit by Enthough is it different from OpenG? 

 

Regarding Matlab, I have read the data exchange with TCP/IP. Do I need to install any specific package in Labview for Matlab?

Thanks again!

0 Kudos
Message 3 of 6
(2,031 Views)
Solution
Accepted by topic author Alexis_Koul

Hi Alexis,

 


@Alexis_Koul wrote:
Would it be better to use Python or Matlab regarding the network communication?

I don't think it matters, both can do TCP or UDP…

 


@Alexis_Koul wrote:

Also regarding Python, the Python toolkit by Enthough is it different from OpenG? 


Never used any of them.

LabVIEW comes with its own Python node, so why do you want to install anything else at all?

 


@Alexis_Koul wrote:

Regarding Matlab, I have read the data exchange with TCP/IP. Do I need to install any specific package in Labview for Matlab?


You don't need any special package for network communication in LabVIEW, it already brings TCP/UDP functions.

(You might use the Matlab script node in LabVIEW when you have licenses for both IDEs to allow its usage.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 6
(2,027 Views)

Dear GerdW,

Thank you so much for your answers. Very helpful! Last question: So I create communication between Labview and Matlab, but also Matlab needs to recognize the TCP/IP communication protocol with labview, so I would need to download this or something similar?

 

https://www.mathworks.com/matlabcentral/fileexchange/42567-matlab-and-labview-data-exchange-over-tcp...

 

Or could you please some information what I need to do from Matlab point of view?

 

Thanks again GerdW! Really appreciated!!

0 Kudos
Message 5 of 6
(2,007 Views)

What exactly are you trying to do in Python/MatLab? Why are you passing the data? Can whatever you are trying to do be done in LabVIEW itself? I am getting th eimpression that you don't have any existing code in either Python or MatLab. If that is case, why not do everything in LabVIEW itself.

 

In terms of communication, the link you posted is a simple example of passing data via TCP. I haven't looked at it closely but it is probably a very basic protocol. To pass data between components each component needs to know the protocol.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 6 of 6
(1,993 Views)