LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

LabVIEW cluster and python node

Highlighted

Hi,

I have a question!
I'm trying to send cluster data from LabVIEW to python through python node, but so far I have no clue how LabVIEW send cluster data to python (I mean in what format or form), have tried many python parsing options but still getting an error (end of topic), any ideas of how to parse cluster LabVIEW data in python!?

simple LabVIEW vi and python script would be really appreciated!

LabVIEW: (Hex 0x687) There was an error in executing the specified function. Python returned the following error: <class 'TypeError'> bad argument type for built-in operation

Message 1 of 5
(728 Views)

LabVIEW clusters can be sent to Python... but it looks like we forgot to include a shipping example for that. We will fix that mistake in the next version. In the meantime, here's the script to catch a cluster:

def SumClusterIntegers(cluster):
    "cluster[0] -> Integer, cluster[1] -> String, cluster[2] -> Integer"
    return cluster[0] + cluster[2]


And here's the VI:

Untitled.png

Untitled.png

Attached are the script and the VI. I hope that helps.

Message 2 of 5
(675 Views)

There is one shipping example that uses clusters, but it doesn't explicitly call out that it does. It is here:

examples\Connectivity\Python\PythonNode_ComputeEuclideanDistance.vi

We still should add an explicitly tagged example for this common operation.

Message 3 of 5
(667 Views)

it's really helpful thanks a lot!
but not quite what I meant, I want is the return value to be a cluster!

like in the picture I uploaded in cluster x2 (numeric3 would be 10 and string would be abc)

0 Kudos
Message 4 of 5
(653 Views)

Screen Shot 2018-10-04 at 18.40.37.png

0 Kudos
Message 5 of 5
(636 Views)