06-19-2025 01:34 AM
How can I configure the return value of a Python Node in LabVIEW to output two values?
My python code is very simple
06-19-2025 02:26 AM
Your python script returns a tuple:
return sum_result, difference
The LabVIEW code should reflect this by wiring a cluster to represent the python tuple type:
06-19-2025 02:37 AM
Could you please show me where to find these two blocks?
06-19-2025 02:44 AM - edited 06-19-2025 02:45 AM
It is a cluster of 2 numeric constants
Please read this carefully before proceeding:
06-19-2025 03:12 AM
Thank you for your help, I have completed it
09-10-2025 03:00 AM
I added code to be able to log every time it runs. When using LabVIEW, an error occurs; can you please take a look to help me?
09-10-2025 03:08 AM
Well, your python function returns a list... Which I don't think you want, since error_code is a number and result a string (shouldn't this be a boolean?)
Remove the [ ] from the return line. Then make sure that the order of you LabVIEW cluster is the same as your python tuple.
09-10-2025 03:11 AM
Looks like your python code returns number, string and the LabVIEW code expects string, number. Order needs to match.
09-10-2025 03:21 AM
Thanks for the help, I got it running. But only when running python log appears. What do I need to install for labview to be able to have log when changing reference values
09-10-2025 03:29 AM
The file is probably being created just not where you expect. Because you didn't specify a full path python is treating "log.txt" as a path relative to the working directory. Try an absolute path like "c:/log.txt" assuming Windows. Don't forget to escape the /, put "c://log.txt"
No idea where the working directory is in a python node...