You are on page 1of 1

if bControlSource = byte#0 then (*Sursa de control - Local*)

iDriverIndex := objPump.iLocalDriver;
iActiveDrive := iDriverIndex;
if arrDrivers[iDriverIndex].iType = 0 then (*tip convertizor*)
xStart_SS:=false;
xStart_CF:=xStartCommand;
else
xStart_CF:=false;
xStart_SS:=xStartCommand;
end_if;
else
(*Urmareste activarea comenzii de start*)
R_TRIG_Command(CLK:=xStartCommand);
if R_TRIG_Command.Q then
xGasit:=false;
iIndex:=0;
iActiveDrive := 0;
if objPump.xActive then (*cauta driver-ul rezervat*)
while not xGasit and (iIndex < iMaxPumps) do
iIndex:=iIndex+1;
if arrDrivers[iIndex].xReserved and arrDrivers[iIndex].iUsedBy=0 then
xGasit:=true;
objPump.iUses:=iIndex;
iActiveDrive := iIndex;
arrDrivers[iIndex].iUsedBy := objPump.iObjNo;
end_if;
end_while;
else (*cauta driver-ul asociat, neutilizat si nerezervat*)
while not xGasit and (iIndex < iMaxPumps) do
iIndex:=iIndex+1;
if not arrDrivers[iIndex].xReserved and arrDrivers[iIndex].iUsedBy=0 and o
bjPump.arrAssoc[iIndex]=byte#1 then
xGasit:=true;
objPump.iUses:=iIndex;
iActiveDrive := iIndex;
arrDrivers[iIndex].iUsedBy := objPump.iObjNo;
end_if;
end_while;
(*!??----------------------??!*)
(*Ce faci daca nu s-a gasit??!*)
(*!??----------------------??!*)
end_if;
end_if;

(*cata vreme e comanda activa*)


if xStartCommand then
if arrDrivers[iIndex].iType = 0 then (*tip convertizor*)
xStart_SS:=false;
xStart_CF:=xStartCommand;
else
xStart_CF:=false;
xStart_SS:=xStartCommand;
end_if;
end_if;
end_if;

F_TRIG_Command(CLK:=xStartCommand);
if F_TRIG_Command.Q then
if iIndex>0 and iIndex<11 then
arrDrivers[iIndex].iUsedBy := 0;
end_if;
objPump.iUses := 0;
iActiveDrive := 0;
end_if;

if not xStartCommand then (*asigura comanda nula*)


xStart_CF:=false;
xStart_SS:=false;
end_if;

Phoenix Contact GmbH & Co. KG Sheet number


Flachsmarktstraße 8
PC WORX 32825 Blomberg 1
Germany

Current POU: This copy printed out at:


SelectieDriver:SelectieDriver
VL_CL4_MCC1_back 11/23/2015 04:41:02 PM

You might also like