Stimmt. Hab mich wohl zu ungenau ausgedrückt, ich kenne das auch nur von der µC-Programmierung in C. Da es sich hier um einen Roboter handelt, die vermutlich auch mit einem µC angesteuert wird, dachte ich, dass es da etwas ähnliches geben sollte.
Um ganz konkret zu werden, stell ich mal den betroffenen Code-Abschnitt herein.
Code: Alles auswählen
def glue(xout, yout, zout, xin, yin, zin, r,c):
(...)
for x in range(2):
for y in range(9):
#jump fast to other gluing points
dType.SetPTPCommonParams(api, v_fast, a_fast, 1)
dType.SetPTPCmd(api, 0, xout+(x*x2)+xoff, yout+(y*cell)+yoff, zout+1, r, 1)
dType.SetPTPCommonParams(api, 20, a_fast, 1)
dType.SetPTPCmd(api, 0, xout+(x*x2)+xoff, yout+(y*cell)+yoff, zout, r, 1)
#gluing
#glue while first glue-rectangle
#stop gluing while second glue-rectangle
dType.SetIODO(api, 2, 0, 1)
dType.SetPTPCommonParams(api, v_glu, a_glu, 1)
dType.SetPTPCmd(api, 2 , xout+(x*x2)+xoff, yout-xy_arc+(y*cell)+yoff, zout+z_arc, r, 1)
dType.SetPTPCmd(api, 2 , xout-xy_arc+(x*x2)+xoff, yout+(y*cell)+yoff, zout+(2*z_arc), r, 1)
dType.SetPTPCmd(api, 2 , xout+(x*x2)+xoff, yout+xy_arc+(y*cell)+yoff, zout+(3*z_arc), r, 1)
dType.SetPTPCmd(api, 2 , xout+xy_arc+(x*x2)+xoff, yout+(y*cell)+yoff, zout+(4*z_arc), r, 1)
dType.SetIODO(api, 2, 1, 1)
dType.SetPTPCmd(api, 2 , xout+(x*x2)+xoff, yout-xy_arc+(y*cell)+yoff, zout+zup, r, 1)
dType.SetPTPCmd(api, 2 , xout-xy_arc+(x*x2)+xoff, yout+(y*cell)+yoff, zout+zup, r, 1)
dType.SetPTPCmd(api, 2 , xout+(x*x2)+xoff, yout+xy_arc+(y*cell)+yoff, zout+zup, r, 1)
dType.SetPTPCmd(api, 2 , xout+xy_arc+(x*x2)+xoff, yout+(y*cell)+yoff, zout+zup, r, 1)
dType.SetPTPCmd(api, 2 , xout+(x*x2)+xoff, yout-xy_arc+(y*cell)+yoff, zout+zup, r, 1)
if(dType.GetIODI(api, 17)[0]==0):
serv_exit=1
(...)
return serv_exit
Es handelt sich um obenstehendes Unterprogramm. Die Klammer mit den Punkten (...) ersetzt Teile des Codes, die meiner Meinung für die Frage nicht von Bedeutung sind (Variablendefinition, etc.). Die dType-Befehle sind Roboterbefehle (auch nicht so wichtig).
Um auf den Punkt zu kommen: ich will anders als bisher gelöst, die Abarbeitung der for-Schleife im Bereich der if-Anweisung mittels Taster unterbrechen, in ein Unterprogramm (Interrupt-Routine) springen und anschließend soll die for-Schleife im bisherigen Verlauf weiterlaufen. Dabei sollte der Tasterstatus schon während der dType-Befehle abgefragt und in eine Variable geschrieben werden und nicht wie bisher erst in der if-Anweisung.
Ich hoffe das war klar und verständlich ausgedrückt.
