Problem makepy

Wenn du dir nicht sicher bist, in welchem der anderen Foren du die Frage stellen sollst, dann bist du hier im Forum für allgemeine Fragen sicher richtig.
Antworten
Gast

Sonntag 19. Juni 2005, 19:32

hi all,

i am using win32com to call labview from python over COM. since there's sometimes type errors sending complex data types, i am thinking of using EnsureDispatch.

after using "makepy" for the labview type library (static dispatch), i got a .py file. but i am still not able to use EnsureDispatch. the code failed to find _IApplication or something like that.

anybody has idea? thanks a lot in advance!

john
CM
User
Beiträge: 2464
Registriert: Sonntag 29. August 2004, 19:47
Kontaktdaten:

Montag 20. Juni 2005, 07:39

Hi John,

Frankly: I have no idea of Windows whatsoever. Usually you'd get an answer here, but since you are posting in English in a German Python forum I'm not that sure this time.
Well, if nobody answers you here in this thread you might want to check out the tutor mailing list, which connects you with the English speaking community - or in this case a bunch of helpful and really competent people.

Good luck.

Cheers
Christian
Leonidas
Administrator
Beiträge: 16024
Registriert: Freitag 20. Juni 2003, 16:30
Kontaktdaten:

Montag 20. Juni 2005, 13:39

Yu may rather be interessted in Python-win32.

Well, sorry, I can't help you really, I mostly use the simple Dispatch and had no problems.
My god, it's full of CARs! | Leonidasvoice vs Modvoice
Gast

Donnerstag 23. Juni 2005, 15:13

first, thanks a lot for ur replies!

well, maybe i can reformulate my question:

AIM --- set the value of a variable in a Labview VI per SetControlValue (over COM)

PROBLEM --- the variable in the VI is an array of cluster

SAMPLE CODE:
...
>>> aoc = ((2,3,"hello"), (4,5,"world"))
>>> vi.SetControlValue("array of cluster", aoc)
Traceback (most recent call last):
File "<interactive input>", line 1, in ?
File "<COMObject <unknown>>", line 2, in setcontrolvalue
com_error: (-2147352567, 'Ausnahmefehler aufgetreten.', (0, None, None, None, 0, -2147352571), 2)

the control elem "array of cluster" is defined in the VI as an array of clusters, which has the structure (integer, integer, string). it works fine for a one-dimensional array. e.g.: vi.SetControlValue("array", (2,3,4))

anybody with experience in python/com/labview has idea??
CM
User
Beiträge: 2464
Registriert: Sonntag 29. August 2004, 19:47
Kontaktdaten:

Donnerstag 23. Juni 2005, 16:11

Hi John,

Well, what happens if you call vi only with the first tuple of aoc? For instance:

Code: Alles auswählen

vi.SetControlValue("array of cluster", aoc[0])
Please note that this is only a guess.

Cheers,
Christian
john
User
Beiträge: 3
Registriert: Sonntag 19. Juni 2005, 19:14

Freitag 24. Juni 2005, 10:00

thanks christian,

i've tried it before. though it didn't work either, there's still sth to mention. instead of writing values to the first elem (the first cluster) of the array, it seems to have initialized the first THREE elements of the array! because the first three element fields became "white" (they were earlier "grey"). but the values were not there, just zeros or empty.

cheers,
john
CM
User
Beiträge: 2464
Registriert: Sonntag 29. August 2004, 19:47
Kontaktdaten:

Freitag 24. Juni 2005, 13:33

Sorry John, I'm out of ideas. Please try the mailinglist I mentioned in my first post here. Not only will you get support of native speakers - this list is also read by people with all kind of specialties. At least they can point you to a place where to get 'real' support.
I haven't seen a post of you there, but in your case I really wouldn't hesitate to write.

Christian
john
User
Beiträge: 3
Registriert: Sonntag 19. Juni 2005, 19:14

Mittwoch 29. Juni 2005, 10:44

thanks Christian,

i have posted my question to the pythoncom and pythonwin mailing lists, still waiting for constructive advices...

maybe i should look for some help at labview forum :? , coz it seems a little bit more specialized in labview.

cheers,
john
Antworten