LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Communication between Labview and Python

Hello,

 

I am looking for a way to implement communication between Labview and a python script. I have a python script that is doing some vision analysis for me and returning a score based on the quality of the image. I have a function in the python script that simply returns the value of this score, and I am able to successfully retrieve this value from within labview. However, I am only able to get the initial value. Is there a way to have the python script running in parallel with the labview program and have labview return the "live" value of the score? Any help would be greatly appreciated.

 

Thanks,

 

Jeremy 

0 Kudos
Message 1 of 4
(2,484 Views)

Hi Jeremy,

 

you can use any kind of network communication (TCP, UDP) to exchange data between your apps…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,480 Views)

Thanks for the reply!

I had considered going that route but thought that the use of the python node would be easier to implement. My idea was to have the python node call a function in the python script which simply returns the value of the score mentioned in my post. I have declared the score to be a global variable and it is constantly being changed from within the python script. However, when I use the python node to call the function, I am always returned the initial value of the score.

0 Kudos
Message 3 of 4
(2,467 Views)

Hi Jeremy,

 

I have no experience with that Python node as I do my coding mainly with LV2017 (or even older versions)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 4
(2,453 Views)