Hello Team,
I tried to launch LabView application using python code as follows:
import win232com.client
labview_app = win32com.client.Dispatch('LabVIEW.Application')
But it gives an error: pywintypes.com_error: (-2146959355, 'Server execution failed', None, None)
I have also tried one of the solutions mentioned in the forum:
from ctypes import *
import comtypes.client
comtypes.CoInitialize()
TypeLibPath = r'C:\Data\labview.tlb"
comtypes.client.gen_dir = None
comtypes.client.GetModule(TypeLibPath)
Application = comtypes.client.CreateObject("LabVIEW.Application.8", None, None, comtypes.gen.LabVIEW._Application)
But this gives me an error on comtypes.client.CreateObject line: AttributeError: module 'comtypes.gen' has no attribute 'LabVIEW'
LabView version installed: LabView2016 (32-bit)
ActiveX Server Name: LabviewHIL
Python version: Python3.7.9 (32-bit)
Could you please let me know what am I missing out to correctly launch Labview Application using python code?
Thanks,
Reena