Open VI reference error

Riley Caminiti <[email protected]> Tue, 16 Apr 2024 10:59:37 -0500
Newsgroups gmane.comp.python.windows
Message-ID <CAHdwe4DeYkKQg2jwb6mYTHwOfCs9Hywso0DAzLZ_wNotxDjLHw@mail.gmail.com>
--===============1572708630196828907==
Content-Type: multipart/alternative; boundary="000000000000cfcb09061638d3bb"

--000000000000cfcb09061638d3bb
Content-Type: text/plain; charset="UTF-8"

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

--000000000000cfcb09061638d3bb
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi,<div><br></div><div>I&#39;d like to read a string outpu=
t by a Labview executable using Python. As a test, I built my own Labview e=
xe, and can successfully read the string output in Python using the followi=
ng script:</div><div><br></div><div>import win32com.client<br>LabVIEW =3D w=
in32com.client.Dispatch(&quot;Application.Application&quot;)<br>VI =3D LabV=
IEW.getvireference(r&#39;C:\temp\ActiveXpractice\My Application\Application=
.exe\ActiveXpractice.vi&#39;)=C2=A0<br>while True:<br>=C2=A0 =C2=A0 result =
=3D VI.getcontrolvalue(&#39;String&#39;)=C2=A0<br>=C2=A0 =C2=A0 print(resul=
t)<br></div><div><br></div><div>The problem is that when I try to do the ex=
act same thing with a different Labview exe that my coworker built, I get t=
he following error at the third &quot;getvireference&quot; line:</div><div>=
<br></div><div>com_error: (-2147352567, &#39;Exception occurred.&#39;, (694=
5, &#39;LabVIEW&#39;, &#39;LabVIEW: (Hex 0x5A5) Open VI Reference no longer=
 matches VIs in memory by filename. A filename is no longer sufficient beca=
use the full name of a VI now includes any owning libraries.&#39;, None, 0,=
 0), None)<br></div><div><br></div><div>Can someone help me understand why =
the first exe works and the second does=C2=A0not? I can replicate the error=
 for the first exe by changing the third line to VI =3D LabVIEW.getvirefere=
nce(&#39;ActiveXpractice.vi&#39;) so the problem seems to=C2=A0be path rela=
ted, 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 fi=
rst only holds the single vi, does that affect the formatting of the path t=
o the vi?</div><div><br></div><div>Thanks,</div><div>Riley</div></div>

--000000000000cfcb09061638d3bb--

--===============1572708630196828907==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
python-win32 mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-win32

--===============1572708630196828907==--