{"id":15036206,"url":"https://github.com/mycroes/sally7","last_synced_at":"2025-04-04T07:04:15.190Z","repository":{"id":44631906,"uuid":"136655245","full_name":"mycroes/Sally7","owner":"mycroes","description":"C# implementation of Siemens S7 connections with a focus on performance","archived":false,"fork":false,"pushed_at":"2025-01-27T22:19:27.000Z","size":329,"stargazers_count":62,"open_issues_count":13,"forks_count":23,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-04T07:04:07.989Z","etag":null,"topics":["csharp-library","s7-protocol"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mycroes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-08T18:51:52.000Z","updated_at":"2025-01-27T22:17:02.000Z","dependencies_parsed_at":"2024-02-12T12:31:48.861Z","dependency_job_id":"37a6ebc7-8c29-4a6c-8cb6-b6513f4dfa16","html_url":"https://github.com/mycroes/Sally7","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mycroes%2FSally7","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mycroes%2FSally7/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mycroes%2FSally7/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mycroes%2FSally7/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mycroes","download_url":"https://codeload.github.com/mycroes/Sally7/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247135141,"owners_count":20889420,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp-library","s7-protocol"],"created_at":"2024-09-24T20:30:30.606Z","updated_at":"2025-04-04T07:04:15.172Z","avatar_url":"https://github.com/mycroes.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sally7\nC# implementation of Siemens S7 connections with a focus on performance\n\n\n\n![license](https://img.shields.io/github/license/mycroes/Sally7.svg)\n[![.NET](https://github.com/mycroes/Sally7/actions/workflows/dotnet.yml/badge.svg)](https://github.com/mycroes/Sally7/actions/workflows/dotnet.yml)\n[![NuGet](https://img.shields.io/nuget/v/Sally7.svg)](https://www.nuget.org/packages/Sally7)\n\n\n## What is the S7 protocol?\nThe **S7** protocol is a proprietary protocol for PLC communication with and between Siemens S7 PLC's.\nIt's making use of **COTP** (*Connection Oriented Transport Protocol*, ISO 8073 / [RFC 905](https://tools.ietf.org/html/rfc905))\n and **TPKT** (*ISO Transport Service on top of the TCP Version 3*, [RFC 1006](https://tools.ietf.org/html/rfc1006)).\nThe S7 protocol uses **ConnectionRequest** (CC) and **ConnectionConfirm** (CR)\n from COTP for connection management and COTP **DataTransfer** (DT) to wrap S7 protocol functions.\nA good description is available at [The Siemens S7 Communication - Part 1 General Structure](http://gmiru.com/article/s7comm/)\n and [The Siemens S7 Communication - Part 2 Job Requests and Ack Data](http://gmiru.com/article/s7comm-part2/).\n\n## The implementation of Sally7\nSally7 supports the most basic read and write actions to the **DataBlock** area.\nAll protocols are mapped to `struct`s and `enum`s with the intent to create a project that is easy to comprehend and extend.\n\n## How to get started\n### Connect to a PLC\nConnect to a S7-1500 PLC at adress 192.168.0.15 on Rack 0, Slot 1\n```\nvar connection = Sally7.Plc.ConnectionFactory.GetConnection(host: \"192.168.0.15\", cpuType: Sally7.Plc.CpuType.S7_1500, rack: 0, slot: 1);\nawait connection.OpenAsync();\n```\n### Read a DataBlockDataItem\nRead 10 bytes from DataBlock 87 starting at address 54\n```\n var dataItem = new DataBlockDataItem\u003cbyte[]\u003e\n {\n     DbNumber = 87,\n     Length = 10,\n     StartByte = 54\n };\n await connection.ReadAsync(dataItem);\n Console.WriteLine($\"Read data: {BitConverter.ToString(dataItem.Value)}\");\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmycroes%2Fsally7","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmycroes%2Fsally7","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmycroes%2Fsally7/lists"}