Created
February 6, 2017 06:14
-
-
Save h4ck3rk3y/319c038681de20dc9af246a6d73ca881 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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