BACnet-Konfiguration im Laufzeitsystem
CODESYS BACnet2 SL verwendet zur Kommunikation die Komponente CmpBACnet oder CmpBACnet2. Diese Komponente muss In der Konfigurationsdatei des Laufzeitsystems eingetragen und folgendermaßen konfiguriert sein.
[ComponentManager] Component.1=CmpBACnet2 [CmpBACnet2] ; IniFile=$PlcLogic$/bacstac2.ini ; The configuration of the BACnet stack is generated by the CODESYS BACnetServer durign startup, ; if the BACnetServer device parameter g is set to TRUE (which is the default). ; Most likely IniFile= needs to be configured only, if there is a need to manually create a configuration file of the BACnet stack, ; or if another path in the PLC filesystem is required. ; IniFile=$PlcLogic$/bacstac2.ini ; Task priority of the BACstack process task - this is an optional configuration, default is TASKPRIO_NORMAL_END (159). ; The task priority only needs to be configured, if there is a real need to work with IEC task priorities and runtime component task priorities, ; on some very specific PLC's. ; TaskPrio=128 ; Name of the named pipe for the communication with the BACstack - this is an optional configuration. ; By default this named pipe is generated at "\\\\.\\pipeCODESYSBACnetServer" on Windows PLCs or "/dev/CODESYSBACnetServer" on Linux (or any other) PLCs. ; Just in case the PLC filesystem is configured such, that there is no create/write permission for this specific path, ; there is e need to configure AppName=. ; AppName=/tmp/BACnetServer
CODESYS separiert grundsätzlich Zugriffe auf das Dateisystem innerhalb der IEC-Applikation und Zugriffe aus dem Programmcode der Laufzeitsystemkomponenten. Verschiedene Wurzelverzeichnisse können in der Konfigurationsdatei des Laufzeitsystems festgelegt werden.
[SysFile] ; root file path for runtime components FilePath=D:/Temp/Default ; root file path for IEC applications IecFilePath=D:/Temp/IEC
Wenn AutoGenerateBACstackConfig auf TRUE gesetzt ist, schreibt eine IEC-Applikation mit CODESYS BACnet2 SL die Konfigurationsdatei des BACnet-Stacks (unter Nutzung von Informationen aus BACnet.BACnetIPdatalink) beim Starten des BACnet-Servers.
Später während des Startvorgangs liest Code innerhalb der Laufzeitsystemkomponente CmpBACnet die Konfigurationsdatei. Deshalb müssen für diese Konfigurationsdatei gemeinsame Schreib- und Lesezugriffe der IEC-Applikation und der Laufzeitsystemkomponente ermöglicht werden. Dies erfolgt entweder durch die Verwendung eines absoluten Pfades oder (für CODESYS Control >= V3.5.16.0) durch die Verwendung von Platzhaltern.
Absoluter Pfad:
... [CmpBACnet2] IniFile=D:/Temp/bacstac.ini ; Windows ; Linux -> IniFile=/tmp/bacstac.ini ...
Platzhalter - beispielsweise $BACnet$:
... [SysFile] PlcLogicPrefix=1 PlaceholderFilePath=, $Firmware$ PlaceholderFilePath.1=$PlcLogic$/bacnet, $BACnet$ [CmpBACnet] IniFile=$BACnet$/bacstac.ini ...
Des Weiterem erlaubt CODESYS das „sandboxing“ verschiedener Aspekte des Laufzeitsystems, unter Anderem auch Zugriffe auf das Dateisystem. Dabei werden Zugriffe auf das Dateisystem innerhalb der IEC-Applikation und Zugriffe aus dem Programmcode der Laufzeitsystemkomponenten grundsätzlich auf die konfigurierten Pfade beschränkt. Siehe dazu die Konfiguration von SysFile:
... [SysFile] ; ForceFilePath=1 ; ForceIecFilePath=1 ...
Weitere Informationen hierzu gibt es in der Hilfe zu CODESYS Control V3 Runtime System unter „CODESYS Control FilePath & Placeholders“. Diese Hilfe ist im CODESYS GmbH Kundenportal verfügbar.
Bei der Konfiguration des „sandboxing“ des Dateisystems ist zu beachten, dass der oben beschriebene Zugriff auf die Konfigurationsdatei des BACnet-Stacks möglich ist. Daher ist die Variante mit Platzhaltern in diesem Fall zwingend, wenn der Pfad zur bacstac.ini nicht schon anderweitig konfiguriert ist.
Für weitere Informationen siehe: Architektur, Bestandteile und deren Aufgaben