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/
Diff: main.cpp
- Revision:
- 1:9399d44c2b1a
- Parent:
- 0:230c10b228ea
--- a/main.cpp Fri Oct 07 13:41:08 2011 +0000 +++ b/main.cpp Fri Oct 07 13:48:18 2011 +0000 @@ -1,3 +1,23 @@ +/** + * Rapid-prototyping protection schemes with IEC 61850 + * + * Copyright (c) 2011 Steven Blair + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + #include "mbed.h" #include "iec61850.h" @@ -20,7 +40,6 @@ void setFault() { MAGNITUDE_NEG_SEQ = 50.0; MAGNITUDE_ZERO_SEQ = 25.0; - //offset = TWO_PI / 6; } void setNormal() { @@ -67,11 +86,6 @@ wait(1); - /*LPC_EMAC->MAXF = 0x0600; - LPC_EMAC->MAC2 |= (1 << 2); - LPC_EMAC->MAC2 &= 0xFFFD; - wait(1);*/ - sv.attach_us(&svSnapshot, 1250); wait(5); @@ -84,7 +98,7 @@ eth.read((char *) bufIn, lenIn); gseDecode(bufIn, lenIn); - //printf("%f\n", D1Q1SB4.S1.C1.RSYN_1.gse_inputs.instMag_1.f); + //printf("%f\n", D1Q1SB4.S1.C1.RSYN_1.gse_inputs.instMag_1.f); // monitor values from serial port if (D1Q1SB4.S1.C1.RSYN_1.gse_inputs.instMag_1.f > 0) { setFault();