Hi,

I'd like to read a string output by a Labview executable using Python. As a
test, I built my own Labview exe, and can successfully read the string
output in Python using the following script:

import win32com.client
LabVIEW = win32com.client.Dispatch("Application.Application")
VI = LabVIEW.getvireference(r'C:\temp\ActiveXpractice\My
Application\Application.exe\ActiveXpractice.vi')
while True:
    result = VI.getcontrolvalue('String')
    print(result)

The problem is that when I try to do the exact same thing with a different
Labview exe that my coworker built, I get the following error at the third
"getvireference" line:

com_error: (-2147352567, 'Exception occurred.', (6945, 'LabVIEW', 'LabVIEW:
(Hex 0x5A5) Open VI Reference no longer matches VIs in memory by filename.
A filename is no longer sufficient because the full name of a VI now
includes any owning libraries.', None, 0, 0), None)

Can someone help me understand why the first exe works and the second
does not? I can replicate the error for the first exe by changing the third
line to VI = LabVIEW.getvireference('ActiveXpractice.vi') so the problem
seems to be path related, but I am using the absolute path to the second
exe same as the first. The second exe contains a Labview project with
multiple subVIs while the first only holds the single vi, does that affect
the formatting of the path to the vi?

Thanks,
Riley
_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32

Reply via email to