Pastebin
Retrouvez, créez et partagez vos snippets en temps réel.
Rechercher un Pastebin
Aucun paste trouvé.
Créer un paste
Pastebin
Blog
fsdsdsfdsfdsfd
[ { "id": "7db3b30dc762d89d", "type": "tab", "label": "Flux 1", "disabled": false, "info": "", "env": [] }, { "id": "58990d5d91e8ace7", "type": "ui_template", "z": "7db3b30dc762d89d", "group": "6ed62c5740adf91e", "name": "", "order": 2, "width": 30, "height": 6, "format": "<style>\n /* --- THEME BLANC / CLAIR --- */\n .atv-panel {\n font-family: 'Helvetica Neue', Arial, sans-serif;\n background: #ffffff;\n color: #333;\n padding: 15px;\n border-radius: 8px;\n border: 1px solid #e0e0e0;\n box-shadow: 0 2px 12px rgba(0,0,0,0.08);\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n }\n\n .header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-bottom: 2px solid #f0f0f0;\n padding-bottom: 10px;\n margin-bottom: 15px;\n }\n .title { font-weight: 600; color: #555; font-size: 14px; text-transform: uppercase; }\n\n /* Zone Centrale : Vitesse Réelle */\n .lcd-screen {\n background: #f9f9f9;\n border: 1px solid #ddd;\n border-radius: 6px;\n padding: 10px;\n margin-bottom: 20px;\n display: flex;\n flex-direction: column; /* Affichage vertical */\n align-items: center;\n justify-content: center;\n }\n \n /* Ligne Fréquence (Gros) */\n .lcd-main {\n font-family: 'Roboto Mono', monospace;\n font-size: 32px;\n font-weight: bold;\n color: #27ae60;\n line-height: 1.2;\n }\n\n /* Ligne RPM (Plus petit) */\n .lcd-sub {\n font-family: 'Roboto Mono', monospace;\n font-size: 18px;\n color: #7f8c8d; /* Gris bleuté */\n font-weight: 500;\n margin-top: 5px;\n border-top: 1px dashed #ccc; /* Petite séparation */\n padding-top: 5px;\n width: 80%;\n text-align: center;\n }\n\n .unit { font-size: 14px; color: #999; font-weight: normal; }\n\n /* Boutons */\n .controls-row {\n display: flex;\n gap: 12px;\n margin-bottom: 20px;\n }\n .btn-custom {\n flex: 1;\n padding: 14px;\n border: 1px solid #ddd;\n border-radius: 6px;\n background: #f0f0f0;\n color: #666;\n font-weight: 600;\n cursor: pointer;\n transition: all 0.2s;\n text-transform: uppercase;\n font-size: 18px;\n display: flex;\n flex-direction: column;\n align-items: center;\n box-shadow: 0 2px 4px rgba(0,0,0,0.05);\n }\n\n /* États Actifs */\n .btn-custom.active-green {\n background: #2ecc71; color: white; border-color: #27ae60;\n box-shadow: 0 4px 8px rgba(46, 204, 113, 0.4);\n }\n .btn-custom.active-blue {\n background: #3498db; color: white; border-color: #2980b9;\n box-shadow: 0 4px 8px rgba(52, 152, 219, 0.4);\n }\n .btn-custom.active-red {\n background: #e74c3c; color: white; border-color: #c0392b;\n box-shadow: 0 4px 8px rgba(231, 76, 60, 0.4);\n }\n\n /* Slider */\n .slider-container {\n padding: 10px 0;\n background: #fafafa;\n border-radius: 8px;\n padding: 10px;\n border: 1px solid #eee;\n }\n input[type=range] { -webkit-appearance: none; width: 100%; background: transparent; }\n input[type=range]::-webkit-slider-thumb {\n -webkit-appearance: none; height: 22px; width: 22px; border-radius: 50%;\n background: #3498db; cursor: pointer; margin-top: -9px;\n box-shadow: 0 0 5px rgba(0,0,0,0.2);\n }\n input[type=range]::-webkit-slider-runnable-track {\n width: 100%; height: 4px; background: #ddd; border-radius: 2px;\n }\n .slider-infos {\n display: flex; justify-content: space-between; font-size: 20px;\n color: #888; margin-top: 8px; font-weight: 500;\n }\n</style>\n\n<div class=\"atv-panel\">\n \n <div class=\"header\">\n <span class=\"title\">Contrôle Moteur</span>\n <div style=\"width:10px; height:10px; border-radius:50%;\" \n ng-style=\"{'background': status.enable ? '#2ecc71' : '#ccc'}\">\n </div>\n </div>\n\n <div class=\"lcd-screen\">\n <div class=\"lcd-main\">\n {{ displaySpeed }} <span class=\"unit\">Hz (x10)</span>\n </div>\n \n <div class=\"lcd-sub\">\n {{ displaySpeed * 3 }} <span class=\"unit\">tr/min</span>\n </div>\n </div>\n\n <div class=\"controls-row\">\n <button class=\"btn-custom\" \n ng-class=\"{'active-green': status.enable}\" \n ng-click=\"toggleEnable()\">\n {{ status.enable ? 'MARCHE' : 'ARRÊT' }}\n </button>\n\n <button class=\"btn-custom\" \n ng-class=\"{'active-blue': status.forward, 'active-red': !status.forward}\" \n ng-click=\"toggleDirection()\">\n {{ status.forward ? 'AVANT' : 'ARRIÈRE' }}\n </button>\n </div>\n\n <div class=\"slider-container\" style=\"opacity: {{ status.enable ? 1 : 0.5 }}\">\n <input type=\"range\" min=\"0\" max=\"500\" step=\"1\" \n ng-model=\"status.speedRef\" \n ng-change=\"updateSpeed()\"\n ng-disabled=\"!status.enable\">\n \n <div class=\"slider-infos\">\n <span>0</span>\n <span style=\"color:#3498db\">Consigne : {{ status.speedRef }}</span>\n <span>500</span>\n </div>\n </div>\n\n</div>\n\n<script>\n (function(scope) {\n scope.status = scope.status || {\n enable: false,\n forward: true,\n speedRef: 0\n };\n scope.displaySpeed = 0; \n\n // Surveillance des messages pour mettre à jour l'affichage\n scope.$watch('msg', function(data) {\n // Si données reçues (feedback ou chiffre simple), on met à jour l'écran\n if (data && (data.topic === 'feedback' || typeof data.payload === 'number')) {\n scope.displaySpeed = data.payload; \n }\n });\n\n scope.toggleEnable = function() {\n scope.status.enable = !scope.status.enable;\n if(!scope.status.enable) {\n scope.status.speedRef = 0;\n scope.send({ topic: \"set_speed\", payload: 0 }); \n }\n scope.send({ topic: \"set_enable\", payload: scope.status.enable ? 1 : 0 });\n };\n\n scope.toggleDirection = function() {\n scope.status.forward = !scope.status.forward;\n scope.send({ topic: \"set_direction\", payload: scope.status.forward ? \"fwd\" : \"rev\" });\n };\n\n scope.updateSpeed = function() {\n scope.send({ topic: \"set_speed\", payload: parseInt(scope.status.speedRef) });\n };\n\n })(scope);\n</script>", "storeOutMessages": true, "fwdInMessages": true, "resendOnRefresh": true, "templateScope": "local", "className": "", "x": 780, "y": 860, "wires": [ [ "d21246df6867b476" ] ] }, { "id": "bcec64413cfd8d7f", "type": "modbus-read", "z": "7db3b30dc762d89d", "name": "", "topic": "", "showStatusActivities": false, "logIOActivities": false, "showErrors": false, "showWarnings": true, "unitid": "", "dataType": "HoldingRegister", "adr": "7", "quantity": "1", "rate": "500", "rateUnit": "ms", "delayOnStart": false, "enableDeformedMessages": false, "startDelayTime": "", "server": "ae9de57610f83d51", "useIOFile": false, "ioFile": "", "useIOForPayload": false, "emptyMsgOnFail": false, "x": 130, "y": 860, "wires": [ [ "86319b5b183ded37" ], [] ] }, { "id": "087a86f570b89fcd", "type": "change", "z": "7db3b30dc762d89d", "name": "", "rules": [ { "t": "set", "p": "topic", "pt": "msg", "to": "feedback", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 540, "y": 860, "wires": [ [ "58990d5d91e8ace7" ] ] }, { "id": "d21246df6867b476", "type": "switch", "z": "7db3b30dc762d89d", "name": "", "property": "topic", "propertyType": "msg", "rules": [ { "t": "eq", "v": "set_enable", "vt": "str" }, { "t": "eq", "v": "set_direction", "vt": "str" }, { "t": "eq", "v": "set_speed", "vt": "str" } ], "checkall": "true", "repair": false, "outputs": 3, "x": 980, "y": 860, "wires": [ [ "ece499057282dd4f" ], [ "b69b3b2c0f8677ea" ], [ "b796d6117b212efa", "1b7c104b88e0759e" ] ] }, { "id": "ece499057282dd4f", "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": 1180, "y": 780, "wires": [ [], [] ] }, { "id": "b796d6117b212efa", "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": 1180, "y": 940, "wires": [ [], [] ] }, { "id": "b69b3b2c0f8677ea", "type": "function", "z": "7db3b30dc762d89d", "name": "function 1", "func": "// Si demande Forward\nif (msg.payload === \"fwd\") {\n return [\n { payload: 1, topic: \"write_fwd\" }, // Vers Adr 1\n { payload: 0, topic: \"write_rev\" } // Vers Adr 2\n ];\n}\n// Si demande Reverse\nelse {\n return [\n { payload: 0, topic: \"write_fwd\" }, // Vers Adr 1\n { payload: 1, topic: \"write_rev\" } // Vers Adr 2\n ];\n}", "outputs": 2, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1140, "y": 860, "wires": [ [ "eae17d065fe3b8e7" ], [ "8596f8d9064a8b66" ] ] }, { "id": "eae17d065fe3b8e7", "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": 1400, "y": 840, "wires": [ [], [] ] }, { "id": "8596f8d9064a8b66", "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": 1400, "y": 900, "wires": [ [], [] ] }, { "id": "86319b5b183ded37", "type": "function", "z": "7db3b30dc762d89d", "name": "function 2", "func": "// 1. Récupérer la valeur brute (ex: 65500 pour l'arrière)\nlet rawValue = msg.payload;\nlet signedValue = rawValue;\n\n// 2. Conversion Modbus 16-bit (Complément à 2)\n// Si la valeur est > 32767, c'est que le variateur envoie un nombre négatif\n// (Exemple : 65535 équivaut à -1)\nif (rawValue > 32767) {\n signedValue = rawValue - 65536;\n}\n\n// 3. Convertir en positif pour l'affichage (Valeur Absolue)\n// Cela transforme -300 en 300 pour que ton afficheur vert et ton graphique\n// restent dans l'échelle 0-500.\nmsg.payload = Math.abs(signedValue);\n\nreturn msg;", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 300, "y": 860, "wires": [ [ "087a86f570b89fcd", "4d34263f7fe61456" ] ] }, { "id": "1b7c104b88e0759e", "type": "ui_chart", "z": "7db3b30dc762d89d", "name": "", "group": "6ed62c5740adf91e", "order": 1, "width": 30, "height": 11, "label": "Consigne et vitesse", "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": 1190, "y": 1080, "wires": [ [] ] }, { "id": "4d34263f7fe61456", "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": 680, "y": 1100, "wires": [ [ "1b7c104b88e0759e" ] ] }, { "id": "087bd0e55e5735eb", "type": "ui_spacer", "z": "7db3b30dc762d89d", "name": "spacer", "group": "6ed62c5740adf91e", "order": 3, "width": 30, "height": 1 }, { "id": "68e07674a67e276f", "type": "ui_spacer", "z": "7db3b30dc762d89d", "name": "spacer", "group": "6ed62c5740adf91e", "order": 4, "width": 30, "height": 1 }, { "id": "85b9488f757b00f3", "type": "ui_spacer", "z": "7db3b30dc762d89d", "name": "spacer", "group": "6ed62c5740adf91e", "order": 5, "width": 30, "height": 1 }, { "id": "367eeb6f2830e9f1", "type": "ui_spacer", "z": "7db3b30dc762d89d", "name": "spacer", "group": "6ed62c5740adf91e", "order": 6, "width": 30, "height": 1 }, { "id": "0a380afbf8082f8d", "type": "ui_spacer", "z": "7db3b30dc762d89d", "name": "spacer", "group": "6ed62c5740adf91e", "order": 7, "width": 30, "height": 1 }, { "id": "d5aa5b06fb2b0993", "type": "ui_spacer", "z": "7db3b30dc762d89d", "name": "spacer", "group": "6ed62c5740adf91e", "order": 8, "width": 30, "height": 1 }, { "id": "56f993bb15c99019", "type": "ui_spacer", "z": "7db3b30dc762d89d", "name": "spacer", "group": "6ed62c5740adf91e", "order": 9, "width": 30, "height": 1 }, { "id": "389beaa24afe9290", "type": "ui_spacer", "z": "7db3b30dc762d89d", "name": "spacer", "group": "6ed62c5740adf91e", "order": 10, "width": 30, "height": 1 }, { "id": "999935182ebad271", "type": "ui_spacer", "z": "7db3b30dc762d89d", "name": "spacer", "group": "6ed62c5740adf91e", "order": 11, "width": 30, "height": 1 }, { "id": "67b84842eb91c778", "type": "ui_spacer", "z": "7db3b30dc762d89d", "name": "spacer", "group": "6ed62c5740adf91e", "order": 12, "width": 30, "height": 1 }, { "id": "2eee8f043f5818ab", "type": "ui_spacer", "z": "7db3b30dc762d89d", "name": "spacer", "group": "6ed62c5740adf91e", "order": 13, "width": 30, "height": 1 }, { "id": "7a4043dc915922a7", "type": "ui_spacer", "z": "7db3b30dc762d89d", "name": "spacer", "group": "6ed62c5740adf91e", "order": 14, "width": 30, "height": 1 }, { "id": "69c4b5d188238555", "type": "ui_spacer", "z": "7db3b30dc762d89d", "name": "spacer", "group": "6ed62c5740adf91e", "order": 15, "width": 30, "height": 1 }, { "id": "08ec72686f88e7e1", "type": "ui_spacer", "z": "7db3b30dc762d89d", "name": "spacer", "group": "6ed62c5740adf91e", "order": 16, "width": 30, "height": 1 }, { "id": "fa79ff0cf8cddc18", "type": "ui_spacer", "z": "7db3b30dc762d89d", "name": "spacer", "group": "6ed62c5740adf91e", "order": 18, "width": 5, "height": 1 }, { "id": "42eb264431d78ffd", "type": "ui_spacer", "z": "7db3b30dc762d89d", "name": "spacer", "group": "6ed62c5740adf91e", "order": 20, "width": 2, "height": 1 }, { "id": "f83cb4689ac979b5", "type": "ui_spacer", "z": "7db3b30dc762d89d", "name": "spacer", "group": "6ed62c5740adf91e", "order": 21, "width": 5, "height": 1 }, { "id": "216cb37a6420edb7", "type": "ui_spacer", "z": "7db3b30dc762d89d", "name": "spacer", "group": "6ed62c5740adf91e", "order": 24, "width": 7, "height": 1 }, { "id": "8f6fc2a63cbc1167", "type": "ui_spacer", "z": "7db3b30dc762d89d", "name": "spacer", "group": "6ed62c5740adf91e", "order": 25, "width": 4, "height": 1 }, { "id": "d4487cbb281a7419", "type": "ui_spacer", "z": "7db3b30dc762d89d", "name": "spacer", "group": "6ed62c5740adf91e", "order": 27, "width": 7, "height": 1 }, { "id": "b8d360a8bd19d21e", "type": "ui_spacer", "z": "7db3b30dc762d89d", "name": "spacer", "group": "6ed62c5740adf91e", "order": 30, "width": 6, "height": 1 }, { "id": "3223321343045e8e", "type": "ui_spacer", "z": "7db3b30dc762d89d", "name": "spacer", "group": "6ed62c5740adf91e", "order": 31, "width": 6, "height": 1 }, { "id": "cb9f09fe1715c576", "type": "ui_spacer", "z": "7db3b30dc762d89d", "name": "spacer", "group": "6ed62c5740adf91e", "order": 32, "width": 6, "height": 1 }, { "id": "d0cbf3b2756744ed", "type": "ui_spacer", "z": "7db3b30dc762d89d", "name": "spacer", "group": "6ed62c5740adf91e", "order": 33, "width": 6, "height": 1 }, { "id": "6ed62c5740adf91e", "type": "ui_group", "name": "Main", "tab": "7e77918b2f96f16a", "order": 1, "disp": true, "width": 30, "collapse": false, "className": "" }, { "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": "7e77918b2f96f16a", "type": "ui_tab", "name": "Home", "icon": "dashboard", "disabled": false, "hidden": false }, { "id": "13de5583cff24028", "type": "global-config", "env": [], "modules": { "node-red-dashboard": "3.6.6", "node-red-contrib-modbus": "5.45.2" } } ]
Créé il y a 1 mois.