OPC xml client ItemName/ItemPath

hi, i'm trying to use opcxml supflow (opcxml subflow (flow) - Node-RED) and have some problems to read the variables of a SIMOTION D445_2 (Siemens). With an external Client there are no Problems to get the Values. But specialy this subflow I don't know how the syntax is (ItemName/ItemPath), where do I put in strings? does someone worked with it and can help me out?

regards

Neligan

Hi,
did you have a look at the help sidebar of the subflow node? There you will find some hints to get started. Its not much of documentation, and the formatting seems slightly corrupted, but it is definitely possible to decode the syntax.

As a jump start, feed the node with

{
"payload":{"ItemList":[{"ItemName":"Dynamic.Analog Types.Fools.Rosencrantz"}]},
"url":"http://info.advosol.com/XMLDADemo/XML_Sim/OpcXmlDaServer.asmx",
"action":"Read"
}

Hi,

yes I red the help. But it isn't the same syntax I used to do. see the pictures below.
ItemProperties shows the connection via extern OPCxml-client (there i see the Server is working and i can Brows through the variables.

I tried every way but neer seen a Value on payload.


NR

The idea is to use the subflow as a node, configure it and feed with suitable msg.payload. You shouldn’t have to get inside the subflow. Anyhow I can put together a demo flow next time I’m by the computer.

Is that dOPC explorer from Kassl?

Try this Example and see if it works out for you

[{"id":"a0568e71.72952","type":"subflow","name":"opcxml","info":"OPC XML Client  \n\n### Inputs\n---\n1.  url  \nIf not configured in the node, this property sets the url of the request.\n2.  action  \nIf action <msg.action> is configured in the node, this property sets the action of the request.\nAvailable actions are\n - GetStatus\n - Read\n - Write\n - Subscribe\n - SubscriptionPolledrefresh\n - SubscriptionCancel\n - Browse\n - GetProperties\n3. payload  \nThe payload defines the details of the action. Each action has different payload structure.  \n - Read\n ```\n{\n   \"ItemPath\": <string>, optional\n   \"ItemList\": [\n        {\n            \"ClientItemHandle\": <string>, optioanl\n            \"ItemName\": <string> required\n        },\n        ...\n]}\n```\n - Write\n ```\n{\n   \"ItemPath\": <string>,\n   \"ItemList\": [\n        {\n            \"ClientItemHandle\": <string>, optional\n            \"ItemName\": <string>, required\n            \"Value\": <>, required\n            \"Type\": <string> required as retrieved from GetProperties action  \n        },\n        ...\n]}\n```\n - Subscribe\n ```\n{\n   \"SubscriptionPingRate\": <number>, optional defaults to 60000 ms  \n   \"requestedSamplingRate\": <number>, optional defaults to 1000 ms  \n   \"ClientRequestHandle\": <string>, optional\n   \"ItemPath\": <string>,\n   \"ItemList\": [\n        {\n            \"ClientItemHandle\": <string>, optional  \"ItemName\": <string> required\n        },\n        ...\n]}\n```\n - SubscriptionPolledRefresh ```payload = {'ServerSubHandle': <string>}```\n - SubscriptionCancel ```payload = {'ServerSubHandle': <string>}```\n - Browse ```payload = {'ItemName': <string>}```  \n - GetProperties ```payload = {'ItemName': <string>}```  \n\n4. options  \n''options.raw = true'' to skip parsing of XML result  \n---\n\n### Example  \nBrowse Advosol public server  \n```  \nmsg.url = 'http://info.advosol.com/XMLDADemo/XML_Sim/OpcXmlDaServer.asmx'  \nmsg.action = 'Browse'\nmsg.payload = {\"ItemName\": \"\"}\n```\n\n### Details\nUse this flow at your own risk. This \"client\" is not certified, nor based on any documentation. Its just loosely a result of testing communication with a couple of OPC XML servers that happen to be within reach.\n","category":"","in":[{"x":40,"y":180,"wires":[{"id":"63e32c20.b76e94"}]}],"out":[{"x":1280,"y":980,"wires":[{"id":"12f2c851.6e7428","port":0}]}],"env":[{"name":"action","type":"str","value":"GetStatus","ui":{"type":"select","opts":{"opts":[{"l":{"en-US":"GetStatus"},"v":"GetStatus"},{"l":{"en-US":"Read"},"v":"Read"},{"l":{"en-US":"Write"},"v":"Write"},{"l":{"en-US":"Subscribe"},"v":"Subscribe"},{"l":{"en-US":"SubscriptionPolledRefresh"},"v":"SubscriptionPolledRefresh"},{"l":{"en-US":"SubscriptionCancel"},"v":"SubscriptionCancel"},{"l":{"en-US":"Browse"},"v":"Browse"},{"l":{"en-US":"GetProperties"},"v":"GetProperties"},{"l":{"en-US":"<msg.action>"},"v":""}]}}},{"name":"url","type":"str","value":"","ui":{"type":"input","opts":{"types":["str","env"]}}},{"name":"raw","type":"bool","value":"false","ui":{"type":"checkbox"}}],"meta":{},"color":"#da9","outputLabels":["payload"]},{"id":"d06bded4.355dc","type":"template","z":"a0568e71.72952","name":"GetStatus","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<soap:Envelope \nxmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" \nxmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" \nxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n<soap:Body>\n<GetStatus xmlns=\"http://opcfoundation.org/webservices/XMLDA/1.0/\"/>\n</soap:Body>\n</soap:Envelope>\n","output":"str","x":580,"y":60,"wires":[["8daff6d4.368e78"]]},{"id":"88ea2c40.56b0a","type":"http request","z":"a0568e71.72952","name":"","method":"POST","ret":"txt","paytoqs":false,"url":"","tls":"","persist":false,"proxy":"","authType":"","x":990,"y":160,"wires":[["705fabcb.519744"]]},{"id":"236450f8.a7b8a","type":"xml","z":"a0568e71.72952","name":"","property":"payload","attr":"","chr":"","x":510,"y":580,"wires":[["ed80557e.beba28"]]},{"id":"57f9a1f9.97185","type":"template","z":"a0568e71.72952","name":"Read","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<soap:Envelope \nxmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" \nxmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" \nxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n<soap:Body>\n <Read xmlns=\"http://opcfoundation.org/webservices/XMLDA/1.0/\">\n  <Options\n    ReturnErrorText=\"true\"\n    ReturnItemTime=\"true\"\n    ReturnItemName=\"true\"\n    LocaleID=\"en\"/>\n  <ItemList{{#payload.ItemPath}} ItemPath=\"{{{payload.ItemPath}}}\"{{/payload.ItemPath}}>\n    {{#payload.ItemList}}\n       <Items{{#ItemPath}} ItemPath=\"{{{ItemPath}}}\"{{/ItemPath}} ItemName=\"{{{ItemName}}}\"{{#ClientItemHandle}} ClientItemHandle=\"{{{ClientItemHandle}}}\"{{/ClientItemHandle}}/>\n    {{/payload.ItemList}}\n  </ItemList>\n </Read>\t  \n</soap:Body></soap:Envelope>\n","output":"str","x":570,"y":100,"wires":[["8daff6d4.368e78"]]},{"id":"60c6ce6.1d42f3","type":"switch","z":"a0568e71.72952","name":"action","property":"action","propertyType":"msg","rules":[{"t":"eq","v":"GetStatus","vt":"str"},{"t":"eq","v":"Read","vt":"str"},{"t":"eq","v":"Write","vt":"str"},{"t":"eq","v":"Subscribe","vt":"str"},{"t":"eq","v":"SubscriptionPolledRefresh","vt":"str"},{"t":"eq","v":"SubscriptionCancel","vt":"str"},{"t":"eq","v":"Browse","vt":"str"},{"t":"eq","v":"GetProperties","vt":"str"},{"t":"else"}],"checkall":"false","repair":false,"outputs":9,"x":370,"y":180,"wires":[["d06bded4.355dc"],["57f9a1f9.97185"],["29092e47.e835a2"],["6335ea21.ad4a54"],["957a24a0.800c58"],["9ffb90ef.88ccd"],["1c5abe9c.425c31"],["67d14704.f3e058"],["7c0160cd.337dd"]]},{"id":"1c5abe9c.425c31","type":"template","z":"a0568e71.72952","name":"Browse","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<soap:Envelope \nxmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" \nxmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" \nxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n<soap:Body>\n<Browse xmlns=\"http://opcfoundation.org/webservices/XMLDA/1.0/\"\n\tItemName=\"{{{payload.ItemName}}}\"\n>\n</Browse>\t  \n</soap:Body>\n</soap:Envelope>\n","output":"str","x":580,"y":300,"wires":[["8daff6d4.368e78"]]},{"id":"7c0160cd.337dd","type":"function","z":"a0568e71.72952","name":"Error","func":"node.error('Unknown SOAP action', msg)\n","outputs":0,"noerr":0,"x":530,"y":380,"wires":[]},{"id":"8f627fde.e3c0f","type":"switch","z":"a0568e71.72952","name":"action","property":"action","propertyType":"msg","rules":[{"t":"eq","v":"GetStatus","vt":"str"},{"t":"eq","v":"Read","vt":"str"},{"t":"eq","v":"Write","vt":"str"},{"t":"eq","v":"Subscribe","vt":"str"},{"t":"eq","v":"SubscriptionPolledRefresh","vt":"str"},{"t":"eq","v":"SubscriptionCancel","vt":"str"},{"t":"eq","v":"Browse","vt":"str"},{"t":"eq","v":"GetProperties","vt":"str"}],"checkall":"false","repair":false,"outputs":8,"x":230,"y":880,"wires":[["35897351.3c2adc"],["7e8d6d76.e0a0c4"],["2e7040d.343cbc"],["b865212e.e1d0b"],["8e60984d.cfcf18"],["6f1e64f4.bcbcac"],["e2e40866.9ce498"],["c93f193f.e756b8"]]},{"id":"4ac0e773.fc42f8","type":"link out","z":"a0568e71.72952","name":"Response","links":["2a3004a5.86317c"],"x":1295,"y":140,"wires":[]},{"id":"7e8d6d76.e0a0c4","type":"change","z":"a0568e71.72952","name":"ReadResponse","rules":[{"t":"set","p":"payload","pt":"msg","to":"**.ReadResponse.RItemList.Items.{\t\"ItemName\":$.\"$\".ItemName,\t\"ClientItemHandle\":$.\"$\".ClientItemHandle,\t\"Timestamp\":$.\"$\".Timestamp,\t\"value\": Value.\"_\",\t\"type\": Value.\"$\".\"xsi:type\",\t\"Quality\": Quality[0].\"$\".QualityField\t}[]","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":820,"wires":[["6d7a466.2d910b8"]]},{"id":"6d7a466.2d910b8","type":"split","z":"a0568e71.72952","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":710,"y":820,"wires":[["4dc9e078.2774"]]},{"id":"4dc9e078.2774","type":"switch","z":"a0568e71.72952","name":"","property":"payload.type","propertyType":"msg","rules":[{"t":"eq","v":"xsd:float","vt":"str"},{"t":"eq","v":"xsd:double","vt":"str"},{"t":"eq","v":"xsd:int","vt":"str"},{"t":"eq","v":"xsd:unsignedInt","vt":"str"},{"t":"eq","v":"xsd:string","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":6,"x":830,"y":820,"wires":[["d232b24f.36022"],["d232b24f.36022"],["d232b24f.36022"],["d232b24f.36022"],["f79accb.58b8b3"],["b87f32a3.f1562","bf0f1ea6.1ef93"]]},{"id":"b87f32a3.f1562","type":"join","z":"a0568e71.72952","name":"","mode":"auto","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":"false","timeout":"","count":"","reduceRight":false,"x":1150,"y":840,"wires":[["bfb860b4.f3ac9"]]},{"id":"d232b24f.36022","type":"change","z":"a0568e71.72952","name":"number","rules":[{"t":"set","p":"payload.value","pt":"msg","to":"$number(payload.value)","tot":"jsonata"},{"t":"delete","p":"payload.type","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1000,"y":780,"wires":[["b87f32a3.f1562"]]},{"id":"f79accb.58b8b3","type":"change","z":"a0568e71.72952","name":"string","rules":[{"t":"delete","p":"payload.type","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":990,"y":820,"wires":[["b87f32a3.f1562"]]},{"id":"cda10e22.075af","type":"function","z":"a0568e71.72952","name":"Warn","func":"node.warn(msg.payload)\n","outputs":1,"noerr":0,"x":1150,"y":880,"wires":[[]]},{"id":"f713686b.a04448","type":"link out","z":"a0568e71.72952","name":"","links":["12f2c851.6e7428"],"x":655,"y":780,"wires":[]},{"id":"12f2c851.6e7428","type":"link in","z":"a0568e71.72952","name":"Done","links":["f713686b.a04448","bfb860b4.f3ac9","c7d068d5.6d5d08","d9af02c5.7f4f6","1ebc5fbf.98ebf","5e695cd6.f557f4","667f0f18.9d189","f3cc9a14.e34458","a93b46ec.4c71e8","7d15a46f.55944c","2854f3b9.1b98fc","2ff36629.b3c0aa"],"x":1175,"y":980,"wires":[[]]},{"id":"bfb860b4.f3ac9","type":"link out","z":"a0568e71.72952","name":"","links":["12f2c851.6e7428"],"x":1235,"y":840,"wires":[]},{"id":"c7d068d5.6d5d08","type":"link out","z":"a0568e71.72952","name":"","links":["12f2c851.6e7428"],"x":695,"y":1020,"wires":[]},{"id":"2a3004a5.86317c","type":"link in","z":"a0568e71.72952","name":"Transform","links":["4ac0e773.fc42f8"],"x":55,"y":540,"wires":[["9fb2f08f.b0814"]]},{"id":"bf0f1ea6.1ef93","type":"change","z":"a0568e71.72952","name":"type","rules":[{"t":"set","p":"payload","pt":"msg","to":"'Read. Unhandled type: ' & payload.type","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":990,"y":880,"wires":[["cda10e22.075af"]]},{"id":"705fabcb.519744","type":"switch","z":"a0568e71.72952","name":"statusCode","property":"statusCode","propertyType":"msg","rules":[{"t":"eq","v":"200","vt":"num"},{"t":"jsonata_exp","v":"statusCode in ['ECONNREFUSED', 'ETIMEDOUT']","vt":"jsonata"},{"t":"else"}],"checkall":"false","repair":false,"outputs":3,"x":1150,"y":160,"wires":[["4ac0e773.fc42f8"],[],["d8ec6e2f.a08d7"]]},{"id":"d8ec6e2f.a08d7","type":"function","z":"a0568e71.72952","name":"Error","func":"node.error(\"Http Error. statusCode=\"+msg.statusCode, msg);\n","outputs":0,"noerr":0,"x":1310,"y":200,"wires":[]},{"id":"1e5b953.aa6bf6b","type":"comment","z":"a0568e71.72952","name":"statusCodes","info":"msg.statusCode =   \n= 200, ok  \n= 500, Internal error, no error thrown from http request node. Throw error with function node.  \n= ECONNREFUSED, Error already thrown from http request node. Dont produce additional errors  ","x":1150,"y":200,"wires":[]},{"id":"b050323f.b395f","type":"comment","z":"a0568e71.72952","name":"dropping namespace","info":"https://stackoverflow.com/questions/4505103/how-to-remove-xml-namespaces-using-javascript\n","x":400,"y":620,"wires":[]},{"id":"eb250a13.029f88","type":"function","z":"a0568e71.72952","name":"namespace","func":"// Options to drop namespace for xml node\n// from xml2js lib/processors.js\nprefixMatch = new RegExp(/(?!xmlns)^.*:/);\nfunction stripPrefix(str){\n    return str.replace(prefixMatch, '');\n}\nmsg.options = {\"tagNameProcessors\": [stripPrefix]}\nreturn msg;\n\n/*msg.options = {\"xmlns\":true,}*/\n","outputs":1,"noerr":0,"x":370,"y":580,"wires":[["236450f8.a7b8a"]],"info":"Dropping namespace\n\nSetting options to xml2js\n\nhttps://github.com/Leonidas-from-XIV/node-xml2js/blob/master/README.md#options\n"},{"id":"e2e40866.9ce498","type":"change","z":"a0568e71.72952","name":"BrowseResponse","rules":[{"t":"set","p":"payload","pt":"msg","to":"**.BrowseResponse.Elements.{\t\"Name\":*.Name,\t\"ItemName\":*.ItemName,\t\"IsItem\":$boolean(*.IsItem),\t\"HasChildren\":$boolean(*.HasChildren)\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":1020,"wires":[["c7d068d5.6d5d08"]]},{"id":"9fb2f08f.b0814","type":"switch","z":"a0568e71.72952","name":"Raw?","property":"options.raw","propertyType":"msg","rules":[{"t":"true"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":210,"y":540,"wires":[["d6e1bf57.9810a"],["eb250a13.029f88"]]},{"id":"d6e1bf57.9810a","type":"xml","z":"a0568e71.72952","name":"","property":"payload","attr":"","chr":"","x":350,"y":520,"wires":[["a93b46ec.4c71e8"]]},{"id":"67d14704.f3e058","type":"template","z":"a0568e71.72952","name":"GetProperties","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<soap:Envelope \nxmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" \nxmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" \nxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n<soap:Body>\n\t<GetProperties ReturnPropertyValues=\"true\" xmlns=\"http://opcfoundation.org/webservices/XMLDA/1.0/\">\n\t\t<ItemIDs ItemName=\"{{{payload.ItemName}}}\" />\n\t\t<PropertyNames>accessRights</PropertyNames>\n\t\t<PropertyNames>dataType</PropertyNames>\n\t</GetProperties>\n</soap:Body>\n</soap:Envelope>\n","output":"str","x":600,"y":340,"wires":[["8daff6d4.368e78"]]},{"id":"8daff6d4.368e78","type":"change","z":"a0568e71.72952","name":"","rules":[],"action":"","property":"","from":"","to":"","reg":false,"x":875,"y":160,"wires":[["88ea2c40.56b0a"]],"l":false},{"id":"667f0f18.9d189","type":"link out","z":"a0568e71.72952","name":"","links":["12f2c851.6e7428"],"x":815,"y":1060,"wires":[]},{"id":"c93f193f.e756b8","type":"change","z":"a0568e71.72952","name":"GetPropertiesResponse","rules":[{"t":"set","p":"payload","pt":"msg","to":"**.GetPropertiesResponse.PropertyLists{\t\"ItemName\":*.ItemName,\tProperties[0].\"$\".Name: Properties[0].Value.\"_\",\tProperties[1].\"$\".Name: Properties[1].Value.\"_\"\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":1060,"wires":[["667f0f18.9d189"]]},{"id":"ed80557e.beba28","type":"switch","z":"a0568e71.72952","name":"Errors?","property":"$exists(**.Errors)","propertyType":"jsonata","rules":[{"t":"true"},{"t":"else"}],"checkall":"false","repair":false,"outputs":2,"x":660,"y":580,"wires":[["4771771.0d32c88"],["d3a2a2e0.14737"]]},{"id":"4771771.0d32c88","type":"change","z":"a0568e71.72952","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"**.Errors.*.ID","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":560,"wires":[["b821e0a3.f58ac"]]},{"id":"b821e0a3.f58ac","type":"function","z":"a0568e71.72952","name":"Error","func":"node.error(\"OPC XML Error: \" + msg.payload, msg);\n","outputs":0,"noerr":0,"x":1010,"y":560,"wires":[]},{"id":"d3a2a2e0.14737","type":"link out","z":"a0568e71.72952","name":"","links":["f635cca.b0f323"],"x":775,"y":620,"wires":[]},{"id":"f635cca.b0f323","type":"link in","z":"a0568e71.72952","name":"","links":["d3a2a2e0.14737"],"x":60,"y":880,"wires":[["8f627fde.e3c0f"]]},{"id":"a93b46ec.4c71e8","type":"link out","z":"a0568e71.72952","name":"","links":["12f2c851.6e7428"],"x":455,"y":520,"wires":[]},{"id":"3e321531.96860a","type":"catch","z":"a0568e71.72952","name":"","scope":["c93f193f.e756b8"],"uncaught":false,"x":370,"y":1100,"wires":[["6a21b5f2.bcb84c"]]},{"id":"ad008474.6637b8","type":"change","z":"a0568e71.72952","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"**.GetPropertiesResponse.PropertyLists","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":1100,"wires":[["667f0f18.9d189"]]},{"id":"6a21b5f2.bcb84c","type":"function","z":"a0568e71.72952","name":"Warning","func":"node.warn(\"Unexpected GetPropertiesResponse\")\nreturn msg;","outputs":1,"noerr":0,"x":500,"y":1100,"wires":[["ad008474.6637b8"]]},{"id":"4e95808c.a3252","type":"template","z":"a0568e71.72952","name":"Subscribe","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<soap:Envelope \nxmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" \nxmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" \nxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n<soap:Body>\n<Subscribe xmlns=\"http://opcfoundation.org/webservices/XMLDA/1.0/\"\n    ReturnValuesOnReply=\"true\" \n    SubscriptionPingRate=\"{{payload.SubscriptionPingRate}}\"\n    >\n    <Options\n        ReturnErrorText=\"true\"\n        ReturnItemTime=\"true\"\n        ReturnItemName=\"true\"\n        />\n    <ItemList\n        {{#payload.ItemPath}} ItemPath=\"{{{payload.ItemPath}}}\"{{/payload.ItemPath}}\n        {{#payload.requestedSamplingRate}} requestedSamplingRate=\"{{{payload.requestedSamplingRate}}}\"{{/payload.requestedSamplingRate}}\n        >\n        {{#payload.ItemList}}\n        <Items\n            ItemName=\"{{{ItemName}}}\"{{#ItemPath}} \n            ItemPath=\"{{{ItemPath}}}\"{{/ItemPath}}{{#ClientItemHandle}}\n            ClientItemHandle=\"{{{ClientItemHandle}}}\"{{/ClientItemHandle}}\n            />\n        {{/payload.ItemList}}\n    </ItemList>\n</Subscribe>\t  \n</soap:Body>\n</soap:Envelope>\n","output":"str","x":700,"y":180,"wires":[["8daff6d4.368e78"]]},{"id":"63e32c20.b76e94","type":"change","z":"a0568e71.72952","name":"env","rules":[{"t":"set","p":"action","pt":"msg","to":"($boolean($env('action'))) ? $env('action'): $boolean(action) ? action : \"GetStatus\"\t","tot":"jsonata"},{"t":"set","p":"url","pt":"msg","to":"($boolean($env('url'))) ? $env('url'): $boolean(url) ? url : \"\"\t","tot":"jsonata"},{"t":"set","p":"options","pt":"msg","to":"(\t$raw := (\"raw\" in $keys(options)) ? options.raw: $env('raw');\t{\"raw\":$boolean($raw)}\t)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":130,"y":180,"wires":[["700dcd8e.8e42d4"]]},{"id":"6335ea21.ad4a54","type":"change","z":"a0568e71.72952","name":"default","rules":[{"t":"set","p":"payload.SubscriptionPingRate","pt":"msg","to":"(\"SubscriptionPingRate\" in $keys(payload)) ? payload.SubscriptionPingRate: 60000\t","tot":"jsonata"},{"t":"set","p":"payload.requestedSamplingRate","pt":"msg","to":"(\"requestedSamplingRate\" in $keys(payload)) ? payload.requestedSamplingRate: 1000\t","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":180,"wires":[["4e95808c.a3252"]]},{"id":"b865212e.e1d0b","type":"change","z":"a0568e71.72952","name":"SubscribeResponse","rules":[{"t":"set","p":"payload","pt":"msg","to":"**.SubscribeResponse.{\t\"ServerSubHandle\":$.\"$\".ServerSubHandle\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":900,"wires":[["7d15a46f.55944c"]]},{"id":"7d15a46f.55944c","type":"link out","z":"a0568e71.72952","name":"","links":["12f2c851.6e7428"],"x":615,"y":900,"wires":[]},{"id":"957a24a0.800c58","type":"template","z":"a0568e71.72952","name":"SubscriptionPolledRefresh","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<soap:Envelope \nxmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" \nxmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" \nxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n<soap:Body>\n<SubscriptionPolledRefresh xmlns=\"http://opcfoundation.org/webservices/XMLDA/1.0/\" \n    ReturnAllItems=\"true\"> \n\t<Options ReturnErrorText=\"true\" ReturnItemTime=\"true\" ReturnItemName=\"true\" LocaleID=\"en\" /> \n\t<ServerSubHandles>{{{payload.ServerSubHandle}}}</ServerSubHandles>\n</SubscriptionPolledRefresh> \n</soap:Body>\n</soap:Envelope>\n","output":"str","x":640,"y":220,"wires":[["8daff6d4.368e78"]]},{"id":"9ffb90ef.88ccd","type":"template","z":"a0568e71.72952","name":"SubscriptionCancel","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<soap:Envelope \nxmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" \nxmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" \nxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n<soap:Body>\n<SubscriptionCancel xmlns=\"http://opcfoundation.org/webservices/XMLDA/1.0/\"\n\tServerSubHandle=\"{{{payload.ServerSubHandle}}}\"/> \n</soap:Body>\n</soap:Envelope>\n","output":"str","x":610,"y":260,"wires":[["8daff6d4.368e78"]]},{"id":"29092e47.e835a2","type":"template","z":"a0568e71.72952","name":"Write","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<soap:Envelope \nxmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" \nxmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" \nxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n<soap:Body>\n <Write xmlns=\"http://opcfoundation.org/webservices/XMLDA/1.0/\"  ReturnValuesOnReply=\"true\">\n  <Options\n    ReturnErrorText=\"true\"\n    ReturnItemTime=\"true\"\n    ReturnItemName=\"true\"\n    ReturnItemPath=\"true\"\n    LocaleID=\"en\" \n    />\n  <ItemList{{#payload.ItemPath}} ItemPath=\"{{{payload.ItemPath}}}\"{{/payload.ItemPath}}>\n    {{#payload.ItemList}}\n       <Items  ItemName=\"{{{ItemName}}}\"{{#ItemPath}} ItemPath=\"{{{ItemPath}}}\"{{/ItemPath}}{{#ClientItemHandle}} ClientItemHandle=\"{{{ClientItemHandle}}}\"{{/ClientItemHandle}}>\n            <Value xsi:type=\"{{type}}\">{{value}}</Value>\n        </Items>\n    {{/payload.ItemList}}\n  </ItemList>\n </Write>\t  \n</soap:Body>\n</soap:Envelope>\n","output":"str","x":570,"y":140,"wires":[["8daff6d4.368e78"]]},{"id":"700dcd8e.8e42d4","type":"change","z":"a0568e71.72952","name":"header","rules":[{"t":"set","p":"headers","pt":"msg","to":"{\t   \"SOAPAction\":\"http://opcfoundation.org/webservices/XMLDA/1.0/\" & action,\t   \"Content-Type\":\"text/xml\"\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":250,"y":180,"wires":[["60c6ce6.1d42f3"]]},{"id":"8e60984d.cfcf18","type":"change","z":"a0568e71.72952","name":"SubscriptionPolledRefreshResult","rules":[{"t":"set","p":"payload","pt":"msg","to":"**.SubscriptionPolledRefreshResponse.RItemList.Items.{\t\"ItemName\":$.\"$\".ItemName,\t\"ClientItemHandle\":$.\"$\".ClientItemHandle,\t\"Timestamp\":$.\"$\".Timestamp,\t\"value\": Value.\"_\",\t\"type\": Value.\"$\".\"xsi:type\",\t\"Quality\": Quality[0]\t}[]","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":940,"wires":[["6d7a466.2d910b8"]]},{"id":"6f1e64f4.bcbcac","type":"change","z":"a0568e71.72952","name":"SubscriptionCancelResponse","rules":[{"t":"set","p":"payload","pt":"msg","to":"**.SubscriptionCancelResponse.*.ClientRequestHandle{\t\"ClientRequestHandle\":$\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":980,"wires":[["2854f3b9.1b98fc"]]},{"id":"2854f3b9.1b98fc","type":"link out","z":"a0568e71.72952","name":"","links":["12f2c851.6e7428"],"x":675,"y":980,"wires":[]},{"id":"2e7040d.343cbc","type":"change","z":"a0568e71.72952","name":"ReadResponse","rules":[{"t":"set","p":"payload","pt":"msg","to":"**.WriteResponse.RItemList.Items.{\t\"ItemName\":$.\"$\".ItemName,\t\"Timestamp\":$.\"$\".Timestamp,\t\"value\": Value.\"_\",\t\"type\": Value.\"$\".\"xsi:type\"\t}[]","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":860,"wires":[["6d7a466.2d910b8"]]},{"id":"35897351.3c2adc","type":"change","z":"a0568e71.72952","name":"Status","rules":[{"t":"set","p":"payload","pt":"msg","to":"**.Status{\t\"StatusInfo\":StatusInfo,\t\"VendorInfo\":VendorInfo,\t\"SupportedLocaleIDs\":SupportedLocaleIDs,\t\"SupportedInterfaceVersions\":SupportedInterfaceVersions,\t\"StartTime\":*.StartTime,\t\"ProductVersion\":*.ProductVersion,\t\"ServerState\":$$.**.ServerState\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":780,"wires":[["a38f31fa.bd3fc"]]},{"id":"a38f31fa.bd3fc","type":"change","z":"a0568e71.72952","name":"string cleanup","rules":[{"t":"set","p":"payload","pt":"msg","to":"/* Straight strings or \"xsd:string\" */\t(\t$clean := function($o) {$join([\t$filter($o, function($v,$i,$a) {\"xsi:type\" in $keys($v.\"$\") ? true: false}).\"_\",\t$filter($o, function($v,$i,$a) {\"xsi:type\" in $keys($v.\"$\") ? false: true})\t], \",\")};\t{\t\"StatusInfo\": $clean(payload.StatusInfo),\t\"VendorInfo\": $clean(payload.VendorInfo),\t\"SupportedLocaleIDs\": $clean(payload.SupportedLocaleIDs),\t\"SupportedInterfaceVersions\": $clean(payload.SupportedInterfaceVersions),\t\"StartTime\":payload.StartTime,\t\"ProductVersion\":payload.ProductVersion,\t\"ServerState\":payload.ServerState\t}\t\t)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":780,"wires":[["f713686b.a04448"]]},{"id":"f6f2187d.f17ca8","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"9c2ef35c871b8ab3","type":"subflow:a0568e71.72952","z":"f6f2187d.f17ca8","name":"","env":[{"name":"action","value":"","type":"str"},{"name":"url","value":"http://info.advosol.com/XMLDADemo/TS_Sim/OpcDAGateway.asmx","type":"str"}],"x":320,"y":100,"wires":[["870388de85df3e0c"]]},{"id":"b9ae6a62d4a32958","type":"inject","z":"f6f2187d.f17ca8","name":"Read","props":[{"p":"payload"},{"p":"action","v":"Read","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"ItemList\":[{\"ItemName\":\"Dynamic.Analog Types.Fools.Rosencrantz\"},{\"ItemName\":\"Dynamic.Analog Types.Fools.Guildenstern\"}]}","payloadType":"json","x":150,"y":160,"wires":[["9c2ef35c871b8ab3"]]},{"id":"870388de85df3e0c","type":"debug","z":"f6f2187d.f17ca8","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":480,"y":100,"wires":[]},{"id":"8cbd7bf921501b5a","type":"inject","z":"f6f2187d.f17ca8","name":"Browse","props":[{"p":"payload"},{"p":"action","v":"Browse","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{}","payloadType":"json","x":150,"y":80,"wires":[["9c2ef35c871b8ab3"]]},{"id":"2b2e80fb7de3ac6a","type":"inject","z":"f6f2187d.f17ca8","name":"GetProperties","props":[{"p":"payload"},{"p":"action","v":"GetProperties","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"ItemName\":\"Dynamic.Analog Types.Fools.Rosencrantz\"}","payloadType":"json","x":130,"y":120,"wires":[["9c2ef35c871b8ab3"]]}]


From my experience the use of ItemPath sometimes behaves a bit unexpected, depending on server implementation. But from what I can tell from your screenshots i think you manage without it. Just modify url and ItemName and give it a try

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