Hello,
I am using:
node-red-contrib-s7
node-red-contrib-opcua
currently I am struggling with a flow to create many tags (approx. 800).
I am using OPCUA-IIoT-Inject->OPCUA-IIoT-Server-ASO->OPCUA-IIoT-Sver to create the folders and tags in the OPCServer. => This is working good but is quite huge (1603 nodes in total).
Now I need to read data from S7 (RFC1006), I've created S7-Endpoint where all the Variables of S7 are defined "Endpoint"->"Name".
Then I've created nodes for each variable as a "s7 in" in mode "single" so that I could use a function for each node afterwards to transform the msg from "s7 in" to a msg for a OPCUA-IIoT-Write node.
The function is defined:
msg.topic = ""
msg.nodetype ="inject"
msg.injectType = write
msg.addressSpaceItems = [
{"name":"","nodeId":"ns=1;s=OPCTAGNAME_E352","datatypeName":"Boolean"}
]
msg.valuesToWrite = [
msg.payload.S7Endpoint_E352
]
return msg;
This solution results into a too big flow which I can not deploy.
Now usually I do not like to build it in this way, normally I would use loops or so to reduce everything but I am new to NodeRed.
Anyways the "documentation" does not help me identifying which object is in msg for "S7 in" when I used mode "ALL" or mode "All, one per message".
The issue is that I need to set the datatypeName for OPCUA Server for the specific tag.
I.e. I could create multiple S7 endpoints for each data type, then create a node for "S7 In" for the datatype and set this to mode "ALL". But then I am lost, how can I transform the msg to OPCUA Server for all of the variables which are contained in msg of "S7 in"? I also need to set the S= to the OPCTAGNAME but this could be the same as the name of the "S7 in" variable (if I can extract it from input msg)
Regards
Joerg