3

I'm trying to connect to a S7 1212 using this library. I can connect to the PLC fine, but whenever I try and read a tag I get the error exception Received 12 bytes: '32-02-00-00-00-00-00-00-00-00-81-04', expected 19 bytes.

I'm using the latest version of the software, and as far as I can tell, the PLC is set up correctly. My code is as basic as it can be:

using (var plc = new Plc(CpuType.S71200, "10.10.10.180", 0, 1))
        {
            plc.Open();
            try
            {
                bool tagName = (bool)plc.Read("DB1.DBX0.0");
                Console.WriteLine("Tag Name: " + tagName);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
        }

DB1 and OB1:
image

Network: image

The permissions are full access and PUT/GET communication is allowed: image

And the Datablock Optimised block access is turned off.

Any idea's why I am getting this error?

Marcus S
  • 103
  • 8

1 Answers1

1

The issue was with the PLC itself, not being compiled and downloaded to the CPU (in case this helps anyone else)

Marcus S
  • 103
  • 8