Problem mit Python und LabVIEW via ActiveX & win32com
Verfasst: Freitag 24. Juni 2005, 14:49
Folgendes Problem:
Die Übertragung der Parameter beim aufruf der "Call" methode funktioniert nur in eine Richtung (Python -> LV).
In die andere Richtung werden die Daten nicht verändert.
-------------
oViTest = oLv.GetVIReference(strVi,"",True) # get reference to LabVIEW VI
bError = True # preset bool before call
strResult = "" # preset string
arParNames = ["strEntry","strOutput","bError"] # first and second are strings, third is bool
arParVals = ["Hello World", strResult, bError] # the 3 parameter values
oViTest .Call(arParNames,arParVals)
# hier nach dem call ist die Liste arParVals nicht geändert, sollte aber sein.
-------------------------
Aus LV-Doc
paramNames : array of strings by ref (Names of the front panel objects that act as input and output parameters to the call).
paramVals: array of variants by ref (Input values for the input parameters and return values from the output parameters in the order in which the names were specified in paramNames)
Der "strResult" und "bError" sind nach dem call nicht geändert.
Hat schon mal jemand dieses Interface zu LabVIEW genutzt ?
Welcher Python Typ soll verwendet werden damit Python ihn in ein "array of variants by ref" wandeln kann ?
BTW: ich verwende "Static Dispatch" mittels makepy.
In anderen sprachen funktionierts (VBScript, JScript)
Danke im Vorraus
Martin
Die Übertragung der Parameter beim aufruf der "Call" methode funktioniert nur in eine Richtung (Python -> LV).
In die andere Richtung werden die Daten nicht verändert.
-------------
oViTest = oLv.GetVIReference(strVi,"",True) # get reference to LabVIEW VI
bError = True # preset bool before call
strResult = "" # preset string
arParNames = ["strEntry","strOutput","bError"] # first and second are strings, third is bool
arParVals = ["Hello World", strResult, bError] # the 3 parameter values
oViTest .Call(arParNames,arParVals)
# hier nach dem call ist die Liste arParVals nicht geändert, sollte aber sein.
-------------------------
Aus LV-Doc
paramNames : array of strings by ref (Names of the front panel objects that act as input and output parameters to the call).
paramVals: array of variants by ref (Input values for the input parameters and return values from the output parameters in the order in which the names were specified in paramNames)
Der "strResult" und "bError" sind nach dem call nicht geändert.
Hat schon mal jemand dieses Interface zu LabVIEW genutzt ?
Welcher Python Typ soll verwendet werden damit Python ihn in ein "array of variants by ref" wandeln kann ?
BTW: ich verwende "Static Dispatch" mittels makepy.
In anderen sprachen funktionierts (VBScript, JScript)
Danke im Vorraus
Martin