FUNCTION "FC_BARCODE_SEARCH" : Void { S7_Optimized_Access := 'TRUE' } VERSION : 0.1 VAR_INPUT nInArea : Int; // Suchort eingrenzen: 0 = alles durchsuchen / xxx00 = nur hier suchen xInActive : Bool; // Flanke für Starten des Abrufes END_VAR VAR_OUTPUT xOutNewRetrieve : Bool; // Flanke als Ausgang dass neuer Abruf VOM LAGER stattfindet nOutMissingBarcode : DInt; // Fehlteil xOutError : Bool; // FALSE: Kein Fehler | TRUE: Während der Bearbeitung ist ein Fehler aufgetreten nOutStatus : Int; // Fehlercodes END_VAR VAR_IN_OUT InOutTest : Array[*] of "stCarrier"; // Liste mit dem Jambereich des Lagerausgangs InOutStructRetrieve : Struct // Struktur in der Abruf vorgegeben wird nBarcode : DInt; nDestination : USInt; END_STRUCT; InOutLocalized : "SearchResult"; // Ergebnis END_VAR VAR_TEMP nBarcode : DInt; nDestination : Int; nIdx1 : USInt; nIdx2 : USInt; nIdx3 : Int; nLine : Int; // Zwischenmerker für Suchergebnis nPos : Int; // Zwischenmerker für Suchergebnis nArrTestMax : Int; xPartFound : Bool; // Zwischenmerker Teil gefunden END_VAR VAR CONSTANT ERR_RETRIEVE_INVALID : Int := 3000; // Ungültige Eingaben jeglicher Art ERR_RETRIEVE_EMPTY : Int := 3001; // NIU ERR_RETRIEVE_NOT_FOUND : Int := 3001; // Nicht gefunden ERR_RETRIEVE_MISCERROR : Int := 3003; // NIU "Store2.1.1" : Int := 1; "Store2.1.2" : Int := 2; "Store2.1.3" : Int := 3; "Store2.1.4" : Int := 4; "Store2.2.1" : Int := 5; "Store2.2.2" : Int := 6; "Store2.2.3" : Int := 7; "Store2.2.4" : Int := 8; "Store2.3.1" : Int := 9; "Store2.3.2" : Int := 10; "Store2.3.3" : Int := 11; "Store2.3.4" : Int := 12; END_VAR BEGIN (* ************************************************************************************ Sucht in Vorsortierlinie sowie Lager nach dem Teil welches als EXPRESS abgerufen werden soll ************************************************************************************ *) IF #xInActive THEN REGION Array-Größen ermitteln #nArrTestMax := DINT_TO_INT(UPPER_BOUND(ARR := #InOutTest, DIM := 1)); END_REGION REGION Return Bedingung TO DO IF #InOutStructRetrieve.nDestination < "cDestLvl1B1" OR #InOutStructRetrieve.nDestination > "cDestExit" OR //kein gültiges Ziel (#InOutStructRetrieve.nBarcode / 10000000 <> 2) OR //Wenn hier etwas anderes als 2 rauskommt, dann ist der angeforderte Barcode nicht 8-stellig oder beginnt nicht mit 2 für "MiniTrolley" (((#InOutStructRetrieve.nBarcode / 10) MOD 100) MOD 2 <> 1) //Wenn hier etwas anderes als 1 rauskommt, dann ist die 10er Stelle nicht ungerade THEN #xOutError := TRUE; #nOutStatus := #ERR_RETRIEVE_INVALID; #nOutMissingBarcode := 0; RETURN;//Abruf ungültig ELSE //Wenn Eingaben in Ordnung, dann speichere in Temp #nBarcode := #InOutStructRetrieve.nBarcode; #nDestination := #InOutStructRetrieve.nDestination; END_IF; END_REGION REGION Durchsuche TEST // FOR #nIdx1 := 1 TO #nArrTestMax DO // IF #nBarcode = #InOutTest[#nIdx1].stLoadData.nProductNo AND // #InOutTest[#nIdx1].stLoadData.nDestinationNo <> INT_TO_USINT(#nTarget) AND // #InOutTest[#nIdx1].stLoadData.nDestinationNo <> "cDestQUALITY" (* AND // #InOutExitArray[#nIdx1].stLoadData.nDestinationNo <> "cDestSEAT" AND // #InOutExitArray[#nIdx1].stLoadData.nDestinationNo <> "cDestREST" *) THEN // // #tempPartFound := TRUE; // REGION Schreibe Daten // "FC_GetBackFcPart"(stInPart := #InOutTest[#nIdx1], // xOutput => "DB_RetrieveSearchResult".xGetBackFc); // #InOutTest[#nIdx1].stLoadData.nDestinationNo := INT_TO_USINT(#nTarget); // #InOutTest[#nIdx1].stLoadData.nJobNo := #nJobNo; // END_REGION // #InOutLocalized.nBarcode := #nBarcode; // #InOutLocalized.Storage.Line := 0; // #InOutLocalized.Storage.Pos := 0; // #InOutLocalized.JamTest := #nIdx1; // #InOutLocalized.205_1 := 0; // #InOutLocalized.205_2 := 0; // // #xOutNewRetrieve := TRUE; // #xOutError := FALSE; // #nOutStatus := 0; // #nOutMissingBarcode[1] := 0; // #nOutMissingBarcode[2] := 0; // RETURN; //Suche unterbrechen wenn Teil gefunden wurde // END_IF; // END_FOR; END_REGION (* REGION Durchsuche Lager 1.1.1 IF #nInArea = 0 OR #nInArea = "cDest11100" THEN FOR #nIdx1 := 1 TO "cNoLines1.1.1" DO //Lagerlinien FOR #nIdx2 := 1 TO "cNoPositionsBlock1" DO //Positionen pro Linie IF #nBarcode = "DB_Storage1.1.1".arLine[#nIdx1].arCarrier[#nIdx2].nBarcode AND // "DB_Storage2.1.1".arLine[#nIdx1].arCarrier[#nIdx2].nTarget <> INT_TO_USINT(#nTarget) AND (#nPos = 0 OR #nPos > #nIdx2) THEN //***********falls gefunden********* #nLine := #nIdx1; #nPos := #nIdx2; // #tempPartFound := TRUE; EXIT; //Suche unterbrechen wenn Teil gefunden wurde END_IF; IF #nIdx2 = "cNoPositionsBlock1" THEN EXIT; //nach letzter Position -> Schleife beenden END_IF; END_FOR; IF #nIdx1 = "cNoLines1.1.1" THEN EXIT; //nach letzter Linie -> Schleife beenden END_IF; END_FOR; END_IF; REGION Schreibe Daten IF #nPos > 0 THEN "DB_Storage1.1.1".arLine[#nLine].arCarrier[#nPos].nDestination := INT_TO_USINT(#nDestination); #InOutLocalized.nBarcode := #nBarcode; #InOutLocalized.Storage.Store := #"Store2.1.1"; #InOutLocalized.Storage.Line := #nLine; #InOutLocalized.Storage.Pos := #nPos; #InOutLocalized.JamTest := 0; #xOutNewRetrieve := TRUE; #xOutError := FALSE; #nOutStatus := 0; #nOutMissingBarcode := 0; RETURN; END_IF; END_REGION END_REGION *) (* REGION Durchsuche Lager 1.1.2 IF #nInArea = 0 OR #nInArea = "cDest11200" THEN FOR #nIdx1 := 1 TO "cNoLines1.1.2" DO //Lagerlinien FOR #nIdx2 := 1 TO "cNoPositionsBlock1" DO //Positionen pro Linie IF #nBarcode = "DB_Storage1.1.2".arLine[#nIdx1].arCarrier[#nIdx2].nBarcode AND // "DB_Storage2.1.2".arLine[#nIdx1].arCarrier[#nIdx2].nTarget <> INT_TO_USINT(#nTarget) AND (#nPos = 0 OR #nPos > #nIdx2) THEN //***********falls gefunden********* #nLine := #nIdx1; #nPos := #nIdx2; // #tempPartFound := TRUE; EXIT; //Suche unterbrechen wenn Teil gefunden wurde END_IF; IF #nIdx2 = "cNoPositionsBlock1" THEN EXIT; //nach letzter Position -> Schleife beenden END_IF; END_FOR; IF #nIdx1 = "cNoLines1.1.2" THEN EXIT; //nach letzter Linie -> Schleife beenden END_IF; END_FOR; END_IF; REGION Schreibe Daten IF #nPos > 0 THEN "DB_Storage1.1.2".arLine[#nLine].arCarrier[#nPos].nDestination := INT_TO_USINT(#nDestination); #InOutLocalized.nBarcode := #nBarcode; #InOutLocalized.Storage.Store := #"Store2.1.2"; #InOutLocalized.Storage.Line := #nLine; #InOutLocalized.Storage.Pos := #nPos; #InOutLocalized.JamTest := 0; #xOutNewRetrieve := TRUE; #xOutError := FALSE; #nOutStatus := 0; #nOutMissingBarcode := 0; RETURN; END_IF; END_REGION END_REGION*) (*REGION Durchsuche Lager 1.1.3 IF #nInArea = 0 OR #nInArea = "cDest11300" THEN FOR #nIdx1 := 1 TO "cNoLines1.1.3" DO //Lagerlinien FOR #nIdx2 := 1 TO "cNoPositionsBlock1" DO //Positionen pro Linie IF #nBarcode = "DB_Storage1.1.3".arLine[#nIdx1].arCarrier[#nIdx2].nBarcode AND // "DB_Storage2.1.3".arLine[#nIdx1].arCarrier[#nIdx2].nTarget <> INT_TO_USINT(#nTarget) AND (#nPos = 0 OR #nPos > #nIdx2) THEN //***********falls gefunden********* #nLine := #nIdx1; #nPos := #nIdx2; // #tempPartFound := TRUE; EXIT; //Suche unterbrechen wenn Teil gefunden wurde END_IF; IF #nIdx2 = "cNoPositionsBlock1" THEN EXIT; //nach letzter Position -> Schleife beenden END_IF; END_FOR; IF #nIdx1 = "cNoLines1.1.3" THEN EXIT; //nach letzter Linie -> Schleife beenden END_IF; END_FOR; END_IF; REGION Schreibe Daten IF #nPos > 0 THEN "DB_Storage1.1.3".arLine[#nLine].arCarrier[#nPos].nDestination := INT_TO_USINT(#nDestination); #InOutLocalized.nBarcode := #nBarcode; #InOutLocalized.Storage.Store := #"Store2.1.3"; #InOutLocalized.Storage.Line := #nLine; #InOutLocalized.Storage.Pos := #nPos; #InOutLocalized.JamTest := 0; #xOutNewRetrieve := TRUE; #xOutError := FALSE; #nOutStatus := 0; #nOutMissingBarcode := 0; RETURN; END_IF; END_REGION END_REGION REGION Durchsuche Lager 1.1.4 IF #nInArea = 0 OR #nInArea = "cDest11400" THEN FOR #nIdx1 := 1 TO "cNoLines1.1.4" DO //Lagerlinien FOR #nIdx2 := 1 TO "cNoPositionsBlock1" DO //Positionen pro Linie IF #nBarcode = "DB_Storage1.1.4".arLine[#nIdx1].arCarrier[#nIdx2].nBarcode AND // "DB_Storage2.1.4".arLine[#nIdx1].arCarrier[#nIdx2].nTarget <> INT_TO_USINT(#nTarget) AND (#nPos = 0 OR #nPos > #nIdx2) THEN //***********falls gefunden********* #nLine := #nIdx1; #nPos := #nIdx2; // #tempPartFound := TRUE; EXIT; //Suche unterbrechen wenn Teil gefunden wurde END_IF; IF #nIdx2 = "cNoPositionsBlock1" THEN EXIT; //nach letzter Position -> Schleife beenden END_IF; END_FOR; IF #nIdx1 = "cNoLines1.1.4" THEN EXIT; //nach letzter Linie -> Schleife beenden END_IF; END_FOR; END_IF; REGION Schreibe Daten IF #nPos > 0 THEN "DB_Storage1.1.4".arLine[#nLine].arCarrier[#nPos].nDestination := INT_TO_USINT(#nDestination); #InOutLocalized.nBarcode := #nBarcode; #InOutLocalized.Storage.Store := #"Store2.1.4"; #InOutLocalized.Storage.Line := #nLine; #InOutLocalized.Storage.Pos := #nPos; #InOutLocalized.JamTest := 0; #xOutNewRetrieve := TRUE; #xOutError := FALSE; #nOutStatus := 0; #nOutMissingBarcode := 0; RETURN; END_IF; END_REGION END_REGION REGION Durchsuche Lager 1.2.1 IF #nInArea = 0 OR #nInArea = "cDest12100" THEN FOR #nIdx1 := 1 TO "cNoLines1.2.1" DO //Lagerlinien FOR #nIdx2 := 1 TO "cNoPositionsBlock2" DO //Positionen pro Linie IF #nBarcode = "DB_Storage1.2.1".arLine[#nIdx1].arCarrier[#nIdx2].nBarcode AND // "DB_Storage2.2.1".arLine[#nIdx1].arCarrier[#nIdx2].nTarget <> INT_TO_USINT(#nTarget) AND (#nPos = 0 OR #nPos > #nIdx2) THEN //***********falls gefunden********* #nLine := #nIdx1; #nPos := #nIdx2; // #tempPartFound := TRUE; EXIT; //Suche unterbrechen wenn Teil gefunden wurde END_IF; IF #nIdx2 = "cNoPositionsBlock2" THEN EXIT; //nach letzter Position -> Schleife beenden END_IF; END_FOR; IF #nIdx1 = "cNoLines1.2.1" THEN EXIT; //nach letzter Linie -> Schleife beenden END_IF; END_FOR; END_IF; REGION Schreibe Daten IF #nPos > 0 THEN "DB_Storage1.2.1".arLine[#nLine].arCarrier[#nPos].nDestination := INT_TO_USINT(#nDestination); #InOutLocalized.nBarcode := #nBarcode; #InOutLocalized.Storage.Store := #"Store2.2.1"; #InOutLocalized.Storage.Line := #nLine; #InOutLocalized.Storage.Pos := #nPos; #InOutLocalized.JamTest := 0; #xOutNewRetrieve := TRUE; #xOutError := FALSE; #nOutStatus := 0; #nOutMissingBarcode := 0; RETURN; END_IF; END_REGION END_REGION REGION Durchsuche Lager 1.2.2 IF #nInArea = 0 OR #nInArea = "cDest12200" THEN FOR #nIdx1 := 1 TO "cNoLines1.2.2" DO //Lagerlinien FOR #nIdx2 := 1 TO "cNoPositionsBlock2" DO //Positionen pro Linie IF #nBarcode = "DB_Storage1.2.2".arLine[#nIdx1].arCarrier[#nIdx2].nBarcode AND // "DB_Storage2.2.2".arLine[#nIdx1].arCarrier[#nIdx2].nTarget <> INT_TO_USINT(#nTarget) AND (#nPos = 0 OR #nPos > #nIdx2) THEN //***********falls gefunden********* #nLine := #nIdx1; #nPos := #nIdx2; // #tempPartFound := TRUE; EXIT; //Suche unterbrechen wenn Teil gefunden wurde END_IF; IF #nIdx2 = "cNoPositionsBlock2" THEN EXIT; //nach letzter Position -> Schleife beenden END_IF; END_FOR; IF #nIdx1 = "cNoLines1.2.2" THEN EXIT; //nach letzter Linie -> Schleife beenden END_IF; END_FOR; END_IF; REGION Schreibe Daten IF #nPos > 0 THEN "DB_Storage1.2.2".arLine[#nLine].arCarrier[#nPos].nDestination := INT_TO_USINT(#nDestination); #InOutLocalized.nBarcode := #nBarcode; #InOutLocalized.Storage.Store := #"Store2.2.2"; #InOutLocalized.Storage.Line := #nLine; #InOutLocalized.Storage.Pos := #nPos; #InOutLocalized.JamTest := 0; #xOutNewRetrieve := TRUE; #xOutError := FALSE; #nOutStatus := 0; #nOutMissingBarcode := 0; RETURN; END_IF; END_REGION END_REGION REGION Durchsuche Lager 1.2.3 IF #nInArea = 0 OR #nInArea = "cDest12300" THEN FOR #nIdx1 := 1 TO "cNoLines1.2.3" DO //Lagerlinien FOR #nIdx2 := 1 TO "cNoPositionsBlock2" DO //Positionen pro Linie IF #nBarcode = "DB_Storage1.2.3".arLine[#nIdx1].arCarrier[#nIdx2].nBarcode AND // "DB_Storage2.2.3".arLine[#nIdx1].arCarrier[#nIdx2].nTarget <> INT_TO_USINT(#nTarget) AND (#nPos = 0 OR #nPos > #nIdx2) THEN //***********falls gefunden********* #nLine := #nIdx1; #nPos := #nIdx2; // #tempPartFound := TRUE; EXIT; //Suche unterbrechen wenn Teil gefunden wurde END_IF; IF #nIdx2 = "cNoPositionsBlock2" THEN EXIT; //nach letzter Position -> Schleife beenden END_IF; END_FOR; IF #nIdx1 = "cNoLines1.2.3" THEN EXIT; //nach letzter Linie -> Schleife beenden END_IF; END_FOR; END_IF; REGION Schreibe Daten IF #nPos > 0 THEN "DB_Storage1.2.3".arLine[#nLine].arCarrier[#nPos].nDestination := INT_TO_USINT(#nDestination); #InOutLocalized.nBarcode := #nBarcode; #InOutLocalized.Storage.Store := #"Store2.2.3"; #InOutLocalized.Storage.Line := #nLine; #InOutLocalized.Storage.Pos := #nPos; #InOutLocalized.JamTest := 0; #xOutNewRetrieve := TRUE; #xOutError := FALSE; #nOutStatus := 0; #nOutMissingBarcode := 0; RETURN; END_IF; END_REGION END_REGION REGION Durchsuche Lager 1.2.4 IF #nInArea = 0 OR #nInArea = "cDest12400" THEN FOR #nIdx1 := 1 TO "cNoLines1.2.4" DO //Lagerlinien FOR #nIdx2 := 1 TO "cNoPositionsBlock2" DO //Positionen pro Linie IF #nBarcode = "DB_Storage1.2.4".arLine[#nIdx1].arCarrier[#nIdx2].nBarcode AND // "DB_Storage2.2.4".arLine[#nIdx1].arCarrier[#nIdx2].nTarget <> INT_TO_USINT(#nTarget) AND (#nPos = 0 OR #nPos > #nIdx2) THEN //***********falls gefunden********* #nLine := #nIdx1; #nPos := #nIdx2; // #tempPartFound := TRUE; EXIT; //Suche unterbrechen wenn Teil gefunden wurde END_IF; IF #nIdx2 = "cNoPositionsBlock2" THEN EXIT; //nach letzter Position -> Schleife beenden END_IF; END_FOR; IF #nIdx1 = "cNoLines1.2.4" THEN EXIT; //nach letzter Linie -> Schleife beenden END_IF; END_FOR; END_IF; REGION Schreibe Daten IF #nPos > 0 THEN "DB_Storage1.2.4".arLine[#nLine].arCarrier[#nPos].nDestination := INT_TO_USINT(#nDestination); #InOutLocalized.nBarcode := #nBarcode; #InOutLocalized.Storage.Store := #"Store2.2.4"; #InOutLocalized.Storage.Line := #nLine; #InOutLocalized.Storage.Pos := #nPos; #InOutLocalized.JamTest := 0; #xOutNewRetrieve := TRUE; #xOutError := FALSE; #nOutStatus := 0; #nOutMissingBarcode := 0; RETURN; END_IF; END_REGION END_REGION REGION Durchsuche Lager 1.3.1 IF #nInArea = 0 OR #nInArea = "cDest13100" THEN FOR #nIdx1 := 1 TO "cNoLines1.3.1" DO //Lagerlinien FOR #nIdx2 := 1 TO "cNoPositionsBlock3" DO //Positionen pro Linie IF #nBarcode = "DB_Storage1.3.1".arLine[#nIdx1].arCarrier[#nIdx2].nBarcode AND // "DB_Storage2.3.1".arLine[#nIdx1].arCarrier[#nIdx2].nTarget <> INT_TO_USINT(#nTarget) AND (#nPos = 0 OR #nPos > #nIdx2) THEN //***********falls gefunden********* #nLine := #nIdx1; #nPos := #nIdx2; // #tempPartFound := TRUE; EXIT; //Suche unterbrechen wenn Teil gefunden wurde END_IF; IF #nIdx2 = "cNoPositionsBlock3" THEN EXIT; //nach letzter Position -> Schleife beenden END_IF; END_FOR; IF #nIdx1 = "cNoLines1.3.1" THEN EXIT; //nach letzter Linie -> Schleife beenden END_IF; END_FOR; END_IF; REGION Schreibe Daten IF #nPos > 0 THEN "DB_Storage1.3.1".arLine[#nLine].arCarrier[#nPos].nDestination := INT_TO_USINT(#nDestination); #InOutLocalized.nBarcode := #nBarcode; #InOutLocalized.Storage.Store := #"Store2.3.1"; #InOutLocalized.Storage.Line := #nLine; #InOutLocalized.Storage.Pos := #nPos; #InOutLocalized.JamTest := 0; #xOutNewRetrieve := TRUE; #xOutError := FALSE; #nOutStatus := 0; #nOutMissingBarcode := 0; RETURN; END_IF; END_REGION END_REGION REGION Durchsuche Lager 1.3.2 IF #nInArea = 0 OR #nInArea = "cDest13200" THEN FOR #nIdx1 := 1 TO "cNoLines1.3.2" DO //Lagerlinien FOR #nIdx2 := 1 TO "cNoPositionsBlock3" DO //Positionen pro Linie IF #nBarcode = "DB_Storage1.3.2".arLine[#nIdx1].arCarrier[#nIdx2].nBarcode AND // "DB_Storage2.3.2".arLine[#nIdx1].arCarrier[#nIdx2].nTarget <> INT_TO_USINT(#nTarget) AND (#nPos = 0 OR #nPos > #nIdx2) THEN //***********falls gefunden********* #nLine := #nIdx1; #nPos := #nIdx2; // #tempPartFound := TRUE; EXIT; //Suche unterbrechen wenn Teil gefunden wurde END_IF; IF #nIdx2 = "cNoPositionsBlock3" THEN EXIT; //nach letzter Position -> Schleife beenden END_IF; END_FOR; IF #nIdx1 = "cNoLines1.3.2" THEN EXIT; //nach letzter Linie -> Schleife beenden END_IF; END_FOR; END_IF; REGION Schreibe Daten IF #nPos > 0 THEN "DB_Storage1.3.2".arLine[#nLine].arCarrier[#nPos].nDestination := INT_TO_USINT(#nDestination); #InOutLocalized.nBarcode := #nBarcode; #InOutLocalized.Storage.Store := #"Store2.3.2"; #InOutLocalized.Storage.Line := #nLine; #InOutLocalized.Storage.Pos := #nPos; #InOutLocalized.JamTest := 0; #xOutNewRetrieve := TRUE; #xOutError := FALSE; #nOutStatus := 0; #nOutMissingBarcode := 0; RETURN; END_IF; END_REGION END_REGION REGION Durchsuche Lager 1.3.3 IF #nInArea = 0 OR #nInArea = "cDest13300" THEN FOR #nIdx1 := 1 TO "cNoLines1.3.3" DO //Lagerlinien FOR #nIdx2 := 1 TO "cNoPositionsBlock3" DO //Positionen pro Linie IF #nBarcode = "DB_Storage1.3.3".arLine[#nIdx1].arCarrier[#nIdx2].nBarcode AND // "DB_Storage2.3.3".arLine[#nIdx1].arCarrier[#nIdx2].nTarget <> INT_TO_USINT(#nTarget) AND (#nPos = 0 OR #nPos > #nIdx2) THEN //***********falls gefunden********* #nLine := #nIdx1; #nPos := #nIdx2; // #tempPartFound := TRUE; EXIT; //Suche unterbrechen wenn Teil gefunden wurde END_IF; IF #nIdx2 = "cNoPositionsBlock3" THEN EXIT; //nach letzter Position -> Schleife beenden END_IF; END_FOR; IF #nIdx1 = "cNoLines1.3.3" THEN EXIT; //nach letzter Linie -> Schleife beenden END_IF; END_FOR; END_IF; REGION Schreibe Daten IF #nPos > 0 THEN "DB_Storage1.3.3".arLine[#nLine].arCarrier[#nPos].nDestination := INT_TO_USINT(#nDestination); #InOutLocalized.nBarcode := #nBarcode; #InOutLocalized.Storage.Store := #"Store2.3.3"; #InOutLocalized.Storage.Line := #nLine; #InOutLocalized.Storage.Pos := #nPos; #InOutLocalized.JamTest := 0; #xOutNewRetrieve := TRUE; #xOutError := FALSE; #nOutStatus := 0; #nOutMissingBarcode := 0; RETURN; END_IF; END_REGION END_REGION REGION Durchsuche Lager 1.3.4 IF #nInArea = 0 OR #nInArea = "cDest13400" THEN FOR #nIdx1 := 1 TO "cNoLines1.3.4" DO //Lagerlinien FOR #nIdx2 := 1 TO "cNoPositionsBlock3" DO //Positionen pro Linie IF #nBarcode = "DB_Storage1.3.4".arLine[#nIdx1].arCarrier[#nIdx2].nBarcode AND // "DB_Storage2.3.4".arLine[#nIdx1].arCarrier[#nIdx2].nTarget <> INT_TO_USINT(#nTarget) AND (#nPos = 0 OR #nPos > #nIdx2) THEN //***********falls gefunden********* #nLine := #nIdx1; #nPos := #nIdx2; // #tempPartFound := TRUE; EXIT; //Suche unterbrechen wenn Teil gefunden wurde END_IF; IF #nIdx2 = "cNoPositionsBlock3" THEN EXIT; //nach letzter Position -> Schleife beenden END_IF; END_FOR; IF #nIdx1 = "cNoLines1.3.4" THEN EXIT; //nach letzter Linie -> Schleife beenden END_IF; END_FOR; END_IF; REGION Schreibe Daten IF #nPos > 0 THEN "DB_Storage1.3.4".arLine[#nLine].arCarrier[#nPos].nDestination := INT_TO_USINT(#nDestination); #InOutLocalized.nBarcode := #nBarcode; #InOutLocalized.Storage.Store := #"Store2.3.4"; #InOutLocalized.Storage.Line := #nLine; #InOutLocalized.Storage.Pos := #nPos; #InOutLocalized.JamTest := 0; #xOutNewRetrieve := TRUE; #xOutError := FALSE; #nOutStatus := 0; #nOutMissingBarcode := 0; ELSE #xOutError := TRUE; #nOutStatus := #ERR_RETRIEVE_NOT_FOUND; #nOutMissingBarcode := #nBarcode; END_IF; END_REGION END_REGION*) END_IF; END_FUNCTION