GithubHelp home page GithubHelp logo

zy015240 / sally7 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mycroes/sally7

0.0 1.0 0.0 226 KB

C# implementation of Siemens S7 connections with a focus on performance

License: MIT License

C# 100.00%

sally7's Introduction

Sally7

C# implementation of Siemens S7 connections with a focus on performance

license AppVeyor NuGet

What is the S7 protocol?

The S7 protocol is a proprietary protocol for PLC communication with and between Siemens S7 PLC's. It's making use of COTP (Connection Oriented Transport Protocol, ISO 8073 / RFC 905) and TPKT (ISO Transport Service on top of the TCP Version 3, RFC 1006). The S7 protocol uses ConnectionRequest (CC) and ConnectionConfirm (CR) from COTP for connection management and COTP DataTransfer (DT) to wrap S7 protocol functions. A good description is available at The Siemens S7 Communication - Part 1 General Structure and The Siemens S7 Communication - Part 2 Job Requests and Ack Data.

The implementation of Sally7

Sally7 supports the most basic read and write actions to the DataBlock area. All protocols are mapped to structs and enums with the intent to create a project that is easy to comprehend and extend.

How to get started

Connect to a PLC

Connect to a S7-1500 PLC at adress 192.168.0.15 on Rack 0, Slot 1

var connection = Sally7.Plc.ConnectionFactory.GetConnection(host: "192.168.0.15", cpuType: Sally7.Plc.CpuType.S7_1500, rack: 0, slot: 1);
await connection.OpenAsync();

Read a DataBlockDataItem

Read 10 bytes from DataBlock 87 starting at address 54

 var dataItem = new DataBlockDataItem<byte[]>
 {
     DbNumber = 87,
     Length = 10,
     StartByte = 54
 };
 await connection.ReadAsync(dataItem);
 Console.WriteLine($"Read data: {BitConverter.ToString(dataItem.Value)}");

sally7's People

Contributors

gfoidl avatar mycroes avatar scamille avatar thieum avatar

Watchers

 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.