Reputation: 23
I am working on the connection between C# and a Siemens PLC (S7-1200). I've created a datablock (a.k.a. database) to which I need to read and eventually write. The connection to the PLC works, but I can't read anything from its datablock. It always give me the following error:
Error 33028 context is not supported. Step7 says: Function not implemented or error in telegram.
The number of the datablock is 311. I am starting at the first byte and I've only given up 1 as length.
I've also disabled Optimize block access, enabling does not solve this problem.
if (0 == lndConnection.connectPLC())
{
Byte[] bytes = new Byte[1];
res = lndConnection.readBytes(libnodave.daveDB ,311,0, 1, bytes);
if (res == 0)
MessageBox.Show(lndConnection.getS32().ToString());
else
{
mInt = 0;
MessageBox.Show("error " + res + " " + libnodave.daveStrerror(res));
}
}
I hope somebody can help me out with the problem.
Upvotes: 2
Views: 8266
Reputation: 31
S7-1500 implements extended communication protocol which is not supported by libnodave. It is possible though to connect and read/write global db blocks using the "old" protocol.
I have communicate successfully with both 1200 and 1500, but some additional setting plc-side are needed.
S7-1200
S7-1500
Details with screen-shots can be found at: http://snap7.sourceforge.net/snap7_client.html
Hope it helps! Cheers, peter
Upvotes: 3
Reputation: 430
The answer from Roatin Mart: "S7-1200 has indirect access on by default. Check if Optimised Block access is disabled."
Upvotes: 3