11-28-2024 05:22 AM
Hi,
Apologies for disturbing you. I have prepared a LabVIEW (LV) code that currently handles only the data collection part. For data analysis, I am required to run a separate Python script, which makes my entire data processing workflow a two-step process: first, data collection, and second, data analysis.
I am wondering if it is possible to integrate or synchronize the Python script with the LV code so that the entire workflow becomes seamless, with the Python code executing automatically as soon as the data is collected.
I would greatly appreciate your guidance on how to achieve this. Thank you!
Hasham
Solved! Go to Solution.
11-28-2024 05:32 AM
I guess, you should start from here: Integrating Python Code in LabVIEW.
11-28-2024 06:34 AM
You can call Python functions in LV, so it should be simple.
11-29-2024 03:41 AM
Just one small thing.
If you will pass LabVIEW arrays to the Python Script I would like to recommend to marshal data as numpy arrays, this will decrease "transfer" overhead.
Minimal working example:
Some examples in <LabVIEW>\examples\Connectivity\Python\support
11-29-2024 04:31 AM
Hi,
Thanks for your reply. I have phython3.11 version and getting this error. could you please guide me.
Kind regards
Hasham
11-29-2024 04:58 AM
11-29-2024 05:32 AM - edited 11-29-2024 05:33 AM
@Hasham622x wrote:
Hi,
Thanks for your reply. I have phython3.11 version and getting this error. could you please guide me.
Kind regards
Hasham
Two things - first check your LabVIEW Version and compatible Python from the link above, and be sure that Python bitness the same with LabVIEW (both 32 bit or both 64, but not mixed), then it should work.
---
12-11-2024 05:09 AM
Hi,
Sorry for the disturbance. I installed Python 3.9 (64-bit) and am currently using LV22 (64-bit). I prepared a sample example, but it gives me an error. Please guide me.
kind regards
Hasham
12-11-2024 06:08 AM
@Hasham622x wrote:
Hi,
Sorry for the disturbance. I installed Python 3.9 (64-bit) and am currently using LV22 (64-bit). I prepared a sample example, but it gives me an error. Please guide me.
Path input in Open PYthon Session is not intended for your script, this is path to Python itself, which usually grabbed automatically from registry.
Just try to leave it unconnected:
12-15-2024 03:30 AM
Hi,
Thank you for your reply. It is working as expected.
If you don’t mind, could you kindly guide me on how to add a Python node into my main LabVIEW code? I am currently using the NI 6363 to acquire data from multichannel analog inputs (AI).
If possible, please share any relevant guidance or a solved example for reference.
Thank you for your time and support.
Kind regards
Hasham