03-15-2017 08:46 AM
Hi. I am trying to load a vi from Python. (the .vi will build a specific executable).
To do this I have used the below python code. The VI Server seems to be terminating my attempts to open a vi. is there anyway of stopping this?
C:\> pip install pypiwin32
C:\> py
>>> import win32com.client >>> LabVIEW = win32com.client.Dispatch("Labview.Application") >>> VI = LabVIEW.getvireference('<path_to_vi>') >>> VI.Call() File "C:\...Python\Python36-32\lib\site-packages\win32com\client\dynamic.yp", line 516, in __getattr__ ret = self.oleobj_.Invoke(retEntry.dispid,0,invoke_type,1) pywinterypes.com_error: (-2147352567, 'Exception occured.', (5010, 'LabVIEW', 'LabVIEW : VI execution terminated by the server.', None, 0, 0) None)
03-15-2017 10:35 AM
First guess is that VI has some output(s) connected (if all inputs are not set to "required") and you need to call it with
vi.Call(paramNames,paramVals)
03-16-2017 04:18 AM
Thanks, but this VI has no inputs or outputs.