Your catch is causing a loop. Here is how i would limit it:
use ctrl+i
to import
[{"id":"3ad37c94568d82ca","type":"catch","z":"3642c7ee286f9c17","name":"","scope":["97a58f9d8b285a7d"],"uncaught":false,"x":130,"y":740,"wires":[["4d61fbafe16cded9"]]},{"id":"4fd40519fefb0f21","type":"function","z":"3642c7ee286f9c17","name":"disconnect","func":"\nreturn {topic:\"disconnect\"}","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":510,"y":740,"wires":[["1ef4ba9a9009a223","ac45f05633e9325d"]]},{"id":"039feddc08cebc07","type":"inject","z":"3642c7ee286f9c17","name":"Poll for data","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":510,"y":660,"wires":[["ac45f05633e9325d"]]},{"id":"5b8b66e1ef8db0eb","type":"function","z":"3642c7ee286f9c17","name":"","func":"\nmsg.payload.device_id='XQQD-Z-202'\nvar temp=msg.payload;\nvar res={}\nvar payload={};\n\n\n//判断数量是否变化\nvar cur_product_num = temp.D7857;\nvar cur_device_id=temp.device_id\nvar pre_product_num=0\n\n//获取上一个产品的数量\npre_product_num = flow.get(\"device1_pre_product_num\");\n\nif (pre_product_num==0){\n flow.set(\"device1_pre_product_num\", cur_product_num);\n}\nelse if (pre_product_num != cur_product_num){\n //数量变化后再进行字段映射\n //暂存当前产品数量为上一个产品数量\n flow.set(\"device1_pre_product_num\", cur_product_num);\n payload.preheating_temperature = temp.D7850\n payload.preheating_time = temp.D7851\n payload.mold_temperature = temp.D7852\n payload.maximum_angle = temp.D7853\n payload.powder_weight = temp.D7854\n payload.afterheating_temperature = temp.D7855\n payload.afterheating_time = temp.D7856\n payload.processing_quantity = temp.D7857\n payload.device_id=temp.device_id\n\n \n //转换产品名称,将整型格式的产品名称转换成字符串\n var productname=\"\"\n var index=0\n for (;index<=15;index++){\n let lastindex=7858+index\n let addstrindex= 'D'+lastindex\n var intd7858=temp[addstrindex]\n \n if(intd7858==0){\n break\n }\n var bitd7858=intd7858.toString(2)\n length=bitd7858.length\n zerostr=\"\"\n for(;length<16;length++){\n zerostr=zerostr+\"0\"\n }\n bitd7858=zerostr+bitd7858\n var x1=bitd7858.substring(0,8)\n \n var low8bitd7858=bitd7858.substring(0,8)\n var high8bitd7858=bitd7858.substring(8,16)\n var lowchar=String.fromCharCode(parseInt(low8bitd7858, 2));\n var highchar=String.fromCharCode(parseInt(high8bitd7858, 2));\n \n productname=productname+highchar+lowchar\n }\n \n payload.mold_code=productname.trim()\n \n msg.payload=payload\n //将当前结果暂存为上一个\n flow.set(\"device1_pre_res\", payload);\n \n return msg;\n}","outputs":1,"timeout":"","noerr":7,"initialize":"","finalize":"","libs":[],"x":960,"y":740,"wires":[["4512f4e1d8e71580"]]},{"id":"4512f4e1d8e71580","type":"debug","z":"3642c7ee286f9c17","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1150,"y":740,"wires":[]},{"id":"97a58f9d8b285a7d","type":"MC Read","z":"3642c7ee286f9c17","name":"","topic":"","connection":"49014d6b.ab6ef4","address":"D7850,24","addressType":"str","outputFormat":"0","errorHandling":"throw","outputs":1,"x":800,"y":740,"wires":[["5b8b66e1ef8db0eb"]]},{"id":"b5455ab990f64c4e","type":"inject","z":"3642c7ee286f9c17","name":"reconnect","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":300,"y":660,"wires":[["4fd40519fefb0f21"]]},{"id":"4d61fbafe16cded9","type":"delay","z":"3642c7ee286f9c17","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"10","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"allowrate":false,"outputs":1,"x":320,"y":740,"wires":[["4fd40519fefb0f21"]]},{"id":"1ef4ba9a9009a223","type":"delay","z":"3642c7ee286f9c17","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":500,"y":780,"wires":[["88a761827e38c846"]]},{"id":"88a761827e38c846","type":"function","z":"3642c7ee286f9c17","name":"connect","func":"\nreturn {topic:\"connect\"}","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":500,"y":820,"wires":[["ac45f05633e9325d"]]},{"id":"6e5d66284e027773","type":"debug","z":"3642c7ee286f9c17","name":"debug 8","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":800,"y":820,"wires":[]},{"id":"ac45f05633e9325d","type":"junction","z":"3642c7ee286f9c17","x":680,"y":740,"wires":[["97a58f9d8b285a7d","6e5d66284e027773"]]},{"id":"49014d6b.ab6ef4","type":"MC Protocol Connection","name":"","host":"192.168.205.66","port":"5001","protocol":"TCP","frame":"3E","plcType":"QnA","ascii":false,"PLCStation":"","PCStation":"","PLCModuleNo":"","network":"","octalInputOutput":false,"timeout":"1000"}]
As for your function, there are better ways to parse the data. You can use node-red-contrib-buffer-parser
to make sense of the PLC data without a huge function! - e.g:

[{"id":"e545ea8ee860f737","type":"buffer-parser","z":"3642c7ee286f9c17","name":"","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"int16le","name":"preheating_temperature","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"preheating_time","offset":2,"length":1,"offsetbit":0,"scale":"/10","mask":""},{"type":"int16le","name":"mold_temperature","offset":4,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"maximum_angle","offset":6,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"powder_weight","offset":8,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"afterheating_temperature","offset":10,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"afterheating_time","offset":12,"length":1,"offsetbit":0,"scale":"/10","mask":""},{"type":"int16le","name":"processing_quantity","offset":14,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"ascii","name":"mold_code","offset":16,"length":30,"offsetbit":0,"scale":"1","mask":""}],"swap1":"swap16","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":2070,"y":120,"wires":[["140735407da290da"]]},{"id":"b44de05dc63f404a","type":"MC Read","z":"3642c7ee286f9c17","name":"Read D7850,24","topic":"","connection":"f9c2667da94e59e8","address":"D7850,24","addressType":"str","outputFormat":"1","errorHandling":"throw","outputs":1,"x":1880,"y":120,"wires":[["e545ea8ee860f737"]]},{"id":"140735407da290da","type":"debug","z":"3642c7ee286f9c17","name":"debug 6","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":2080,"y":180,"wires":[]},{"id":"5a3f2b8e912c4bc5","type":"inject","z":"3642c7ee286f9c17","name":"Poll for data","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1690,"y":120,"wires":[["b44de05dc63f404a"]]},{"id":"f9c2667da94e59e8","type":"MC Protocol Connection","name":"","host":"localhost","port":"5003","protocol":"UDP","frame":"4E","plcType":"Q","ascii":false,"PLCStation":"","PCStation":"","PLCModuleNo":"","network":"","octalInputOutput":false,"timeout":"3000"}]