[ { "id": "70d7630e97bb7b16", "type": "tab", "label": "Flow 1", "disabled": false, "info": "", "env": [] }, { "id": "a9e721cdd7be2775", "type": "ads-client-connection-status", "z": "70d7630e97bb7b16", "name": "", "connection": "4bf895418c29201f", "showInput": false, "inputs": 0, "x": 820, "y": 120, "wires": [ [ "f840b76ce09d7c10" ] ] }, { "id": "f840b76ce09d7c10", "type": "debug", "z": "70d7630e97bb7b16", "name": "Connection state changed", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "\"Connection state changed - connected: \" & payload", "targetType": "jsonata", "statusVal": "", "statusType": "auto", "x": 1470, "y": 120, "wires": [] }, { "id": "155536051f40e0cd", "type": "ads-client-read-value", "z": "70d7630e97bb7b16", "name": "", "connection": "4bf895418c29201f", "path": "GVL_Read.ComplexTypes.STRUCT_", "x": 890, "y": 200, "wires": [ [ "a2ed2c0c6ff32862" ] ] }, { "id": "4821a294f45c315b", "type": "inject", "z": "70d7630e97bb7b16", "name": "Read value", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 430, "y": 200, "wires": [ [ "155536051f40e0cd" ] ] }, { "id": "a2ed2c0c6ff32862", "type": "debug", "z": "70d7630e97bb7b16", "name": "Read value result", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1450, "y": 200, "wires": [] }, { "id": "02ee96180de117e4", "type": "ads-client-write-value", "z": "70d7630e97bb7b16", "name": "", "connection": "4bf895418c29201f", "path": "GVL_Write.ComplexTypes.STRUCT_", "autoFill": false, "x": 890, "y": 280, "wires": [ [ "29554dab2352092c" ] ] }, { "id": "3b4a313d4fe21723", "type": "inject", "z": "70d7630e97bb7b16", "name": "Write value", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "{\"BOOL_\":true,\"BOOL_2\":false,\"BYTE_\":255,\"WORD_\":65535,\"DWORD_\":4294967295,\"SINT_\":127,\"SINT_2\":-128,\"USINT_\":255,\"INT_\":32767,\"INT_2\":-32768,\"UINT_\":65535,\"DINT_\":2147483647,\"DINT_2\":-2147483648,\"UDINT_\":4294967295,\"REAL_\":3.3999999521443642e+38,\"REAL_2\":-3.3999999521443642e+38,\"REAL_3\":75483.546875,\"REAL_4\":-75483.546875,\"STRING_\":\"A test string ääöö!!@@\",\"STRING_2\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque bibendum mauris vel metus rutrum, sed gravida justo dignissim. Aenean et nisi cursus, auctor mi vel, posuere enim. Suspendisse ultricies mauris in finibus tristique. Nullam turpis duis.\",\"STRING_3\":\"ベッコフ\",\"DATE_\":\"2106-02-06T00:00:00.000Z\",\"DT_\":\"2106-02-06T06:28:15.000Z\",\"DT_2\":\"2106-02-06T06:28:15.000Z\",\"TOD_\":4294967295,\"TOD_2\":4294967295,\"TIME_\":4294967295,\"LWORD_\":184467440,\"LINT_\":922337203,\"LINT_2\":-92233720,\"ULINT_\":18446744,\"LREAL_\":1.7e+308,\"LREAL_2\":-1.7e+308,\"LREAL_3\":75483.546875,\"LREAL_4\":-75483.546875,\"WSTRING_\":\"A test wstring ääöö!!@@ ẞẟΔش\",\"WSTRING_2\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque bibendum mauris vel metus rutrum, sed gravida justo dignissim. Aenean et nisi cursus, auctor mi vel, posuere enim. Suspendisse ultricies mauris in finibus tristique. Nullam turpis duis.\",\"LTIME_\":1844674407}", "payloadType": "json", "x": 420, "y": 280, "wires": [ [ "02ee96180de117e4" ] ] }, { "id": "29554dab2352092c", "type": "debug", "z": "70d7630e97bb7b16", "name": "Write value result", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1450, "y": 280, "wires": [] }, { "id": "18f7fe40ead64162", "type": "comment", "z": "70d7630e97bb7b16", "name": "", "info": "NOTE: Skipping writing of BigInt values (using smaller values for 64 bit variables)", "x": 420, "y": 320, "wires": [] }, { "id": "e52901bda28bb4de", "type": "ads-client-subscribe-value", "z": "70d7630e97bb7b16", "name": "", "connection": "4bf895418c29201f", "path": "GVL_Subscription.NumericValue_100ms", "cycleTime": "500", "mode": "onchange", "maxDelay": 0, "retryInterval": 2000, "controlSubscription": true, "resubscribeTimeout": 2000, "inputs": 1, "x": 910, "y": 440, "wires": [ [ "707e181f37b769a6" ] ] }, { "id": "707e181f37b769a6", "type": "debug", "z": "70d7630e97bb7b16", "name": "Subscription value updated", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1480, "y": 440, "wires": [] }, { "id": "dc58e8e518d12d1a", "type": "inject", "z": "70d7630e97bb7b16", "name": "Subscribe", "props": [ { "p": "subscribe", "v": "true", "vt": "bool" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "x": 420, "y": 420, "wires": [ [ "e52901bda28bb4de" ] ] }, { "id": "e1b1b9605a9b2131", "type": "inject", "z": "70d7630e97bb7b16", "name": "Unsubscribe", "props": [ { "p": "subscribe", "v": "false", "vt": "bool" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "x": 430, "y": 460, "wires": [ [ "e52901bda28bb4de" ] ] }, { "id": "5c845610c47de5cf", "type": "ads-client-subscribe-value", "z": "70d7630e97bb7b16", "name": "", "connection": "4bf895418c29201f", "path": "GVL_Subscription.NumericValue_1000ms", "cycleTime": "5000", "mode": "cyclic", "maxDelay": 0, "retryInterval": 2000, "controlSubscription": false, "resubscribeTimeout": 2000, "inputs": 0, "x": 920, "y": 360, "wires": [ [ "1b1a7db181ad3c7f" ] ] }, { "id": "1b1a7db181ad3c7f", "type": "debug", "z": "70d7630e97bb7b16", "name": "Subscription value updated (every 5s)", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1510, "y": 360, "wires": [] }, { "id": "70ee1adca17e9ff0", "type": "ads-client-invoke-rpc-method", "z": "70d7630e97bb7b16", "name": "", "connection": "4bf895418c29201f", "path": "GVL_RPC.RpcBlock", "method": "Calculator", "x": 900, "y": 540, "wires": [ [ "94cd83ec0e49660a" ] ] }, { "id": "49db61bc28ef771c", "type": "inject", "z": "70d7630e97bb7b16", "name": "Invoke", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "{\"Value1\":3.14,\"Value2\":1000}", "payloadType": "json", "x": 410, "y": 540, "wires": [ [ "70ee1adca17e9ff0" ] ] }, { "id": "94cd83ec0e49660a", "type": "debug", "z": "70d7630e97bb7b16", "name": "RPC method result", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 1450, "y": 540, "wires": [] }, { "id": "e67b0ac2b006cc2f", "type": "inject", "z": "70d7630e97bb7b16", "name": "Read PLC runtime state", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 460, "y": 620, "wires": [ [ "fa509cac631b3186" ] ] }, { "id": "76327008e8338c7e", "type": "debug", "z": "70d7630e97bb7b16", "name": "Read PLC runtime state result", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "result", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1490, "y": 620, "wires": [] }, { "id": "6b74bbda20d97d6a", "type": "ads-client-get-symbols", "z": "70d7630e97bb7b16", "name": "", "connection": "4bf895418c29201f", "x": 770, "y": 860, "wires": [ [ "95a4df8ffe63fd16" ] ] }, { "id": "f37ad0f9ec3c37dd", "type": "inject", "z": "70d7630e97bb7b16", "name": "Read TC system state", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 460, "y": 700, "wires": [ [ "103a06ce2e411e61" ] ] }, { "id": "103a06ce2e411e61", "type": "ads-client-read-tc-system-state", "z": "70d7630e97bb7b16", "name": "", "connection": "4bf895418c29201f", "x": 800, "y": 700, "wires": [ [ "1f2d1cd441becf26" ] ] }, { "id": "1f2d1cd441becf26", "type": "debug", "z": "70d7630e97bb7b16", "name": "Read TC system state result", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "result", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1480, "y": 700, "wires": [] }, { "id": "b00e68f8e63b94f2", "type": "inject", "z": "70d7630e97bb7b16", "name": "Get all symbols", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 440, "y": 860, "wires": [ [ "6b74bbda20d97d6a" ] ] }, { "id": "95a4df8ffe63fd16", "type": "debug", "z": "70d7630e97bb7b16", "name": "Get all symbols result", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1460, "y": 860, "wires": [] }, { "id": "72dcf981de72a51a", "type": "ads-client-get-symbol", "z": "70d7630e97bb7b16", "name": "", "connection": "4bf895418c29201f", "path": "GVL_Read.ComplexTypes", "x": 860, "y": 940, "wires": [ [ "ddf579090afe6a75" ] ] }, { "id": "bea3f8feeec175b9", "type": "inject", "z": "70d7630e97bb7b16", "name": "Get symbol", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 430, "y": 940, "wires": [ [ "72dcf981de72a51a" ] ] }, { "id": "ddf579090afe6a75", "type": "debug", "z": "70d7630e97bb7b16", "name": "Get symbol result", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1450, "y": 940, "wires": [] }, { "id": "256f67769ed2796a", "type": "ads-client-read-raw", "z": "70d7630e97bb7b16", "name": "", "connection": "4bf895418c29201f", "indexGroup": "", "indexOffset": "", "size": "", "x": 950, "y": 1100, "wires": [ [ "4a539ec25a28731e", "c0c655b28e168de1" ] ] }, { "id": "b8dae94d8efb1fe8", "type": "inject", "z": "70d7630e97bb7b16", "name": "Read raw", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 420, "y": 1020, "wires": [ [ "24debebc5ac104c9" ] ] }, { "id": "24debebc5ac104c9", "type": "ads-client-get-symbol", "z": "70d7630e97bb7b16", "name": "", "connection": "4bf895418c29201f", "path": "GVL_Read.ComplexTypes.STRUCT_", "x": 890, "y": 1020, "wires": [ [ "d6c1f68ab2853147" ] ] }, { "id": "4a539ec25a28731e", "type": "debug", "z": "70d7630e97bb7b16", "name": "Read raw result", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1440, "y": 1100, "wires": [] }, { "id": "d6c1f68ab2853147", "type": "change", "z": "70d7630e97bb7b16", "name": "", "rules": [ { "t": "set", "p": "topic", "pt": "msg", "to": "payload", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 750, "y": 1100, "wires": [ [ "256f67769ed2796a" ] ] }, { "id": "419ee140f7e6bed8", "type": "inject", "z": "70d7630e97bb7b16", "name": "Write raw", "props": [ { "p": "value", "v": "{\"BOOL_\":true,\"BOOL_2\":false,\"BYTE_\":255,\"WORD_\":65535,\"DWORD_\":4294967295,\"SINT_\":127,\"SINT_2\":-128,\"USINT_\":255,\"INT_\":32767,\"INT_2\":-32768,\"UINT_\":65535,\"DINT_\":2147483647,\"DINT_2\":-2147483648,\"UDINT_\":4294967295,\"REAL_\":3.3999999521443642e+38,\"REAL_2\":-3.3999999521443642e+38,\"REAL_3\":75483.546875,\"REAL_4\":-75483.546875,\"STRING_\":\"A test string ääöö!!@@\",\"STRING_2\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque bibendum mauris vel metus rutrum, sed gravida justo dignissim. Aenean et nisi cursus, auctor mi vel, posuere enim. Suspendisse ultricies mauris in finibus tristique. Nullam turpis duis.\",\"STRING_3\":\"ベッコフ\",\"DATE_\":\"2106-02-06T00:00:00.000Z\",\"DT_\":\"2106-02-06T06:28:15.000Z\",\"DT_2\":\"2106-02-06T06:28:15.000Z\",\"TOD_\":4294967295,\"TOD_2\":4294967295,\"TIME_\":4294967295,\"LWORD_\":184467440,\"LINT_\":922337203,\"LINT_2\":-92233720,\"ULINT_\":18446744,\"LREAL_\":1.7e+308,\"LREAL_2\":-1.7e+308,\"LREAL_3\":75483.546875,\"LREAL_4\":-75483.546875,\"WSTRING_\":\"A test wstring ääöö!!@@ ẞẟΔش\",\"WSTRING_2\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque bibendum mauris vel metus rutrum, sed gravida justo dignissim. Aenean et nisi cursus, auctor mi vel, posuere enim. Suspendisse ultricies mauris in finibus tristique. Nullam turpis duis.\",\"LTIME_\":1844674407}", "vt": "json" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "x": 420, "y": 1280, "wires": [ [ "b2593dff652fd200" ] ] }, { "id": "5d09f80a24e68123", "type": "ads-client-convert-to-raw", "z": "70d7630e97bb7b16", "name": "", "connection": "4bf895418c29201f", "dataTypeName": "ST_StandardTypes", "autoFill": false, "x": 1050, "y": 1360, "wires": [ [ "dc4df9567bdaebd9", "b42cdd98a22c5528" ] ] }, { "id": "c0c655b28e168de1", "type": "ads-client-convert-from-raw", "z": "70d7630e97bb7b16", "name": "", "connection": "4bf895418c29201f", "dataTypeName": "ST_StandardTypes", "x": 860, "y": 1180, "wires": [ [ "6c13da76dc92725f" ] ] }, { "id": "6c13da76dc92725f", "type": "debug", "z": "70d7630e97bb7b16", "name": "Convert from raw result", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1470, "y": 1180, "wires": [] }, { "id": "dc4df9567bdaebd9", "type": "debug", "z": "70d7630e97bb7b16", "name": "Convert to raw result", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 1460, "y": 1360, "wires": [] }, { "id": "b2593dff652fd200", "type": "ads-client-get-symbol", "z": "70d7630e97bb7b16", "name": "", "connection": "4bf895418c29201f", "path": "GVL_Read.ComplexTypes.STRUCT_", "x": 890, "y": 1280, "wires": [ [ "07165f4d1ebb3677" ] ] }, { "id": "07165f4d1ebb3677", "type": "change", "z": "70d7630e97bb7b16", "name": "", "rules": [ { "t": "set", "p": "topic", "pt": "msg", "to": "payload", "tot": "msg" }, { "t": "set", "p": "payload", "pt": "msg", "to": "value", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 760, "y": 1360, "wires": [ [ "5d09f80a24e68123" ] ] }, { "id": "b42cdd98a22c5528", "type": "ads-client-write-raw", "z": "70d7630e97bb7b16", "name": "", "connection": "4bf895418c29201f", "indexGroup": "", "indexOffset": "", "x": 770, "y": 1440, "wires": [] }, { "id": "fa509cac631b3186", "type": "ads-client-read-plc-runtime-state", "z": "70d7630e97bb7b16", "name": "", "connection": "4bf895418c29201f", "x": 810, "y": 620, "wires": [ [ "76327008e8338c7e" ] ] }, { "id": "c8ef5b103a091c2b", "type": "comment", "z": "70d7630e97bb7b16", "name": "", "info": "1. Get symbol for variable\n2. Read value for the variable using symbol address\n3. Convert to Javascript object", "x": 420, "y": 1060, "wires": [] }, { "id": "4fbefe934bd04538", "type": "comment", "z": "70d7630e97bb7b16", "name": "", "info": "1. Get symbol for variable\n2. Conver Javascript object to a raw value\n3. Write the raw value using symbol address", "x": 420, "y": 1320, "wires": [] }, { "id": "8e4da152943c7319", "type": "ads-client-read-tc-system-extended-state", "z": "70d7630e97bb7b16", "name": "", "connection": "4bf895418c29201f", "x": 830, "y": 780, "wires": [ [ "99b32d54002cb572" ] ] }, { "id": "afb1c46a7be519d2", "type": "inject", "z": "70d7630e97bb7b16", "name": "Read TC system extended state", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 490, "y": 780, "wires": [ [ "8e4da152943c7319" ] ] }, { "id": "99b32d54002cb572", "type": "debug", "z": "70d7630e97bb7b16", "name": "Read TC system state extended result", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "result", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1510, "y": 780, "wires": [] }, { "id": "4bf895418c29201f", "type": "ads-client-connection", "name": "TwinCAT", "allowHalfOpen": false, "autoReconnect": true, "connectionCheckInterval": "", "connectionDownDelay": "", "convertDatesToJavascript": true, "hideConsoleWarnings": false, "localAddress": "", "localAdsPort": "", "localAmsNetId": "", "localTcpPort": "", "monitorPlcSymbolVersion": true, "objectifyEnumerations": true, "rawClient": false, "readAndCacheDataTypes": false, "readAndCacheSymbols": false, "reconnectInterval": "", "routerAddress": "", "routerTcpPort": "", "targetAdsPort": 851, "targetAmsNetId": "192.168.4.1.1.1", "timeoutDelay": "" }, { "id": "63ac10cb36d49608", "type": "global-config", "env": [], "modules": { "node-red-contrib-ads-client": "2.0.0" } } ]