[python-win32] How to send an array of clusters to labview??

2005-06-28 Thread john taylor
hi all, 

i am using win32com to call labview from python over
COM 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 "", line 1, in ?
  File "labview.py", line 149, in Call
, paramVals)
  File
"C:\Python24\Lib\site-packages\win32com\client\__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 (elements of different types). 

anybody with experience in python/com/labview has
idea?? thanks a lot in advance?

cheers,
john

___
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


[python-win32] threading in python

2005-06-28 Thread john taylor
hi, 

anybody has called two VIs in parallel?? 

somehow like this: 
*
import win32com.client 
import thread 

lv = win32com.client.Dispatch("LabVIEW.Application") 

def start(): 
vi2 = lv.GetVIReference("p2.vi") 
vi2.Run() 

thr = thread.start_new_thread(start, ()) 

vi1 = lv.GetVIReference("p1.vi") 
vi1.Run() 

*

it doesn't work. i've tried calling functions of usual
objects in several threads like this and everything
was fine. but in this case, there must be sth to take
care of between COM objects and python. 

i've also tried the following: 
1. construct two lv objects in the main thread. 
2. construct lv objects in the main and the new
threads respectively. 
3. construct two vi objects in the main thread. 
4. pass lv or vi as argument when calling new thread. 
none of them works.  

anybody can help? 

cheers, 
john

___
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32