> 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="/files/sCFFPofvf3GddpjaZgFt" 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="/files/nESGTpbflEsszSxpBsDx" 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="/files/dwog659QPBAZdpBzNb4u" 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="/files/xeZsLe8P0abBm8dUh0Kj" 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="/files/JLUwYa0fmEQupXJnhCcJ" 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="/files/8p0SBEF19OA3BEpFY64x" 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="/files/yCriiuUIsIvgdgZzjUdh" 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
