Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
fbarresi authored Mar 20, 2020
1 parent 3713ee5 commit ee8585c
Showing 1 changed file with 79 additions and 24 deletions.
103 changes: 79 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,39 @@
# BeckhoffS7Client

[![Build status](https://ci.appveyor.com/api/projects/status/7qbba540vvgwj09a?svg=true)](https://ci.appveyor.com/project/fbarresi/beckhoffs7client)
![Licence](https://img.shields.io/github/license/fbarresi/BeckhoffS7Client.svg)
![GitHub All Releases](https://img.shields.io/github/downloads/fbarresi/BeckhoffS7Client/total)

Unofficial TwinCAT function for S7 Communication


This software is an (unofficial) opensource implementation of [TF6610 | TC3 S5/S7 Communication](https://www.beckhoff.com.ph/default.asp?twincat/tf6760.htm) similar to my other project [BeckhoffHttpClient](https://github.com/fbarresi/BeckhoffHttpClient).

## First release is coming: stay tuned!
## Main features

Scheduled for April 2020
Your surely gonna love this software, but if you still need a couple of information for starring this project...

- **FREE! (for commercial use aswell)**
- Resilient: doesn't matter what you do with the beckhoff (Start, Stop, Config-Mode, Run-Mode, etc.)
- Modern: build with the newest TwinCAT Version and .Net Core 3.1
- Clever: don't need to specify any datatype or bit numbering

## Requirements

- TwinCAT 3.1.4024.7+

## The S7 Attribute
## How to use this software

Use the simple S7 attribute on your primitive variables in order to mark them as input or output.
### Install and setup connections

```reStructuredText
VAR_GLOBAL
{attribute 'S7.Out'}
{attribute 'S7.Address' := 'db2.dbx0.0'}
imAlive : BOOL;
- Install the service on your beckhoff and ajdust the settings file `TFU002.settings.json` located `C:\TwinCAT\Functions\Unofficial\BeckhoffS7Client`

{attribute 'S7.In'}
{attribute 'S7.Address' := 'db2.dbx1.0'}
{attribute 'S7.Plc' := 's7-300'} // you have to select select a plc by name if you have more then one
otherSystemAlive :BOOL;
END_VAR
```


## Settings
- Put your connection parameters for all your S7 PLC in the settings file.

Setup the service settings locally on your Beckhoff or remote and support as many different S7 plc as you need.

````json
```json
{
"BeckhoffSettings": {
"AmsNetId": "5.45.127.110.1.1",
"AmsNetId": "",
"Port": 851
},
"ExtenalPlcSettings": [
Expand All @@ -55,3 +48,65 @@ Setup the service settings locally on your Beckhoff or remote and support as man
}
```

### Use The S7 Attribute

Use the S7 attribute in your project for connect your primitive variables (like an input or output) to a S7.

```reStructuredText
VAR_GLOBAL
{attribute 'S7.Out'}
{attribute 'S7.Address' := 'db2.dbx0.0'}
imAlive : BOOL;
{attribute 'S7.In'}
{attribute 'S7.Address' := 'db2.dbx1.0'}
{attribute 'S7.Plc' := 's7-300'} // you have to select a plc by name only if you have more then one
otherSystemAlive :BOOL;
END_VAR
```

### Supported TwinCAT Datatypes

- BOOL
- BYTE und BYTE[]
- INT / UINT
- DINT / UDINT
- LINT / ULINT
- REAL

### S7 Addressing rules

every address has the form (case unsenible) `DB<number>.<TYPE><Start>.<Length/Position>`
i.e.: `DB42.DBX0.7` => (means) Datablock 42, Bit (DBX), Start: 0, Position: 7 .

Following types are supported:
- `DBX` => Bit (BOOL)
- `DBB` => BYTE or BYTE[]
- `INT`
- `DINT`
- `DUL` => LINT
- `D` => REAL

### Logfiles

Logfiles are saved into `C:\TwinCAT\Functions\Unofficial\BeckhoffS7Client\Service.log`.
You can use [TailBlazer](https://github.com/RolandPheasant/TailBlazer) for a live view.


## Would you like to contribute?

Yes, please!

Try the library and feel free to open an issue or ask for support.

Don't forget to **star this project**!

## Credits

Special thanks to [JetBrains](https://www.jetbrains.com/?from=BeckhoffHttpClient) for supporting this open source project.

<a href="https://www.jetbrains.com/?from=BeckhoffHttpClient"><img height="200" src="https://www.jetbrains.com/company/brand/img/jetbrains_logo.png"></a>


0 comments on commit ee8585c

Please sign in to comment.