The goal of this software is to automatically generate C/C++ code which reads and writes GOOSE and Sampled Value packets. Any valid IEC 61850 Substation Configuration Description (SCD) file, describing GOOSE and/or SV communications, can be used as the input. The output code is lightweight and platform-independent, so it can run on a variety of devices, including low-cost microcontrollers. It\'s ideal for rapid-prototyping new protection and control systems that require communications. This mbed project is a simple example of this functionality. Other code: https://github.com/stevenblair/rapid61850 Project homepage: http://personal.strath.ac.uk/steven.m.blair/
datatypes.c@1:9399d44c2b1a, 2011-10-07 (annotated)
- Committer:
- sblair
- Date:
- Fri Oct 07 13:48:18 2011 +0000
- Revision:
- 1:9399d44c2b1a
- Parent:
- 0:230c10b228ea
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sblair | 1:9399d44c2b1a | 1 | /** |
sblair | 1:9399d44c2b1a | 2 | * Rapid-prototyping protection schemes with IEC 61850 |
sblair | 1:9399d44c2b1a | 3 | * |
sblair | 1:9399d44c2b1a | 4 | * Copyright (c) 2011 Steven Blair |
sblair | 1:9399d44c2b1a | 5 | * |
sblair | 1:9399d44c2b1a | 6 | * This program is free software; you can redistribute it and/or |
sblair | 1:9399d44c2b1a | 7 | * modify it under the terms of the GNU General Public License |
sblair | 1:9399d44c2b1a | 8 | * as published by the Free Software Foundation; either version 2 |
sblair | 1:9399d44c2b1a | 9 | * of the License, or (at your option) any later version. |
sblair | 1:9399d44c2b1a | 10 | |
sblair | 1:9399d44c2b1a | 11 | * This program is distributed in the hope that it will be useful, |
sblair | 1:9399d44c2b1a | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
sblair | 1:9399d44c2b1a | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
sblair | 1:9399d44c2b1a | 14 | * GNU General Public License for more details. |
sblair | 1:9399d44c2b1a | 15 | |
sblair | 1:9399d44c2b1a | 16 | * You should have received a copy of the GNU General Public License |
sblair | 1:9399d44c2b1a | 17 | * along with this program; if not, write to the Free Software |
sblair | 1:9399d44c2b1a | 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
sblair | 1:9399d44c2b1a | 19 | */ |
sblair | 1:9399d44c2b1a | 20 | |
sblair | 1:9399d44c2b1a | 21 | #include "ctypes.h" |
sblair | 1:9399d44c2b1a | 22 | #include "datatypes.h" |
sblair | 1:9399d44c2b1a | 23 | #include "ied.h" |
sblair | 0:230c10b228ea | 24 | #include <stdlib.h> |
sblair | 0:230c10b228ea | 25 | |
sblair | 0:230c10b228ea | 26 | |
sblair | 1:9399d44c2b1a | 27 | void init_myAnalogValue(struct myAnalogValue *myAnalogValue) { |
sblair | 1:9399d44c2b1a | 28 | myAnalogValue->f = 1.024; |
sblair | 1:9399d44c2b1a | 29 | } |
sblair | 1:9399d44c2b1a | 30 | void init_ScaledValueConfig(struct ScaledValueConfig *ScaledValueConfig) { |
sblair | 1:9399d44c2b1a | 31 | } |
sblair | 1:9399d44c2b1a | 32 | void init_myVector(struct myVector *myVector) { |
sblair | 1:9399d44c2b1a | 33 | } |
sblair | 1:9399d44c2b1a | 34 | void init_simpleVector(struct simpleVector *simpleVector) { |
sblair | 1:9399d44c2b1a | 35 | } |
sblair | 1:9399d44c2b1a | 36 | void init_myMod(struct myMod *myMod) { |
sblair | 1:9399d44c2b1a | 37 | } |
sblair | 1:9399d44c2b1a | 38 | void init_myHealth(struct myHealth *myHealth) { |
sblair | 1:9399d44c2b1a | 39 | } |
sblair | 1:9399d44c2b1a | 40 | void init_myBeh(struct myBeh *myBeh) { |
sblair | 1:9399d44c2b1a | 41 | } |
sblair | 1:9399d44c2b1a | 42 | void init_myINS(struct myINS *myINS) { |
sblair | 1:9399d44c2b1a | 43 | } |
sblair | 1:9399d44c2b1a | 44 | void init_myLPL(struct myLPL *myLPL) { |
sblair | 1:9399d44c2b1a | 45 | myLPL->ldNs = (CTYPE_VISSTRING255) malloc(18); |
sblair | 1:9399d44c2b1a | 46 | strncpy(myLPL->ldNs, "IEC61850-7-4:2003\0", 18); |
sblair | 1:9399d44c2b1a | 47 | myLPL->configRev = (CTYPE_VISSTRING255) malloc(9); |
sblair | 1:9399d44c2b1a | 48 | strncpy(myLPL->configRev, "Rev 3.45\0", 9); |
sblair | 1:9399d44c2b1a | 49 | } |
sblair | 1:9399d44c2b1a | 50 | void init_myDPL(struct myDPL *myDPL) { |
sblair | 1:9399d44c2b1a | 51 | myDPL->vendor = (CTYPE_VISSTRING255) malloc(13); |
sblair | 1:9399d44c2b1a | 52 | strncpy(myDPL->vendor, "myVendorName\0", 13); |
sblair | 1:9399d44c2b1a | 53 | myDPL->hwRev = (CTYPE_VISSTRING255) malloc(9); |
sblair | 1:9399d44c2b1a | 54 | strncpy(myDPL->hwRev, "Rev 1.23\0", 9); |
sblair | 1:9399d44c2b1a | 55 | } |
sblair | 1:9399d44c2b1a | 56 | void init_myPos(struct myPos *myPos) { |
sblair | 1:9399d44c2b1a | 57 | } |
sblair | 1:9399d44c2b1a | 58 | void init_mySPS(struct mySPS *mySPS) { |
sblair | 1:9399d44c2b1a | 59 | } |
sblair | 1:9399d44c2b1a | 60 | void init_myMV(struct myMV *myMV) { |
sblair | 1:9399d44c2b1a | 61 | } |
sblair | 1:9399d44c2b1a | 62 | void init_simpleMV(struct simpleMV *simpleMV) { |
sblair | 1:9399d44c2b1a | 63 | } |
sblair | 1:9399d44c2b1a | 64 | void init_simpleCMV(struct simpleCMV *simpleCMV) { |
sblair | 1:9399d44c2b1a | 65 | } |
sblair | 1:9399d44c2b1a | 66 | void init_simpleWYE(struct simpleWYE *simpleWYE) { |
sblair | 1:9399d44c2b1a | 67 | } |
sblair | 1:9399d44c2b1a | 68 | void init_myCMV(struct myCMV *myCMV) { |
sblair | 1:9399d44c2b1a | 69 | } |
sblair | 1:9399d44c2b1a | 70 | void init_mySEQ(struct mySEQ *mySEQ) { |
sblair | 1:9399d44c2b1a | 71 | } |
sblair | 1:9399d44c2b1a | 72 | void init_mySAV(struct mySAV *mySAV) { |
sblair | 1:9399d44c2b1a | 73 | } |
sblair | 1:9399d44c2b1a | 74 | void init_simpleSAV(struct simpleSAV *simpleSAV) { |
sblair | 1:9399d44c2b1a | 75 | } |
sblair | 1:9399d44c2b1a | 76 | void init_datatypes() { |
sblair | 1:9399d44c2b1a | 77 | init_myLPL(&E1Q1SB1.S1.C1.LLN0.NamPlt); |
sblair | 1:9399d44c2b1a | 78 | init_myLPL(&E1Q1SB1.S1.C1.LLN0.NamPlt); |
sblair | 1:9399d44c2b1a | 79 | init_myLPL(&E1Q1SB1.S1.C1.LLN0.NamPlt); |
sblair | 1:9399d44c2b1a | 80 | init_myLPL(&E1Q1SB1.S1.C1.LLN0.NamPlt); |
sblair | 1:9399d44c2b1a | 81 | init_myAnalogValue(&E1Q1SB1.S1.C1.RMXU_1.AmpLocPhsA.instMag); |
sblair | 1:9399d44c2b1a | 82 | init_myAnalogValue(&E1Q1SB1.S1.C1.RMXU_1.AmpLocPhsB.instMag); |
sblair | 1:9399d44c2b1a | 83 | init_myAnalogValue(&E1Q1SB1.S1.C1.RMXU_1.AmpLocPhsC.instMag); |
sblair | 1:9399d44c2b1a | 84 | init_myLPL(&E1Q1SB1.S1.C1.LPHD_1.NamPlt); |
sblair | 1:9399d44c2b1a | 85 | init_myDPL(&E1Q1SB1.S1.C1.LPHD_1.PhyNam); |
sblair | 1:9399d44c2b1a | 86 | init_myAnalogValue(&E1Q1SB1.S1.C1.MMXU_1.Amps.mag); |
sblair | 1:9399d44c2b1a | 87 | init_myAnalogValue(&E1Q1SB1.S1.C1.MMXU_1.Volts.mag); |
sblair | 1:9399d44c2b1a | 88 | init_myAnalogValue(&E1Q1SB1.S1.C1.TVTR_1.Vol.instMag); |
sblair | 1:9399d44c2b1a | 89 | init_myLPL(&D1Q1SB4.S1.C1.LLN0.NamPlt); |
sblair | 1:9399d44c2b1a | 90 | init_myLPL(&D1Q1SB4.S1.C1.LLN0.NamPlt); |
sblair | 1:9399d44c2b1a | 91 | init_myLPL(&D1Q1SB4.S1.C1.LPHD_1.NamPlt); |
sblair | 1:9399d44c2b1a | 92 | init_myDPL(&D1Q1SB4.S1.C1.LPHD_1.PhyNam); |
sblair | 1:9399d44c2b1a | 93 | init_myLPL(&D1Q1SB4.S1.C1.RSYN_1.NamPlt); |
sblair | 1:9399d44c2b1a | 94 | } |
sblair | 0:230c10b228ea | 95 |