BACnetSetClientGlobalCommTimingParameters (FUN) ¶ FUNCTION BACnetSetClientGlobalCommTimingParameters : IEC_BACNET_STATUS Sets the global communication parameters of the advanced client API. This function gives a user application the ability to configure the used APDU timings for communication with remote BACnet devices. During connection establishment the APDU parameters are read from the remote BACnet devices and used. But in some cases it might be useful to override those parameters.n To remove the global timing parameters and use the dynamically assigned ones again set nTimeout, nSegmentTimeout and nRetryCount to -1.n To disable the periodic alive check set nAliveCheckInterval to 0. Return: IEC_BACNET_STATUS InOut: Scope Name Type Comment Return BACnetSetClientGlobalCommTimingParameters IEC_BACNET_STATUS Input nTimeout IEC_BACNET_UINT This is the APDU timeout in milliseconds (see ::BACNET_APDU_PROPERTIES for further information to this paramter). nSegmentTimeout IEC_BACNET_UINT This is the APDU segment timeout in milliseconds (see ::BACNET_APDU_PROPERTIES for further information to this paramter). nRetryCount IEC_BACNET_UINT This is the APDU retry count (see ::BACNET_APDU_PROPERTIES for further information to this paramter). nAliveCheckInterval IEC_BACNET_UINT This is the alive check interval in milliseconds in which periodical requests are sent to devices to check if they are still alive. If this is set to 0 no alive check will be performed at all. The default interval is 15000 milliseconds. nErrorAliveCheckInterval IEC_BACNET_UINT In case of an detected communication failure this value is used as the timer trying to establish communication again. The default interval is 15000 milliseconds. nErrorCovCheckInterval IEC_BACNET_UINT In case a subscribe for COV(-P) failed and the error returned was of a temporarily kind this interval in seconds is the interval at which retries for subscriptions are executed. The default is 3600 seconds. This interval is only active in case the fallback to polling is allowed for that registered datapoint. nCovSubcribeWatchdogTimer IEC_BACNET_UINT This specifies the time in seconds to use for the observation timer to expect a COV notification received after the subscribe request has been sent and confirmed. If no COV notification is received within this time the subscription is marked as not successful and polling for this property will be activated if not disabled. In case of receiving a COV notification after this time the polling will stop and the COV bad marking will be removed. A value of 0 will use the default time calculated from APDU timeout x APDU retries x 3. The maximum value used for this timer will be 600 seconds. nMaxClntErrorCounts IEC_BACNET_UINT Number of detected communication failures needed to switch state to offline. The default interval is 5. bReportErrors IEC_BACNET_BOOLEAN If set to True special error checking will take place on reception of COV, COVP and event notifications. If the API receives an notification for an device object property reference which is not registered by any customer it will reply an error to the sender of the notification. If set to False those notifications will be positiv acknowledged. The default is False. bExtendedDeviceInfo IEC_BACNET_BOOLEAN If set to True extended device information will be read on connection establishment and provided to the user application in the ::BACNET_REMOTE_DEVICE_CAPS structure. bNoUseOfRPM IEC_BACNET_BOOLEAN If set to True the polling of all registered object properties will be made using the ReadProperty service and not the ReadPropertyMultiple service event if the corresponding device supports this service. bUseDeviceId IEC_BACNET_BOOLEAN If set to True all subscriptions in recipient lists for event and device-restart notifications will be written by using the device-id entry type instead of the MAC address type of the recipient. bNoCheckForMissingCovs IEC_BACNET_BOOLEAN If set to True the timer for expecting COV notification after the (re-)subscribe is not activated. So in case the COV subscription does not lead to a COV notification in time frame specified with nCovSubcribeWatchdogTimer or APDU timeout x APDU retries x 3 as default, no event of a possible COV subscription failure will be returned to the users application and loss of data might be possible for some devices which have problems in their COV implementation in case the fallback of polling is disabled too.
BACnetSetClientGlobalMaxDeviceActions (FUN) ¶ FUNCTION BACnetSetClientGlobalMaxDeviceActions : IEC_BACNET_STATUS Sets the maximum pending requests per registered device. This function gives a user application the ability to restrict the maximum pending requests to one device. The advanced BACnet client API uses asynchronous requests for communication to devices. So it is able to send multiple requests to one device at the same time. As soon as the device responses, an new request will be sent as long as there are any requests in the queue for that device. Return: IEC_BACNET_STATUS InOut: Scope Name Type Comment Return BACnetSetClientGlobalMaxDeviceActions IEC_BACNET_STATUS Input nMaxActionsPerDevice IEC_BACNET_UNSIGNED Number of maximum pending requests per registered device. Valid ranges are values from 2 till 40. The default on registration is 20 for a new device. nMaxRpmItemCounts IEC_BACNET_UNSIGNED Number of maximum object items or property items in one ReadPropertyMultiple request sent to an device. The default is 100 items. Valid range values from 10 to 500 items.
BACnetUnregisterClientDataPoint (FUN) ¶ FUNCTION BACnetUnregisterClientDataPoint : IEC_BACNET_STATUS Releases an device object property reference from data acquisation. The user application can remove device object property references from data acquisation which it doesn’t need anymore. If the user application has registered an callback for unsubscribe completion, it will get notified about the successful or unsuccessful unsubscription asynchronously. ::BACNET_STATUS BACNET_STATUS_BUSY: if unsubscription is pending. The registered unsubscribe-complete callback will be called on completion to indicate that unregistration has been completed. BACNET_STATUS_OK: unsubscription completed. The registered unsubscribe-complete callback WILL NOT BE CALLED because other customers have an active registration on the same reference OR the data is retrieved by polling using read property or read property multiple. OTHER: some other failure in given parameters has been detected InOut: Scope Name Type Comment Return BACnetUnregisterClientDataPoint 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 not be acquired anymore. pObjId POINTER TO IEC_BACNET_OBJECT_ID A pointer to the object identifier from the remote or local object from which the value shall not be acquired anymore. propId IEC_BACNET_PROPERTY_ID The property identifier from which the value shall not be acquired anymore. index IEC_BACNET_ARRAY_INDEX The property array index from which the value shall not be acquired anymore. bClockAlignedPolling IEC_BACNET_BOOLEAN If set to True the acquisation will be stopped for the clock aligned registered reference. If set to False the NON clock aligned reference will be removed. bForceUnsubscribe IEC_BACNET_BOOLEAN If set to True the unsubscription will be executed with nininmal delay instead of waiting for the next device alive check or waiting for new registrations.
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.
BACnetRegisterClientDataValueCallback (FUN) ¶ FUNCTION BACnetRegisterClientDataValueCallback : IEC_BACNET_STATUS Registers the user application callback for received value changes. This function gives a user application the ability to get notified on received value changes which have been registered by using the ::BACnetRegisterClientDataPoint function. Return: IEC_BACNET_STATUS InOut: Scope Name Type Comment Return BACnetRegisterClientDataValueCallback IEC_BACNET_STATUS Input hCustomer IEC_BACNET_HANDLE An handle to an created advanced BACnet client customer created by ::BACnetOpenClientCustomer. pICallback CmpEventMgr.ICmpEventCallback Pointer to the event-callback interface. Event-callback argument type is EVT_BACNET_CLIENT_VALUE . Purpose documented in BACstack: A pointer to the user application function which gets called on recived value changes. To unregister from notifications a NULL pointer shall be used here.
BACnetRegisterClientEventNotification (FUN) ¶ FUNCTION BACnetRegisterClientEventNotification : IEC_BACNET_STATUS Registers an device notification class reference for event and alarm acquisation. This function enables the user appliaction to subscribe to an event and alarm source very easy. 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 alarms and event acquired from other devices. Return: IEC_BACNET_STATUS InOut: Scope Name Type Comment Return BACnetRegisterClientEventNotification 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 events or alarms shall be acquired. notifClass IEC_BACNET_INST_NUMBER The notification class object instance number from the remote or local device from which the events or alarms shall be acquired. pValidTransitions POINTER TO IEC_BACNET_BIT_STRING A pointer to an bit string structure which contians the bits for the transitions on which a notification shall be sent. More information can be found under ::BACNET_DESTINATION pValidDays POINTER TO IEC_BACNET_BIT_STRING A pointer to an bit string structure which contians the bits for the weekdays on which a notification shall be sent. More information can be found under ::BACNET_DESTINATION pFromTime POINTER TO IEC_BACNET_TIME A pointer to a time structure which contains the start time at which notifications shall be sent. More information can be found under ::BACNET_DESTINATION pToTime POINTER TO IEC_BACNET_TIME A pointer to a time structure which contains the end time at which notifications shall NOT be sent anymore. More information can be found under ::BACNET_DESTINATION 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 notification class and will be returned in the callback on event notifications from this notificaion class.
BACnetOpenClientCustomer (FUN) ¶ FUNCTION BACnetOpenClientCustomer : IEC_BACNET_HANDLE Creates a new advanced BACnet client customer handle. To use the advanced BACnet client API, first an customer needs to be created. This handle is needed to register device object property references for data acquisation or subscriptions to event notification of remote or local devices and objects. ::BAC_HANDLE A valid handle is return on success and a NULL handle on failure. InOut: Scope Name Type Comment Return BACnetOpenClientCustomer IEC_BACNET_HANDLE Input bReportOnlyOnValueChanges IEC_BACNET_BOOLEAN If this parameter is set to True, the value change notification callback ::BACNET_CLIENT_VALUE_CB is only called if the value has changed and not every time on reception of an ChangeOfValue notification or on response on ReadProperty request.
BACnetReadFileObjectContents (FUN) ¶ FUNCTION BACnetReadFileObjectContents : IEC_BACNET_STATUS Function initiates a file data transfer to read the file object data. This function will start a file data transfer to read the specified file object data in the specified device. In case of stream data in the specified file object the data is written in binary format as received. In case of record data in the file object the record is stored also in binary format but is may be extended by a record marker and record size. Return: IEC_BACNET_STATUS InOut: Scope Name Type Comment Return BACnetReadFileObjectContents IEC_BACNET_STATUS Input pInfo POINTER TO IEC_BACNET_FILEACCESS_INFO Pointer to information which specifies which device and which file object will be accessed. pICallback CmpEventMgr.ICmpEventCallback Pointer to the event-callback interface. Event-callback argument type is EVT_BACNET_FILEACCESS_PROGRESS . Purpose documented in BACstack: Pointer to the user application callback funktion to inform about failures and progress information during the data transfer procedure. pAPDUParams POINTER TO IEC_BACNET_APDU_PROPERTIES A pointer to the structure which contains a set of APDU properties to control the timing and size of transmitted frames for this request. It temporarily overwrites the global APDU settings made in the source device from which this request is sent and which parameters would control this request if this pointer is NULL. pTransactionToken POINTER TO BACnetAsyncTransactionToken Transaction token of the asynchronous call - see BACnetAsyncTransactionToken .
BACnetRegisterClientCommunicationStateCallback (FUN) ¶ FUNCTION BACnetRegisterClientCommunicationStateCallback : IEC_BACNET_STATUS Registers the user application callback for communication changes. This function gives a user application the ability to get notified if an connection to one of the registered devices couldn’t or could be established. It is called in every case were the connection state to an BACnet remote device changes. Return: IEC_BACNET_STATUS InOut: Scope Name Type Comment Return BACnetRegisterClientCommunicationStateCallback IEC_BACNET_STATUS Input hCustomer IEC_BACNET_HANDLE An handle to an created advanced BACnet client customer created by ::BACnetOpenClientCustomer. pICallback CmpEventMgr.ICmpEventCallback Pointer to the event-callback interface. Event-callback argument type is EVT_BACNET_CLIENT_STATUS . Purpose documented in BACstack: A pointer to the user application function which gets called on changes in communication to the device. To unregister from notifications a NULL pointer shall be used here. 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.
BACnetRestoreBACnetDevice (FUN) ¶ FUNCTION BACnetRestoreBACnetDevice : IEC_BACNET_STATUS Function initiates a restore for an BACnet device. This function will start an restore procedure for the specified device. Return: IEC_BACNET_STATUS InOut: Scope Name Type Comment Return BACnetRestoreBACnetDevice IEC_BACNET_STATUS Input pInfo POINTER TO IEC_BACNET_BACKUPRESTORE_INFO Pointer to information which specifies which device should be restored and where the file object data is stored to be restored. pICallback CmpEventMgr.ICmpEventCallback Pointer to the event-callback interface. Event-callback argument type is EVT_BACNET_BACKUPRESTORE_PROGRESS . Purpose documented in BACstack: Pointer to the user application callback funktion to inform about failures and progress information during the procedure execution. pAPDUParams POINTER TO IEC_BACNET_APDU_PROPERTIES A pointer to the structure which contains a set of APDU properties to control the timing and size of transmitted frames for this request. It temporarily overwrites the global APDU settings made in the source device from which this request is sent and which parameters would control this request if this pointer is NULL. pTransactionToken POINTER TO BACnetAsyncTransactionToken Transaction token of the asynchronous call - see BACnetAsyncTransactionToken .