Académique Documents
Professionnel Documents
Culture Documents
1_ introduction
1_ introduction
Calculs :
L=b*N
NLignes = a/Pas
a : longueur du moule
Le pas étant de 20
grafset en anex
PROGRAM _INIT
//Deplacement
x0 := 20; //[mm]
END_PROGRAM
PROGRAM _CYCLIC
CASE etat OF
0: //Attente demande de demarrage
IF ihm_on THEN
etat := 10;
gAxeCmd01.BpOn := TRUE;
gAxeCmd02.BpOn := TRUE;
etat:=10;
END_IF
END_IF
31://Demarrage moteur
IF gAxeInfo01.PowerOn AND gAxeInfo02.PowerOn THEN
gAxeCmd01.BpMoveAbsolute := TRUE;
gAxeCmd02.BpMoveAbsolute := TRUE;
etat := 12;
END_IF
//------------------------
//Deplacement aller-retour
//------------------------
100://Deplacement en x0
IF gAxeInfo02.StandstillAbs THEN //Information
"mouvement termine"
gAxeCmd01.MoveAbsolute.Acc := 100;
gAxeCmd01.MoveAbsolute.Vit := 20;
gAxeCmd01.MoveAbsolute.Pos := 20;
gAxeCmd01.MoveAbsolute.BpMove := TRUE;
etat := 101;
END_IF
101:
IF gAxeInfo01.Standstill.Abs THEN
gAxeCmd02.MoveAbsolute.Acc := 100;
gAxeCmd02.MoveAbsolute.Vit := 20;
gAxeCmd02.MoveAbsolute.Pos := 20;
gAxeCmd02.MoveAbsolute.BpMove := TRUE;
etat := 102;
END_IF
102:
IF gAxeInfo02.StandstillAbs THEN
gAxeCmd01.MoveAbsolute.Acc := 100;
gAxeCmd01.MoveAbsolute.Vit := 20;
gAxeCmd01.MoveAbsolute.Pos := 150;
gAxeCmd01.MoveAbsolute.BpMove := TRUE;
etat := 103;
END_IF
103:
IF gAxeInfo01.StandstillAbs THEN
gAxeCmd02.MoveAbsolute.Acc := 100;
gAxeCmd02.MoveAbsolute.Vit := 20;
gAxeCmd02.MoveAbsolute.Pos := 150;
gAxeCmd02.MoveAbsolute.BpMove := TRUE;
etat := 104;
END_IF
104:
122:
IF ihm_start THEN
etat := 13;
ihm_start:=0;
END_IF
END_CASE
END_PROGRAM