Index: /BPM/bpm_constants.py
===================================================================
--- /BPM/bpm_constants.py	(revision 777)
+++ /BPM/bpm_constants.py	(revision 778)
@@ -4,6 +4,6 @@
 
 global data_dir
-if os.path.exists('home/alexandre/Bureau/stage/BPM/') :
-	data_dir='home/alexandre/Bureau/stage/BPM/'
+if os.path.exists('/home/alexandre/Bureau/stage/BPM/') :
+	data_dir='/home/alexandre/Bureau/stage/BPM/'
 if os.path.exists('/Users/delerue/Downloads/'):
 	data_dir='/Users/delerue/Downloads/'
Index: /BPM/initialise_motors.py
===================================================================
--- /BPM/initialise_motors.py	(revision 777)
+++ /BPM/initialise_motors.py	(revision 778)
@@ -59,4 +59,15 @@
             print('Be carful with disable vertical motor')
         else :
+            move_motor_absolute(2,10000,-10000)
+            while motor_get(2, 'status') != 'READY':
+	        time.sleep(1)
+            print('Say ok when motor can be put in position 0')
+            x = raw_input()
+            while not (x == 'OK' or x == 'ok' or x == 'Ok'):
+                print('Say ok when motor can be put in position 0')
+                x = raw_input()
+            move_motor_absolute(2,5000,0)
+            while motor_get(2, 'status') != 'READY':
+	        time.sleep(1)
             msg = str(motor) + 'CD'
             motor_send(msg, verbose)
@@ -266,9 +277,9 @@
     while os.path.exists(data_name_and_path) :
         idata+=1
-        data_name_and_path = data_dir+"position_vs_tension_"+bpm_name+start_time_str+"_"+str(idata)+".txt"
+        data_name_and_path = data_dir+"data/position_vs_tension_"+bpm_name+"_"+start_time_str+"_"+str(idata)+".txt"
     return(data_name_and_path)
     
     
-def horizontal_aquisition(begin,end,pas,bpm_name):
+def horizontal_acquisition(begin,end,pas,bpm_name):
     if pas == 0: #position test
         motor_enable(1)
@@ -313,5 +324,5 @@
 
 
-def vertical_aquisition(begin,end,pas,bpm_name):
+def vertical_acquisition(begin,end,pas,bpm_name):
     if pas == 0: #position test
         motor_enable(2)
@@ -354,14 +365,27 @@
         motor_disable(2)
 
-
-
-
-def aquisition(begin1,end1,pas2,begin2,end2,pas1,bpm_name):
-    if pas == 0: #position test
+def acqui_column(begin, end, pas, data_path, other_position): # use in aquisition to read a column
+    if (end - begin)*pas < 0 :
+        pas = -pas
+    for i in range(begin,end,pas):
+	move_motor_absolute(2,5000,i)
+	while motor_get(2, 'status') != 'READY':
+	    time.sleep(1)
+        time.sleep(1)
+	l = read_scope_and_write_2D(other_position, i, data_path)
+    time.sleep(1)
+    move_motor_absolute(2,5000,end) # pour assuré le dernier pas, en aller ou retour
+    while motor_get(2, 'status') != 'READY':
+	time.sleep(1)
+    time.sleep(1)
+    read_scope_and_write_2D(other_position, end, data_path)    
+
+def acquisition(begin1,end1,pas1,begin2,end2,pas2,bpm_name):
+    if pas1 == 0 or pas2 == 0: #position test
         motor_enable(1)
         motor_enable(2)
        	move_motor_absolute(1,10000,begin1)
        	move_motor_absolute(2,10000,begin2)
-	while (motor_get(1, 'status') != 'READY') and (motor_get(2, 'status') != 'READY'):
+	while (motor_get(1, 'status') != 'READY') or (motor_get(2, 'status') != 'READY'):
 	    time.sleep(1)
         print("position ok ?")
@@ -369,5 +393,5 @@
        	move_motor_absolute(1,10000,end1)
        	move_motor_absolute(2,10000,end2)
-	while (motor_get(1, 'status') != 'READY') and (motor_get(2, 'status') != 'READY'):
+	while (motor_get(1, 'status') != 'READY') or (motor_get(2, 'status') != 'READY'):
 	    time.sleep(1)
         print("position ok ?")
@@ -375,36 +399,32 @@
         motor_disable(2)
     else:
-        if (end - begin)*pas < 0 :
-            pas = -pas
+        if (end1 - begin1)*pas1 < 0 :
+            pas1 = -pas1
+        if (end2 - begin2)*pas2 < 0 :
+            pas2 = -pas2
         data_name_and_path = path(bpm_name)
         motor_enable(1)
         motor_enable(2)
-        L = [[],[],[],[],[]]
-        for i in range(begin1, end1,pas1):
+#        L = [[],[],[],[],[],[]]
+        for i in range(begin1, end1, pas1):            
 	    move_motor_absolute(1,5000,i)
 	    while motor_get(1, 'status') != 'READY':
 		time.sleep(1)
-	    time.sleep(1)
-            for j in range(begin2, end2,pas2):
-	        move_motor_absolute(2,5000,i)
-	        while motor_get(2, 'status') != 'READY':
-                    time.sleep(1)
-	        time.sleep(1)
-                l = read_scope_and_write_2D(i, data_name_and_path)
-                for k in range(5):
-                    L[k].append(l[k])
-                time.sleep(1)
-        move_motor_absolute(1,5000,end1)    
-        move_motor_absolute(2,5000,end2) # pour assuré le dernier pas, en aller ou retour
-        while (motor_get(1, 'status') != 'READY') & (motor_get(2, 'status') != 'READY'): 
-	    time.sleep(1)
-        time.sleep(1)
-        l = read_scope_and_write_2D(end, data_name_and_path)
-        for j in range(5):
-            L[j].append(l[j])
-        time.sleep(1)
-        for i in range(4):
-            plt.plot(L[0],L[i+1])
-        plt.show()
+            acqui_column(begin2, end2, pas2, data_name_and_path, i)
+            begin2,end2 = end2,begin2
+        move_motor_absolute(1,5000,end1) # pour assuré le dernier pas, en aller ou retour
+        while motor_get(1, 'status') != 'READY': 
+	    time.sleep(1)
+        time.sleep(1)
+
+        acqui_column(begin2, end2, pas2, data_name_and_path, end1)
+        
+        motor_disable(1)
+        motor_disable(2)
+#        for j in range(6):
+#L[j].append(l[j])
+#        for i in range(4):
+#            plt.plot(L[0],L[i+2])
+#        plt.show()
 
 
Index: /BPM/motor_control.py
===================================================================
--- /BPM/motor_control.py	(revision 777)
+++ /BPM/motor_control.py	(revision 778)
@@ -10,4 +10,5 @@
 # moteur 2 -> verticale
 
+"""
 motor_enable(2)
 move_motor_absolute(2,5000,-50000)
@@ -15,4 +16,5 @@
     time.sleep(1)
 time.sleep(5)
+"""
 """ 
 move_motor_absolute(2,5000,0)
@@ -33,19 +35,24 @@
 #                                 creation graphique
 
+#horizontal_acquisition(4000,0,-4000,"test")    
+
+acquisition(-10000,10000,10000,-50000,0,25000,"test")
+
+#acquisition(-10000,10000,1000,-50000,0,5000,"test")
 
 #turn_on()
 
-vertical_aquisition(-110000,90000,4000,"ch1-3_bpm_ref_ch2-4_bpm_impr_vertical_acquisition")
+#vertical_acquisition(-110000,90000,4000,"ch1-3_bpm_ref_ch2-4_bpm_impr_vertical_acquisition")
 
-#vertical_aquisition(90000,-110000,4000,"ch1-3_bpm_ref_ch2-4_bpm_impr_vertical_acquisition")
+#vertical_acquisition(90000,-110000,4000,"ch1-3_bpm_ref_ch2-4_bpm_impr_vertical_acquisition")
 
-#vertical_aquisition(0,-4000,2000,"test")
-#vertical_aquisition(4000,0,2000,"test2")
+#vertical_acquisition(0,-4000,2000,"test")
+#vertical_acquisition(4000,0,2000,"test2")
 
-#horizontal_aquisition(400000,0,-4000,"ch1-3_bpm_ref_ch2-4_bpm_impr")    
+#horizontal_acquisition(400000,0,-4000,"ch1-3_bpm_ref_ch2-4_bpm_impr")    
 
 #turn_off()
 
-#fichier = open("24-05-2018_aquisition_from_0_to_400000_step_of_1000.txt", "r")
+#fichier = open("24-05-2018_acquisition_from_0_to_400000_step_of_1000.txt", "r")
 """
 A = fichier.read()
Index: /BPM/motor_error.txt
===================================================================
--- /BPM/motor_error.txt	(revision 777)
+++ /BPM/motor_error.txt	(revision 778)
@@ -43,4 +43,5 @@
      	     	    Turn on alimentation to UDC motor voltage
 		    under tension on UDC motor voltage
+		    Issue may appear after a certain time, because motor need more current
 
 Error No.: 1887
@@ -64,4 +65,10 @@
 What we have done : Turn on alimentation 
 
+Error No.: 1557
+Designation : MCALC_PARA_MC3
+Description :The movement calculator has received invalid parameters
+Possible cause/Solution :Check all parameters acceleration, moving velocity, ramp time, ramp path, ramp type, starting position, target position
+What we have done : Velocity to high (50000)
+
 
 
Index: /BPM/scope_function.py
===================================================================
--- /BPM/scope_function.py	(revision 777)
+++ /BPM/scope_function.py	(revision 778)
@@ -83,5 +83,17 @@
         
 
+def read_scope_and_write_2D(x ,y ,path):
+    fichier  = open(path, "a")
+    fichier.write(str(x)+' '+str(y)+' ')
+    L = [x,y]
+    for i in range(4):
+	scpi_command('CURS1:SOUR CH'+str(i+1)+' \n CURS1:SOUR?')
+	valeur = scpi_query('CURS1:FUNC UPE \n CURS:RES?')
+        valeur = suppress_alignea(valeur)
+        L.append(float(valeur))
+        fichier.write(valeur+' ')
+    fichier.write('\n')
+    fichier.close()
+    return(L)
 
 
-
