IgnitionModuleDevelopmentCommunity / IgnitionNode-RED

Adds support for Node-RED
Apache License 2.0
31 stars 7 forks source link

Read node not working #2

Closed chrisegge closed 4 years ago

chrisegge commented 5 years ago

For some reason the "Read" Ignition Node is not working. The write Node is working. And when I use the same ignition server and Tag path in the read Node that is working in the Write Node it still does not work. The quality "Good" is false and it says it cannot locate tag. It has read and write privileges on all devices installed. Thanks for any help in advance.

iatraviscox commented 5 years ago

Can you post an example flow with the issue and your tag backup in Ignition?

chrisegge commented 5 years ago

[{"id":"782fb920.db95e8","type":"widgetlords-relay","z":"7855a877.f56ea8","name":"Relay Out 1","channel":"0","address":"0","chipenable":"0","x":1130,"y":100,"wires":[]},{"id":"9c40fe5a.f5677","type":"widgetlords-relay","z":"7855a877.f56ea8","name":"Relay Out 2","channel":"1","address":"0","chipenable":"0","x":1130,"y":160,"wires":[]},{"id":"6ac3de1b.ea453","type":"widgetlords-relay","z":"7855a877.f56ea8","name":"Relay Out 3","channel":"2","address":"0","chipenable":"0","x":1130,"y":220,"wires":[]},{"id":"40e1d5a2.d6c64c","type":"widgetlords-relay","z":"7855a877.f56ea8","name":"Relay Out 4","channel":"3","address":"0","chipenable":"0","x":1130,"y":280,"wires":[]},{"id":"72c51017.3f798","type":"widgetlords-relay","z":"7855a877.f56ea8","name":"Relay Out 1","channel":"0","address":"0","chipenable":"1","x":1130,"y":340,"wires":[]},{"id":"2581449d.6076cc","type":"widgetlords-relay","z":"7855a877.f56ea8","name":"Relay Out 2","channel":"1","address":"0","chipenable":"1","x":1130,"y":400,"wires":[]},{"id":"b2fcb0.ec54135","type":"widgetlords-relay","z":"7855a877.f56ea8","name":"Relay Out 3","channel":"2","address":"0","chipenable":"1","x":1130,"y":460,"wires":[]},{"id":"2a956020.23","type":"widgetlords-relay","z":"7855a877.f56ea8","name":"Relay Out 4","channel":"3","address":"0","chipenable":"1","x":1130,"y":520,"wires":[]},{"id":"8fa62423.fe46e8","type":"inject","z":"7855a877.f56ea8","name":"shutdown!","topic":"","payload":"","repeat":"","crontab":"","once":false,"x":100,"y":1760,"wires":[["90225991.c1c038"]]},{"id":"90225991.c1c038","type":"exec","z":"7855a877.f56ea8","command":"sudo poweroff #","append":"","useSpawn":"","name":"turn off Pi","x":314,"y":1759,"wires":[[],[],[]]},{"id":"8d4f5a5d.1062b8","type":"widgetlords-digital","z":"7855a877.f56ea8","name":"24VDC Input 1","channel":"0","address":"0","chipenable":"2","interval":"100","x":100,"y":700,"wires":[["62737bd.4632084"]]},{"id":"c6d566fd.375018","type":"widgetlords-digital","z":"7855a877.f56ea8","name":"24VDC Input 2","channel":"1","address":"0","chipenable":"2","interval":"100","x":100,"y":760,"wires":[["2ba55d32.95e422"]]},{"id":"3293375.d8a8fc8","type":"widgetlords-digital","z":"7855a877.f56ea8","name":"24VDC Input 3","channel":"2","address":"0","chipenable":"2","interval":"100","x":100,"y":820,"wires":[["cde8b4f1.fbc968"]]},{"id":"a29937a3.4f4588","type":"widgetlords-digital","z":"7855a877.f56ea8","name":"24VDC Input 4","channel":"3","address":"0","chipenable":"2","interval":"100","x":100,"y":880,"wires":[["9eb424f2.54c818"]]},{"id":"7188d255.23c5fc","type":"widgetlords-digital","z":"7855a877.f56ea8","name":"24VDC Input 5","channel":"4","address":"0","chipenable":"2","interval":"100","x":100,"y":940,"wires":[["79e27856.03a138"]]},{"id":"eb373f8b.42c67","type":"widgetlords-digital","z":"7855a877.f56ea8","name":"24VDC Input 6","channel":"5","address":"0","chipenable":"2","interval":"100","x":100,"y":1000,"wires":[["2ab15b9c.a437b4"]]},{"id":"536e122b.9bc56c","type":"widgetlords-digital","z":"7855a877.f56ea8","name":"24VDC Input 7","channel":"6","address":"0","chipenable":"2","interval":"100","x":100,"y":1060,"wires":[["c42f4f2f.345b3"]]},{"id":"44a58f64.ad427","type":"widgetlords-digital","z":"7855a877.f56ea8","name":"24VDC Input 8","channel":"7","address":"0","chipenable":"2","interval":"100","x":100,"y":1120,"wires":[["2a5b9f26.33aef"]]},{"id":"2ba55d32.95e422","type":"rbe","z":"7855a877.f56ea8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":290,"y":760,"wires":[["df93e552.492158"]]},{"id":"cde8b4f1.fbc968","type":"rbe","z":"7855a877.f56ea8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":290,"y":820,"wires":[["ccf7f6dc.a258f8"]]},{"id":"9eb424f2.54c818","type":"rbe","z":"7855a877.f56ea8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":290,"y":880,"wires":[["f8ae55d7.9bf158"]]},{"id":"79e27856.03a138","type":"rbe","z":"7855a877.f56ea8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":290,"y":940,"wires":[["168a1246.90cc9e"]]},{"id":"2ab15b9c.a437b4","type":"rbe","z":"7855a877.f56ea8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":290,"y":1000,"wires":[["7bbf372b.ba5018"]]},{"id":"c42f4f2f.345b3","type":"rbe","z":"7855a877.f56ea8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":290,"y":1060,"wires":[["cd1ba340.9045b"]]},{"id":"2a5b9f26.33aef","type":"rbe","z":"7855a877.f56ea8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":290,"y":1120,"wires":[["cccecef5.07352"]]},{"id":"d489ffe8.ab107","type":"switch","z":"7855a877.f56ea8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":true,"outputs":2,"x":490,"y":700,"wires":[["b738fa5d.ad90d8"],["bb370ebc.75132"]]},{"id":"b738fa5d.ad90d8","type":"ignition-tag-write","z":"7855a877.f56ea8","server":"7446865.6542978","value":"","valueType":"msg.payload","tagPath":"Edge Nodes/Opto22/MCCRoom/GroovEdgeBox/MCC_Room/L1_Seasoning_SPI_DIN_Discrete_Input[0]","tagValue":"1","name":"","x":1100,"y":600,"wires":[[]]},{"id":"bb370ebc.75132","type":"ignition-tag-write","z":"7855a877.f56ea8","server":"7446865.6542978","value":"","valueType":"msg.payload","tagPath":"Edge Nodes/Opto22/MCCRoom/GroovEdgeBox/MCC_Room/L1_Seasoning_SPI_DIN_Discrete_Input[0]","tagValue":"0","name":"","x":1100,"y":640,"wires":[[]]},{"id":"ced908eb.c82f28","type":"python3-function","z":"7855a877.f56ea8","name":"Line 1 Seasoning Bool Array Read","func":"\n'''\nthe following import is only necessary because eip.py is not in this directory\n'''\nimport sys\nsys.path.append('/home/pi/Documents')\n\n\n'''\nRead a little faster by providing the data type\nup front\n\nThis only really makes sense to do if you have to\nread a lot of unique tags. Typically, when you read a\ntag, it has to fetch the data type first. This only\nhappens the first time you read a uniuqe tag name. Once\nwe have read a tag, we remember the type.\n\nIf you have, for example, 1000 tags to read and they are\nall unique, you would have have to fetch the data type,\nthen the value, which is quite a bit of overhead.\n\nIf you pass the data type up front, it will skip that\ninitial read...\n'''\nfrom pylogix import PLC\n\ntag_list = ['L1_Seasoning_SPI_DIN_Discrete_Output.0', 'L1_Seasoning_SPI_DIN_Discrete_Output.1',\n'L1_Seasoning_SPI_DIN_Discrete_Output.2','L1_Seasoning_SPI_DIN_Discrete_Output.3',\n'L1_Seasoning_SPI_DIN_Discrete_Output.4','L1_Seasoning_SPI_DIN_Discrete_Output.5',\n'L1_Seasoning_SPI_DIN_Discrete_Output.6','L1_Seasoning_SPI_DIN_Discrete_Output.7',]\n\nwith PLC() as comm:\n comm = PLC()\n comm.IPAddress = '192.168.10.21'\n value = comm.Read(tag_list)\n print(value)\n comm.Close()\n\n \nmsg = {'payload':value}\nreturn msg;\n\n","outputs":1,"x":380,"y":100,"wires":[["df5c3876.0c4ff8","44690c80.8d0644","747419df.0e4c98","d7f8b5cf.f37838","46378bcc.30b4c4","2f03357e.6983da","137850f5.863d4f","492c84eb.66d22c"]]},{"id":"df5c3876.0c4ff8","type":"change","z":"7855a877.f56ea8","name":"","rules":[{"t":"move","p":"payload[0]","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":100,"wires":[["782fb920.db95e8"]]},{"id":"44690c80.8d0644","type":"change","z":"7855a877.f56ea8","name":"","rules":[{"t":"move","p":"payload[1]","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":140,"wires":[["9c40fe5a.f5677"]]},{"id":"747419df.0e4c98","type":"change","z":"7855a877.f56ea8","name":"","rules":[{"t":"move","p":"payload[2]","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":180,"wires":[["6ac3de1b.ea453"]]},{"id":"d7f8b5cf.f37838","type":"change","z":"7855a877.f56ea8","name":"","rules":[{"t":"move","p":"payload[3]","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":220,"wires":[["40e1d5a2.d6c64c"]]},{"id":"46378bcc.30b4c4","type":"change","z":"7855a877.f56ea8","name":"","rules":[{"t":"move","p":"payload[4]","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":260,"wires":[["72c51017.3f798"]]},{"id":"2f03357e.6983da","type":"change","z":"7855a877.f56ea8","name":"","rules":[{"t":"move","p":"payload[5]","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":300,"wires":[["2581449d.6076cc"]]},{"id":"137850f5.863d4f","type":"change","z":"7855a877.f56ea8","name":"","rules":[{"t":"move","p":"payload[6]","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":340,"wires":[["b2fcb0.ec54135"]]},{"id":"492c84eb.66d22c","type":"change","z":"7855a877.f56ea8","name":"","rules":[{"t":"move","p":"payload[7]","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":380,"wires":[["2a956020.23"]]},{"id":"62737bd.4632084","type":"rbe","z":"7855a877.f56ea8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":290,"y":700,"wires":[["d489ffe8.ab107"]]},{"id":"d346d24b.f7f27","type":"inject","z":"7855a877.f56ea8","name":"","topic":"","payload":"","payloadType":"date","repeat":".50","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":100,"wires":[["ced908eb.c82f28"]]},{"id":"df93e552.492158","type":"switch","z":"7855a877.f56ea8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":true,"outputs":2,"x":490,"y":760,"wires":[["691c0fed.4b84"],["2cc1682d.7e86f8"]]},{"id":"ccf7f6dc.a258f8","type":"switch","z":"7855a877.f56ea8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":true,"outputs":2,"x":490,"y":820,"wires":[["6c75f70a.021088"],["e0424366.46f1b"]]},{"id":"f8ae55d7.9bf158","type":"switch","z":"7855a877.f56ea8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":true,"outputs":2,"x":490,"y":880,"wires":[["dd67dbfc.5c1cf8"],["937cea71.264268"]]},{"id":"168a1246.90cc9e","type":"switch","z":"7855a877.f56ea8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":true,"outputs":2,"x":490,"y":940,"wires":[["a4aef6f4.b521f8"],["e22b04f7.3d35b8"]]},{"id":"7bbf372b.ba5018","type":"switch","z":"7855a877.f56ea8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":true,"outputs":2,"x":490,"y":1000,"wires":[["b645c0e2.47ab9"],["d7298e0b.debc8"]]},{"id":"cd1ba340.9045b","type":"switch","z":"7855a877.f56ea8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":true,"outputs":2,"x":490,"y":1060,"wires":[["d48679f5.0416f8"],["ca1f4cfa.fb80d"]]},{"id":"cccecef5.07352","type":"switch","z":"7855a877.f56ea8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":true,"outputs":2,"x":490,"y":1120,"wires":[["ba82b19f.6aaa5"],["544184a4.448b9c"]]},{"id":"691c0fed.4b84","type":"ignition-tag-write","z":"7855a877.f56ea8","server":"7446865.6542978","value":"","valueType":"msg.payload","tagPath":"Edge Nodes/Opto22/MCCRoom/GroovEdgeBox/MCC_Room/L1_Seasoning_SPI_DIN_Discrete_Input[1]","tagValue":"1","name":"","x":1100,"y":700,"wires":[[]]},{"id":"2cc1682d.7e86f8","type":"ignition-tag-write","z":"7855a877.f56ea8","server":"7446865.6542978","value":"","valueType":"msg.payload","tagPath":"Edge Nodes/Opto22/MCCRoom/GroovEdgeBox/MCC_Room/L1_Seasoning_SPI_DIN_Discrete_Input[1]","tagValue":"0","name":"","x":1100,"y":740,"wires":[[]]},{"id":"6c75f70a.021088","type":"ignition-tag-write","z":"7855a877.f56ea8","server":"7446865.6542978","value":"","valueType":"msg.payload","tagPath":"Edge Nodes/Opto22/MCCRoom/GroovEdgeBox/MCC_Room/L1_Seasoning_SPI_DIN_Discrete_Input[2]","tagValue":"1","name":"","x":1100,"y":800,"wires":[[]]},{"id":"e0424366.46f1b","type":"ignition-tag-write","z":"7855a877.f56ea8","server":"7446865.6542978","value":"","valueType":"msg.payload","tagPath":"Edge Nodes/Opto22/MCCRoom/GroovEdgeBox/MCC_Room/L1_Seasoning_SPI_DIN_Discrete_Input[2]","tagValue":"0","name":"","x":1100,"y":840,"wires":[[]]},{"id":"dd67dbfc.5c1cf8","type":"ignition-tag-write","z":"7855a877.f56ea8","server":"7446865.6542978","value":"","valueType":"msg.payload","tagPath":"Edge Nodes/Opto22/MCCRoom/GroovEdgeBox/MCC_Room/L1_Seasoning_SPI_DIN_Discrete_Input[3]","tagValue":"1","name":"","x":1100,"y":900,"wires":[[]]},{"id":"937cea71.264268","type":"ignition-tag-write","z":"7855a877.f56ea8","server":"7446865.6542978","value":"","valueType":"msg.payload","tagPath":"Edge Nodes/Opto22/MCCRoom/GroovEdgeBox/MCC_Room/L1_Seasoning_SPI_DIN_Discrete_Input[3]","tagValue":"0","name":"","x":1100,"y":940,"wires":[[]]},{"id":"a4aef6f4.b521f8","type":"ignition-tag-write","z":"7855a877.f56ea8","server":"7446865.6542978","value":"","valueType":"msg.payload","tagPath":"Edge Nodes/Opto22/MCCRoom/GroovEdgeBox/MCC_Room/L1_Seasoning_SPI_DIN_Discrete_Input[4]","tagValue":"1","name":"","x":1100,"y":1000,"wires":[[]]},{"id":"e22b04f7.3d35b8","type":"ignition-tag-write","z":"7855a877.f56ea8","server":"7446865.6542978","value":"","valueType":"msg.payload","tagPath":"Edge Nodes/Opto22/MCCRoom/GroovEdgeBox/MCC_Room/L1_Seasoning_SPI_DIN_Discrete_Input[4]","tagValue":"0","name":"","x":1100,"y":1040,"wires":[[]]},{"id":"b645c0e2.47ab9","type":"ignition-tag-write","z":"7855a877.f56ea8","server":"7446865.6542978","value":"","valueType":"msg.payload","tagPath":"Edge Nodes/Opto22/MCCRoom/GroovEdgeBox/MCC_Room/L1_Seasoning_SPI_DIN_Discrete_Input[5]","tagValue":"1","name":"","x":1100,"y":1100,"wires":[[]]},{"id":"d7298e0b.debc8","type":"ignition-tag-write","z":"7855a877.f56ea8","server":"7446865.6542978","value":"","valueType":"msg.payload","tagPath":"Edge Nodes/Opto22/MCCRoom/GroovEdgeBox/MCC_Room/L1_Seasoning_SPI_DIN_Discrete_Input[5]","tagValue":"0","name":"","x":1100,"y":1140,"wires":[[]]},{"id":"d48679f5.0416f8","type":"ignition-tag-write","z":"7855a877.f56ea8","server":"7446865.6542978","value":"","valueType":"msg.payload","tagPath":"Edge Nodes/Opto22/MCCRoom/GroovEdgeBox/MCC_Room/L1_Seasoning_SPI_DIN_Discrete_Input[6]","tagValue":"1","name":"","x":1100,"y":1200,"wires":[[]]},{"id":"ca1f4cfa.fb80d","type":"ignition-tag-write","z":"7855a877.f56ea8","server":"7446865.6542978","value":"","valueType":"msg.payload","tagPath":"Edge Nodes/Opto22/MCCRoom/GroovEdgeBox/MCC_Room/L1_Seasoning_SPI_DIN_Discrete_Input[6]","tagValue":"0","name":"","x":1100,"y":1240,"wires":[[]]},{"id":"ba82b19f.6aaa5","type":"ignition-tag-write","z":"7855a877.f56ea8","server":"7446865.6542978","value":"","valueType":"msg.payload","tagPath":"Edge Nodes/Opto22/MCCRoom/GroovEdgeBox/MCC_Room/L1_Seasoning_SPI_DIN_Discrete_Input[7]","tagValue":"1","name":"","x":1100,"y":1300,"wires":[[]]},{"id":"544184a4.448b9c","type":"ignition-tag-write","z":"7855a877.f56ea8","server":"7446865.6542978","value":"","valueType":"msg.payload","tagPath":"Edge Nodes/Opto22/MCCRoom/GroovEdgeBox/MCC_Room/L1_Seasoning_SPI_DIN_Discrete_Input[7]","tagValue":"0","name":"","x":1100,"y":1340,"wires":[[]]},{"id":"e15a2e7e.97403","type":"ignition-tag-read","z":"7855a877.f56ea8","server":"7446865.6542978","value":"","valueType":"msg.payload","tagPath":"Edge Nodes/Opto22/MCCRoom/GroovEdgeBox/MCC_Room/L1_Seasoning_SPI_DIN_Discrete_Output[0]","name":"","x":440,"y":1560,"wires":[["3e1eb7cc.c90ee8"]]},{"id":"34c2c661.dcdb8a","type":"inject","z":"7855a877.f56ea8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":130,"y":1500,"wires":[["e15a2e7e.97403"]]},{"id":"3e1eb7cc.c90ee8","type":"debug","z":"7855a877.f56ea8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":760,"y":1560,"wires":[]},{"id":"7446865.6542978","type":"ignition-server","z":"","hostname":"192.168.10.130","port":"8088","ssl":false,"defaultTagProvider":"edge","name":""}]

That is the flow I am using right now. I added the read node at the bottom of the flow. I am not sure how to do a tag backup. i am using only two INT tags that i am using as two Byte arrays.

chrisegge commented 5 years ago

i think i figured out, it says not found when trying to read a value from a BYTE array but if i make a derived tag from that value in that BYTE array it reads the tag fine