Added a basic creatable loop object with PID control (#1141)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -57,6 +57,7 @@
|
||||
#include "bacnet/basic/object/iv.h"
|
||||
#include "bacnet/basic/object/osv.h"
|
||||
#include "bacnet/basic/object/piv.h"
|
||||
#include "bacnet/basic/object/loop.h"
|
||||
#include "bacnet/basic/object/time_value.h"
|
||||
#include "bacnet/basic/object/timer.h"
|
||||
#include "bacnet/basic/object/channel.h"
|
||||
@@ -386,6 +387,14 @@ static object_functions_t My_Object_Table[] = {
|
||||
NULL /* COV */, NULL /* COV Clear */, NULL /* Intrinsic Reporting */,
|
||||
NULL /* Add_List_Element */, NULL /* Remove_List_Element */,
|
||||
NULL /* Create */, NULL /* Delete */, NULL /* Timer */ },
|
||||
{ OBJECT_LOOP, Loop_Init, Loop_Count,
|
||||
Loop_Index_To_Instance, Loop_Valid_Instance,
|
||||
Loop_Object_Name, Loop_Read_Property,
|
||||
Loop_Write_Property, Loop_Property_Lists,
|
||||
NULL /* ReadRangeInfo */, NULL /* Iterator */, NULL /* Value_Lists */,
|
||||
NULL /* COV */, NULL /* COV Clear */, NULL /* Intrinsic Reporting */,
|
||||
NULL /* Add_List_Element */, NULL /* Remove_List_Element */,
|
||||
Loop_Create, Loop_Delete, Loop_Timer },
|
||||
{ OBJECT_PROGRAM, Program_Init, Program_Count,
|
||||
Program_Index_To_Instance, Program_Valid_Instance,
|
||||
Program_Object_Name, Program_Read_Property,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,214 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief API for Loop object type
|
||||
* @author Steve Karg <skarg@users.sourceforge.net>
|
||||
* @date November 2025
|
||||
* @copyright SPDX-License-Identifier: MIT
|
||||
*/
|
||||
#ifndef BACNET_BASIC_OBJECT_LOOP_H
|
||||
#define BACNET_BASIC_OBJECT_LOOP_H
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
/* BACnet Stack defines - first */
|
||||
#include "bacnet/bacdef.h"
|
||||
/* BACnet Stack API */
|
||||
#include "bacnet/bacerror.h"
|
||||
#include "bacnet/timer_value.h"
|
||||
#include "bacnet/wp.h"
|
||||
#include "bacnet/rp.h"
|
||||
#include "bacnet/list_element.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Loop_Property_Lists(
|
||||
const int **pRequired, const int **pOptional, const int **pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
void Loop_Proprietary_Property_List_Set(const int *pProprietary);
|
||||
BACNET_STACK_EXPORT
|
||||
void Loop_Read_Property_Proprietary_Callback_Set(read_property_function cb);
|
||||
BACNET_STACK_EXPORT
|
||||
void Loop_Write_Property_Proprietary_Callback_Set(write_property_function cb);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_Valid_Instance(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Loop_Count(void);
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Loop_Index_To_Instance(unsigned index);
|
||||
BACNET_STACK_EXPORT
|
||||
unsigned Loop_Instance_To_Index(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_Object_Name(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *object_name);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_Name_Set(uint32_t object_instance, const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Loop_Name_ASCII(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_Description(
|
||||
uint32_t object_instance, BACNET_CHARACTER_STRING *description);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_Description_Set(uint32_t instance, const char *new_name);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *Loop_Description_ANSI(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_Out_Of_Service(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Loop_Out_Of_Service_Set(uint32_t instance, bool oos_flag);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_RELIABILITY Loop_Reliability(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_Reliability_Set(uint32_t object_instance, BACNET_RELIABILITY value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
float Loop_Present_Value(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_Present_Value_Set(uint32_t object_instance, float value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Loop_Update_Interval(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_Update_Interval_Set(uint32_t object_instance, uint32_t value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Loop_Output_Units(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_Output_Units_Set(uint32_t instance, uint16_t units);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_Manipulated_Variable_Reference(
|
||||
uint32_t object_instance, BACNET_OBJECT_PROPERTY_REFERENCE *value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_Manipulated_Variable_Reference_Set(
|
||||
uint32_t object_instance, BACNET_OBJECT_PROPERTY_REFERENCE *value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_Controlled_Variable_Reference(
|
||||
uint32_t object_instance, BACNET_OBJECT_PROPERTY_REFERENCE *value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_Controlled_Variable_Reference_Set(
|
||||
uint32_t object_instance, BACNET_OBJECT_PROPERTY_REFERENCE *value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
float Loop_Controlled_Variable_Value(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_Controlled_Variable_Value_Set(uint32_t object_instance, float value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Loop_Controlled_Variable_Units(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_Controlled_Variable_Units_Set(uint32_t instance, uint16_t units);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_Setpoint_Reference(
|
||||
uint32_t instance, BACNET_OBJECT_PROPERTY_REFERENCE *value);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_Setpoint_Reference_Set(
|
||||
uint32_t instance, BACNET_OBJECT_PROPERTY_REFERENCE *value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
float Loop_Setpoint(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_Setpoint_Set(uint32_t object_instance, float value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
BACNET_ACTION Loop_Action(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_Action_Set(uint32_t object_instance, BACNET_ACTION value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
float Loop_Proportional_Constant(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_Proportional_Constant_Set(uint32_t object_instance, float value);
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Loop_Proportional_Constant_Units(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_Proportional_Constant_Units_Set(uint32_t instance, uint16_t units);
|
||||
BACNET_STACK_EXPORT
|
||||
float Loop_Integral_Constant(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_Integral_Constant_Set(uint32_t object_instance, float value);
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Loop_Integral_Constant_Units(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_Integral_Constant_Units_Set(uint32_t instance, uint16_t units);
|
||||
BACNET_STACK_EXPORT
|
||||
float Loop_Derivative_Constant(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_Derivative_Constant_Set(uint32_t object_instance, float value);
|
||||
BACNET_STACK_EXPORT
|
||||
uint16_t Loop_Derivative_Constant_Units(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_Derivative_Constant_Units_Set(uint32_t instance, uint16_t units);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
float Loop_Bias(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_Bias_Set(uint32_t object_instance, float value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
float Loop_Maximum_Output(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_Maximum_Output_Set(uint32_t object_instance, float value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
float Loop_Minimum_Output(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_Minimum_Output_Set(uint32_t object_instance, float value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint8_t Loop_Priority_For_Writing(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_Priority_For_Writing_Set(uint32_t object_instance, uint8_t value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
float Loop_COV_Increment(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_COV_Increment_Set(uint32_t instance, float value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_Reliability_Evaluation_Inhibit(uint32_t instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_Reliability_Evaluation_Inhibit_Set(uint32_t instance, bool value);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Loop_Timer(uint32_t object_instance, uint16_t elapsed_milliseconds);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Loop_Write_Property_Internal_Callback_Set(write_property_function cb);
|
||||
BACNET_STACK_EXPORT
|
||||
void Loop_Read_Property_Internal_Callback_Set(read_property_function cb);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
int Loop_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
uint32_t Loop_Create(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
bool Loop_Delete(uint32_t object_instance);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void Loop_Cleanup(void);
|
||||
BACNET_STACK_EXPORT
|
||||
size_t Loop_Size(void);
|
||||
BACNET_STACK_EXPORT
|
||||
void Loop_Init(void);
|
||||
|
||||
BACNET_STACK_EXPORT
|
||||
void *Loop_Context_Get(uint32_t object_instance);
|
||||
BACNET_STACK_EXPORT
|
||||
void Loop_Context_Set(uint32_t object_instance, void *context);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
Reference in New Issue
Block a user