An mbed implementation of IEC 61850-9-2LE Sample Values. Creating using the rapid61850 library, available at: https://github.com/stevenblair/rapid61850.
datatypes.h
00001 /** 00002 * Rapid-prototyping protection schemes with IEC 61850 00003 * 00004 * Copyright (c) 2012 Steven Blair 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License 00008 * as published by the Free Software Foundation; either version 2 00009 * of the License, or (at your option) any later version. 00010 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #ifndef DATATYPES_H 00022 #define DATATYPES_H 00023 00024 #ifdef __cplusplus /* If this is a C++ compiler, use C linkage */ 00025 extern "C" { 00026 #endif 00027 00028 #include "ctypes.h" 00029 00030 00031 // enums 00032 00033 // data attributes 00034 struct IEC_61850_9_2LEAV { 00035 CTYPE_INT32 i; 00036 }; 00037 struct IEC_61850_9_2LEsVCAmp { 00038 CTYPE_FLOAT32 scaleFactor; 00039 CTYPE_FLOAT32 offset; 00040 }; 00041 struct IEC_61850_9_2LEsVCVol { 00042 CTYPE_FLOAT32 scaleFactor; 00043 CTYPE_FLOAT32 offset; 00044 }; 00045 00046 // data objects 00047 struct IEC_61850_9_2LESAVAmp { 00048 struct IEC_61850_9_2LEAV instMag; 00049 CTYPE_QUALITY q; 00050 struct IEC_61850_9_2LEsVCAmp sVC; 00051 }; 00052 struct IEC_61850_9_2LESAVVol { 00053 struct IEC_61850_9_2LEAV instMag; 00054 CTYPE_QUALITY q; 00055 struct IEC_61850_9_2LEsVCVol sVC; 00056 }; 00057 struct IEC_61850_9_2LEINC { 00058 CTYPE_INT32 ctlVal; 00059 CTYPE_INT32 stVal; 00060 CTYPE_QUALITY q; 00061 CTYPE_TIMESTAMP t; 00062 }; 00063 00064 // datasets 00065 struct LE_IED_MUnn_PhsMeas1 { 00066 struct IEC_61850_9_2LEAV MUnn_TCTR_1_Amp_instMag; 00067 CTYPE_QUALITY MUnn_TCTR_1_Amp_q; 00068 struct IEC_61850_9_2LEAV MUnn_TCTR_2_Amp_instMag; 00069 CTYPE_QUALITY MUnn_TCTR_2_Amp_q; 00070 struct IEC_61850_9_2LEAV MUnn_TCTR_3_Amp_instMag; 00071 CTYPE_QUALITY MUnn_TCTR_3_Amp_q; 00072 struct IEC_61850_9_2LEAV MUnn_TCTR_4_Amp_instMag; 00073 CTYPE_QUALITY MUnn_TCTR_4_Amp_q; 00074 struct IEC_61850_9_2LEAV MUnn_TVTR_1_Vol_instMag; 00075 CTYPE_QUALITY MUnn_TVTR_1_Vol_q; 00076 struct IEC_61850_9_2LEAV MUnn_TVTR_2_Vol_instMag; 00077 CTYPE_QUALITY MUnn_TVTR_2_Vol_q; 00078 struct IEC_61850_9_2LEAV MUnn_TVTR_3_Vol_instMag; 00079 CTYPE_QUALITY MUnn_TVTR_3_Vol_q; 00080 struct IEC_61850_9_2LEAV MUnn_TVTR_4_Vol_instMag; 00081 CTYPE_QUALITY MUnn_TVTR_4_Vol_q; 00082 }; 00083 00084 // logical nodes 00085 struct IEC_61850_9_2LELLN0 { 00086 struct IEC_61850_9_2LEINC Mod; 00087 }; 00088 struct IEC_61850_9_2LETCTR { 00089 struct IEC_61850_9_2LESAVAmp Amp; 00090 struct { 00091 struct LE_IED_MUnn_PhsMeas1 LE_IED_MUnn_PhsMeas1; 00092 void (*datasetDecodeDone)(CTYPE_INT16U smpCnt); 00093 CTYPE_INT16U smpCnt; 00094 } sv_inputs_MSVCB01; 00095 }; 00096 struct IEC_61850_9_2LETVTR { 00097 struct IEC_61850_9_2LESAVVol Vol; 00098 }; 00099 00100 void init_datatypes(void); 00101 00102 00103 00104 00105 #ifdef __cplusplus /* If this is a C++ compiler, end C linkage */ 00106 } 00107 #endif 00108 00109 #endif
Generated on Sat Jul 23 2022 01:15:10 by 1.7.2