Publish and Subscribe

Publisher and Subscriber provide a way to easily exchange information.

Sample 1

Publish and Subscribe 1:

Application of Publisher and Subscriber to specific functions and objects.

Each function block can be used as Publisher. Function blocks that can subscribe to the desired data types serve as Subscribers. To do this, the unique object name of the Publisher and its AMS NetID must be specified on the Subscriber.

Sample 2

Publish and Subscribe 2:

Application of Publisher and Subscriber for any data types.

The FB_BA_RawPublisher can be used to make information of different sizes available to the FB_BA_RawSubscriber. As in the previous sample, the object name and the AMS NetID must be specified on the Subscriber. As indicated in the sample, this configuration takes place once in FB_init of FB_BA_RawSubscriber.

If there are several instances of an object with the same symbol name, it is necessary to specify the complete symbol name of the object in the parameter sSubject.

Sample 3

In the sample, the faults of two heating circuit pumps are to be published and subscribed to separately.

Publish and Subscribe 3:

Within the heating circuits, the pumps Pu and the published binary objects of the fault Dst have the same name.

The parameter is therefore published from both templates in the same way.

Publish and Subscribe 4:
Publish and Subscribe 5:

Subscribing is done separately, you only need to ensure that the symbol path for the event to be subscribed to is specified correctly.

Publish and Subscribe 6:
Publish and Subscribe 7: