Howto write a more complex JSON object with Node-Red to DataLayer

Hi all,

I want to write a more complex JSON object with Node-Red to the DataLayer to handle it in the PLC. The objects contains one or more arrays within other objects.

I found a running example how to write a simple object to the DataLayer here: https://github.com/boschrexroth/node-red-contrib-ctrlx-automation/blob/master/doc/EXAMPLES.md#monitor-and-handle-a-struct-plc-variable-strstruct

If I add an array or other object inside the main object and write it to the DataLayer, I will always receive a DL_TYPE_MISMATCH...

Is it possible to write such data to the DataLayer with the DataLayerRequest-Node?

Best reply by CodeShepherd

Here is a summary of our short live meeting:

  • There seems to be a problem when more then one array is in a PLC structure. Then the provided node in the data layer does not include any data but only child nodes.

  • When reading the node from the data layer via Node-RED the names of the arrays are not visible.

  • DeUb will test our "App_Http (HyperText Transfer Protocol)" library to have less software parts involved.

View original
NodeRed_JSON-Object_Create-Function.png
21.58KB
PLC_JSON-Struct-Var.png
7.53KB
NodeRed_JSON-Object.png
11.39KB
18 replies