Bibliothekskonfiguration erstellen

Die Bibliothekskonfiguration definiert das Layout für die zu erstellende Bibliothek (z.B. Ordner der Bibliothek) und die einzubindenden Elemente (z.B. die Anwenderbausteine).

So erstellen Sie eine Bibliothekskonfiguration:

  1. Wählen Sie einen Ordner im →Projekt, in dem Sie die Bibliothekskonfiguration erstellen wollen.

  2. Im Menü Datei oder im Kontextmenü des Ordners wählen Sie Neu und den Befehl Bibliothekskonfiguration.
    Ergebnis: Im Projektexplorer wird das ST-Objekt (mit Symbol ) angezeigt. Die Bibliothekskonfiguration ist im Editor für die Bibliothekskonfiguration geöffnet.

  3. Passen Sie die bereits vorgegebenen Einstellungen für die Bibliothekskonfiguration laut Ihren Bedürfnissen an.

Beispiel für Bibliothekskonfiguration

Das folgende Beispiel bewirkt, dass die erzeugte Bibliothek:

  • eine Bibliothek vom Typ LOGICAD ist (siehe "Eigene Bibliothek erstellen und bereitstellen" für die möglichen Bibliothekstypen)

  • eine Snapshot-Bibliothek ist (siehe "Snapshot-Bibliotheken und finalisierte Bibliotheken erstellen und verwenden" für Details)

  • den folgenden Inhalt enthält:

    • 2 Ordner – siehe die Anweisungen FOLDER ...

    • insgesamt 4 Bausteine – siehe die Anweisungen IEC := ...

    • Dateien für die externe Bausteinhilfe – siehe die Anweisungen FILE := ...,   die direkt nach den Anweisungen für die Bausteinen folgen

    • Binäries, Include und Source-Dateien – siehe die Anweisungen ab BINARY_LIBRARIES

LIBRARY com.CompanyA.Controller   (* The library is created with the name 'com.CompanyA.Controller__1.1.0-SNAPSHOT.zip'. *)
  VERSION := 1.1.0-SNAPSHOT;
  PACKAGETYPE := zip;
  FOLDER "Motors"   (* The library contains the folder 'Motors' and the sub-folder 'Testing'. Hence, the ZIP-file contains: FOLDER\Motors\Testing *)
    IEC := com.CompanyA.Controller.Motor1;  (* 'Motors" will contain the files 'com.CompanyA.Controller.Motor1' and 'com.CompanyA.Controller.Motor2'. *)
    IEC := com.CompanyA.Controller.Motor2;  
    FILE := ".olh\com.CompanyA.Controller.Motor1.EN.html", SOURCEPATH := "src/";     (* The files for the external block help for 'Motor1' and 'Motor2' - in English. *)
    FILE := ".olh\Motor1.png", SOURCEPATH := "src/";
    FILE := ".olh\com.CompanyA.Controller.Motor2.EN.html", SOURCEPATH := "src/";
    FILE := ".olh\Motor2.png", SOURCEPATH := "src/";
    FILE := ".olh\style.css", SOURCEPATH := "src/";
    FOLDER "Testing"                        (* 'Testing" will contain the files 'com.CompanyA.Controller.Test1' and 'com.CompanyA.Controller.Testr2'. *)
      IEC := com.CompanyA.Controller.Test1; 
      IEC := com.CompanyA.Controller.Test2;
      FILE := ".olh\com.CompanyA.Controller.Test1.EN.html", SOURCEPATH := "src/";     (* The files for the external block help for 'Test1' and 'Test2' - in English. *)
      FILE := ".olh\Test1.png", SOURCEPATH := "src/";
      FILE := ".olh\com.CompanyA.Controller.Test2.EN.html", SOURCEPATH := "src/";
      FILE := ".olh\Test2.png", SOURCEPATH := "src/";
      FILE := ".olh\style.css", SOURCEPATH := "src/";
    END_FOLDER
  END_FOLDER
  BINARY_LIBRARIES FOR BuiltInPlc    (* Moreover, the library will contain some binaries, include and source files as well. *)
    FILE := "libs\mathlib.lib";
  END_BINARY_LIBRARIES
  BINARY_OBJECTS FOR BuiltInPlc
    FILE := "libs\mathlib.o";
  END_BINARY_OBJECTS
  INCLUDES
    FILE := "h\mathlib.h";
  END_INCLUDES
  SOURCES
    FILE := "code.c" , SOURCEPATH := "c";
  END_SOURCES
END_LIBRARY

Mehr Erklärungen zu den Anweisungen finden Sie unter "Syntax für Bibliothekskonfiguration" und "Beispiel: Bibliothek mit Bausteinen inkl. Hilfe-Dateien erstellen".

 
  1. Speichern Sie die Bibliothekskonfiguration: z.B. Menü Datei, Speichern

Darstellung/Aktionen im Editor für eine Bibliothekskonfiguration

  • Der Inhalt einer Bibliothekskonfiguration wird in einem Editor ähnlich zum ST-Editor angezeigt. In Folge können Sie die Funktionalitäten des ST-Editors (z.B. Inhaltshilfe im ST-Editor (Code-Assistent oder "Content Assist")) im Editor für die Bibliotheksreferenz benutzen.

  • Aktionen im ST-Editor sind zum Großteil auch im Editor für eine Bibliothekskonfiguration anwendbar. Wählen Sie einfach den Befehl im Editor für eine Bibliothekskonfiguration. Falls das Ergebnis nicht Ihren Vorstellungen entspricht, machen Sie die Aktion rückgängig (Menü Bearbeiten, Rückgängig).

  • Der Editor für eine Bibliothekskonfiguration unterstützt jedoch eine andere Syntax als der ST-Editor. Informieren Sie sich unter "Syntax für Bibliothekskonfiguration" über die korrekte Syntax im Editor für eine Bibliothekskonfiguration.