# Howto write ExtensionObjectArray with node-red-contrib-opcua

**URL:** <https://discourse.nodered.org/t/howto-write-extensionobjectarray-with-node-red-contrib-opcua/92108>\
**Category:** General\
**Created:** [1 October 2024 15:18 UTC](https://discourse.nodered.org/t/howto-write-extensionobjectarray-with-node-red-contrib-opcua/92108 "2024-10-01T15:18:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Barb21](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@Barb21](https://discourse.nodered.org/u/Barb21)\
**Post date:** [1 October 2024 15:18 UTC](https://discourse.nodered.org/t/howto-write-extensionobjectarray-with-node-red-contrib-opcua/92108/1 "2024-10-01T15:18:40Z")

</div>

Hello,  
is it possible to write an ExtensionObjectArray with or without a given range?  
My Node-red does always a restart as an error is thrown

```auto
{"log":"14:53:19.615Z :datatype_factory :210 warning ns=0;i=0 name= SimaticStructures does not have binary encoding\n","stream":"stdout","time":"2024-10-01T14:53:19.616599674Z"}
{"log":"14:53:19.619Z :datatype_factory :210 warning ns=0;i=0 name= SimaticSystemStructures does not have binary encoding\n","stream":"stdout","time":"2024-10-01T14:53:19.620217313Z"}
{"log":"14:53:20.063Z :populate_data_type_manager_104:62 Cannot find dataType Definition ! with nodeId =ns=2;i=6525 2:ParameterResultDataType false\n","stream":"stdout","time":"2024-10-01T14:53:20.064282667Z"}
{"log":"14:53:20.225Z :datatype_factory :309 target namespace = ``\n","stream":"stdout","time":"2024-10-01T14:53:20.226199695Z"}
{"log":"14:53:20.231Z :datatype_factory :310 registerFactory : SimaticStructures already registered. dataTypeNodeId= ns=3;i=3400\n","stream":"stdout","time":"2024-10-01T14:53:20.232521133Z"}
{"log":"14:53:20.234Z :datatype_factory :309 target namespace = ``\n","stream":"stdout","time":"2024-10-01T14:53:20.234782131Z"}
{"log":"14:53:20.236Z :datatype_factory :310 registerFactory : SimaticSystemStructures already registered. dataTypeNodeId= ns=3;i=3500\n","stream":"stdout","time":"2024-10-01T14:53:20.237321735Z"}
{"log":"14:53:20.505Z :populate_data_type_manager_104:62 Cannot find dataType Definition ! with nodeId =ns=2;i=15889 2:TransferResultDataDataType false\n","stream":"stdout","time":"2024-10-01T14:53:20.506557014Z"}
{"log":"14:53:20.507Z :populate_data_type_manager_104:62 Cannot find dataType Definition ! with nodeId =ns=2;i=15888 2:TransferResultErrorDataType false\n","stream":"stdout","time":"2024-10-01T14:53:20.508253879Z"}
{"log":"14:53:30.739Z :datatype_factory :210 warning ns=0;i=0 name= SimaticStructures does not have binary encoding\n","stream":"stdout","time":"2024-10-01T14:53:30.741303831Z"}
{"log":"14:53:30.745Z :datatype_factory :210 warning ns=0;i=0 name= SimaticSystemStructures does not have binary encoding\n","stream":"stdout","time":"2024-10-01T14:53:30.747081296Z"}
{"log":"14:53:31.201Z :populate_data_type_manager_104:62 Cannot find dataType Definition ! with nodeId =ns=2;i=6525 2:ParameterResultDataType false\n","stream":"stdout","time":"2024-10-01T14:53:31.202454677Z"}
{"log":"14:53:31.319Z :datatype_factory :309 target namespace = ``\n","stream":"stdout","time":"2024-10-01T14:53:31.32065042Z"}
{"log":"14:53:31.321Z :datatype_factory :310 registerFactory : SimaticStructures already registered. dataTypeNodeId= ns=3;i=3400\n","stream":"stdout","time":"2024-10-01T14:53:31.322307937Z"}
{"log":"14:53:31.323Z :datatype_factory :309 target namespace = ``\n","stream":"stdout","time":"2024-10-01T14:53:31.323751721Z"}
{"log":"14:53:31.325Z :datatype_factory :310 registerFactory : SimaticSystemStructures already registered. dataTypeNodeId= ns=3;i=3500\n","stream":"stdout","time":"2024-10-01T14:53:31.325602114Z"}
{"log":"14:53:31.481Z :populate_data_type_manager_104:62 Cannot find dataType Definition ! with nodeId =ns=2;i=15889 2:TransferResultDataDataType false\n","stream":"stdout","time":"2024-10-01T14:53:31.481919062Z"}
{"log":"14:53:31.482Z :populate_data_type_manager_104:62 Cannot find dataType Definition ! with nodeId =ns=2;i=15888 2:TransferResultErrorDataType false\n","stream":"stdout","time":"2024-10-01T14:53:31.483376226Z"}
{"log":"1 Oct 14:53:31 - [red] Uncaught Exception:\n","stream":"stdout","time":"2024-10-01T14:53:31.921440002Z"}
{"log":"1 Oct 14:53:31 - [error] TypeError: Cannot read properties of undefined (reading 'schema')\n","stream":"stdout","time":"2024-10-01T14:53:31.921757031Z"}
{"log":" at EXTENSION.get schema [as schema] (/home/nodered/node-red-home/node-red-flows/node_modules/node-red-contrib-opcua/node_modules/node-opcua-schemas/source/dynamic_extension_object.ts:533:18)\n","stream":"stdout","time":"2024-10-01T14:53:31.921798263Z"}
{"log":" at EXTENSION.toJSON (/home/nodered/node-red-home/node-red-flows/node_modules/node-red-contrib-opcua/node_modules/node-opcua-schemas/source/dynamic_extension_object.ts:849:37)\n","stream":"stdout","time":"2024-10-01T14:53:31.921820919Z"}
{"log":" at JSON.stringify (\u003canonymous\u003e)\n","stream":"stdout","time":"2024-10-01T14:53:31.921842855Z"}
{"log":" at write_action_input (/home/nodered/node-red-home/node-red-flows/node_modules/node-red-contrib-opcua/opcua/102-opcuaclient.js:1665:86)\n","stream":"stdout","time":"2024-10-01T14:53:31.921864251Z"}
{"log":" at processTicksAndRejections (node:internal/process/task_queues:95:5)\n","stream":"stdout","time":"2024-10-01T14:53:31.921885803Z"}

```

My message properties are like this:

```auto
msg.payload = {value: newArray};
msg.topic = "ns=5;i=xxxx;datatype=ExtensionObjectArray;typeId=ns=5;i=yyyy";
msg.datatype = "ExtensionObjectArray";
msg.action = "write";
msg.range = "1";

```

Is my input wrong or am I missing something?  
An example would be great!

Thanks in advance

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [30 December 2024 15:19 UTC](https://discourse.nodered.org/t/howto-write-extensionobjectarray-with-node-red-contrib-opcua/92108/2 "2024-12-30T15:19:32Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
