So here's my flow
[
{
"id": "1378ba83.90c825",
"type": "tab",
"label": "Read file",
"disabled": false,
"info": ""
},
{
"id": "20b32e98.5e9fb2",
"type": "file in",
"z": "1378ba83.90c825",
"name": "RequĂȘte1",
"filename": "C:\\Users\\Theodros\\Documents\\GRTgaz\\NODE-RED_GRTgaz\\Tables modbus\\Requete1.csv",
"format": "utf8",
"chunk": false,
"sendError": false,
"encoding": "none",
"allProps": false,
"x": 300,
"y": 460,
"wires": [
[
"a8436e2f.135fe"
]
]
},
{
"id": "a8436e2f.135fe",
"type": "csv",
"z": "1378ba83.90c825",
"name": "",
"sep": ",",
"hdrin": false,
"hdrout": "all",
"multi": "mult",
"ret": "\\r\\n",
"temp": "label",
"skip": "0",
"strings": true,
"include_empty_strings": "",
"include_null_values": "",
"x": 450,
"y": 460,
"wires": [
[
"9e327bbf.9c3c58",
"93cf18f7.648228"
]
]
},
{
"id": "9e327bbf.9c3c58",
"type": "debug",
"z": "1378ba83.90c825",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 630,
"y": 420,
"wires": []
},
{
"id": "93cf18f7.648228",
"type": "function",
"z": "1378ba83.90c825",
"name": "REMPLISSAGE",
"func": "msg.options = msg.payload.map((el, index) => {\n\nreturn { [el.label] : index }\n \n})\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 680,
"y": 540,
"wires": [
[
"a33a2128.40e88"
]
]
},
{
"id": "9232e59c366097f5",
"type": "file in",
"z": "1378ba83.90c825",
"name": "RequĂȘte2",
"filename": "C:\\Users\\Theodros\\Documents\\GRTgaz\\NODE-RED_GRTgaz\\Tables modbus\\Requete2.csv",
"format": "utf8",
"chunk": false,
"sendError": false,
"encoding": "none",
"allProps": false,
"x": 300,
"y": 700,
"wires": [
[
"46283feae83669d0"
]
]
},
{
"id": "bfa7ea1854572131",
"type": "debug",
"z": "1378ba83.90c825",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 630,
"y": 660,
"wires": []
},
{
"id": "7b54af6a49744acb",
"type": "function",
"z": "1378ba83.90c825",
"name": "REMPLISSAGE",
"func": "msg.options = msg.payload.map((el, index) => {\n\nreturn { [el.label] : index }\n \n})\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 680,
"y": 780,
"wires": [
[
"7a1076f8bb47d19f"
]
]
},
{
"id": "55ca832546785f2b",
"type": "file in",
"z": "1378ba83.90c825",
"name": "RequĂȘte3",
"filename": "C:\\Users\\Theodros\\Documents\\GRTgaz\\NODE-RED_GRTgaz\\Tables modbus\\Requete3.csv",
"format": "utf8",
"chunk": false,
"sendError": false,
"encoding": "none",
"allProps": false,
"x": 300,
"y": 960,
"wires": [
[
"db9bd5da2b417c25"
]
]
},
{
"id": "4661fbad8601b1c4",
"type": "debug",
"z": "1378ba83.90c825",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 630,
"y": 920,
"wires": []
},
{
"id": "fcf264a7e9715206",
"type": "function",
"z": "1378ba83.90c825",
"name": "REMPLISSAGE",
"func": "msg.options = msg.payload.map((el, index) => {\n\nreturn { [el.label] : index }\n \n})\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 680,
"y": 1040,
"wires": [
[
"99de5655e7178068"
]
]
},
{
"id": "a33a2128.40e88",
"type": "ui_dropdown",
"z": "1378ba83.90c825",
"name": "",
"label": "",
"tooltip": "",
"place": "Select option",
"group": "671cb6d0f0a7d1c7",
"order": 5,
"width": 0,
"height": 0,
"passthru": true,
"multiple": false,
"options": [],
"payload": "",
"topic": "S1",
"topicType": "str",
"className": "",
"x": 860,
"y": 540,
"wires": [
[
"b7b1f645eb9b83c0"
]
]
},
{
"id": "4dd9ce82a81007d0",
"type": "ui_button",
"z": "1378ba83.90c825",
"name": "",
"group": "ac5f4946e8c230e7",
"order": 1,
"width": 0,
"height": 0,
"passthru": true,
"label": "button",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "",
"payload": "",
"payloadType": "date",
"topic": "topic",
"topicType": "msg",
"x": 70,
"y": 700,
"wires": [
[
"20b32e98.5e9fb2",
"9232e59c366097f5",
"55ca832546785f2b"
]
]
},
{
"id": "458310f8128b08be",
"type": "ui_switch",
"z": "1378ba83.90c825",
"name": "",
"label": "switch",
"tooltip": "",
"group": "671cb6d0f0a7d1c7",
"order": 2,
"width": "1",
"height": "1",
"passthru": true,
"decouple": "false",
"topic": "B1",
"topicType": "str",
"style": "",
"onvalue": "1",
"onvalueType": "num",
"onicon": "",
"oncolor": "",
"offvalue": "0",
"offvalueType": "num",
"officon": "",
"offcolor": "",
"animate": false,
"className": "",
"x": 850,
"y": 480,
"wires": [
[
"b7b1f645eb9b83c0"
]
]
},
{
"id": "46283feae83669d0",
"type": "csv",
"z": "1378ba83.90c825",
"name": "",
"sep": ",",
"hdrin": false,
"hdrout": "all",
"multi": "mult",
"ret": "\\r\\n",
"temp": "label",
"skip": "0",
"strings": true,
"include_empty_strings": "",
"include_null_values": "",
"x": 450,
"y": 700,
"wires": [
[
"bfa7ea1854572131",
"7b54af6a49744acb"
]
]
},
{
"id": "db9bd5da2b417c25",
"type": "csv",
"z": "1378ba83.90c825",
"name": "",
"sep": ",",
"hdrin": false,
"hdrout": "all",
"multi": "mult",
"ret": "\\r\\n",
"temp": "label",
"skip": "0",
"strings": true,
"include_empty_strings": "",
"include_null_values": "",
"x": 450,
"y": 960,
"wires": [
[
"fcf264a7e9715206",
"4661fbad8601b1c4"
]
]
},
{
"id": "b4e1c71defe23048",
"type": "link in",
"z": "1378ba83.90c825",
"name": "Valeur choix1",
"links": [
"79e4d93ab0c66a1c"
],
"x": 165,
"y": 1380,
"wires": [
[
"5a6587d2222c2220"
]
]
},
{
"id": "f71362bbb83da4c9",
"type": "link in",
"z": "1378ba83.90c825",
"name": "choix1",
"links": [
"16abf2150784fc77"
],
"x": 165,
"y": 1440,
"wires": [
[
"5a6587d2222c2220"
]
]
},
{
"id": "d0b9e76692aadad7",
"type": "ui_button",
"z": "1378ba83.90c825",
"name": "",
"group": "671cb6d0f0a7d1c7",
"order": 1,
"width": 0,
"height": 0,
"passthru": false,
"label": "envoyer",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "",
"payload": "true",
"payloadType": "bool",
"topic": "topic",
"topicType": "msg",
"x": 200,
"y": 1220,
"wires": [
[]
]
},
{
"id": "5a6587d2222c2220",
"type": "function",
"z": "1378ba83.90c825",
"name": "Adressage",
"func": "table = [];\nadressage = [];\nvar num = msg.payload.S1; //Chiffre allant de 0 à 79\nvar val = msg.payload.B1; // booléen\n\nfor(i = 0; i<79 ; i++){\ntable[i] = 0 ;\n}\n\ntable[num] = val; //On assigne une valeur à l'adresse saisie\n\nif(num < 15){\n for(i = 0; i<16 ; i++){\n adressage[i] = table[i]; //It returns the whole table\n } \n \n}\n\nmsg.payload = adressage;\nreturn msg",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 470,
"y": 1400,
"wires": [
[
"19f79ff39da8bb1b"
]
]
},
{
"id": "6ee3aaf7d2238cc2",
"type": "change",
"z": "1378ba83.90c825",
"name": "",
"rules": [
{
"t": "set",
"p": "selected",
"pt": "flow",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1200,
"y": 500,
"wires": [
[]
]
},
{
"id": "e72aa291dd82fd34",
"type": "change",
"z": "1378ba83.90c825",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "selected",
"tot": "flow"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 380,
"y": 1280,
"wires": [
[
"5a6587d2222c2220"
]
]
},
{
"id": "b7b1f645eb9b83c0",
"type": "join",
"z": "1378ba83.90c825",
"name": "",
"mode": "custom",
"build": "object",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": "\\n",
"joinerType": "str",
"accumulate": true,
"timeout": "",
"count": "1",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "",
"reduceFixup": "",
"x": 1010,
"y": 500,
"wires": [
[
"6ee3aaf7d2238cc2"
]
]
},
{
"id": "7a1076f8bb47d19f",
"type": "ui_dropdown",
"z": "1378ba83.90c825",
"name": "",
"label": "",
"tooltip": "",
"place": "Select option",
"group": "846c632af12c3e74",
"order": 5,
"width": 0,
"height": 0,
"passthru": true,
"multiple": false,
"options": [],
"payload": "",
"topic": "S1",
"topicType": "str",
"className": "",
"x": 860,
"y": 780,
"wires": [
[
"7007a963b3ae03c0"
]
]
},
{
"id": "c9957cf08822b7a0",
"type": "ui_switch",
"z": "1378ba83.90c825",
"name": "",
"label": "switch",
"tooltip": "",
"group": "846c632af12c3e74",
"order": 2,
"width": "1",
"height": "1",
"passthru": true,
"decouple": "false",
"topic": "B1",
"topicType": "str",
"style": "",
"onvalue": "1",
"onvalueType": "num",
"onicon": "",
"oncolor": "",
"offvalue": "0",
"offvalueType": "num",
"officon": "",
"offcolor": "",
"animate": false,
"className": "",
"x": 850,
"y": 720,
"wires": [
[
"7007a963b3ae03c0"
]
]
},
{
"id": "eeac4a72b9dc5d0e",
"type": "change",
"z": "1378ba83.90c825",
"name": "",
"rules": [
{
"t": "set",
"p": "selected",
"pt": "flow",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1200,
"y": 740,
"wires": [
[]
]
},
{
"id": "7007a963b3ae03c0",
"type": "join",
"z": "1378ba83.90c825",
"name": "",
"mode": "custom",
"build": "object",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": "\\n",
"joinerType": "str",
"accumulate": true,
"timeout": "",
"count": "1",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "",
"reduceFixup": "",
"x": 1010,
"y": 740,
"wires": [
[
"eeac4a72b9dc5d0e"
]
]
},
{
"id": "99de5655e7178068",
"type": "ui_dropdown",
"z": "1378ba83.90c825",
"name": "",
"label": "",
"tooltip": "",
"place": "Select option",
"group": "25e2db2699b87ee1",
"order": 5,
"width": 0,
"height": 0,
"passthru": true,
"multiple": false,
"options": [],
"payload": "",
"topic": "S1",
"topicType": "str",
"className": "",
"x": 860,
"y": 1040,
"wires": [
[
"5676a3cd7ef5e23d"
]
]
},
{
"id": "3dd6b08423eb1dd1",
"type": "ui_switch",
"z": "1378ba83.90c825",
"name": "",
"label": "switch",
"tooltip": "",
"group": "25e2db2699b87ee1",
"order": 2,
"width": "1",
"height": "1",
"passthru": true,
"decouple": "false",
"topic": "B1",
"topicType": "str",
"style": "",
"onvalue": "1",
"onvalueType": "num",
"onicon": "",
"oncolor": "",
"offvalue": "0",
"offvalueType": "num",
"officon": "",
"offcolor": "",
"animate": false,
"className": "",
"x": 850,
"y": 980,
"wires": [
[
"5676a3cd7ef5e23d"
]
]
},
{
"id": "5fc121eeade2156a",
"type": "change",
"z": "1378ba83.90c825",
"name": "",
"rules": [
{
"t": "set",
"p": "selected",
"pt": "flow",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1200,
"y": 1000,
"wires": [
[]
]
},
{
"id": "5676a3cd7ef5e23d",
"type": "join",
"z": "1378ba83.90c825",
"name": "",
"mode": "custom",
"build": "object",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": "\\n",
"joinerType": "str",
"accumulate": true,
"timeout": "",
"count": "1",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "",
"reduceFixup": "",
"x": 1010,
"y": 1000,
"wires": [
[
"5fc121eeade2156a"
]
]
},
{
"id": "3ffeefaa5596a04c",
"type": "debug",
"z": "1378ba83.90c825",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 810,
"y": 1400,
"wires": []
},
{
"id": "8d613ded2d4ecc2e",
"type": "ui_button",
"z": "1378ba83.90c825",
"name": "",
"group": "671cb6d0f0a7d1c7",
"order": 1,
"width": 0,
"height": 0,
"passthru": false,
"label": "Valider",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "",
"payload": "",
"payloadType": "date",
"topic": "topic",
"topicType": "msg",
"x": 190,
"y": 1280,
"wires": [
[
"e72aa291dd82fd34"
]
]
},
{
"id": "19f79ff39da8bb1b",
"type": "buffer-parser",
"z": "1378ba83.90c825",
"name": "",
"data": "payload",
"dataType": "msg",
"specification": "spec",
"specificationType": "ui",
"items": [
{
"type": "uint16be",
"name": "item1",
"offset": 0,
"length": 1,
"offsetbit": 0,
"scale": "1",
"mask": ""
}
],
"swap1": "",
"swap2": "",
"swap3": "",
"swap1Type": "swap",
"swap2Type": "swap",
"swap3Type": "swap",
"msgProperty": "payload",
"msgPropertyType": "str",
"resultType": "keyvalue",
"resultTypeType": "return",
"multipleResult": false,
"fanOutMultipleResult": false,
"setTopic": true,
"outputs": 1,
"x": 630,
"y": 1400,
"wires": [
[
"3ffeefaa5596a04c"
]
]
},
{
"id": "671cb6d0f0a7d1c7",
"type": "ui_group",
"name": "RequĂȘte 1",
"tab": "3f071cb9a3d49f7f",
"order": 1,
"disp": true,
"width": "6",
"collapse": false,
"className": ""
},
{
"id": "ac5f4946e8c230e7",
"type": "ui_group",
"name": "Initialisation des listes déroulantes",
"tab": "3f071cb9a3d49f7f",
"order": 4,
"disp": true,
"width": "6",
"collapse": false,
"className": ""
},
{
"id": "846c632af12c3e74",
"type": "ui_group",
"name": "RequĂȘte 2",
"tab": "3f071cb9a3d49f7f",
"order": 1,
"disp": true,
"width": "6",
"collapse": false,
"className": ""
},
{
"id": "25e2db2699b87ee1",
"type": "ui_group",
"name": "RequĂȘte 3",
"tab": "3f071cb9a3d49f7f",
"order": 3,
"disp": true,
"width": "6",
"collapse": false,
"className": ""
},
{
"id": "3f071cb9a3d49f7f",
"type": "ui_tab",
"name": "COMPRESSEUR",
"icon": "COMPRESSEUR",
"disabled": false,
"hidden": false
}
]