[
    {
        "id": "46f42e44ec9df5aa",
        "type": "tab",
        "label": "plc control",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "486022d0d96c0a86",
        "type": "modbus-write",
        "z": "46f42e44ec9df5aa",
        "name": "M0",
        "showStatusActivities": false,
        "showErrors": false,
        "showWarnings": true,
        "unitid": "1",
        "dataType": "Coil",
        "adr": "0",
        "quantity": "1",
        "server": "44d2be7fa82ab90f",
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 550,
        "y": 200,
        "wires": [
            [],
            []
        ]
    },
    {
        "id": "84ae70de1c544e0e",
        "type": "ui_button",
        "z": "46f42e44ec9df5aa",
        "name": "",
        "group": "180751e22a858b11",
        "order": 1,
        "width": 9,
        "height": 1,
        "passthru": false,
        "label": "button for M0 (start)",
        "tooltip": "",
        "color": "",
        "bgcolor": "",
        "className": "",
        "icon": "",
        "payload": "",
        "payloadType": "str",
        "topic": "topic",
        "topicType": "msg",
        "x": 190,
        "y": 200,
        "wires": [
            [
                "13a4190d02793a79"
            ]
        ]
    },
    {
        "id": "13a4190d02793a79",
        "type": "trigger",
        "z": "46f42e44ec9df5aa",
        "name": "",
        "op1": "1",
        "op2": "0",
        "op1type": "num",
        "op2type": "num",
        "duration": "500",
        "extend": false,
        "overrideDelay": false,
        "units": "ms",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 380,
        "y": 200,
        "wires": [
            [
                "486022d0d96c0a86"
            ]
        ]
    },
    {
        "id": "73d9cf588ef65135",
        "type": "debug",
        "z": "46f42e44ec9df5aa",
        "name": "debug 11",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 800,
        "y": 360,
        "wires": []
    },
    {
        "id": "5d7227b0bc2c8232",
        "type": "change",
        "z": "46f42e44ec9df5aa",
        "name": "",
        "rules": [
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "false",
                "fromt": "bool",
                "to": "no",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 600,
        "y": 360,
        "wires": [
            [
                "73d9cf588ef65135",
                "56a89e063fac9de9"
            ]
        ]
    },
    {
        "id": "39377f22e95ed364",
        "type": "debug",
        "z": "46f42e44ec9df5aa",
        "name": "debug 12",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 560,
        "y": 440,
        "wires": []
    },
    {
        "id": "29761d9e4dc11290",
        "type": "modbus-read",
        "z": "46f42e44ec9df5aa",
        "name": "Output M2",
        "topic": "",
        "showStatusActivities": false,
        "logIOActivities": false,
        "showErrors": false,
        "showWarnings": true,
        "unitid": "1",
        "dataType": "Coil",
        "adr": "2",
        "quantity": "1",
        "rate": "1",
        "rateUnit": "s",
        "delayOnStart": false,
        "enableDeformedMessages": false,
        "startDelayTime": "",
        "server": "44d2be7fa82ab90f",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "x": 200,
        "y": 360,
        "wires": [
            [
                "33a2dfbb17a93736",
                "aa29eac5df33bf94"
            ],
            []
        ]
    },
    {
        "id": "33a2dfbb17a93736",
        "type": "debug",
        "z": "46f42e44ec9df5aa",
        "name": "debug 13",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 380,
        "y": 400,
        "wires": []
    },
    {
        "id": "aa29eac5df33bf94",
        "type": "function",
        "z": "46f42e44ec9df5aa",
        "name": "function 5",
        "func": "msg.payload = msg.payload[0];\n\nlet last = context.get('lastValue');\nlet current = msg.payload;\nif (last === undefined) {\n    context.set('lastValue', current);\n    return null;\n}\nif (current !== last) {\n    context.set('lastValue', current);\n    return msg;\n}\nreturn null;\n",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 380,
        "y": 360,
        "wires": [
            [
                "39377f22e95ed364",
                "5d7227b0bc2c8232",
                "d79ded85397db9cc"
            ]
        ]
    },
    {
        "id": "20ecd78db23c80a1",
        "type": "modbus-write",
        "z": "46f42e44ec9df5aa",
        "name": "M1",
        "showStatusActivities": false,
        "showErrors": false,
        "showWarnings": true,
        "unitid": "1",
        "dataType": "Coil",
        "adr": "1",
        "quantity": "1",
        "server": "44d2be7fa82ab90f",
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 550,
        "y": 280,
        "wires": [
            [],
            []
        ]
    },
    {
        "id": "26864d69c988b383",
        "type": "ui_button",
        "z": "46f42e44ec9df5aa",
        "name": "",
        "group": "180751e22a858b11",
        "order": 2,
        "width": 9,
        "height": 1,
        "passthru": false,
        "label": "button for M1 (stop)",
        "tooltip": "",
        "color": "",
        "bgcolor": "",
        "className": "",
        "icon": "",
        "payload": "",
        "payloadType": "str",
        "topic": "topic",
        "topicType": "msg",
        "x": 190,
        "y": 280,
        "wires": [
            [
                "1dca0aae00949b23"
            ]
        ]
    },
    {
        "id": "1dca0aae00949b23",
        "type": "trigger",
        "z": "46f42e44ec9df5aa",
        "name": "",
        "op1": "1",
        "op2": "0",
        "op1type": "num",
        "op2type": "num",
        "duration": "500",
        "extend": false,
        "overrideDelay": false,
        "units": "ms",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 380,
        "y": 280,
        "wires": [
            [
                "20ecd78db23c80a1"
            ]
        ]
    },
    {
        "id": "d79ded85397db9cc",
        "type": "ui_led2",
        "z": "46f42e44ec9df5aa",
        "order": 5,
        "group": "180751e22a858b11",
        "width": 5,
        "height": 1,
        "label": "led (green-red)",
        "property": "payload",
        "labelPlacement": "left",
        "labelAlignment": "left",
        "colorForValue": [
            {
                "color": "#ff0000",
                "value": "false",
                "valueType": "bool"
            },
            {
                "color": "#008000",
                "value": "true",
                "valueType": "bool"
            }
        ],
        "allowColorForValueInMessage": false,
        "shape": "circle",
        "showGlow": true,
        "name": "",
        "x": 550,
        "y": 400,
        "wires": []
    },
    {
        "id": "56a89e063fac9de9",
        "type": "ui_led",
        "z": "46f42e44ec9df5aa",
        "order": 3,
        "group": "180751e22a858b11",
        "width": 5,
        "height": 1,
        "label": "led (green only)",
        "labelPlacement": "left",
        "labelAlignment": "left",
        "colorForValue": [
            {
                "color": "#ff0000",
                "value": "false",
                "valueType": "bool"
            },
            {
                "color": "#008000",
                "value": "true",
                "valueType": "bool"
            }
        ],
        "allowColorForValueInMessage": false,
        "shape": "circle",
        "showGlow": true,
        "name": "",
        "x": 790,
        "y": 400,
        "wires": []
    },
    {
        "id": "11f59126b7f6aa3b",
        "type": "ui_spacer",
        "z": "46f42e44ec9df5aa",
        "name": "spacer",
        "group": "180751e22a858b11",
        "order": 4,
        "width": 4,
        "height": 1
    },
    {
        "id": "3daaecd1506826ca",
        "type": "ui_spacer",
        "z": "46f42e44ec9df5aa",
        "name": "spacer",
        "group": "180751e22a858b11",
        "order": 6,
        "width": 4,
        "height": 1
    },
    {
        "id": "44d2be7fa82ab90f",
        "type": "modbus-client",
        "name": "plc se",
        "clienttype": "tcp",
        "bufferCommands": true,
        "stateLogEnabled": false,
        "queueLogEnabled": false,
        "failureLogEnabled": true,
        "tcpHost": "192.168.100.106",
        "tcpPort": 502,
        "tcpType": "DEFAULT",
        "serialPort": "/dev/ttyUSB",
        "serialType": "RTU-BUFFERD",
        "serialBaudrate": 9600,
        "serialDatabits": 8,
        "serialStopbits": 1,
        "serialParity": "none",
        "serialConnectionDelay": 100,
        "serialAsciiResponseStartDelimiter": "0x3A",
        "unit_id": 1,
        "commandDelay": 1,
        "clientTimeout": 1000,
        "reconnectOnTimeout": true,
        "reconnectTimeout": 2000,
        "parallelUnitIdsAllowed": true,
        "showErrors": false,
        "showWarnings": true,
        "showLogs": true
    },
    {
        "id": "180751e22a858b11",
        "type": "ui_group",
        "name": "plc",
        "tab": "10ae2c4b566b4f96",
        "order": 1,
        "disp": true,
        "width": 9,
        "collapse": false,
        "className": ""
    },
    {
        "id": "10ae2c4b566b4f96",
        "type": "ui_tab",
        "name": "plc control",
        "icon": "dashboard",
        "order": 3,
        "disabled": false,
        "hidden": false
    },
    {
        "id": "751cfba3ae59b26c",
        "type": "global-config",
        "env": [],
        "modules": {
            "node-red-contrib-modbus": "5.45.2",
            "node-red-dashboard": "3.6.6",
            "node-red-contrib-ui-led2": "0.4.19",
            "node-red-contrib-ui-led": "0.4.11"
        }
    }
]