Questions tagged [sharp7]

Sharp7 is the C# port of Snap7 Client. It’s a C# implementation of the S7Protocol.

Sharp7 is the C# port of Snap7 Client. It’s not a wrapper, i.e. you don’t have an interface code that loads snap7.dll (or .so) but it’s a pure C# implementation of the S7Protocol.

Sharp7 is deployed as a single source file that contains some classes that you can use directly in your .NET project to communicate with S7 PLCs.

It’s designed to work with small hardware .NET-based or even for large projects which don’t need extended control functions.

Features:

  • Native port of Snap7 core in C#, no DLL to deploy
  • Fully managed “safe” code in a single source file
  • Virtually every hardware with an Ethernet adapter able to run a .NET Core can be connected to an S7 PLC.
  • Packed protocol headers to improve performances.
  • Compatible with Snap7.net.cs, plug and play replaceable.
  • Compatible with Universal Windows Platform including Win10 IoT for Raspberry.

Sharp7 deploy: Sharp7 is a single file classes library.

C# users: Just add it in your C# project.

VB users: refer to the example, you need to create the assembly Sharp7.net

Useful links:

4 questions
1
vote
0 answers

Write bit to PLC using DBWrite doesn't give the right result (result = 3145782)

I have a Siemens S7-1212 AC/DC/Rly PLC and i want communicate with a C# application using Snap7. I have successfully made a connection to the PLC in the UI and i can even successfully write values to the PLC. Sometimes however (1 in 3 times) the…
Theo Tromp
  • 23
  • 4
1
vote
1 answer

Writing a boolean to PLC using Sharp7

When I am trying to write an integer to an integer Database field I am successful: byte[] db13buffer = new byte[buffer]; var shorty = short.Parse(valuesForPlc[i]); S7.SetIntAt(db13buffer, 0, shorty); int writeResult2 = client.DBWrite(dbnumber,…
Mister Verleg
  • 4,053
  • 5
  • 43
  • 68
0
votes
1 answer

C# snap7 reading array of char null character

I'm reading an array of char from the plc but I have to add the character to the string if it's not empty but as in the picture all the character in the plc are empty but when run the code it add all the character anyway. I can't understand where…
0
votes
1 answer

C# & Siemens S7 communication with Sharp7 library - GetAgBlockInfo parameters?

For this function: public int GetAgBlockInfo(int BlockType, int BlockNumber, ref S7BlockInfo Block); What is the parameter for BlockType if I would like to use this fc to read DB? I've tried: S7Consts.S7AreaDB, 132, 0x41, 65