ScriptName "CopyIndexed" ScriptAuthor "(dA)St" ScriptVersion "(9)" // Beschreibung: "CopyIndexed" copiert eine länge Zeichen von einem Buffer mit Offset in eine zweiten Buffer mit Offset // Der Offset wird bestimmt aus dem Wert in den eckigen Klammern plus dem Index var NumberBytes : word ; var Source : Buffer[10] ; var SourceInd : word ; var Destination : Buffer[10] ; var DestinationInd : word ; MoveConst(NumberBytes, 3); MoveConst(Source[0], "1234567890"); MoveConst(SourceInd, 2); MoveConst(Destination[0], #0#0#0#0#0#0#0#0#0#0); MoveConst(DestinationInd, 6); // Pfad: unsorted commands -> CopyIndexed // CopyIndexed ( w1 , B2 , w3 , B4 , w5 ) ; // /* WPtr_Anz_Byte SPtr_Quelladr WPtr_QOffset SPtr_Zieladr WPtr_ZielOffset*/ // w1 = NumberBytes // B2 = Source // w3 = Source Index // B4 = Destination // w5 = Destination Index // Parameter Typ (b=Byte, w=Word,l=Long, B=Buffer) und Beschreibung // Feldbus-Seite // RS-Seite // Intern -> Ja // min value = // max value = // Beispiel: // Vorher: // NumberBytes = 3 // Source[0 - 9] = 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39 // SourceInd = 2 // Destination[0 - 9] = 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // DestinationInd = 6 CopyIndexed ( NumberBytes , Source[0] , SourceInd , Destination[1] , DestinationInd ) ; // Nacher: // NumberBytes = 3 // Source[0 - 9] = 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39 // SourceInd = 2 // Destination[0 - 9] = 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, , 0x00, 0x33, 0x34, 0x35 // DestinationInd = 6 stop ;