FB_BACnet_PulseConverter_RAW

FB_BACnet_PulseConverter_RAW 1:

Application

The function block FB_BACnet_PulseConverter_RAW can be used for read and write access to a BACnet object of type PulseConverter.

In contrast to the standard and _EX versions of the block, the raw value and the state of the property Reliablitity are provided by function block inputs, not directly by the IO hardware. For example, the state of a counter input can be mapped from a sub-bus system in PLC code to a BACnet object (signal conversion from sub-bus systems or virtual data points to BACnet, see Example).

VAR_INPUT

nRawIn         : UINT;
bNoSensor      : BOOL;
bOverRange     : BOOL;
bUnderRange    : BOOL;
bOpenLoop      : BOOL;
bShortedLoop   : BOOL;
bCommFailure   : BOOL;
bConfigError   : BOOL;
bOtherFault    : BOOL;

nRawIn: Raw value input of the object in the range -32768 to 32767. The input is linked to the process data "RawIoPulseConverterUnsignedValue" of the BACnet object. Changes in the value of nRawIn are offset with the property Scale_Factor to calculate the value of the property Present_Value (provided the object state is not out_of_service).

bNoSensor, bOverRange, bUnderRange, bOpenLoop, bShortedLoop, bCommFailure, bConfigError, bOtherFault: TRUE at the input sets the appropriate state of the property Reliability. The priority decreases with the order of the inputs (bNoSensor has highest priority, bOtherFault lowest). See BACnet specification DIN EN ISO 16484-5 for BACnet object PulseConverter and property Reliability.

VAR_OUPUT

bReady         : BOOL;
fPresentValue  : REAL;
nCount         : UDINT;
bOverridden    : BOOL;
bOutOfService  : BOOL;
bFault         : BOOL;
bInAlarm       : BOOL;
bError         : BOOL;
nErrorId       : UINT;

bReady: Notification of general readiness. If this output is set, the other status outputs are valid (PresentValue, Overridden ...). If the output is FALSE, the corresponding function block FB_BACnet_Device does not report "Operational", or the block instance was not linked correctly in the TwinCAT System Manager.

fPresentValue: Current value of the BACnet object (see BACnet specification DIN EN ISO 16484-5 for BACnet object PulseConverter and property Present_Value).

nCount: Value of the property Count. Count represents the sampled input pulses or input value changes. In addition, the value of Count may contain corrections from the property Adjust_Value. See BACnet specification DIN EN ISO 16484-5 for BACnet object PulseConverter and property Count.

bOverridden, bOutOfService, bFault, bInAlarm: See BACnet specification DIN EN ISO 16484-5 for BACnet object PulseConverter and property Status_Flags.

bError: An error is pending.

nErrorId: see global constants BACnet_Globals.

VAR_IN_OUT

Device         : FB_BACnet_Device;

Device: Specification of the instance of the local corresponding BACnet server block. For each BACnet adapter one BACnet server is possible. See FB_BACnet_Adapter and FB_BACnet_Device for further information.