An mbed implementation of IEC 61850-9-2LE Sample Values. Creating using the rapid61850 library, available at: https://github.com/stevenblair/rapid61850.

Dependencies:   mbed

An mbed implementation of IEC 61850-9-2LE Sample Values. Creating using the rapid61850 library, available at: https://github.com/stevenblair/rapid61850.

Committer:
sblair
Date:
Tue Oct 02 21:31:05 2012 +0000
Revision:
0:f09b7bb8bcce
converted library to folder

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sblair 0:f09b7bb8bcce 1 /**
sblair 0:f09b7bb8bcce 2 * Rapid-prototyping protection schemes with IEC 61850
sblair 0:f09b7bb8bcce 3 *
sblair 0:f09b7bb8bcce 4 * Copyright (c) 2012 Steven Blair
sblair 0:f09b7bb8bcce 5 *
sblair 0:f09b7bb8bcce 6 * This program is free software; you can redistribute it and/or
sblair 0:f09b7bb8bcce 7 * modify it under the terms of the GNU General Public License
sblair 0:f09b7bb8bcce 8 * as published by the Free Software Foundation; either version 2
sblair 0:f09b7bb8bcce 9 * of the License, or (at your option) any later version.
sblair 0:f09b7bb8bcce 10
sblair 0:f09b7bb8bcce 11 * This program is distributed in the hope that it will be useful,
sblair 0:f09b7bb8bcce 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
sblair 0:f09b7bb8bcce 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
sblair 0:f09b7bb8bcce 14 * GNU General Public License for more details.
sblair 0:f09b7bb8bcce 15
sblair 0:f09b7bb8bcce 16 * You should have received a copy of the GNU General Public License
sblair 0:f09b7bb8bcce 17 * along with this program; if not, write to the Free Software
sblair 0:f09b7bb8bcce 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
sblair 0:f09b7bb8bcce 19 */
sblair 0:f09b7bb8bcce 20
sblair 0:f09b7bb8bcce 21 #ifndef DATATYPES_H
sblair 0:f09b7bb8bcce 22 #define DATATYPES_H
sblair 0:f09b7bb8bcce 23
sblair 0:f09b7bb8bcce 24 #ifdef __cplusplus /* If this is a C++ compiler, use C linkage */
sblair 0:f09b7bb8bcce 25 extern "C" {
sblair 0:f09b7bb8bcce 26 #endif
sblair 0:f09b7bb8bcce 27
sblair 0:f09b7bb8bcce 28 #include "ctypes.h"
sblair 0:f09b7bb8bcce 29
sblair 0:f09b7bb8bcce 30
sblair 0:f09b7bb8bcce 31 // enums
sblair 0:f09b7bb8bcce 32
sblair 0:f09b7bb8bcce 33 // data attributes
sblair 0:f09b7bb8bcce 34 struct IEC_61850_9_2LEAV {
sblair 0:f09b7bb8bcce 35 CTYPE_INT32 i;
sblair 0:f09b7bb8bcce 36 };
sblair 0:f09b7bb8bcce 37 struct IEC_61850_9_2LEsVCAmp {
sblair 0:f09b7bb8bcce 38 CTYPE_FLOAT32 scaleFactor;
sblair 0:f09b7bb8bcce 39 CTYPE_FLOAT32 offset;
sblair 0:f09b7bb8bcce 40 };
sblair 0:f09b7bb8bcce 41 struct IEC_61850_9_2LEsVCVol {
sblair 0:f09b7bb8bcce 42 CTYPE_FLOAT32 scaleFactor;
sblair 0:f09b7bb8bcce 43 CTYPE_FLOAT32 offset;
sblair 0:f09b7bb8bcce 44 };
sblair 0:f09b7bb8bcce 45
sblair 0:f09b7bb8bcce 46 // data objects
sblair 0:f09b7bb8bcce 47 struct IEC_61850_9_2LESAVAmp {
sblair 0:f09b7bb8bcce 48 struct IEC_61850_9_2LEAV instMag;
sblair 0:f09b7bb8bcce 49 CTYPE_QUALITY q;
sblair 0:f09b7bb8bcce 50 struct IEC_61850_9_2LEsVCAmp sVC;
sblair 0:f09b7bb8bcce 51 };
sblair 0:f09b7bb8bcce 52 struct IEC_61850_9_2LESAVVol {
sblair 0:f09b7bb8bcce 53 struct IEC_61850_9_2LEAV instMag;
sblair 0:f09b7bb8bcce 54 CTYPE_QUALITY q;
sblair 0:f09b7bb8bcce 55 struct IEC_61850_9_2LEsVCVol sVC;
sblair 0:f09b7bb8bcce 56 };
sblair 0:f09b7bb8bcce 57 struct IEC_61850_9_2LEINC {
sblair 0:f09b7bb8bcce 58 CTYPE_INT32 ctlVal;
sblair 0:f09b7bb8bcce 59 CTYPE_INT32 stVal;
sblair 0:f09b7bb8bcce 60 CTYPE_QUALITY q;
sblair 0:f09b7bb8bcce 61 CTYPE_TIMESTAMP t;
sblair 0:f09b7bb8bcce 62 };
sblair 0:f09b7bb8bcce 63
sblair 0:f09b7bb8bcce 64 // datasets
sblair 0:f09b7bb8bcce 65 struct LE_IED_MUnn_PhsMeas1 {
sblair 0:f09b7bb8bcce 66 struct IEC_61850_9_2LEAV MUnn_TCTR_1_Amp_instMag;
sblair 0:f09b7bb8bcce 67 CTYPE_QUALITY MUnn_TCTR_1_Amp_q;
sblair 0:f09b7bb8bcce 68 struct IEC_61850_9_2LEAV MUnn_TCTR_2_Amp_instMag;
sblair 0:f09b7bb8bcce 69 CTYPE_QUALITY MUnn_TCTR_2_Amp_q;
sblair 0:f09b7bb8bcce 70 struct IEC_61850_9_2LEAV MUnn_TCTR_3_Amp_instMag;
sblair 0:f09b7bb8bcce 71 CTYPE_QUALITY MUnn_TCTR_3_Amp_q;
sblair 0:f09b7bb8bcce 72 struct IEC_61850_9_2LEAV MUnn_TCTR_4_Amp_instMag;
sblair 0:f09b7bb8bcce 73 CTYPE_QUALITY MUnn_TCTR_4_Amp_q;
sblair 0:f09b7bb8bcce 74 struct IEC_61850_9_2LEAV MUnn_TVTR_1_Vol_instMag;
sblair 0:f09b7bb8bcce 75 CTYPE_QUALITY MUnn_TVTR_1_Vol_q;
sblair 0:f09b7bb8bcce 76 struct IEC_61850_9_2LEAV MUnn_TVTR_2_Vol_instMag;
sblair 0:f09b7bb8bcce 77 CTYPE_QUALITY MUnn_TVTR_2_Vol_q;
sblair 0:f09b7bb8bcce 78 struct IEC_61850_9_2LEAV MUnn_TVTR_3_Vol_instMag;
sblair 0:f09b7bb8bcce 79 CTYPE_QUALITY MUnn_TVTR_3_Vol_q;
sblair 0:f09b7bb8bcce 80 struct IEC_61850_9_2LEAV MUnn_TVTR_4_Vol_instMag;
sblair 0:f09b7bb8bcce 81 CTYPE_QUALITY MUnn_TVTR_4_Vol_q;
sblair 0:f09b7bb8bcce 82 };
sblair 0:f09b7bb8bcce 83
sblair 0:f09b7bb8bcce 84 // logical nodes
sblair 0:f09b7bb8bcce 85 struct IEC_61850_9_2LELLN0 {
sblair 0:f09b7bb8bcce 86 struct IEC_61850_9_2LEINC Mod;
sblair 0:f09b7bb8bcce 87 };
sblair 0:f09b7bb8bcce 88 struct IEC_61850_9_2LETCTR {
sblair 0:f09b7bb8bcce 89 struct IEC_61850_9_2LESAVAmp Amp;
sblair 0:f09b7bb8bcce 90 struct {
sblair 0:f09b7bb8bcce 91 struct LE_IED_MUnn_PhsMeas1 LE_IED_MUnn_PhsMeas1;
sblair 0:f09b7bb8bcce 92 void (*datasetDecodeDone)(CTYPE_INT16U smpCnt);
sblair 0:f09b7bb8bcce 93 CTYPE_INT16U smpCnt;
sblair 0:f09b7bb8bcce 94 } sv_inputs_MSVCB01;
sblair 0:f09b7bb8bcce 95 };
sblair 0:f09b7bb8bcce 96 struct IEC_61850_9_2LETVTR {
sblair 0:f09b7bb8bcce 97 struct IEC_61850_9_2LESAVVol Vol;
sblair 0:f09b7bb8bcce 98 };
sblair 0:f09b7bb8bcce 99
sblair 0:f09b7bb8bcce 100 void init_datatypes(void);
sblair 0:f09b7bb8bcce 101
sblair 0:f09b7bb8bcce 102
sblair 0:f09b7bb8bcce 103
sblair 0:f09b7bb8bcce 104
sblair 0:f09b7bb8bcce 105 #ifdef __cplusplus /* If this is a C++ compiler, end C linkage */
sblair 0:f09b7bb8bcce 106 }
sblair 0:f09b7bb8bcce 107 #endif
sblair 0:f09b7bb8bcce 108
sblair 0:f09b7bb8bcce 109 #endif