FB_BACnet_ExceptionScheduleProperty

FB_BACnet_ExceptionScheduleProperty 1:

Application

The function block can be used to read the property Exception_Schedule of any BACnet object (typically BACnet schedule object). The input tObjectID specifies the object (Object_Identifier: object type and object instance) to be accessed. The Example shows a possible configuration.

The data to be read or written is stored in the same input/output data structure (see also ST_BACnet_ExceptionScheduleBool).

The only data types supported by the PLC function block for entries in the property Exception_Schedule are Bool and Null! Entries with other data types are ignored or deleted on write access to the property.

FB_BACnet_ExceptionScheduleProperty 2:
Figure 1: Example entry of the property Exception_Schedule with data type Bool.

The function block instance is created by the PLC program and called cyclically. The input/output stAdsConn must be linked to the output stAdsConn of the respective device function block (FB_BACnet_Device or FB_BACnet_RemoteDevice).

FB_BACnet_ExceptionScheduleProperty 3:

The ADS buffer from the global variables is used for buffering the ADS data (see ST_BACnet_GlobalAdsBuffer).

VAR_INPUT

tObjectID      : T_BACnet_ObjectIdentifier:=16#FFFFFFFF;
bAutoGet       : BOOL:=TRUE;
bGet           : BOOL;
bSet           : BOOL;

 

tObjectID: Specifies the object (Object_Identifier: object type and object instance) to be accessed.

bAutoGet: TRUE = the property is read automatically when the ADS connection or the Object_Identifier have changed. An ADS connection change occurs when the connection is restored after an interruption, or if the AMS NetID or port has changed. Automatic reading does not occur cyclically, and not if the property itself changes!

bGet: FALSETRUE = Property is read once, irrespective of input bAutoGet.

bSet : FALSE --> TRUE = property is written.

 

VAR_OUPUT

bDone          : BOOL;
bBusy          : BOOL;
bError         : BOOL;
nErrorId       : UINT;

 

bDone: Reading or writing of the data completed successfully. bDone set remains set until bGet, bSet and bAutoGet are reset, or until a new read or write operation starts. If bGet, bSet and bAutoGet are reset before bDone is active, bDone is set for one cycle.

bBusy: The block is busy.

bError: Error during processing.

nErrorId: Error code, see BACnet_Globals for an overview.

 

VAR_IN_OUT

stExceptSched  : ST_BACnet_ExceptionScheduleBool;
stAdsConn      : ST_BACnet_AdsConnection;

stExceptSched:  Input/output data structure for the entries of the property Exception_Schedule with data type Bool or Null. The following section compares an entry in the PLC and the TwinCAT System Manager (see Example).

stAdsConn: Linking to the output stAdsConn of the corresponding device function block.

 

Example Comparison of PLC and System Manager

FB_BACnet_ExceptionScheduleProperty 4:
Fig. 2: Example of a property entry in the PLC
FB_BACnet_ExceptionScheduleProperty 5:
Fig. 3: Example of a property entry in the TwinCAT System Manager

Example 2: Function block call

FB_BACnet_ExceptionScheduleProperty 6:
Figure 4: Application example. Reading and writing of the property Exception_Schedule of a BACnet schedule object.