libIEC61850  1.0.0
Open-source IEC 61850 MMS/GOOSE/SV server and client library
iec61850_cdc.h
Go to the documentation of this file.
1 /*
2  * cdc.h
3  *
4  * Copyright 2014 Michael Zillgith
5  *
6  * This file is part of libIEC61850.
7  *
8  * libIEC61850 is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * libIEC61850 is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with libIEC61850. If not, see <http://www.gnu.org/licenses/>.
20  *
21  * See COPYING file for the complete license text.
22  */
23 
24 #ifndef CDC_H_
25 #define CDC_H_
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 
47 #define CDC_OPTION_PICS_SUBST (1 << 0)
48 #define CDC_OPTION_BLK_ENA (1 << 1)
49 
51 #define CDC_OPTION_DESC (1 << 2)
52 
54 #define CDC_OPTION_DESC_UNICODE (1 << 3)
55 
57 #define CDC_OPTION_AC_DLNDA (1 << 4)
58 
60 #define CDC_OPTION_AC_DLN (1 << 5)
61 
63 #define CDC_OPTION_UNIT (1 << 6)
64 
65 #define CDC_OPTION_FROZEN_VALUE (1 << 7)
66 
67 #define CDC_OPTION_ADDR (1 << 8)
68 #define CDC_OPTION_ADDINFO (1 << 9)
69 
70 #define CDC_OPTION_INST_MAG (1 << 10)
71 #define CDC_OPTION_RANGE (1 << 11)
72 
73 #define CDC_OPTION_UNIT_MULTIPLIER (1 << 12)
74 
75 #define CDC_OPTION_AC_SCAV (1 << 13)
76 
77 #define CDC_OPTION_MIN (1 << 14)
78 #define CDC_OPTION_MAX (1 << 15)
79 
80 #define CDC_OPTION_AC_CLC_O (1 << 16)
81 
82 #define CDC_OPTION_RANGE_ANG (1 << 17)
83 
84 #define CDC_OPTION_PHASE_A (1 << 18)
85 #define CDC_OPTION_PHASE_B (1 << 19)
86 #define CDC_OPTION_PHASE_C (1 << 20)
87 
88 #define CDC_OPTION_PHASE_NEUT (1 << 21)
89 
90 #define CDC_OPTION_PHASES_ABC (CDC_OPTION_PHASE_A | CDC_OPTION_PHASE_B | CDC_OPTION_PHASE_C)
91 
92 #define CDC_OPTION_PHASES_ALL (CDC_OPTION_PHASE_A | CDC_OPTION_PHASE_B | CDC_OPTION_PHASE_C | CDC_OPTION_PHASE_NEUT)
93 
94 #define CDC_OPTION_STEP_SIZE (1 << 22)
95 
96 #define CDC_OPTION_ANGLE_REF (1 << 23)
97 
99 #define CDC_OPTION_DPL_HWREV (1 << 17)
100 #define CDC_OPTION_DPL_SWREV (1 << 18)
101 #define CDC_OPTION_DPL_SERNUM (1 << 19)
102 #define CDC_OPTION_DPL_MODEL (1 << 20)
103 #define CDC_OPTION_DPL_LOCATION (1 << 21)
104 
106 #define CDC_OPTION_AC_LN0_M (1 << 24)
107 #define CDC_OPTION_AC_LN0_EX (1 << 25)
108 #define CDC_OPTION_AC_DLD_M (1 << 26)
109 
113 #define CDC_CTL_MODEL_NONE 0
114 #define CDC_CTL_MODEL_DIRECT_NORMAL 1
115 #define CDC_CTL_MODEL_SBO_NORMAL 2
116 #define CDC_CTL_MODEL_DIRECT_ENHANCED 3
117 #define CDC_CTL_MODEL_SBO_ENHANCED 4
118 
119 #define CDC_CTL_MODEL_HAS_CANCEL (1 << 4)
120 #define CDC_CTL_MODEL_IS_TIME_ACTIVATED (1 << 5)
121 
122 #define CDC_CTL_OPTION_ORIGIN (1 << 6)
123 #define CDC_CTL_OPTION_CTL_NUM (1 << 7)
124 #define CDC_CTL_OPTION_ST_SELD (1 << 8)
125 #define CDC_CTL_OPTION_OP_RCVD (1 << 9)
126 #define CDC_CTL_OPTION_OP_OK (1 << 10)
127 #define CDC_CTL_OPTION_T_OP_OK (1 << 11)
128 #define CDC_CTL_OPTION_SBO_TIMEOUT (1 << 12)
129 #define CDC_CTL_OPTION_SBO_CLASS (1 << 13)
130 #define CDC_CTL_OPTION_OPER_TIMEOUT (1 << 14)
131 
132 /****************************************************
133  * Constructed Attribute Classes (CAC)
134  ***************************************************/
135 
136 DataAttribute*
137 CAC_AnalogueValue_create(const char* name, ModelNode* parent, FunctionalConstraint fc, uint8_t triggerOptions,
138  bool isIntegerNotFloat);
139 
140 
146 DataAttribute*
147 CAC_ValWithTrans_create(const char* name, ModelNode* parent, FunctionalConstraint fc, uint8_t triggerOptions, bool hasTransientIndicator);
148 
149 
153 DataAttribute*
154 CAC_Vector_create(const char* name, ModelNode* parent, uint32_t options, FunctionalConstraint fc, uint8_t triggerOptions);
155 
156 DataAttribute*
157 CAC_Point_create(const char* name, ModelNode* parent, FunctionalConstraint fc, uint8_t triggerOptions, bool hasZVal);
158 
159 DataAttribute*
160 CAC_ScaledValueConfig_create(const char* name, ModelNode* parent);
161 
162 DataAttribute*
163 CAC_Unit_create(const char* name, ModelNode* parent, bool hasMagnitude);
164 
165 DataAttribute*
166 CDA_OperBoolean(ModelNode* parent, bool isTImeActivated);
167 
168 /****************************************************
169  * Common Data Classes (CDC)
170  ***************************************************/
171 
172 DataObject*
173 CDC_SPS_create(const char* dataObjectName, ModelNode* parent, uint32_t options);
174 
175 DataObject*
176 CDC_DPS_create(const char* dataObjectName, ModelNode* parent, uint32_t options);
177 
178 DataObject*
179 CDC_INS_create(const char* dataObjectName, ModelNode* parent, uint32_t options);
180 
181 DataObject*
182 CDC_ENS_create(const char* dataObjectName, ModelNode* parent, uint32_t options);
183 
184 DataObject*
185 CDC_BCR_create(const char* dataObjectName, ModelNode* parent, uint32_t options);
186 
187 
188 
204 DataObject*
205 CDC_SEC_create(const char* dataObjectName, ModelNode* parent, uint32_t options);
206 
224 DataObject*
225 CDC_MV_create(const char* dataObjectName, ModelNode* parent, uint32_t options, bool isIntegerNotFloat);
226 
231 DataObject*
232 CDC_CMV_create(const char* dataObjectName, ModelNode* parent, uint32_t options);
233 
252 DataObject*
253 CDC_SAV_create(const char* dataObjectName, ModelNode* parent, uint32_t options, bool isIntegerNotFloat);
254 
276 DataObject*
277 CDC_LPL_create(const char* dataObjectName, ModelNode* parent, uint32_t options);
278 
300 DataObject*
301 CDC_DPL_create(const char* dataObjectName, ModelNode* parent, uint32_t options);
302 
303 DataObject*
304 CDC_HST_create(const char* dataObjectName, ModelNode* parent, uint32_t options, uint16_t maxPts);
305 
324 DataObject*
325 CDC_ACD_create(const char* dataObjectName, ModelNode* parent, uint32_t options);
326 
330 DataObject*
331 CDC_ACT_create(const char* dataObjectName, ModelNode* parent, uint32_t options);
332 
340 DataObject*
341 CDC_SPG_create(const char* dataObjectName, ModelNode* parent, uint32_t options);
342 
350 DataObject*
351 CDC_ENG_create(const char* dataObjectName, ModelNode* parent, uint32_t options);
352 
364 DataObject*
365 CDC_ING_create(const char* dataObjectName, ModelNode* parent, uint32_t options);
366 
378 DataObject*
379 CDC_ASG_create(const char* dataObjectName, ModelNode* parent, uint32_t options, bool isIntegerNotFloat);
380 
387 DataObject*
388 CDC_WYE_create(const char* dataObjectName, ModelNode* parent, uint32_t options);
389 
396 DataObject*
397 CDC_DEL_create(const char* dataObjectName, ModelNode* parent, uint32_t options);
398 
399 /***************************
400  * Controls
401  ***************************/
402 
408 DataObject*
409 CDC_SPC_create(const char* dataObjectName, ModelNode* parent, uint32_t options, uint32_t controlOptions);
410 
426 DataObject*
427 CDC_DPC_create(const char* dataObjectName, ModelNode* parent, uint32_t options, uint32_t controlOptions);
428 
448 DataObject*
449 CDC_INC_create(const char* dataObjectName, ModelNode* parent, uint32_t options, uint32_t controlOptions);
450 
466 DataObject*
467 CDC_ENC_create(const char* dataObjectName, ModelNode* parent, uint32_t options, uint32_t controlOptions);
468 
485 DataObject*
486 CDC_BSC_create(const char* dataObjectName, ModelNode* parent, uint32_t options, uint32_t controlOptions, bool hasTransientIndicator);
487 
503 DataObject*
504 CDC_APC_create(const char* dataObjectName, ModelNode* parent, uint32_t options, uint32_t controlOptions, bool isIntegerNotFloat);
505 
507 #define CDC_OPTION_61400_MIN_MX_VAL (1 << 10)
508 
510 #define CDC_OPTION_61400_MAX_MX_VAL (1 << 11)
511 
513 #define CDC_OPTION_61400_TOT_AV_VAL (1 << 12)
514 
516 #define CDC_OPTION_61400_SDV_VAL (1 << 13)
517 
519 #define CDC_OPTION_61400_INC_RATE (1 << 14)
520 
522 #define CDC_OPTION_61400_DEC_RATE (1 << 15)
523 
525 #define CDC_OPTION_61400_SP_ACS (1 << 16)
526 
528 #define CDC_OPTION_61400_CHA_PER_RS (1 << 17)
529 
531 #define CDC_OPTION_61400_CM_ACS (1 << 18)
532 
534 #define CDC_OPTION_61400_TM_TOT (1 << 19)
535 
537 #define CDC_OPTION_61400_COUNTING_DAILY (1 << 20)
538 
540 #define CDC_OPTION_61400_COUNTING_MONTHLY (1 << 21)
541 
543 #define CDC_OPTION_61400_COUNTING_YEARLY (1 << 22)
544 
546 #define CDC_OPTION_61400_COUNTING_TOTAL (1 << 23)
547 
549 #define CDC_OPTION_61400_COUNTING_ALL (CDC_OPTION_61400_COUNTING_DAILY | CDC_OPTION_61400_COUNTING_MONTHLY | CDC_OPTION_61400_COUNTING_YEARLY | CDC_OPTION_61400_COUNTING_TOTAL)
550 
551 DataObject*
552 CDC_SPV_create(const char* dataObjectName, ModelNode* parent,
553  uint32_t options,
554  uint32_t controlOptions,
555  uint32_t wpOptions,
556  bool hasChaManRs);
557 
558 DataObject*
559 CDC_STV_create(const char* dataObjectName, ModelNode* parent,
560  uint32_t options,
561  uint32_t controlOptions,
562  uint32_t wpOptions,
563  bool hasOldStatus);
564 
565 DataObject*
566 CDC_CMD_create(const char* dataObjectName, ModelNode* parent,
567  uint32_t options,
568  uint32_t controlOptions,
569  uint32_t wpOptions,
570  bool hasOldStatus,
571  bool hasCmTm,
572  bool hasCmCt);
573 
574 DataObject*
575 CDC_ALM_create(const char* dataObjectName, ModelNode* parent,
576  uint32_t options,
577  uint32_t controlOptions,
578  uint32_t wpOptions,
579  bool hasOldStatus);
580 
581 DataObject*
582 CDC_CTE_create(const char* dataObjectName, ModelNode* parent,
583  uint32_t options,
584  uint32_t controlOptions,
585  uint32_t wpOptions,
586  bool hasHisRs);
587 
588 DataObject*
589 CDC_TMS_create(const char* dataObjectName, ModelNode* parent,
590  uint32_t options,
591  uint32_t controlOptions,
592  uint32_t wpOptions,
593  bool hasHisRs);
594 
599 #ifdef __cplusplus
600 }
601 #endif
602 
603 #endif /* CDC_H_ */
DataAttribute * CAC_ScaledValueConfig_create(const char *name, ModelNode *parent)
DataObject * CDC_DPC_create(const char *dataObjectName, ModelNode *parent, uint32_t options, uint32_t controlOptions)
Controllable double point (DPC)
DataObject * CDC_SPG_create(const char *dataObjectName, ModelNode *parent, uint32_t options)
Single point setting (SPG)
DataObject * CDC_BSC_create(const char *dataObjectName, ModelNode *parent, uint32_t options, uint32_t controlOptions, bool hasTransientIndicator)
Controllable enumerated status (ENC)
DataObject * CDC_SEC_create(const char *dataObjectName, ModelNode *parent, uint32_t options)
create a new SEC (Security violation) CDC instance (data object)
DataObject * CDC_SPV_create(const char *dataObjectName, ModelNode *parent, uint32_t options, uint32_t controlOptions, uint32_t wpOptions, bool hasChaManRs)
DataObject * CDC_SPC_create(const char *dataObjectName, ModelNode *parent, uint32_t options, uint32_t controlOptions)
Controllable single point (SPC)
DataObject * CDC_DEL_create(const char *dataObjectName, ModelNode *parent, uint32_t options)
Phase to phase related measured values of a three-phase system (DEL)
DataObject * CDC_ENC_create(const char *dataObjectName, ModelNode *parent, uint32_t options, uint32_t controlOptions)
Controllable enumerated status (ENC)
DataObject * CDC_APC_create(const char *dataObjectName, ModelNode *parent, uint32_t options, uint32_t controlOptions, bool isIntegerNotFloat)
Controllable analogue process value (APC)
DataAttribute * CAC_Vector_create(const char *name, ModelNode *parent, uint32_t options, FunctionalConstraint fc, uint8_t triggerOptions)
DataAttribute * CAC_AnalogueValue_create(const char *name, ModelNode *parent, FunctionalConstraint fc, uint8_t triggerOptions, bool isIntegerNotFloat)
DataObject * CDC_BCR_create(const char *dataObjectName, ModelNode *parent, uint32_t options)
DataObject * CDC_ALM_create(const char *dataObjectName, ModelNode *parent, uint32_t options, uint32_t controlOptions, uint32_t wpOptions, bool hasOldStatus)
DataObject * CDC_LPL_create(const char *dataObjectName, ModelNode *parent, uint32_t options)
create a new LPL (Logical node name plate) CDC instance (data object)
DataObject * CDC_ENG_create(const char *dataObjectName, ModelNode *parent, uint32_t options)
Enumerated status setting (ENG)
DataObject * CDC_MV_create(const char *dataObjectName, ModelNode *parent, uint32_t options, bool isIntegerNotFloat)
create a new MV (Measured value) CDC instance (data object)
DataObject * CDC_ING_create(const char *dataObjectName, ModelNode *parent, uint32_t options)
Integer status setting (ING)
DataObject * CDC_DPS_create(const char *dataObjectName, ModelNode *parent, uint32_t options)
DataObject * CDC_INS_create(const char *dataObjectName, ModelNode *parent, uint32_t options)
DataObject * CDC_CMV_create(const char *dataObjectName, ModelNode *parent, uint32_t options)
DataAttribute * CAC_ValWithTrans_create(const char *name, ModelNode *parent, FunctionalConstraint fc, uint8_t triggerOptions, bool hasTransientIndicator)
create a ValWithTrans constructed data attribute
DataObject * CDC_TMS_create(const char *dataObjectName, ModelNode *parent, uint32_t options, uint32_t controlOptions, uint32_t wpOptions, bool hasHisRs)
DataObject * CDC_ACT_create(const char *dataObjectName, ModelNode *parent, uint32_t options)
Protection activation information (ACT)
DataObject * CDC_ENS_create(const char *dataObjectName, ModelNode *parent, uint32_t options)
DataObject * CDC_STV_create(const char *dataObjectName, ModelNode *parent, uint32_t options, uint32_t controlOptions, uint32_t wpOptions, bool hasOldStatus)
DataObject * CDC_SAV_create(const char *dataObjectName, ModelNode *parent, uint32_t options, bool isIntegerNotFloat)
create a new SAV (Sampled analog value) CDC instance (data object)
DataObject * CDC_ACD_create(const char *dataObjectName, ModelNode *parent, uint32_t options)
Directional protection activation information (ACD)
DataObject * CDC_ASG_create(const char *dataObjectName, ModelNode *parent, uint32_t options, bool isIntegerNotFloat)
Analogue Setting (ASG)
DataAttribute * CDA_OperBoolean(ModelNode *parent, bool isTImeActivated)
DataObject * CDC_INC_create(const char *dataObjectName, ModelNode *parent, uint32_t options, uint32_t controlOptions)
Controllable integer status (INC)
DataAttribute * CAC_Point_create(const char *name, ModelNode *parent, FunctionalConstraint fc, uint8_t triggerOptions, bool hasZVal)
DataObject * CDC_DPL_create(const char *dataObjectName, ModelNode *parent, uint32_t options)
create a new DPL (Device name plate) CDC instance (data object)
DataObject * CDC_SPS_create(const char *dataObjectName, ModelNode *parent, uint32_t options)
FunctionalConstraint
Definition: iec61850_common.h:202
DataObject * CDC_WYE_create(const char *dataObjectName, ModelNode *parent, uint32_t options)
Phase to ground/neutral related measured values of a three-phase system (WYE)
DataObject * CDC_HST_create(const char *dataObjectName, ModelNode *parent, uint32_t options, uint16_t maxPts)
DataObject * CDC_CMD_create(const char *dataObjectName, ModelNode *parent, uint32_t options, uint32_t controlOptions, uint32_t wpOptions, bool hasOldStatus, bool hasCmTm, bool hasCmCt)
DataAttribute * CAC_Unit_create(const char *name, ModelNode *parent, bool hasMagnitude)
DataObject * CDC_CTE_create(const char *dataObjectName, ModelNode *parent, uint32_t options, uint32_t controlOptions, uint32_t wpOptions, bool hasHisRs)