import numpy as np import epics from matplotlib import pyplot as plt from epics import caget, caput, cainfo threshold = 0.2 monitor_ch = 'SLAAT21-LMOT-M703:MOT' current_ch = caget(monitor_ch) c = 0 while c == 0: current_ch = caget(monitor_ch) print('value checked and it is : ' , current_ch) print('####### ----- #######') if np.abs(current_ch - 55.7 ) > threshold: plt.figure(figsize = (50,5)) plt.plot((0,500),(0,1), lw = 0.001) plt.text(0.5, 0.5,'stage_moved', fontsize = 100, color = "r") plt.show()