forked from YujinChu/AWX_collector
dummy
This commit is contained in:
parent
c40e686cad
commit
5d42b474b6
|
@ -167,7 +167,7 @@ def cwt_thread(evt, chip_index, port_a_ai_id , port_a_do_id, port_b_ai_id , port
|
|||
#prev_b_ai = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
|
||||
|
||||
ai_array = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
|
||||
random_index = random.randint(0, len(my_array) -1)
|
||||
random_index = random.randint(0, len(ai_array) -1)
|
||||
ai_array = [random.randint(1,50000) for _ in range(16)]
|
||||
|
||||
prev_a_ai = ai_array
|
||||
|
|
|
@ -162,12 +162,16 @@ def cwt_thread(evt, chip_index, port_a_ai_id , port_a_do_id, port_b_ai_id , port
|
|||
#print("read thread get even")
|
||||
evt.clear()
|
||||
|
||||
prev_a_ai = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
|
||||
prev_b_ai = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
|
||||
|
||||
ai_array = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
|
||||
#prev_a_ai = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
|
||||
#prev_b_ai = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
|
||||
|
||||
ai_array = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
|
||||
random_index = random.randint(0, len(my_array) -1)
|
||||
ai_array = [random.randint(1,50000) for _ in range(16)]
|
||||
|
||||
prev_a_ai = ai_array
|
||||
prev_b_ai = ai_array
|
||||
#value list on -> do control data
|
||||
#추<><ECB694>에 do power on 할 리스트는 어디선가 읽어서 와야 해요
|
||||
#do1 do2 나눠야 해요
|
||||
|
@ -194,13 +198,14 @@ def cwt_thread(evt, chip_index, port_a_ai_id , port_a_do_id, port_b_ai_id , port
|
|||
# PORT A
|
||||
port_a_do_value = list(b[:16])
|
||||
try:
|
||||
a_ai_data=port_A_AI.read_registers(0x32, 32)
|
||||
#a_ai_data=port_A_AI.read_registers(0x32, 32)
|
||||
a_ai_data=ai_array
|
||||
# suc_cnt_ai = suc_cnt_ai +1
|
||||
except:
|
||||
isSuccess = False
|
||||
|
||||
if isSuccess:
|
||||
prev_a_ai = ai_array
|
||||
priv_a_ai = ai_array
|
||||
|
||||
try:
|
||||
port_A_DO.write_bits(0, port_a_do_value)
|
||||
|
@ -211,8 +216,9 @@ def cwt_thread(evt, chip_index, port_a_ai_id , port_a_do_id, port_b_ai_id , port
|
|||
# PORT B
|
||||
port_b_do_value = list(b[17:32])
|
||||
try:
|
||||
b_ai_data=port_B_AI.read_registers(0x32, 32)
|
||||
prev_b_ai = ai_array
|
||||
#b_ai_data=port_B_AI.read_registers(0x32, 32)
|
||||
b_ai_data = ai_array
|
||||
#prev_b_ai = ai_array
|
||||
# suc_cnt_ai = suc_cnt_ai +1
|
||||
except:
|
||||
isSuccess = False
|
||||
|
@ -230,8 +236,8 @@ def cwt_thread(evt, chip_index, port_a_ai_id , port_a_do_id, port_b_ai_id , port
|
|||
queue_a.put([timenow,ai_array, port_a_do_value])
|
||||
queue_b.put([timenow,ai_array, port_b_do_value])
|
||||
else:
|
||||
queue_a.put([0,ai_array, port_a_do_value])
|
||||
queue_b.put([0,ai_array, port_b_do_value])
|
||||
queue_a.put([0,prev_a_ai, port_a_do_value])
|
||||
queue_b.put([0,prev_a_ai, port_b_do_value])
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue