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/
gsePacketData.h@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 | 0:230c10b228ea | 21 | #ifndef GSE_PACKET_DATA_H |
sblair | 0:230c10b228ea | 22 | #define GSE_PACKET_DATA_H |
sblair | 0:230c10b228ea | 23 | |
sblair | 0:230c10b228ea | 24 | #ifdef __cplusplus /* If this is a C++ compiler, use C linkage */ |
sblair | 0:230c10b228ea | 25 | extern "C" { |
sblair | 0:230c10b228ea | 26 | #endif |
sblair | 0:230c10b228ea | 27 | |
sblair | 0:230c10b228ea | 28 | #include <stdlib.h> |
sblair | 0:230c10b228ea | 29 | #include <string.h> |
sblair | 0:230c10b228ea | 30 | #include "ctypes.h" |
sblair | 0:230c10b228ea | 31 | |
sblair | 0:230c10b228ea | 32 | //#define GSE_MAX_DATASET_SIZE 1280 |
sblair | 0:230c10b228ea | 33 | |
sblair | 0:230c10b228ea | 34 | struct gseData { |
sblair | 0:230c10b228ea | 35 | struct ethHeaderData ethHeaderData; |
sblair | 0:230c10b228ea | 36 | unsigned char *gocbRef; // <IEDname><LDinst>/LLN0$<GSEControl.name> e.g. "E1Q1SB1C1/LLN0$ItlPositions" |
sblair | 0:230c10b228ea | 37 | CTYPE_INT32U timeAllowedToLive; |
sblair | 0:230c10b228ea | 38 | unsigned char *datSet; // <IEDname><LDinst>/LLN0$<DataSet.name> e.g. "E1Q1SB1C1/LLN0$Positions" |
sblair | 0:230c10b228ea | 39 | unsigned char *goID; // optional |
sblair | 0:230c10b228ea | 40 | CTYPE_TIMESTAMP t; |
sblair | 0:230c10b228ea | 41 | CTYPE_INT32U stNum; |
sblair | 0:230c10b228ea | 42 | CTYPE_INT32U sqNum; |
sblair | 0:230c10b228ea | 43 | CTYPE_BOOLEAN test; |
sblair | 0:230c10b228ea | 44 | CTYPE_INT32U confRev; |
sblair | 0:230c10b228ea | 45 | CTYPE_BOOLEAN ndsCom; |
sblair | 0:230c10b228ea | 46 | CTYPE_INT32U numDatSetEntries; |
sblair | 0:230c10b228ea | 47 | CTYPE_INT32U minTime; // stored in milliseconds |
sblair | 0:230c10b228ea | 48 | CTYPE_INT32U maxTime; // stored in milliseconds |
sblair | 0:230c10b228ea | 49 | int (*encodeDataset)(unsigned char *buf); // function pointer to dataset-specific encoder |
sblair | 0:230c10b228ea | 50 | int (*getDatasetLength)(); // function pointer to dataset-specific getLength function |
sblair | 0:230c10b228ea | 51 | }; |
sblair | 0:230c10b228ea | 52 | |
sblair | 0:230c10b228ea | 53 | |
sblair | 0:230c10b228ea | 54 | #ifdef __cplusplus /* If this is a C++ compiler, end C linkage */ |
sblair | 0:230c10b228ea | 55 | } |
sblair | 0:230c10b228ea | 56 | #endif |
sblair | 0:230c10b228ea | 57 | |
sblair | 0:230c10b228ea | 58 | #endif |