Hallo,
nach etwas Zeit haben wir nun die multitask Variante umgesetzt.
Den Quellcode dazu will ich euch nicht vorenthalten.
Code
PROC mainsub()
VAR jointtarget joints;
VAR robtarget act_pos_temp;
VAR num rotaxis;
VAR num n1; VAR num n2;
VAR num windingAngle;
WHILE 1=1 DO
joints:=CJointT(\TaskRef:=T_ROB1Id);
act_pos_temp:=CalcRobT(joints, act_tool \WObj:=act_wobj);
IF NOT joints.extax.eax_b=9E9 then
n1:=trunc(joints.extax.eax_b/180);
n2:=trunc(joints.extax.eax_b/360);
rotaxis:=joints.extax.eax_b-(n1-n2)*360;
ELSE
rotaxis:=-327.68;
ENDIF
windingAngle:=EulerZYX(\X, act_pos_temp.rot);
setAO aoAct_X, act_pos_temp.trans.x;
setAO aoAct_Y, act_pos_temp.trans.y;
setAO aoAct_Z, act_pos_temp.trans.z;
SetAO aoAct_C, windingAngle;
SetAO aoAct_extAx, rotaxis;
ENDWHILE
ENDPROC
Alles anzeigen
Jetzt würde ich nur noch gerne das aktuelle Tool und das aktuelle Werkobjekt abfragen. Für den CalcRobT-Befehl.
Gibt es dafür eine Möglichkeit?
Wie kann ich Variablen Taskübergreifend lesen. Das mit doppelt als Pers anlegen funktioniert irgendwie nicht.
Gruß Lars