LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to access labview executable from a python code

I am trying to open the vi through labview executable in python code

 

Have tried this but failed

 

import win32com.client

labview = win32com.client.Dispatch("Labview.Application")

VI = labview.getvireference(r'C:\labview\myexe\my.vi')

0 Kudos
Message 1 of 4
(3,219 Views)

@jigneshmehta wrote:

I am trying to open the vi through labview executable in python code

 

Have tried this but failed

 

import win32com.client

labview = win32com.client.Dispatch("Labview.Application")

VI = labview.getvireference(r'C:\labview\myexe\my.vi')


Have you configured your EXE file to allow remote access to this VI? The LabVIEW VI server does only allow external applications to access VIs that have been explicitedly configured to be accessible. That are the same settings as used in LabVIEW itself. So the easiest is to go into your LabVIEW configuration settings dialog and configure the VI server to allow access through ActiveX and then add the name of the VIs you want to be accessible to the exported VI list. Then look in your LabVIEW.ini file for these settings and copy them over to your <myapp>.ini file.

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 4
(3,193 Views)

I have even tried but the python code is not able to find the VI path

0 Kudos
Message 3 of 4
(3,161 Views)

I think you shouldn't try the entire path but simply the VI name only or maybe if you have a more complex application, the relative path inside the executeable.

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 4
(3,145 Views)