LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Outputs from Python Node

Solved!
Go to solution

Hi, 

 

Is it possible to have more than one output from the Python Node in LabVIEW? There is only one "Return Value" terminal and then the rest are "Output Parameter" terminals which are just for returning the amended value of the corresponding input parameter as I understand it. Could I return an array from Python and then split this array to be displayed on individual indicators in LabVIEW? How exactly would I go about doing this? 

 

Thanks in advance!

0 Kudos
Message 1 of 6
(423 Views)
Solution
Accepted by zhale

You can return a list of the same data type from Python as an array in LabVIEW. Does that satisfy your requirements?

 

Here's an example (modified from my previous example in another post):

modPythonSnippet.pngpythonScript.png

Message 2 of 6
(407 Views)

cbutcher, 

 

Yes thanks this is perfect! What's the easiest way to split the values of the 1D array back into the individual components of the array? 

0 Kudos
Message 3 of 6
(399 Views)
Message 4 of 6
(397 Views)

Hello, did you install the numpy in your Python? In my case, even i didn't import numpy, just install it in Python, an array cannot be returned from the Python node.

0 Kudos
Message 5 of 6
(39 Views)
Highlighted

In the examples here, I was returning a Python List, not an array. I haven't tried with Numpy arrays, but there is a message here (from the makers of the Python toolkit, which has been somewhat replaced) suggesting a workaround.

0 Kudos
Message 6 of 6
(30 Views)