Changeset 772 in ETALON
- Timestamp:
- May 28, 2018, 2:54:21 PM (6 years ago)
- Location:
- BPM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
BPM/initialise_motors.py
r771 r772 245 245 motor_disable(1) 246 246 247 def horizontal_aquisition(begin,end,pas,fichier): 247 def horizontal_aquisition(begin,end,pas,bpm_name): 248 idata = 0 249 start_time_str=datetime.now().strftime("%Y%m%d_%H%M%S") 250 data_name_and_path = data_dir+"data/position_vs_tension_"+bpm_name+"_"+start_time_str+"_"+str(idata)+".txt" 251 while os.path.exists(data_name_and_path) : 252 idata+=1 253 data_name_and_path = data_dir+"position_vs_tension_"+bpm_name+start_time_str+"_"+str(idata)+".txt" 254 fichier = open(data_name_and_path, "w") 255 motor_enable(1) 248 256 L = [[],[],[],[],[]] 249 for i in range(begin, end +1,pas):257 for i in range(begin, end,pas): 250 258 move_motor_absolute(1,5000,i) 251 259 while motor_get(1, 'status') != 'READY': … … 253 261 time.sleep(1) 254 262 l = read_scope_and_write(i, fichier) 255 for iin range(5):256 L[ i].append(l[i])263 for j in range(5): 264 L[j].append(l[j]) 257 265 time.sleep(1) 258 move_motor_absolute(1,5000,begin) 266 267 move_motor_absolute(1,5000,end) # pour assuré le dernier pas, en aller ou retour 259 268 while motor_get(1, 'status') != 'READY': 260 269 time.sleep(1) 270 time.sleep(1) 271 l = read_scope_and_write(end, fichier) 272 for j in range(5): 273 L[j].append(l[j]) 261 274 time.sleep(1) 262 275 motor_disable(1) … … 264 277 plt.plot(L[0],L[i+1]) 265 278 plt.show() 266 279 fichier.close() 267 280 268 281 #controller_hello() -
BPM/motor_control.py
r771 r772 26 26 27 27 28 29 30 31 28 32 turn_on() 29 fichier = open("test.txt", "w")30 horizontal_aquisition(0,2,1,fichier)31 fichier.close()32 #turn_off()33 33 34 horizontal_aquisition(0,400000,4000,"ch1-3_bpm_ref_ch2-4_bpm_impr") 35 36 #horizontal_aquisition(400000,0,-4000,"ch1-3_bpm_ref_ch2-4_bpm_impr") 37 38 turn_off() 39 40 #fichier = open("24-05-2018_aquisition_from_0_to_400000_step_of_1000.txt", "r") 34 41 """ 35 fichier = open("24-05-2018_aquisition_from_0_to_400000_step_of_1000.txt", "r")36 42 A = fichier.read() 37 43 … … 85 91 plt.plot(X,Y4) 86 92 plt.show() 93 """ 87 94 88 95 #fichier.close() 89 """ 96 90 97 91 98 … … 111 118 112 119 #motor_disable(2) #commande dangeureuse 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
Note: See TracChangeset
for help on using the changeset viewer.