Skip to content

Instantly share code, notes, and snippets.

@h4ck3rk3y
Created February 6, 2017 06:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save h4ck3rk3y/319c038681de20dc9af246a6d73ca881 to your computer and use it in GitHub Desktop.
Save h4ck3rk3y/319c038681de20dc9af246a6d73ca881 to your computer and use it in GitHub Desktop.
import thread
import win32com.client
import time
labview = win32com.client.Dispatch("Labview.Application")
VI = labview.getvireference(r'C:\path\to\target.vi')
def run_app():
VI.run()
def get_vi():
while True:
print "%s %s" %(str(time.time()), str(VI.getcontrolvalue("HMI_LT_003")))
time.sleep(5)
try:
thread.start_new_thread(run_app)
thread.start_new_thread(get_vi)
except:
print 'unable to start thread'
while 1:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment