示例#1
0
Start_Current = (M.Read(Client, Tags.Recirculator_Halfway, Average = True, count = count,sleep_time = sleep_time) + \
                 M.Read(Client, Tags.Recirculator_Bypass, Average = True, count = count,sleep_time = sleep_time))

H_Broken = V_Broken = False  #Creating the check tag for the dog leg, starting out as false as no errors could have been raised yet

Full_Data_Set = list()
WF6H_Tag = Tags.WF6H  #Storing these tags since we use them frequently.
WF7H_Tag = Tags.WF7H
WF6V_Tag = Tags.WF6V
WF7V_Tag = Tags.WF7V

print("Right Displacement")

## Each of these are adding our data to a list as instantiated above. These will appear at each data gathering point
Full_Data_Set.append(
    M.Gather(Client, Tag_List, count=count, sleep_time=sleep_time))

for Right_Steps in range(1, Read_Steps + 1):
    a = time.time()
    if Right_Steps != 1:  #Don't check on the first run due to absence of Window Frame write values
        #Comparing the current value to the last write value, if it is different, this updates the break loop for both Horizontal and Vertical
        if abs(M.Read(Client, WF6H_Tag) - WF6H_Write_Value
               ) or abs(M.Read(Client, WF7H_Tag) -
                        WF7H_Write_Value) >= 0.001:  #WF6H Check
            H_Broken = V_Broken = True
            print("Loop Broken")
            #break

    WF6H_Write_Value = WF6H_Start + (
        Delta_6 /
        Read_Steps) * Right_Steps  #Calculated value to walk 6 to the right