Skip to content
Snippets Groups Projects
Commit dab98656 authored by Paulus Kruger's avatar Paulus Kruger
Browse files

remove

parent 9bc742ab
No related branches found
No related tags found
1 merge request!11Pypcc2
import opcuaserv
import threading
import signal
import sys
import time
#import Vars
import logging
import argparse
from opcuaserv import i2client
from opcuaserv import yamlreader
def run(args):
#RCUthread1=RCU.start(Q1)
#CLKthread1=CLK.start(Q2)
RunTimer=True;
def TimerThread(RCU_I2C,RCU_conf):
V1=opcuaserv.AddVar("RCU_monitor_rate_RW",30)
cnt=0;#Count second ticks
while RunTimer:
time.sleep(1)
T1=V1.get_data_value().Value.Value
if T1==0:
continue;
cnt+=1;
if cnt>=T1:
# if Q1.qsize()>3: continue;
cnt=0;
# logging.debug(str(("I2C bytes=",I2C.I2Ccounter," Qlength=",Q1.qsize())))
# RCU.Queue_Monitor(Q1)
logging.info("End Timer thread")
#Timerthread1 = threading.Thread(target=TimerThread, args=(RCU_I2C,RCU_conf))
#Timerthread1.start()
# on SIGINT: stop thread(s) by adding None to instruction queue(s)
def signal_handler(sig, frame):
# logging.info('Stop RCU thread')
# Q1.put(None)
# Q2.put(None)
# logging.info('Stop timer thread')
global RunTimer;
RunTimer=False
signal.signal(signal.SIGINT, signal_handler)
# try:
#Do nothing.
while RunTimer:
time.sleep(1)
# time.sleep(0.001)
# RCU_conf.getvar();#Todo use thread and blocking
# finally:
# RCU_I2C.stop();
# RCUthread1.join()
# CLKthread1.join()
# Timerthread1.join()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment