The BACnet server from the FAQ BACnet: Cyclic Reading of a Property is used as the server here.
Reduce this one to reading the analog value.
Requirements for the server and client
Check that the following entries are present in the file CODESYSControl.cfg.
- Integration of the BACnet component:
- Integration of the INI file of the BACnet stack (pay attention to the syntax):
BACnet client project
- Create a "Standard project” and select CODESYS Control Win V3 as the device.
- Define the target system by means of the network scan (see BACnet server).
- Insert a "BACNet Server" object into the device tree and rename it as "BACnet_Client".
- Open the Library Manager and add the following libraries:
Edit the PLC_PRG POU as follows:
Download the project to the controller and set the xWriteExecute variable to TRUE.
The value is transferred to the server.
The PresentValue property is written with priorities from 1 to 16, where 16 is the lowest.
When you write a value with a higher priority to the server, it is retained until it is deleted or overwritten by an even higher priority.
During the delete operation, the value of the highest set priority is then output as PresentValue.
A priority is deleted by writing to it with the data type DATA_TYPE_NULL.