LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Python Node - output tuple

Solved!
Go to solution

Is it possible to return a tuple from a python node, e.g.:

def get_tuple():
    return (['a', 'b', 'c', ...], [['d', 'e', 'f'], ['g', 'h', 'i'], ...])


I thought you could use a cluster as the return datatype but I have not been having any luck in labview or looking online.

0 Kudos
Message 1 of 3
(14,311 Views)
Solution
Accepted by topic author Dak31

What LV/python version? seems to work as expected from LV 2024/python 3.11

avogadro5_0-1718053696195.png

The "tuple of lists" also worked when I got rid of the ellipses and passed in arrays with the correct shapes

def get_tuple():
    return (['a', 'b', 'c'], [['d', 'e', 'f'], ['g', 'h', 'i']])

avogadro5_1-1718053873460.png

 

 

0 Kudos
Message 2 of 3
(14,292 Views)

It is working as expected. Labview had crashed and I didn't realize my input control was empty when I reopened the project, and it was the input that was throwing the error that I mistakenly interpreted as the output tuple throwing the error.

0 Kudos
Message 3 of 3
(14,285 Views)