LabVIEWForum.de - How to send an array of clusters to LabVIEW??

LabVIEWForum.de

Normale Version: How to send an array of clusters to LabVIEW??
Du siehst gerade eine vereinfachte Darstellung unserer Inhalte. Normale Ansicht mit richtiger Formatierung.
hi all,

i am using win32com to call LabVIEW from python and i am using early-bounding.

i want to set the value of a control element "array of
cluster" in a VI, and the control in the VI is an
array of clusters, which has the structure (integer,
integer, string).

CODE:
...
>>> paramNames = ["array of cluster"]
>>> paramVals = [(2,3,"hello"), (4,5,"world")]
>>> vi.Call(paramNames, paramVals)

Traceback (most recent call last):
File "<interactive input>", line 1, in ?
File "LabVIEW.py", line 149, in Call
, paramVals)
File
"C:Python24Libsite-packageswin32comclient__init__.py",
line 446, in _ApplyTypes_
return self._get_good_object_(
com_error: (-2147352567, 'Ausnahmefehler
aufgetreten.', (5002, 'LabVIEW', 'LabVIEW : paramVals
Typenfehlanpassung. 1D-Array aus Variants wird
erwartet.', None, 0, 0), None)

it says, 1D-Array of Variants is expected.

i've succeeded in sending 1d and 2d arrays, or a
cluster. the only problem is to send an array of
clusters.

anybody with experience in python/com/LabVIEW has
idea?? i've posted the question at python forum, but got no advice till now, maybe this problem is more specialized in LabVIEW. thanks a lot in advance!

cheers,
john
Hy scott

I tried your problem in LabVIEW and i think it's not possible to do this.
You can make an array of clusters but only with one datatype. That means you can make an array of clusters only with string elements or only with integer elements, but not both together.

I hope, that answers your question.

Have a nice day
You might be able to send an Array of fixedCluster [String "Identifier", String "flated Cluster",Array[int]"Typeofelement"].
You may then reconstruct the received Flated Clusters by String2Variant(Typeofelement) -> Variant2Data(Identified Clustertype).
Offcourse you will need to know all possible Types of Clusters and give the Variant2Data the right Prototype-Cluster (you will need an IdentifierString-Case for this unless you use a "Variant-Attributes"-Case).
Sorry that this comes so late, but it might now help others...

;-)
Referenz-URLs