Skip to content

Problem reading from DB in PLC ET200SP CPU #558

@FR-TheCoder

Description

@FR-TheCoder

Hi there,
I'm just trying to read DB variables using S7.Net+ from an ET200SP CPU
I use Visual Studio 2002

I have an exception in the function ReadBytes in the file PlcSynchronous.cs
public byte[] ReadBytes(DataType dataType, int db, int startByteAdr, int count)
with the parameters dataType : DataBlock , db : 4 , startByteAdr : 10 , count : 50

In the PLC DB4 is defined as an Array[0..100]of Word

The function ReadBytes calls the function
public void ReadBytes(Span buffer, DataType dataType, int db, int startByteAdr)
Then this function itself calls the function
private void ReadBytesWithSingleRequest(DataType dataType, int db, int startByteAdr, Span buffer)
But the AssertReadResponse function throws the exception
S7.Net.PlcException: "Received 12 bytes: '32-02-00-00-00-00-00-00-00-00-81-04', expected 68 bytes."

The checkbox Permit access with PUT/GET communications is checked in Protection & Security > Connection mechanisms

Do you have any idea?

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions