NOTE: this solution uses the node-red MQTT broker node node-red-contrib-aedes. If you already have a broker, deleted it otherwise install node/node-red-contrib-aedes node from the pallet manager.
So this is what I put together to make a (semi) final solution...
Please read through all the notes on the screen shot, the comment nodes and all the notes inside the functions to understand what its doing.
Once you understand (or not) give me a shout for the final stage (how to acces these MQTT values outside of Node-red - i.e. your SCADA)
the flow ....
[{"id":"90bf94b7.269648","type":"aedes broker","z":"c4135bb4.a5f418","name":"","mqtt_port":1883,"mqtt_ws_port":"","cert":"","key":"","certname":"","keyname":"","dburl":"","usetls":false,"x":330,"y":80,"wires":[[]],"info":"## Title\n### Info...\n- point 1\n- point 2\n\n*More info*"},{"id":"560dc5a6.ccf43c","type":"comment","z":"c4135bb4.a5f418","name":"NODE RED Based broker - delete if using mosquito","info":"### consider using standalone mosquito on the finished system","x":430,"y":40,"wires":[]},{"id":"f0999926.0a7238","type":"mqtt in","z":"c4135bb4.a5f418","name":"subscribe to # for testing purposes","topic":"#","qos":"2","datatype":"auto","broker":"4af1f016.58aaa","x":380,"y":200,"wires":[["adeed42f.2d27e8"]],"info":"## Title\n### Info...\n- point 1\n- point 2\n\n*More info*"},{"id":"adeed42f.2d27e8","type":"debug","z":"c4135bb4.a5f418","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":630,"y":200,"wires":[]},{"id":"5307778e.a29e98","type":"inject","z":"c4135bb4.a5f418","name":"","topic":"device1/test","payload":"hello device1","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":370,"y":320,"wires":[["69c72f1b.4bd6b"]],"info":"## Title\n### Info...\n- point 1\n- point 2\n\n*More info*"},{"id":"69c72f1b.4bd6b","type":"mqtt out","z":"c4135bb4.a5f418","name":"","topic":"","qos":"","retain":"","broker":"4af1f016.58aaa","x":590,"y":320,"wires":[]},{"id":"21bd0e3e.3dbaa2","type":"inject","z":"c4135bb4.a5f418","name":"Poll trigger","topic":"","payload":"","payloadType":"date","repeat":"1","crontab":"","once":false,"onceDelay":0.1,"x":310,"y":540,"wires":[["84cb5d9a.ec35"]],"info":"## Title\n### Info...\n- point 1\n- point 2\n\n*More info*"},{"id":"84cb5d9a.ec35","type":"function","z":"c4135bb4.a5f418","name":"get next COMM data","func":"\n//get poll_sequence from flow context\nvar poll_sequence = flow.get(\"poll_sequence\");\nif (poll_sequence == null) poll_sequence = -1;\n\n//get RS485Setup from flow context\nvar RS485Setup = flow.get(\"RS485Setup\") || [];\nif (RS485Setup.length <= 0){\n node.warn(\"RS485Setup is empty\")\n return null;\n}\n\n//increment to next poll seq\npoll_sequence++;\n\nif (poll_sequence >= RS485Setup.length ){\n poll_sequence = 0;\n}\n\n//store current POLL in msg.poll\nmsg.poll = RS485Setup[poll_sequence];\nmsg.poll_sequence = poll_sequence;\nmsg.payload = new Buffer(\n \" \" + //ESC \n msg.poll.comm + \n \"\\r\" //CR\n)\n//update buff element [0] to be an ESC char\nmsg.payload[0] = 27 //ESC\n\n//store current poll_seq\nflow.set(\"poll_sequence\", poll_sequence);\n\nreturn msg;//return the msg to next node","outputs":1,"noerr":0,"x":500,"y":540,"wires":[["34d2538a.63488c"]],"info":"## Title\n### Info...\n- point 1\n- point 2\n\n*More info*"},{"id":"8518ed37.4d14d","type":"inject","z":"c4135bb4.a5f418","name":"initialse","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":300,"y":440,"wires":[["e75d576b.4b24d8"]],"info":"## Title\n### Info...\n- point 1\n- point 2\n\n*More info*"},{"id":"e75d576b.4b24d8","type":"change","z":"c4135bb4.a5f418","name":"","rules":[{"t":"set","p":"RS485Setup","pt":"flow","to":"[{\"comm\":\"81L\",\"data\":[{\"topic\":\"device1/totaliser/t1\",\"data_start\":20,\"data_end\":30,\"dataType\":\"int\"},{\"topic\":\"device1/totaliser/t2\",\"data_start\":30,\"data_end\":40,\"dataType\":\"int\"}]},{\"comm\":\"81D\",\"data\":[{\"topic\":\"device1/flow\",\"data_start\":25,\"data_end\":31,\"dataType\":\"float\"}]}]","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":440,"wires":[["e32ab155.7b9bf"]],"info":"## Title\n### Info...\n- point 1\n- point 2\n\n*More info*"},{"id":"34d2538a.63488c","type":"function","z":"c4135bb4.a5f418","name":"(fake serial port)","func":"\nif (msg.poll.comm.includes(\"81D\")){\n msg.payload = `FP210v20 81 200516175021 123.${getRandomInt(0, 9)}\\n\\n`\n return msg\n}\n\nif (msg.poll.comm.includes(\"81L\")){\n msg.payload = `FP210v20 81 68535h120000456${getRandomInt(101, 999)}0000789${getRandomInt(101, 999)}\\n\\n`\n return msg\n}\n\n\n\nreturn null;\n\n\n\nfunction getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}","outputs":1,"noerr":0,"x":720,"y":540,"wires":[["98eb398d.e5a4a8","83a05335.69fb"]],"info":"## Title\n### Info...\n- point 1\n- point 2\n\n*More info*"},{"id":"98eb398d.e5a4a8","type":"debug","z":"c4135bb4.a5f418","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":930,"y":540,"wires":[],"info":"## Title\n### Info...\n- point 1\n- point 2\n\n*More info*"},{"id":"e32ab155.7b9bf","type":"debug","z":"c4135bb4.a5f418","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":950,"y":440,"wires":[]},{"id":"83a05335.69fb","type":"function","z":"c4135bb4.a5f418","name":"split items out, add topic, send payload","func":"var poll = msg.poll;\n// node.warn([\"poll\",poll]);\nfor (let index = 0; index < poll.data.length; index++) {\n const e = poll.data[index];\n //node.warn([\"poll.data[i]\", e]);\n var valRaw = msg.payload.slice(e.data_start, e.data_end)\n var val = valRaw;\n switch(e.dataType){\n case \"int\":\n val = parseInt(valRaw);\n break;\n case \"float\":\n val = parseFloat(valRaw);\n break;\n } \n node.send({\n topic: e.topic,\n payload: val,\n valRaw: valRaw,\n poll: e\n });\n}\n\nreturn null;","outputs":1,"noerr":0,"x":550,"y":600,"wires":[["53ef92d1.3abf8c","8c9be340.715b3"]],"info":"## Title\n### Info...\n- point 1\n- point 2\n\n*More info*"},{"id":"58919633.39b1b8","type":"mqtt out","z":"c4135bb4.a5f418","name":"","topic":"","qos":"","retain":"","broker":"4af1f016.58aaa","x":930,"y":600,"wires":[],"info":"## Title\n### Info...\n- point 1\n- point 2\n\n*More info*"},{"id":"6eac4aa6.40bd04","type":"debug","z":"c4135bb4.a5f418","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":930,"y":660,"wires":[],"info":"## Title\n### Info...\n- point 1\n- point 2\n\n*More info*"},{"id":"53ef92d1.3abf8c","type":"rbe","z":"c4135bb4.a5f418","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":790,"y":600,"wires":[["58919633.39b1b8","6eac4aa6.40bd04"]]},{"id":"e4bde9f4.a8aa68","type":"comment","z":"c4135bb4.a5f418","name":"Setup what to POLL in flow.RS485Setup (inside the change node)","info":"","x":470,"y":400,"wires":[]},{"id":"b62c51c5.6d86d","type":"comment","z":"c4135bb4.a5f418","name":"Poll the entries in RS485Setup, request COM data, split data and generate new MQTT payloads","info":"","x":570,"y":500,"wires":[]},{"id":"758402e0.f7a28c","type":"comment","z":"c4135bb4.a5f418","name":"A test (to check MQTT is working)","info":"","x":370,"y":280,"wires":[]},{"id":"52ef13fb.806eec","type":"comment","z":"c4135bb4.a5f418","name":"Subscribe to # (while testing - to see MQTT data is working) - DELETE LATER","info":"### consider using standalone mosquito on the finished system","x":510,"y":160,"wires":[]},{"id":"8c9be340.715b3","type":"debug","z":"c4135bb4.a5f418","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":690,"y":660,"wires":[],"info":"## Title\n### Info...\n- point 1\n- point 2\n\n*More info*"},{"id":"4af1f016.58aaa","type":"mqtt-broker","z":"","name":"aedes local","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"40","cleansession":true,"birthTopic":"aedes/state","birthQos":"0","birthPayload":"ready","closeTopic":"aedes/state","closeQos":"0","closePayload":"alert","willTopic":"aedes/state","willQos":"0","willPayload":"alert"}]
PS
This is what you should see in the debug window...