*
FUNCTION_BLOCK FB 2
TITLE =byteweise Signalentprellung
//byteweise Signalentprellung
//für das gesamte Byte gilt die selbe Zeit
//Multiinstanzfähig
//
//DATE: 12.11.2008
//AUTHOR: 4lagig
//VERSION: V0.1 BasicVer
VERSION : 0.1
VAR_INPUT
bInput : BYTE ;
tDelay : TIME ;
END_VAR
VAR_OUTPUT
bOutput : BYTE ;
END_VAR
VAR
TON_0 : "TON";
TON_1 : "TON";
TON_2 : "TON";
TON_3 : "TON";
TON_4 : "TON";
TON_5 : "TON";
TON_6 : "TON";
TON_7 : "TON";
aTempInput : ARRAY [0 .. 7 ] OF BOOL ;
aTempOutput : ARRAY [0 .. 7 ] OF BOOL ;
END_VAR
VAR_TEMP
dTempAR1 : DWORD ;
dTempAR2 : DWORD ;
END_VAR
BEGIN
NETWORK
TITLE =
TAR2 #dTempAR2;
NETWORK
TITLE =
LAR1 P##bInput;
L #dTempAR2;
+AR1 ;
U [AR1,P#0.0];
= #aTempInput[0];
U [AR1,P#0.1];
= #aTempInput[1];
U [AR1,P#0.2];
= #aTempInput[2];
U [AR1,P#0.3];
= #aTempInput[3];
U [AR1,P#0.4];
= #aTempInput[4];
U [AR1,P#0.5];
= #aTempInput[5];
U [AR1,P#0.6];
= #aTempInput[6];
U [AR1,P#0.7];
= #aTempInput[7];
NETWORK
TITLE =
CALL #TON_0 (
IN := #aTempInput[0],
PT := #tDelay,
Q := #aTempOutput[0]);
CALL #TON_1 (
IN := #aTempInput[1],
PT := #tDelay,
Q := #aTempOutput[1]);
CALL #TON_2 (
IN := #aTempInput[2],
PT := #tDelay,
Q := #aTempOutput[2]);
CALL #TON_3 (
IN := #aTempInput[3],
PT := #tDelay,
Q := #aTempOutput[3]);
CALL #TON_4 (
IN := #aTempInput[4],
PT := #tDelay,
Q := #aTempOutput[4]);
CALL #TON_5 (
IN := #aTempInput[5],
PT := #tDelay,
Q := #aTempOutput[5]);
CALL #TON_6 (
IN := #aTempInput[6],
PT := #tDelay,
Q := #aTempOutput[6]);
CALL #TON_7 (
IN := #aTempInput[7],
PT := #tDelay,
Q := #aTempOutput[7]);
NETWORK
TITLE =
LAR1 P##bOutput;
L #dTempAR2;
+AR1 ;
U #aTempOutput[0];
= [AR1,P#0.0];
U #aTempOutput[1];
= [AR1,P#0.1];
U #aTempOutput[2];
= [AR1,P#0.2];
U #aTempOutput[3];
= [AR1,P#0.3];
U #aTempOutput[4];
= [AR1,P#0.4];
U #aTempOutput[5];
= [AR1,P#0.5];
U #aTempOutput[6];
= [AR1,P#0.6];
U #aTempOutput[7];
= [AR1,P#0.7];
NETWORK
TITLE =
SET ;
SAVE ;
END_FUNCTION_BLOCK