[python-win32] Open VI reference error

Riley Caminiti rileycaminiti at gmail.com
Tue Apr 16 11:59:37 EDT 2024


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/python-win32/attachments/20240416/02dbe0ac/attachment.html>


More information about the python-win32 mailing list