Pastebin
Retrouvez, créez et partagez vos snippets en temps réel.
Rechercher un Pastebin
Aucun paste trouvé.
Créer un paste
Pastebin
Blog
chwabidigou
[ { "id": "7db3b30dc762d89d", "type": "tab", "label": "Flux 1", "disabled": false, "info": "", "env": [] }, { "id": "962e396eb1cfda52", "type": "modbus-read", "z": "7db3b30dc762d89d", "name": "", "topic": "", "showStatusActivities": false, "logIOActivities": false, "showErrors": false, "showWarnings": true, "unitid": "", "dataType": "HoldingRegister", "adr": "7", "quantity": "1", "rate": "1", "rateUnit": "s", "delayOnStart": false, "enableDeformedMessages": false, "startDelayTime": "", "server": "ae9de57610f83d51", "useIOFile": false, "ioFile": "", "useIOForPayload": false, "emptyMsgOnFail": false, "x": 510, "y": 180, "wires": [ [ "9cfc4cb6f67b1b27", "20f5d957ae77b38e" ], [] ] }, { "id": "8ff0d63055044647", "type": "modbus-write", "z": "7db3b30dc762d89d", "name": "", "showStatusActivities": false, "showErrors": false, "showWarnings": true, "unitid": "", "dataType": "HoldingRegister", "adr": "0", "quantity": "1", "server": "ae9de57610f83d51", "emptyMsgOnFail": false, "keepMsgProperties": false, "delayOnStart": false, "startDelayTime": "", "x": 580, "y": 480, "wires": [ [], [] ] }, { "id": "d93fe35d26d48180", "type": "modbus-write", "z": "7db3b30dc762d89d", "name": "", "showStatusActivities": false, "showErrors": false, "showWarnings": true, "unitid": "", "dataType": "HoldingRegister", "adr": "1", "quantity": "1", "server": "ae9de57610f83d51", "emptyMsgOnFail": false, "keepMsgProperties": false, "delayOnStart": false, "startDelayTime": "", "x": 580, "y": 640, "wires": [ [], [] ] }, { "id": "ce828ccdecd9109f", "type": "change", "z": "7db3b30dc762d89d", "name": "", "rules": [ { "t": "change", "p": "payload", "pt": "msg", "from": "true", "fromt": "bool", "to": "1", "tot": "num" }, { "t": "change", "p": "payload", "pt": "msg", "from": "false", "fromt": "bool", "to": "0", "tot": "num" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 340, "y": 480, "wires": [ [ "8ff0d63055044647" ] ] }, { "id": "f5ca9eb9a94e734c", "type": "ui_switch", "z": "7db3b30dc762d89d", "name": "", "label": "Enable", "tooltip": "", "group": "6ed62c5740adf91e", "order": 1, "width": 3, "height": 1, "passthru": true, "decouple": "false", "topic": "payload", "topicType": "msg", "style": "", "onvalue": "true", "onvalueType": "bool", "onicon": "", "oncolor": "", "offvalue": "false", "offvalueType": "bool", "officon": "", "offcolor": "", "animate": false, "className": "", "x": 160, "y": 480, "wires": [ [ "ce828ccdecd9109f" ] ] }, { "id": "909c41e3c05782c2", "type": "ui_gauge", "z": "7db3b30dc762d89d", "name": "", "group": "6ed62c5740adf91e", "order": 13, "width": 15, "height": 9, "gtype": "gage", "title": "Vitesse réelle", "label": "units", "format": "{{value}}", "min": "0", "max": "500", "colors": [ "#00b500", "#e6e600", "#ca3838" ], "seg1": "", "seg2": "", "diff": false, "className": "", "x": 960, "y": 280, "wires": [] }, { "id": "169c37afd3826d09", "type": "ui_switch", "z": "7db3b30dc762d89d", "name": "", "label": "Forward", "tooltip": "", "group": "6ed62c5740adf91e", "order": 2, "width": 3, "height": 1, "passthru": true, "decouple": "false", "topic": "payload", "topicType": "msg", "style": "", "onvalue": "true", "onvalueType": "bool", "onicon": "", "oncolor": "", "offvalue": "false", "offvalueType": "bool", "officon": "", "offcolor": "", "animate": false, "className": "", "x": 160, "y": 640, "wires": [ [ "05772583f7ad0c66", "780e67431780fe3e" ] ] }, { "id": "05772583f7ad0c66", "type": "change", "z": "7db3b30dc762d89d", "name": "", "rules": [ { "t": "change", "p": "payload", "pt": "msg", "from": "true", "fromt": "bool", "to": "1", "tot": "num" }, { "t": "change", "p": "payload", "pt": "msg", "from": "false", "fromt": "bool", "to": "0", "tot": "num" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 340, "y": 640, "wires": [ [ "d93fe35d26d48180" ] ] }, { "id": "dd7c6db86fd66ff3", "type": "ui_chart", "z": "7db3b30dc762d89d", "name": "", "group": "6ed62c5740adf91e", "order": 7, "width": 0, "height": 0, "label": "Graphique des consignes et de la vitesse réelle", "chartType": "line", "legend": "false", "xformat": "HH:mm:ss", "interpolate": "linear", "nodata": "", "dot": false, "ymin": "0", "ymax": "500", "removeOlder": "30", "removeOlderPoints": "", "removeOlderUnit": "1", "cutout": 0, "useOneColor": false, "useUTC": false, "colors": [ "#1f77b4", "#aec7e8", "#ff7f0e", "#2ca02c", "#98df8a", "#d62728", "#ff9896", "#9467bd", "#c5b0d5" ], "outputs": 1, "useDifferentColor": false, "className": "", "x": 1060, "y": 180, "wires": [ [] ] }, { "id": "9cfc4cb6f67b1b27", "type": "function", "z": "7db3b30dc762d89d", "name": "function 1", "func": "//var arr = msg.payload;\n//var msgs = [];\n//for (var i=0; i<arr.length; i++){\n// msgs.push({payload: arr[i], topic:\"valeur\"+i});\n//}\n//return [msgs];\nlet v = msg.payload;\n\n// (Optionnel) Correction 16 bits si le variateur déborde\nif (v > 32767) {\n v = v - 65536;\n}\n\n// Sortie graphique = valeur absolue\nmsg.payload = Math.abs(v);\n\nreturn msg;", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 700, "y": 180, "wires": [ [ "dd7c6db86fd66ff3" ] ] }, { "id": "780e67431780fe3e", "type": "change", "z": "7db3b30dc762d89d", "name": "", "rules": [ { "t": "change", "p": "payload", "pt": "msg", "from": "true", "fromt": "bool", "to": "0", "tot": "num" }, { "t": "change", "p": "payload", "pt": "msg", "from": "false", "fromt": "bool", "to": "1", "tot": "num" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 340, "y": 740, "wires": [ [ "76fd91c77aa3b587" ] ] }, { "id": "76fd91c77aa3b587", "type": "modbus-write", "z": "7db3b30dc762d89d", "name": "", "showStatusActivities": false, "showErrors": false, "showWarnings": true, "unitid": "", "dataType": "HoldingRegister", "adr": "2", "quantity": "1", "server": "ae9de57610f83d51", "emptyMsgOnFail": false, "keepMsgProperties": false, "delayOnStart": false, "startDelayTime": "", "x": 580, "y": 740, "wires": [ [], [] ] }, { "id": "c310a63eec748d9e", "type": "ui_slider", "z": "7db3b30dc762d89d", "name": "", "label": "Vitesse", "tooltip": "", "group": "6ed62c5740adf91e", "order": 4, "width": 7, "height": 1, "passthru": true, "outs": "all", "topic": "payload", "topicType": "msg", "min": 0, "max": "500", "step": 1, "className": "", "x": 160, "y": 840, "wires": [ [ "8fbc9c2f13abe202" ] ] }, { "id": "62c67822a8c5c83f", "type": "ui_gauge", "z": "7db3b30dc762d89d", "name": "", "group": "6ed62c5740adf91e", "order": 14, "width": 0, "height": 0, "gtype": "gage", "title": "Vitesse consigne", "label": "units", "format": "{{value}}", "min": 0, "max": "500", "colors": [ "#00b500", "#e6e600", "#ca3838" ], "seg1": "", "seg2": "", "diff": false, "className": "", "x": 570, "y": 840, "wires": [] }, { "id": "72f4fd0ec00dc2f1", "type": "modbus-write", "z": "7db3b30dc762d89d", "name": "", "showStatusActivities": false, "showErrors": false, "showWarnings": true, "unitid": "", "dataType": "HoldingRegister", "adr": "5", "quantity": "1", "server": "ae9de57610f83d51", "emptyMsgOnFail": false, "keepMsgProperties": false, "delayOnStart": false, "startDelayTime": "", "x": 560, "y": 900, "wires": [ [], [] ] }, { "id": "8fbc9c2f13abe202", "type": "function", "z": "7db3b30dc762d89d", "name": "function 2", "func": "// On suppose que la vitesse arrive dans msg.payload\nlet vitesse = msg.payload;\n\n// Etat du bloc provenant de l'adresse 169c37afd3826d09\nlet etat = msg[\"169c37afd3826d09\"]; // adapter si nécessaire\n\n// Si l’état est FALSE → vitesse négative\nif (etat === false) {\n vitesse = -Math.abs(vitesse);\n} else {\n vitesse = Math.abs(vitesse);\n}\n\n// On renvoie la nouvelle valeur\nmsg.payload = vitesse;\nreturn msg;", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 340, "y": 860, "wires": [ [ "62c67822a8c5c83f", "72f4fd0ec00dc2f1" ] ] }, { "id": "20f5d957ae77b38e", "type": "function", "z": "7db3b30dc762d89d", "name": "function 3", "func": "let v = msg.payload;\n\n// (Optionnel) Correction 16 bits si le variateur déborde\nif (v > 32767) {\n v = v - 65536;\n}\n\n// Sortie graphique = valeur absolue\nmsg.payload = Math.abs(v);\n\nreturn msg;", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 720, "y": 280, "wires": [ [ "909c41e3c05782c2" ] ] }, { "id": "ca3bd22391bd992c", "type": "ui_spacer", "z": "7db3b30dc762d89d", "name": "spacer", "group": "6ed62c5740adf91e", "order": 3, "width": 1, "height": 1 }, { "id": "3ed2c6a3160e4cb5", "type": "ui_spacer", "z": "7db3b30dc762d89d", "name": "spacer", "group": "6ed62c5740adf91e", "order": 5, "width": 1, "height": 1 }, { "id": "92b5a9aa72ce6704", "type": "ui_spacer", "z": "7db3b30dc762d89d", "name": "spacer", "group": "6ed62c5740adf91e", "order": 6, "width": 15, "height": 1 }, { "id": "3bb16743387e7454", "type": "ui_spacer", "z": "7db3b30dc762d89d", "name": "spacer", "group": "6ed62c5740adf91e", "order": 8, "width": 15, "height": 1 }, { "id": "9ca88197bb1939e1", "type": "ui_spacer", "z": "7db3b30dc762d89d", "name": "spacer", "group": "6ed62c5740adf91e", "order": 9, "width": 15, "height": 1 }, { "id": "c731e1349ea36754", "type": "ui_spacer", "z": "7db3b30dc762d89d", "name": "spacer", "group": "6ed62c5740adf91e", "order": 10, "width": 15, "height": 1 }, { "id": "40e57df9417c32d6", "type": "ui_spacer", "z": "7db3b30dc762d89d", "name": "spacer", "group": "6ed62c5740adf91e", "order": 11, "width": 15, "height": 1 }, { "id": "8d9e2b6ae16c946d", "type": "ui_spacer", "z": "7db3b30dc762d89d", "name": "spacer", "group": "6ed62c5740adf91e", "order": 12, "width": 15, "height": 1 }, { "id": "ae9de57610f83d51", "type": "modbus-client", "name": "", "clienttype": "tcp", "bufferCommands": true, "stateLogEnabled": false, "queueLogEnabled": false, "failureLogEnabled": true, "tcpHost": "10.172.6.145", "tcpPort": 502, "tcpType": "DEFAULT", "serialPort": "/dev/ttyUSB", "serialType": "RTU-BUFFERD", "serialBaudrate": 9600, "serialDatabits": 8, "serialStopbits": 1, "serialParity": "none", "serialConnectionDelay": 100, "serialAsciiResponseStartDelimiter": "0x3A", "unit_id": 247, "commandDelay": 1, "clientTimeout": 1000, "reconnectOnTimeout": true, "reconnectTimeout": 2000, "parallelUnitIdsAllowed": true, "showErrors": false, "showWarnings": true, "showLogs": true }, { "id": "6ed62c5740adf91e", "type": "ui_group", "name": "Main", "tab": "7e77918b2f96f16a", "order": 1, "disp": true, "width": 15, "collapse": false, "className": "" }, { "id": "7e77918b2f96f16a", "type": "ui_tab", "name": "Home", "icon": "dashboard", "disabled": false, "hidden": false }, { "id": "9f811cc9a25a1a1f", "type": "global-config", "env": [], "modules": { "node-red-contrib-modbus": "5.45.2", "node-red-dashboard": "3.6.6" } } ]
Créé il y a 1 mois.