DataLayer returns skewed values when reading an array of structures

I encountered a problem while reading an array of structures from the DataLayer - please see the attached video. As you can see in the PLC, I have an array named "arBoards_Class_1" and each item of that array is a structure. Values for each item of this array look like this:

{

    "bActive": true,

    "uiAmount": 0,

    "rLength": 0,

    "rPrice": 0,

    "enSegregate_Type": "NoSegregation",

    "uiSegregate_Addr1": 0,

    "uiSegregate_Addr2": 0,

    "enClass": "Class_1",

    "uiIndex": 1

}

Only the uiIndex is incremented by 1 (which results in the same value as the array index). When I read the single address of this array (single structure), all the data is returned correctly. But when I access the whole array at once, the data is skewed. It seems almost like the DataLayer shifts some bytes, which is causing the data to be incorrect. Even the structure under the second address in that array is incorrect. It should be bActive:=TRUE and uiIndex:=2. But instead it's FALSE and 1. Also, around the index of 9, you can see that the actual value of uiIndex is all over the place, being assigned to different variables.

I found out about this error while reading the data in NodeRED, but as you can see, this problem also exists in the DataLayer's browser in the Core's web interface. Also in the browser, you can see errors "Value is not accepted" referring to the enumerator's numeric value not being defined in the enumerator's definition. But that is a secondary problem and only happens because DataLayer returns skewed data, so the enumerator is assigned a value for which there is no definition.

I attached:

  • An export file with definitions and declarations required to recreate this structure in the PLC (make sure to run the program in a task and export the PerVar to DataLayer via SymbolConfiguration)

  • A JSON file with the response from DataLayer when asked about the whole arBoards_Class_1 content

  • Video showing differences between the returned value when accessing a single item vs the whole array

  • My app versions. Also, I'm using the PLC Engineering 2.6.7 and CtrlX Works 2.6.6

PLC_structures.zip
3.96KB
DataLayer_arBoards_Class_1.json
15.57KB
VideoWithTheIssue.mp4
18.98MB
AppsVersions.png
188.3KB
2
4 replies