FB_BA_Subscriber

FB_BA_Subscriber 1:

The FB_BA_Subscriber is a function block for subscribing to data. It does not have to be called explicitly. This description serves solely to explain the inheritance structure of the publisher function blocks.

Inheritance hierarchy

FB_BA_Base

Syntax

FUNCTION_BLOCK ABSTRACT FB_BA_Subscriber EXTENDS FB_BA_Base IMPLEMENTS I_BA_Subscriber
VAR_OUTPUT
  bError                : BOOL;
END_VAR
VAR_INPUT CONSTANT
  {region 'Fixed Parameters'}
    {attribute 'parameterCategory' := 'Communication'}
    {attribute 'no_copy'}
    sTarget             : T_BA_MedString;
  {endregion}
  {region 'Variable Parameters'}
    {attribute 'parameterCategory' := 'Communication'}
    {attribute 'no_copy'}
    tReadInterval       : TIME := XBA_Param.tSub_DefReadInterval;
    {attribute 'parameterCategory' := 'Communication'}
    {attribute 'no_copy'}
    tReadTolerance      : TIME := XBA_Param.tSub_ReadTolerance; // Time to wait before indicating a continuous error.
    {attribute 'parameterCategory' := 'Communication'}
    {attribute 'no_copy'}
    bClearOnReadError   : BOOL := XBA_Param.bSub_ClearOnReadError; // Clear data if an error occurs.
  {endregion}
END_VAR

FB_BA_Subscriber 2: Inputs CONSTANT

Name

Type

Description

sTarget

BOOL

AMS NetId of the Publisher.

Optionally, the port of the remote ADS device can be specified. The default setting is port 851.

tReadInterval

TIME

Time interval at which data from the subscribed publisher is read. The default setting is 30 seconds.

tReadTolerance

TIME

If there is a read error after the configured time, the status changes internally to Error.

bClearOnReadError

BOOL

Optionally, the subscribed data can be reset in the event of an error (i.e. as soon as the system switches to the Error state). This parameter is FALSE in the default settings.

FB_BA_Subscriber 3: Outputs

Name

Type

Description

bError

BOOL

Displays the current error state of the subscription.

Details can be found in the corresponding error message in the event of an error.

Requirements

Development environment

Required PLC library

TwinCAT from v3.1.4024.17

Tc3_BA2 from v4.8.9.0