BACnetRegisterClientDataPoint (FUN)

FUNCTION BACnetRegisterClientDataPoint : IEC_BACNET_STATUS

Registers an device object property reference for data acquisation.

This is the main function of the advanced BACnet client API. A user application can register device object property references to local and remote BACnet devices to get their property values on an easy way. This function will do most of the work, normally a client application has to manage, just in one call. It checks periodical for the presence and online state for devices and checks for integrity of the values acquired from other devices. n Note 1: Local devices or objects are those which have been created by calls to ::BACnetConstructDevice and ::BACnetConstructObject and are objects in the stack API’s own object database.n Note 2: If different customer register for the same reference but with different modes the following rules apply here: If one customer wants to subscribe the other polls the subscriber winns. If both want polling the shorter interval winns. If one customer wants clock aligned polling and the other subscribes it will be done both: subscribed AND polled clock aligned.

Return: IEC_BACNET_STATUS

InOut:

Scope

Name

Type

Comment

Return

BACnetRegisterClientDataPoint

IEC_BACNET_STATUS

Input

hCustomer

IEC_BACNET_HANDLE

An handle to an created advanced BACnet client customer created by ::BACnetOpenClientCustomer.

devId

IEC_BACNET_INST_NUMBER

The device instance number from the remote or local device from which the value shall be acquired.

pObjId

POINTER TO IEC_BACNET_OBJECT_ID

A pointer to the object identifier from the remote or local object from which the value shall be acquired.

propId

IEC_BACNET_PROPERTY_ID

The property identifier from which the value shall be acquired.

index

IEC_BACNET_ARRAY_INDEX

The property array index from which the value shall be acquired.

bSubscribe

IEC_BACNET_BOOLEAN

If set to True the value acquisation will be done by subscribing for the change of value service if the device supports this service. If the device doesn’t support this service and parameter bPoll is set to False the user application will get notified with an error in the ::BACNET_CLIENT_VALUE_CB callback.

resubscribe

IEC_BACNET_UNSIGNED

The resubscribe time in seconds after that the subscrition to the change of value service will be renewed. For more information look at the ::BACNET_SUBSCRIBE_COV_INFO.

bPoll

IEC_BACNET_BOOLEAN

If set to True the value acquisation will be done by periodical reading the property value from the device. If both parameters bSubscribe AND bPoll are set to True the subscrition will be prefered. But if the device doesn’t support subscriptions it will be polled as a fallback. If multiple references from the same device need to be polled in the same interval and the device supports the ReadPropertyMultiple service, this service will be used to acquire the values.

pollinterval

IEC_BACNET_UNSIGNED

The poll interval defined in seconds in which periodically the value is read from the device. If the nSubscribeMode parameter is set to ::BACNET_SUBSCRIBE_POLL_CLOCKALIGNED the smallest interval will be 60 seconds.

pollClockAlignedIntervalOffset

IEC_BACNET_UNSIGNED

The offset which is added to the clock aligned interval at which the acquisation will take place. Example: A value is needed 10 minutes after every full hour so pollinterval will be set to 3600 seconds and pollClockAlignedIntervalOffset will be set to 600 seconds.

nSubscribeMode

IEC_BACNET_CLIENT_SUBSCRIBE_MODE

This defines how the data is acquired.

pUserArg

POINTER TO IEC_BACNET_BYTE

A pointer to data from the user application which is transparent for the API. This pointer will not be modified by the BACnet API. This may be NULL. The pointer is linked with the registrated datapoint and will be returned in the callback on value changes.