> For the complete documentation index, see [llms.txt](https://support.powerio.com/hub/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.powerio.com/hub/codesys-hvac/hvac-bacnet2-library/beispiele/bacnet-einrichtung-in-codesys.md).

# BACnet Einrichtung in CODESYS

Damit die BACnet Bibliothek verwendet werden kann, muss vorerst die Einrichtung des BACnet IP Datalinks und des BACnet Servers in CODESYS durchgeführt werden.

## BACnet IP Datalink

{% stepper %}
{% step %}
**Ethernet Schnittstelle hinzufügen**

Im Gerätebaum wird das Gerät *Ethernet* angehängt. Hierdurch wird die physikalische Schnittstelle für die BACnet-Kommunikation festgelegt.

<div align="left"><figure><img src="https://879424349-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQR4vCFzt6ixgsqlR3pdR%2Fuploads%2Fgit-blob-08b36a7446046c77f09decba8918ab0191cbee40%2FScreenshot%202025-11-18%20at%2017.01.59.png?alt=media" alt="" width="375"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
**Ethernet Schnittstelle konfigurieren**

Nun wird das Gerät konfiguriert, dabei ist die IP-Adresse des Zielgeräts (also der eigenen CPU) anzugeben. Die IP-Adresse des anderen BACnet-Teilnehmers wird kommunikativ ermittelt (*Who-Is* – Anfrage via Broadcast-Telegramm X.255).

<div align="left"><figure><img src="https://879424349-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQR4vCFzt6ixgsqlR3pdR%2Fuploads%2Fgit-blob-d9e4fd0a204003305402d8107c11777d8de04869%2FScreenshot%202025-11-18%20at%2017.03.17.png?alt=media" alt="" width="375"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
**BACnet IP datalink hinzufügen**

Im Gerätebaum wird unterhalb des Geräts *Ethernet* das Gerät *BACnet IP datalink* angehängt.

<div align="left"><figure><img src="https://879424349-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQR4vCFzt6ixgsqlR3pdR%2Fuploads%2Fgit-blob-98fba4898188ab88f3a9d98fb60de096c9d589f8%2FScreenshot%202025-11-18%20at%2017.05.23.png?alt=media" alt="" width="375"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
**BACnet IP datalink konfigurieren**

In ihm werden vorrangig die BACnet-Netzwerknummer und der verwendete UDP-Port (Standard: 47808) festgelegt.

<div align="left"><figure><img src="https://879424349-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQR4vCFzt6ixgsqlR3pdR%2Fuploads%2Fgit-blob-825ea0a3f42e07d68505fad44d5b28e66daf44c4%2FScreenshot%202025-11-18%20at%2017.08.02.png?alt=media" alt="" width="375"><figcaption></figcaption></figure></div>
{% endstep %}
{% endstepper %}

## BACnet Server

{% stepper %}
{% step %}
**BACnet Server hinzufügen**

Im Gerätebaum wird das Gerät *BACnet Server* angehängt. Es dient als BACnetKommunikationszentrale und muss immer vorhanden sein. Es kommt das Client-Server Prinzip zur Anwendung Der Client liest/schreibt Daten, die der Server zur Verfügung stellt.

<div align="left"><figure><img src="https://879424349-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQR4vCFzt6ixgsqlR3pdR%2Fuploads%2Fgit-blob-c932f2fe70358f469800422c5a470b586a85d83b%2FScreenshot%202025-11-18%20at%2017.09.58.png?alt=media" alt="" width="375"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
**BACnet Server konfigurieren**

Das Zielgerät (unsere CPU) kann sowohl als BACnet Server als auch als BACnetClient betrieben werden (auch gleichzeitig).\
Beim Betrieb als BACnet-Server werden die Objekte (also z.B. ein Temperatur-Istwert des Zielgeräts) als Geräte unterhalb des BACnet Servers angehängt. Beim Betrieb als BACnet-Client werden die Objekte in CFC festgelegt.\
\
In ihm werden der verwendete Zeichensatz (UTF8) und die Option *AutoStart* (automatischer Start des BACnet-Kommunikation) definiert

<figure><img src="https://879424349-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQR4vCFzt6ixgsqlR3pdR%2Fuploads%2Fgit-blob-9529df514107b1aff45d490be870723fe8766bd6%2FScreenshot%202025-11-18%20at%2017.12.25.png?alt=media" alt=""><figcaption></figcaption></figure>

Ferner können hier die Eigenschaften des Objekts *Device* (also des eigenen BACnetServers) festgelegt werden, die dann ein anderer BACnet-Teilnehmer lesen kann.

<figure><img src="https://879424349-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQR4vCFzt6ixgsqlR3pdR%2Fuploads%2Fgit-blob-9c492a43f42ee08f27d8dab125d5b45234ef296c%2FScreenshot%202025-11-18%20at%2017.15.23.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://support.powerio.com/hub/codesys-hvac/hvac-bacnet2-library/beispiele/bacnet-einrichtung-in-codesys.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
