Sei sulla pagina 1di 2

FB to realize the motion of Doser, a forward move until the dispensing length is

reached, and then a control of


the TP state:
1. if TP is on a back move to take the TP off
2. if TP is OFF a forward move to take the TP on , and then a backward move to
take it off.

Mean of result:
0: error
10: wait for start
20: forward move
30: decide next move
40: move back until TP OFF
45: if START then wait axis is stopped, then start
60: move forward until TP ON
65: if TP ON wait axis is stopped, then move until TP OFF

*)

(* INPUT VARIABLES *)
VAR
Loc_LayerNumber:DINT;
Loc_TrigResetPosition:R_TRIG;
MemLE_Fault: BOOL:=FALSE;
App: BOOL; (*temp*)
FirstTimeFlag: BOOL := FALSE;
MoveBackResult: DINT := 0;
MoveForwResult: DINT := 0;
DosingResult: DINT := 0;
FB_Dosing: FB_LaunchDoser;
AccMungitura: DINT:=100; (*old 40%*)
DecMungitura: DINT:=100; (*%*)
FB_MoveBack: FB_Pos;
FB_MoveForw: FB_Pos;
ProductOK: BOOL := FALSE; (* IS TRUE AFTER A DOSING
PHASE WITH PRODUCT PRESENCE *)
MoveForw: BOOL := FALSE;
MoveBack: BOOL := FALSE;
Dosing: BOOL := FALSE;
PausePhase: BOOL:=FALSE;
ForwReset: BOOL := FALSE;
BackReset: BOOL := FALSE;
CamPrepare: BOOL := FALSE;
LancioFinito: BOOL:=FALSE;
DosingActive: BOOL:=FALSE;
FTC_Occupata: BOOL:=FALSE;
FTC_Liberata: BOOL:=FALSE;
XPos: LREAL := 0;
SearchVel: LREAL := 0;
R_TrigMung: R_TRIG;

RTrig_LancioFinito: R_TRIG;
StartPHoffsetActual: LREAL;
IResult: DINT;

EnableFlag: BOOL;
AvvioCambioFase: BOOL;

R_TrigStartDoser: R_TRIG;
FB_DosingVertical: FB_LaunchDoser2;
MungituraStopped: BOOL:=FALSE;
TMPStepSBar: LREAL;

END_VAR

VAR_INPUT
Enable: BOOL := FALSE; (* FB enable, if is true the state of the FB is active
*)
Axis: DRIVE; (* name of controlled axis *)
Encoder: L_ENC; (* name of master of the controlled axis *)
Continue:BOOL:=FALSE;
StartDoser: BOOL := FALSE; (* motion start signal *)
HomeOk:BOOL:=FALSE;(* home appena eseguito*)
SL_Scaling: LREAL := 0; (* end position of the forward movement for slave
axis *)
MS_Scaling: LREAL := 0; (* end position of the forward movement for master
axis *)
ProductPresence: D_IN1; (* Digital input *)
Gearing:LREAL; (* gearing ratio *)
En_Doser:BOOL;
MungituraPhase:BOOL;
StepSBar:LREAL;
StartPHoffset:LREAL;(*entita di sfasamento fase partenza lancio*)
RotoliVerticali:BOOL;(*tipo camma: false=unica camma lancio, true=camme
multiple*)
NumRotoli:LREAL; (*numero rotoli per fila*)
DoserClosed:BOOL;(*se ingresso vale 0 occorre interrompere la mungitura*)
SBarFisrtHalfStep:BOOL;
DeviatorOn:BOOL;
TotDosMasterScalDEV:LREAL;

END_VAR

VAR_OUTPUT
Active: BOOL := FALSE;
Result:DINT;
DoserReady:BOOL:=FALSE;
PositionX: LREAL;
PositionY: LREAL;

END_VAR

Potrebbero piacerti anche