GithubHelp home page GithubHelp logo

pebsconsulting / open103 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xvincentx/open103

0.0 2.0 0.0 172 KB

Feature complete implementation of IEC870-5-103 protocol

License: Apache License 2.0

C++ 95.53% C 4.47%

open103's Introduction

Open103

Open103 is an open source, feature complete reference implementation of IEC 60870-5-103 protocol which define systems used for telecontrol.

Build status: Build status

It includes a C++ core part and an optional .NET binding (that will never be finished due to lack of time). There is no download associated, so jump to documentation to get how drop in lib in your code.

IEC 60870 part 5 is one of the IEC 60870 set of standards which define systems used for telecontrol (supervisory control and data acquisition) in electrical engineering and power system automation applications. Part 5 provides a communication profile for sending basic telecontrol messages between two systems, which uses permanent directly connected data circuits between the systems. The IEC Technical Committee 57 (Working Group 03) have developed a protocol standard for telecontrol, teleprotection, and associated telecommunications for electric power systems. The result of this work is IEC 60870-5.

Please, DO NOT try to use this library without reading the documentation. It will avoid you a lot of headaches. Have fun!

Quick usage guide

WARNING: i'm not going to cover IEC103 reference. Buy the documents and study!

This is not a real library. You have to drop in the source code in your project. At first, the library makes all communication throught an abstract class, that must be derived in order to get it working. Usually communicaton happens on a serial port. However, is very usual to use serial gateway converter that have to work on ethernet Tcp port. Based on your need, create a CommunicationPort implementation that fits your use.

As reference, you may want to use this SerialCommPort

#pragma once
#include "communicationport.h"
#include <Windows.h>

class SerialCommPort :
	public CommunicationPort
{
public:
	SerialCommPort(string name)
	{
		port = CreateFile(name.c_str(),GENERIC_READ|GENERIC_WRITE,0,0,CREATE_ALWAYS,0,0);
		if (port == NULL)
		{

		}

	}
	virtual int Read(unsigned char* thePacket, int maxlen)
	{
		DWORD dw;
		ReadFile(port,thePacket,maxlen,&dw,0);
		return dw;
	}

	virtual int Write(unsigned char* thePacket, int len)
	{
		DWORD dw;
		WriteFile(port,thePacket,len,&dw,0);
		return dw;
	}

	virtual ~SerialCommPort(void)
	{
		if (port != NULL)
			CloseHandle(port);

		port = NULL;
	}

private:
	HANDLE port;
};

Once you have got your code working, you should usual start with a StationInit function (see IEC103 reference) and then enter into the loop and start grabbing messages from protection using the GetNextAsdu function

Then you are able to manage the message, get your data and respond, if needed, to the protection.

open103's People

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.