Python can be used very productively alongside NI's software platform.
This document is a starting point to help curate resources for successfully using Python with NI software and hardware.
Tutorials
Calling the LabVIEW web server using HTTP Requests
Calling LabVIEW through a TCP/IP connection using the LabVIEW Automation library https://github.com/ni/python_labview_automation
System Exec VI
Call Perl and Python Scripts from LabVIEW
Calling Python Code from LabVIEW
LabPython http://vipm.jki.net/#!/package/oglib_labpython
Advanced Scripting in Perl, Python and Tcl
https://pythonhosted.org/PyDAQmx/
https://github.com/bernardokyotoku/pyniscope
https://github.com/armstrap/armstrap-pyvirtualbench
How are you using Python with NI's platform? Any examples you'd like to share?
Also, quite a good wrapper for calling python code from Labview is labpython. Install from VIPM
http://vipm.jki.net/#!/package/oglib_labpython
Also information in: https://decibel.ni.com/content/docs/DOC-21687
Thanks, Joey
Now everything in one place.
Please keep updating
Ian, I love labpython but haven't seen it working with Python 2.7.x. Do you know if there is a release that supports this?
Thanks, Joey, for a great presentation on using Python with LabVIEW and TestStand.
Does it matter which version of Python is used with the NI tools, i.e. 2.7.x or 3.x?
Yuri
Yuri, great question.
I typically use Python 2.7x and made the demos using this. You should be able to use Python 3.x for most of these but may have trouble with some of the code modules (PyDAQmx, Python LabVIEW Automation).
Hi Joey,
Sorry I haven't used LabPython in a while. I know that it works with Python 2.7.3 and Labview 2012. One known issue is that it only works in 32bit mode.
There is a discussion with known issues on the support webpage. In particular some information on redirecting output which helps debug your python code. I recommend reading.
https://sourceforge.net/p/labpython/mailman/labpython-users/?limit=250
Hope this helps
Best Regards
Ian
Thanks Joey.
It will be great if PyDAQmx and Python LabVIEW Automation can be re-tooled for Python 3 eventually. What are the chances of this hapening in the forseeable future?
For the time being, your advice is to stick with Python 2.7.x for full NI tool support?
I think it would be valuable to mention in this article about this - https://decibel.ni.com/content/docs/DOC-47034
What is the data type returned by OpenCV when I call OpenCV library using Python? Can't I get it via a 3D array? why is it like this? What data type do I need to use to get it correctly?
Python Source Code
LabVIEW Source Code
LabVIEW UI