![Avatar](https://opcfoundation.org/wp-content/uploads/sp-resources/forum-avatars/defaults/userdefault.png)
09/07/2023
![sp_UserOfflineSmall](https://opcfoundation.org/wp-content/sp-resources/forum-themes/reboot/images/darkpack/sp_UserOfflineSmall.png)
Hi all,
I'm new in opcua server with nodered and javascript
I would like create a variable structure as described in the xml report which follow as created in plc siemens. But I would like create it using javascript as I started with the following lines
function constructAlarmAddressSpace(server, addressSpace, eventObjects, done) {const opcua = coreServer.choreCompact.opcua;const LocalizedText = opcua.LocalizedText;const namespace = addressSpace.getOwnNamespace();const Variant = opcua.Variant;const DataType = opcua.DataType;const DataValue = opcua.DataValue;var flexServerInternals = this;const rootFolder = addressSpace.findNode("RootFolder");node.warn("construct new address space for OPC UA");const ordiniFolder = namespace.addFolder(rootFolder.objects, {"browseName": "ordini"});const ordine = namespace.addObject({organizedBy: ordiniFolder,browseName: "ordine"});})done();}
![Avatar](https://opcfoundation.org/wp-content/uploads/sp-resources/forum-avatars/defaults/admindefault.png)
05/30/2017
![sp_UserOfflineSmall](https://opcfoundation.org/wp-content/sp-resources/forum-themes/reboot/images/darkpack/sp_UserOfflineSmall.png)
Deleted the long XML you posted because it made the thread hard to read.
Are you using the node-opcua framework:
https://github.com/node-opcua/node-opcua
It should have functions that allow you to do this.
![Avatar](https://opcfoundation.org/wp-content/uploads/sp-resources/forum-avatars/defaults/userdefault.png)
09/07/2023
![sp_UserOfflineSmall](https://opcfoundation.org/wp-content/sp-resources/forum-themes/reboot/images/darkpack/sp_UserOfflineSmall.png)
many thanks for your help. I cannot find information on that link to create the structure I mean. I would like create new dataType
for example in uaexpert I connect to a opcua server and a variable is datatype: "ordine"."ordini" where ordine is a object while ordini is array with value rank 1 and arrayDimension UInt32 Array[1] is [0] = 2
can I set a dataType as created by default from plc using javascript?
many thanks
![Avatar](https://opcfoundation.org/wp-content/uploads/sp-resources/forum-avatars/defaults/userdefault.png)
09/07/2023
![sp_UserOfflineSmall](https://opcfoundation.org/wp-content/sp-resources/forum-themes/reboot/images/darkpack/sp_UserOfflineSmall.png)
I'm using node-red node compact server opcua node and inside it request a javascript code where I can define the structure of variables.
But I cannot undestrand how to create list of structures as I described int the last post https://opcfoundation.org/foru.....res/#p4846
can you help me to undestand how to create this?
many many many thanks in advance
1 Guest(s)