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 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.
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.
- InOut:
Scope
Name
Type
Comment
Return
BACnetRegisterClientDataPointInput
hCustomerAn handle to an created advanced BACnet client customer created by BACnetOpenClientCustomer.
devIdThe device instance number from the remote or local device from which the value shall be acquired.
pObjIdPOINTER TO IEC_BACNET_OBJECT_ID
A pointer to the object identifier from the remote or local object from which the value shall be acquired.
propIdThe property identifier from which the value shall be acquired.
indexThe property array index from which the value shall be acquired. If the property is not an array the value shall be ::BACNET_VOID_INDEX. If the property is an array and the whole array should be acquired the value ::BACNET_ENTIRE_ARRAY shall be used here.
bSubscribeIf 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.
resubscribeThe 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.
bPollIf 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.
pollintervalThe 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.
pollClockAlignedIntervalOffsetThe 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.
nSubscribeModeThis defines how the data is acquired.
pICallbackCmpEventMgr.ICmpEventCallbackA pointer to the event-callback interface which gets called on value notification.
pUserArgPOINTER TO 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 pointer and the pUserFct pointer is associated with the given device instance, object identifier, property identifier and property array index group. So for every different combination of those parameters these pointers are stored. This pointer may be NULL.