libIEC61850  0.8.0
Open-source IEC 61850 MMS/GOOSE server and client library
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
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 #define CDC_OPTION_DESC (1 << 2)
50 #define CDC_OPTION_DESC_UNICODE (1 << 3)
51 
52 #define CDC_OPTION_AC_DLNDA (1 << 4)
53 #define CDC_OPTION_AC_DLN (1 << 5)
54 
55 #define CDC_OPTION_UNIT (1 << 6)
56 
57 #define CDC_OPTION_FROZEN_VALUE (1 << 7)
58 
59 #define CDC_OPTION_ADDR (1 << 8)
60 #define CDC_OPTION_ADDINFO (1 << 9)
61 
62 #define CDC_OPTION_INST_MAG (1 << 10)
63 #define CDC_OPTION_RANGE (1 << 11)
64 
65 #define CDC_OPTION_UNIT_MULTIPLIER (1 << 12)
66 
67 #define CDC_OPTION_AC_SCAV (1 << 13)
68 
69 #define CDC_OPTION_MIN (1 << 14)
70 #define CDC_OPTION_MAX (1 << 15)
71 
72 #define CDC_OPTION_AC_CLC_O (1 << 16)
73 
74 #define CDC_OPTION_RANGE_ANG (1 << 17)
75 
76 #define CDC_OPTION_PHASE_A (1 << 18)
77 #define CDC_OPTION_PHASE_B (1 << 19)
78 #define CDC_OPTION_PHASE_C (1 << 20)
79 
80 #define CDC_OPTION_PHASE_NEUT (1 << 21)
81 
82 #define CDC_OPTION_PHASES_ABC (CDC_OPTION_PHASE_A | CDC_OPTION_PHASE_B | CDC_OPTION_PHASE_C)
83 
84 #define CDC_OPTION_PHASES_ALL (CDC_OPTION_PHASE_A | CDC_OPTION_PHASE_B | CDC_OPTION_PHASE_C | CDC_OPTION_PHASE_NEUT)
85 
86 #define CDC_OPTION_STEP_SIZE (1 << 22)
87 
88 #define CDC_OPTION_ANGLE_REF (1 << 23)
89 
90 
94 #define CDC_CTL_MODEL_NONE 0
95 #define CDC_CTL_MODEL_DIRECT_NORMAL 1
96 #define CDC_CTL_MODEL_SBO_NORMAL 2
97 #define CDC_CTL_MODEL_DIRECT_ENHANCED 3
98 #define CDC_CTL_MODEL_SBO_ENHANCED 4
99 
100 #define CDC_CTL_MODEL_HAS_CANCEL (1 << 4)
101 #define CDC_CTL_MODEL_IS_TIME_ACTIVATED (1 << 5)
102 
103 #define CDC_CTL_OPTION_ORIGIN (1 << 6)
104 #define CDC_CTL_OPTION_CTL_NUM (1 << 7)
105 #define CDC_CTL_OPTION_ST_SELD (1 << 8)
106 #define CDC_CTL_OPTION_OP_RCVD (1 << 9)
107 #define CDC_CTL_OPTION_OP_OK (1 << 10)
108 #define CDC_CTL_OPTION_T_OP_OK (1 << 11)
109 #define CDC_CTL_OPTION_SBO_TIMEOUT (1 << 12)
110 #define CDC_CTL_OPTION_SBO_CLASS (1 << 13)
111 #define CDC_CTL_OPTION_OPER_TIMEOUT (1 << 14)
112 
113 /****************************************************
114  * Constructed Attribute Classes (CAC)
115  ***************************************************/
116 
117 DataAttribute*
118 CAC_AnalogueValue_create(const char* name, ModelNode* parent, FunctionalConstraint fc, uint8_t triggerOptions,
119  bool isIntegerNotFloat);
120 
121 
127 DataAttribute*
128 CAC_ValWithTrans_create(const char* name, ModelNode* parent, FunctionalConstraint fc, uint8_t triggerOptions, bool hasTransientIndicator);
129 
130 
134 DataAttribute*
135 CAC_Vector_create(const char* name, ModelNode* parent, uint32_t options, FunctionalConstraint fc, uint8_t triggerOptions);
136 
137 DataAttribute*
138 CAC_Point_create(const char* name, ModelNode* parent, FunctionalConstraint fc, uint8_t triggerOptions, bool hasZVal);
139 
140 DataAttribute*
141 CAC_ScaledValueConfig_create(const char* name, ModelNode* parent);
142 
143 DataAttribute*
144 CAC_Unit_create(const char* name, ModelNode* parent, bool hasMagnitude);
145 
146 DataAttribute*
147 CDA_OperBoolean(ModelNode* parent, bool isTImeActivated);
148 
149 /****************************************************
150  * Common Data Classes (CDC)
151  ***************************************************/
152 
153 DataObject*
154 CDC_SPS_create(const char* dataObjectName, ModelNode* parent, uint32_t options);
155 
156 DataObject*
157 CDC_DPS_create(const char* dataObjectName, ModelNode* parent, uint32_t options);
158 
159 DataObject*
160 CDC_INS_create(const char* dataObjectName, ModelNode* parent, uint32_t options);
161 
162 DataObject*
163 CDC_ENS_create(const char* dataObjectName, ModelNode* parent, uint32_t options);
164 
165 DataObject*
166 CDC_BCR_create(const char* dataObjectName, ModelNode* parent, uint32_t options);
167 
168 
169 
185 DataObject*
186 CDC_SEC_create(const char* dataObjectName, ModelNode* parent, uint32_t options);
187 
205 DataObject*
206 CDC_MV_create(const char* dataObjectName, ModelNode* parent, uint32_t options, bool isIntegerNotFloat);
207 
212 DataObject*
213 CDC_CMV_create(const char* dataObjectName, ModelNode* parent, uint32_t options);
214 
233 DataObject*
234 CDC_SAV_create(const char* dataObjectName, ModelNode* parent, uint32_t options, bool isIntegerNotFloat);
235 
236 
237 DataObject*
238 CDC_LPL_create(const char* dataObjectName, ModelNode* parent, uint32_t options);
239 
240 DataObject*
241 CDC_HST_create(const char* dataObjectName, ModelNode* parent, uint32_t options, uint16_t maxPts);
242 
261 DataObject*
262 CDC_ACD_create(const char* dataObjectName, ModelNode* parent, uint32_t options);
263 
267 DataObject*
268 CDC_ACT_create(const char* dataObjectName, ModelNode* parent, uint32_t options);
269 
277 DataObject*
278 CDC_SPG_create(const char* dataObjectName, ModelNode* parent, uint32_t options);
279 
287 DataObject*
288 CDC_ENG_create(const char* dataObjectName, ModelNode* parent, uint32_t options);
289 
301 DataObject*
302 CDC_ING_create(const char* dataObjectName, ModelNode* parent, uint32_t options);
303 
315 DataObject*
316 CDC_ASG_create(const char* dataObjectName, ModelNode* parent, uint32_t options, bool isIntegerNotFloat);
317 
324 DataObject*
325 CDC_WYE_create(const char* dataObjectName, ModelNode* parent, uint32_t options);
326 
333 DataObject*
334 CDC_DEL_create(const char* dataObjectName, ModelNode* parent, uint32_t options);
335 
336 /***************************
337  * Controls
338  ***************************/
339 
345 DataObject*
346 CDC_SPC_create(const char* dataObjectName, ModelNode* parent, uint32_t options, uint32_t controlOptions);
347 
363 DataObject*
364 CDC_DPC_create(const char* dataObjectName, ModelNode* parent, uint32_t options, uint32_t controlOptions);
365 
385 DataObject*
386 CDC_INC_create(const char* dataObjectName, ModelNode* parent, uint32_t options, uint32_t controlOptions);
387 
403 DataObject*
404 CDC_ENC_create(const char* dataObjectName, ModelNode* parent, uint32_t options, uint32_t controlOptions);
405 
422 DataObject*
423 CDC_BSC_create(const char* dataObjectName, ModelNode* parent, uint32_t options, uint32_t controlOptions, bool hasTransientIndicator);
424 
440 DataObject*
441 CDC_APC_create(const char* dataObjectName, ModelNode* parent, uint32_t options, uint32_t controlOptions, bool isIntegerNotFloat);
442 
444 #define CDC_OPTION_61400_MIN_MX_VAL (1 << 10)
445 
447 #define CDC_OPTION_61400_MAX_MX_VAL (1 << 11)
448 
450 #define CDC_OPTION_61400_TOT_AV_VAL (1 << 12)
451 
453 #define CDC_OPTION_61400_SDV_VAL (1 << 13)
454 
456 #define CDC_OPTION_61400_INC_RATE (1 << 14)
457 
459 #define CDC_OPTION_61400_DEC_RATE (1 << 15)
460 
462 #define CDC_OPTION_61400_SP_ACS (1 << 16)
463 
465 #define CDC_OPTION_61400_CHA_PER_RS (1 << 17)
466 
468 #define CDC_OPTION_61400_CM_ACS (1 << 18)
469 
471 #define CDC_OPTION_61400_TM_TOT (1 << 19)
472 
474 #define CDC_OPTION_61400_COUNTING_DAILY (1 << 20)
475 
477 #define CDC_OPTION_61400_COUNTING_MONTHLY (1 << 21)
478 
480 #define CDC_OPTION_61400_COUNTING_YEARLY (1 << 22)
481 
483 #define CDC_OPTION_61400_COUNTING_TOTAL (1 << 23)
484 
486 #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)
487 
488 DataObject*
489 CDC_SPV_create(const char* dataObjectName, ModelNode* parent,
490  uint32_t options,
491  uint32_t controlOptions,
492  uint32_t wpOptions,
493  bool hasChaManRs);
494 
495 DataObject*
496 CDC_STV_create(const char* dataObjectName, ModelNode* parent,
497  uint32_t options,
498  uint32_t controlOptions,
499  uint32_t wpOptions,
500  bool hasOldStatus);
501 
502 DataObject*
503 CDC_CMD_create(const char* dataObjectName, ModelNode* parent,
504  uint32_t options,
505  uint32_t controlOptions,
506  uint32_t wpOptions,
507  bool hasOldStatus,
508  bool hasCmTm,
509  bool hasCmCt);
510 
511 DataObject*
512 CDC_ALM_create(const char* dataObjectName, ModelNode* parent,
513  uint32_t options,
514  uint32_t controlOptions,
515  uint32_t wpOptions,
516  bool hasOldStatus);
517 
518 DataObject*
519 CDC_CTE_create(const char* dataObjectName, ModelNode* parent,
520  uint32_t options,
521  uint32_t controlOptions,
522  uint32_t wpOptions,
523  bool hasHisRs);
524 
525 DataObject*
526 CDC_TMS_create(const char* dataObjectName, ModelNode* parent,
527  uint32_t options,
528  uint32_t controlOptions,
529  uint32_t wpOptions,
530  bool hasHisRs);
531 
536 #ifdef __cplusplus
537 }
538 #endif
539 
540 #endif /* CDC_H_ */