# Mcprotocol logging bad quality then uncaught exception

**URL:** https://discourse.nodered.org/t/mcprotocol-logging-bad-quality-then-uncaught-exception/86221
**Category:** Industrial
**Created:** [7 March 2024 03:19 UTC](https://discourse.nodered.org/t/mcprotocol-logging-bad-quality-then-uncaught-exception/86221 "2024-03-07T03:19:06Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![Leon001](https://avatars.discourse-cdn.com/v4/letter/l/4af34b/32.png) [@Leon001](https://discourse.nodered.org/u/Leon001)
#### Post date: [7 March 2024 03:19 UTC](https://discourse.nodered.org/t/mcprotocol-logging-bad-quality-then-uncaught-exception/86221/1 "2024-03-07T03:19:06Z")

</div>

![bacaaa7ef1a783633a33432f289bbb6](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/e/0ecf5c2203e4620af65057f4b5e863ad7287aa49.png)  
error text:  
"  
Response Header is not valid  
Logging a Bad Quality the Pointer 0  
"  
it usually runs correctly but sometimes it disconnceted when i read data from mcprotocol PLC.Is there something wrong with the PLC?  
It will be good when i restart the node-red,but i can't monitor its state all the time, \>-\<  
How can i fix it? 😊

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [7 March 2024 10:29 UTC](https://discourse.nodered.org/t/mcprotocol-logging-bad-quality-then-uncaught-exception/86221/2 "2024-03-07T10:29:02Z")

</div>

This does not actually appear to be related to Dashboard but does appear to be related to some specific hardware? If so, could you please update the tag and add some detail about the hardware in use.

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [7 March 2024 10:33 UTC](https://discourse.nodered.org/t/mcprotocol-logging-bad-quality-then-uncaught-exception/86221/3 "2024-03-07T10:33:25Z")

</div>

> [@Leon001](#):
>
> sometimes it disconnceted when i read data from mcprotocol PLC

Can you tell us what version of `node-red-contrib-mcprotocol` you have installed?

Can you copy and paste (as text, not image) the info AFTER "Uncaught Exception" (that is the important part)

---

<div class="post-metadata">

### Author: ![Leon001](https://avatars.discourse-cdn.com/v4/letter/l/4af34b/32.png) [@Leon001](https://discourse.nodered.org/u/Leon001)
#### Post date: [7 March 2024 11:17 UTC](https://discourse.nodered.org/t/mcprotocol-logging-bad-quality-then-uncaught-exception/86221/4 "2024-03-07T11:17:08Z")

</div>

the version of node-red-contrib-mcprotocol is V1.2.1  
//  
It's not the same error code,but the same error text whitch is "Logging a Bad quality..".I can't log in that wrong server right now.I will paste it tomorrow.  
↓

```auto
2024-03-01T00:10:27.549Z 11141 ] Logging a Bad Quality thePointer 42
[2024-03-01T00:10:27.549Z 11311] Logging a Bad Quality thePointer 44
[2024-03-01T00:10:27.549Z 11488] Logging a Bad Quality thePointer 46
[2024-03-01T00:10:29.052Z 514126 192.168.120.53] We Caught a read/write error ECONNRESET - resetting connection
1 Mar 08:10:29 - [mcprotocol] error ~ mcprotocol: {host:'192.168.120.53', port: 4999}: Error: read ECONNRESET
Error: read ECONNRESET
    at TCP.onStreamRead (internal/stream_base_commons.js:209:20) {
  errno: -4077,
  code: 'ECONNRESET',
  syscall: 'read'
}

```

---

<div class="post-metadata">

### Author: ![Leon001](https://avatars.discourse-cdn.com/v4/letter/l/4af34b/32.png) [@Leon001](https://discourse.nodered.org/u/Leon001)
#### Post date: [7 March 2024 11:19 UTC](https://discourse.nodered.org/t/mcprotocol-logging-bad-quality-then-uncaught-exception/86221/5 "2024-03-07T11:19:26Z")

</div>

OK,Thanks for reminding.

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [7 March 2024 11:38 UTC](https://discourse.nodered.org/t/mcprotocol-logging-bad-quality-then-uncaught-exception/86221/6 "2024-03-07T11:38:04Z")

</div>

> [@Leon001](#):
>
> it usually runs correctly but sometimes it disconnceted when i read data from mcprotocol PLC.Is there something wrong with the PLC?

You might need to share the config setup. For example, over 10 years maintaining Mitsi PLCs, I learned how notoriously flaky Mitsi Ethernet comms were. Especially TCP - to the point where I had to schedule in production downtime to get the PLC powered off/on to recover the connection (A, QnA, Q series Ethernet cards).

If your PLC supports it, I strongly recommend UDP mode and 4E frames. 4E frames have a `sid` (sequence ID) embedded in their frames which makes this the mode reliable method of communication.

As for recovery, the MC Read or MC Write node can be sent a specially crafted msg to disconnect/connect. You can add logic to your flows to either monitor the status of an MC Read or catch the errors, perform some logic/delay testing, issue a disconnect, then a connect msg.

EDIT:

The special messages supported are:

msg.disconnect true  
msg.connect true  
msg.reinitialize true

msg.topic "disconnect"  
msg.topic "connect"  
msg.topic "reinitialize"

Sending any one of these will perform the action it describes.

---

<div class="post-metadata">

### Author: ![Leon001](https://avatars.discourse-cdn.com/v4/letter/l/4af34b/32.png) [@Leon001](https://discourse.nodered.org/u/Leon001)
#### Post date: [7 March 2024 11:54 UTC](https://discourse.nodered.org/t/mcprotocol-logging-bad-quality-then-uncaught-exception/86221/7 "2024-03-07T11:54:25Z")

</div>

Thank you very much for your detailed reply，i'll try it later ❤

---

<div class="post-metadata">

### Author: ![Leon001](https://avatars.discourse-cdn.com/v4/letter/l/4af34b/32.png) [@Leon001](https://discourse.nodered.org/u/Leon001)
#### Post date: [8 March 2024 01:14 UTC](https://discourse.nodered.org/t/mcprotocol-logging-bad-quality-then-uncaught-exception/86221/8 "2024-03-08T01:14:47Z")

</div>

Unfortunately，this PLC does't support UDP mode and 4E frames both 😮‍💨.I'll add 'catch' and 'function' module to monitor PLC's status to reconnect if it disconnects.Thanks for help!

---

<div class="post-metadata">

### Author: ![Leon001](https://avatars.discourse-cdn.com/v4/letter/l/4af34b/32.png) [@Leon001](https://discourse.nodered.org/u/Leon001)
#### Post date: [11 March 2024 00:57 UTC](https://discourse.nodered.org/t/mcprotocol-logging-bad-quality-then-uncaught-exception/86221/9 "2024-03-11T00:57:23Z")

</div>

Dear expert，it went wrong again 😭

 ![bfd1808ec60a2487718043a9a277ece](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/2/42f4b5d4e7706ac27ee39ab45a91f5c9c741f9d4.jpeg)  
fortunately，it's a error not disconnection 🤔  
It will be good if i redeploy the flow.This is too troublesome and will affect my statistical device OEE 😔  
 ![74a8befed3866dfa67bd14da3d772dd](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/c/9cdc826e4c6b86406732f9582cb12cbca4aaf3b5.jpeg)  
 ![60815e99a6cc454661e855aa5891970](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/4/240eca5b48d25c548c330e9953b671ecf5ff509c.jpeg)  
Whether the contents of my function are correct?

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [11 March 2024 02:42 UTC](https://discourse.nodered.org/t/mcprotocol-logging-bad-quality-then-uncaught-exception/86221/10 "2024-03-11T02:42:08Z")

</div>

> [@Leon001](#):
>
> Whether the contents of my function are correct?

No. Only one action at a time is possible. So I would probably recommend only `msg.reinitialize=true`.

---

<div class="post-metadata">

### Author: ![Leon001](https://avatars.discourse-cdn.com/v4/letter/l/4af34b/32.png) [@Leon001](https://discourse.nodered.org/u/Leon001)
#### Post date: [18 March 2024 00:12 UTC](https://discourse.nodered.org/t/mcprotocol-logging-bad-quality-then-uncaught-exception/86221/11 "2024-03-18T00:12:43Z")

</div>

Thank you Steve,this flow has run correctly for a week,but it still has a error.

 ![图片](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/1/e15172b7110a24cb67f46a4597d5c62b4ca57864.jpeg)  
error code shows "message exceed maximum catch quantity".What does it mean?

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [18 March 2024 02:32 UTC](https://discourse.nodered.org/t/mcprotocol-logging-bad-quality-then-uncaught-exception/86221/12 "2024-03-18T02:32:45Z")

</div>

> [@Leon001](#):
>
> message exceed maximum catch quantity

I don't recognise that message.

Is that something you have generated? Share the post of your flow that does this read & the catch node and what the catch connects to

---

<div class="post-metadata">

### Author: ![Leon001](https://avatars.discourse-cdn.com/v4/letter/l/4af34b/32.png) [@Leon001](https://discourse.nodered.org/u/Leon001)
#### Post date: [18 March 2024 03:07 UTC](https://discourse.nodered.org/t/mcprotocol-logging-bad-quality-then-uncaught-exception/86221/13 "2024-03-18T03:07:02Z")

</div>

I'll share it if it shows again.

---

<div class="post-metadata">

### Author: ![Leon001](https://avatars.discourse-cdn.com/v4/letter/l/4af34b/32.png) [@Leon001](https://discourse.nodered.org/u/Leon001)
#### Post date: [19 March 2024 01:06 UTC](https://discourse.nodered.org/t/mcprotocol-logging-bad-quality-then-uncaught-exception/86221/14 "2024-03-19T01:06:20Z")

</div>

![图片](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/1/51b733f5b364cfe191c0a1b2a7a60e7e56e7ff76.jpeg)  
"邮件超过最大捕获数量" means messages exceed the maximum number of captures.  
I just need to click deploy and it will be good 😂

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [19 March 2024 05:53 UTC](https://discourse.nodered.org/t/mcprotocol-logging-bad-quality-then-uncaught-exception/86221/15 "2024-03-19T05:53:30Z")

</div>

I need you to share the flow not a screenshot.

Select those nodes, press ctrl+e, copy to clipboard, paste into a reply.

---

<div class="post-metadata">

### Author: ![Leon001](https://avatars.discourse-cdn.com/v4/letter/l/4af34b/32.png) [@Leon001](https://discourse.nodered.org/u/Leon001)
#### Post date: [19 March 2024 23:59 UTC](https://discourse.nodered.org/t/mcprotocol-logging-bad-quality-then-uncaught-exception/86221/17 "2024-03-19T23:59:57Z")

</div>

```auto
[{"id":"a058c883.9490a8","type":"catch","z":"ce52da99.7def78","name":"","scope":["8a2d13f0.aaff4"],"uncaught":false,"x":110,"y":160,"wires":[["437a1dbc.d68314"]]},{"id":"437a1dbc.d68314","type":"function","z":"ce52da99.7def78","name":"","func":"\nmsg.reinitialize=true;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":350,"y":160,"wires":[["8a2d13f0.aaff4"]]},{"id":"a56e288f.539ef8","type":"inject","z":"ce52da99.7def78","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"1","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":350,"y":40,"wires":[["8a2d13f0.aaff4"]]},{"id":"35834e6a.d5e822","type":"function","z":"ce52da99.7def78","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,"noerr":0,"initialize":"","finalize":"","x":730,"y":160,"wires":[["bfd10f6a.1d5d3","13ef4ae0.7a07a5"]]},{"id":"bfd10f6a.1d5d3","type":"http request","z":"ce52da99.7def78","name":"","method":"POST","ret":"txt","paytoqs":"ignore","url":"https://jsxq.group/slushMoldings/saveNoLogin","tls":"","persist":false,"proxy":"","authType":"","x":980,"y":160,"wires":[[]]},{"id":"13ef4ae0.7a07a5","type":"debug","z":"ce52da99.7def78","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":970,"y":60,"wires":[]},{"id":"8a2d13f0.aaff4","type":"MC Read","z":"ce52da99.7def78","name":"","topic":"","connection":"49014d6b.ab6ef4","address":"D7850,24","addressType":"str","outputFormat":0,"errorHandling":"throw","outputs":1,"x":540,"y":160,"wires":[["35834e6a.d5e822"]]},{"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"}]

```

_admin edit: wrap flow in triple backticks to make it importable_

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [20 March 2024 10:00 UTC](https://discourse.nodered.org/t/mcprotocol-logging-bad-quality-then-uncaught-exception/86221/18 "2024-03-20T10:00:45Z")

</div>

Your catch is causing a loop. Here is how i would limit it:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/0/706cd6e09f1d34f80359ef91b8cb62636d9db0a2.png)

_use `ctrl+i` to import_

```auto
[{"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:

![chrome_bzHfyzrdcg](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/9/898391bc42f3ef7dbee378168d491b378d6dddc9.gif)

```auto
[{"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"}]

```

---

<div class="post-metadata">

### Author: ![Leon001](https://avatars.discourse-cdn.com/v4/letter/l/4af34b/32.png) [@Leon001](https://discourse.nodered.org/u/Leon001)
#### Post date: [20 March 2024 10:21 UTC](https://discourse.nodered.org/t/mcprotocol-logging-bad-quality-then-uncaught-exception/86221/19 "2024-03-20T10:21:03Z")

</div>

`node-red-contrib-buffer-parser`It's very useful and I'll look into it.Steve, thank you so much for your patient guidance. 👍

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [3 April 2024 10:21 UTC](https://discourse.nodered.org/t/mcprotocol-logging-bad-quality-then-uncaught-exception/86221/20 "2024-04-03T10:21:48Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
