# Reading multiple addresses from MC Protocol (Mitsubishi FX PLC)

**URL:** <https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340>\
**Category:** Industrial\
**Created:** [12 October 2024 11:32 UTC](https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340 "2024-10-12T11:32:11Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![Jayeshpitale1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jayeshpitale1/32/70216_2.png) [@Jayeshpitale1](https://discourse.nodered.org/u/Jayeshpitale1)\
**Post date:** [13 October 2024 07:52 UTC](https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340/41 "2024-10-13T07:52:04Z")

</div>

> Tell me the highest `,nn` count number that works.
> 
> * * *
> 
> To make this easier - use this flow:

the highest `,nn` count number worked for me is 50  
rest i tried the example flow you send for testing the highest count number upto 100 but didnot worked

---

<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:** [13 October 2024 07:53 UTC](https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340/42 "2024-10-13T07:53:07Z")

</div>

Did you run the demo flow to assess this?

> [@Steve-Mcl](#):
>
> To make this easier - use this flow:
> 
> ![chrome_I2wEiJz7Xj](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/f/cfcbeed8a6d28a7bd47168e8de1f9528f04e22f7.gif)
> 
> ```auto
> [{"id":"fd3e1507fad47c81","type":"MC Read","z":"99321f37fd961305","name":"","topic":"","connection":"8c926f873226d344","address":"topic","addressType":"msg","outputFormat":"1","errorHandling":"throw","outputs":1,"x":640,"y":540,"wires":[["6548196310afdda8"]]},{"id":"8d08c518904584a4","type":"inject","z":"99321f37fd961305","name":"read next address","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":190,"y":540,"wires":[["46bbd1491909db56"]]},{"id":"6548196310afdda8","type":"debug","z":"99321f37fd961305","name":"PLC Data","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":640,"y":620,"wires":[]},{"id":"46bbd1491909db56","type":"function","z":"99321f37fd961305","name":"address maker","func":"\nif (msg.topic === 'set-count') {\n context.set('count', msg.payload)\n node.status({fill:\"green\",shape:\"ring\",text:\"Set count to \" + msg.payload});\n return\n}\n\nlet count = context.get('count') ?? 98\nnode.status({ fill: \"green\", shape: \"ring\", text: \"Sending address D990,\" + count });\nmsg.topic = \"D990,\" + count\ndelete msg.payload\n\nif (count > 1) count--\ncontext.set('count', count)\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":440,"y":540,"wires":[["fd3e1507fad47c81"]]},{"id":"76ad3972c996b4e0","type":"inject","z":"99321f37fd961305","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"set-count","payload":"98","payloadType":"num","x":210,"y":500,"wires":[["46bbd1491909db56"]]},{"id":"8c926f873226d344","type":"MC Protocol Connection","name":"","host":"192.168.2.20","port":"5001","protocol":"TCP","frame":"1E","plcType":"Q","ascii":false,"PLCStation":"2","PCStation":"255","PLCModuleNo":"2","network":"2","octalInputOutput":false,"timeout":"1000"}]
> 
> ```

show me a screenshot

---

<div class="post-metadata">

**Author:** ![Jayeshpitale1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jayeshpitale1/32/70216_2.png) [@Jayeshpitale1](https://discourse.nodered.org/u/Jayeshpitale1)\
**Post date:** [13 October 2024 07:54 UTC](https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340/43 "2024-10-13T07:54:40Z")

</div>

yes didnot worked for that

---

<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:** [13 October 2024 07:56 UTC](https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340/44 "2024-10-13T07:56:16Z")

</div>

Did you press the "read next address" until it got down to 50?

show me a screen shot.

please dont take any short cuts - please do as I ask.

---

<div class="post-metadata">

**Author:** ![Jayeshpitale1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jayeshpitale1/32/70216_2.png) [@Jayeshpitale1](https://discourse.nodered.org/u/Jayeshpitale1)\
**Post date:** [13 October 2024 07:58 UTC](https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340/45 "2024-10-13T07:58:27Z")

</div>

@Steve-Mcl  
i tried it all way but i get the data when it come to 62

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/d/7d9569d2cb05371b5534259f030bc65a178e8792.png)  
in this image i started from 70 and then it was showing data on 62, why i tried from 70 because i was confused a bit from starting 100 there were only timeout error

---

<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:** [13 October 2024 08:09 UTC](https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340/46 "2024-10-13T08:09:14Z")

</div>

ok, that fine.

now try this flow

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/e/de6909c65b30ffaa0424bebeb779bf31a5aa1ff2.png)

```auto
[{"id":"ee548f43b60a3cfb","type":"inject","z":"99321f37fd961305","name":"","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":130,"y":140,"wires":[["3fc9a582ec030e99"]]},{"id":"17483553facc8081","type":"debug","z":"99321f37fd961305","name":"part 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":990,"y":140,"wires":[]},{"id":"151485cfc8585f0a","type":"buffer-parser","z":"99321f37fd961305","name":"Convert array to named values","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"int16le","name":"extrusionRodNumber","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"extrusionTime","offset":2,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"temperatureGiven","offset":4,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"temperatureSetting","offset":6,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"rapida","offset":28,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"chamdaDe","offset":30,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"protecaob","offset":32,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"protecaoa","offset":34,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"freagem","offset":36,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"limitPressureOfMasterCylinder","offset":42,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"veloc4","offset":44,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"veloc3","offset":46,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"veloc2","offset":48,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"rapida","offset":50,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"fillingPressureGiven","offset":52,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"slopeGivenOfBreakthroughPressure","offset":54,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"velocityAttenuationRatio","offset":58,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"velocityAttenuationStroke","offset":60,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"maximumStrokeGiven","offset":68,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"swap16","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload1","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"return","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":710,"y":140,"wires":[["17483553facc8081","a3c6cd2ccde899bf"]]},{"id":"3fc9a582ec030e99","type":"change","z":"99321f37fd961305","name":"D990,50","rules":[{"t":"set","p":"topic","pt":"msg","to":"D990,50","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":260,"y":140,"wires":[["a1057e4a80c0d287"]]},{"id":"a1057e4a80c0d287","type":"link call","z":"99321f37fd961305","name":"","links":["eaccb1754fe661ae"],"linkType":"static","timeout":"30","x":440,"y":140,"wires":[["151485cfc8585f0a","eef6eca7504c7085"]]},{"id":"ce9c462e93a1e8d3","type":"buffer-parser","z":"99321f37fd961305","name":"Convert array to named values","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"int16le","name":"actualValueOfCoil","offset":36,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"breakthroughPressure","offset":60,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"residualPosition","offset":72,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"masterCylinderPosition","offset":74,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"rateOfDecay","offset":76,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"pressureOfMainCylinder","offset":82,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"speedGiven","offset":84,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"settingPointOfCoil","offset":86,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"pressureOfSideCylinder","offset":88,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"coilCurrent","offset":90,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"masterCylinderSpeed","offset":92,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"swap16","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload2","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"return","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":710,"y":260,"wires":[["dd70bbf1fcc54974","e1898eb76bbd3abe"]]},{"id":"a3c6cd2ccde899bf","type":"change","z":"99321f37fd961305","name":"D1040,50","rules":[{"t":"set","p":"topic","pt":"msg","to":"D1040,50","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":260,"y":260,"wires":[["bdbcd691d033c3d1"]]},{"id":"bdbcd691d033c3d1","type":"link call","z":"99321f37fd961305","name":"","links":["eaccb1754fe661ae"],"linkType":"static","timeout":"30","x":440,"y":260,"wires":[["7f04a5965542d46f","ce9c462e93a1e8d3"]]},{"id":"eef6eca7504c7085","type":"debug","z":"99321f37fd961305","name":"PLC Data 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":650,"y":100,"wires":[]},{"id":"7f04a5965542d46f","type":"debug","z":"99321f37fd961305","name":"PLC Data 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":650,"y":220,"wires":[]},{"id":"dd70bbf1fcc54974","type":"debug","z":"99321f37fd961305","name":"part 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":990,"y":260,"wires":[]},{"id":"e1898eb76bbd3abe","type":"function","z":"99321f37fd961305","name":"merge payload1 & payload2","func":"msg.payload = {\n ... msg.payload1,\n ... msg.payload2\n}\ndelete msg.payload1\ndelete msg.payload2\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":450,"y":340,"wires":[["dd3a59aded3ed544"]]},{"id":"dd3a59aded3ed544","type":"debug","z":"99321f37fd961305","name":"final result","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1010,"y":340,"wires":[]},{"id":"16dbc1e8e4c7b0f1","type":"group","z":"99321f37fd961305","name":"Read PLC Subroutine","style":{"label":true},"nodes":["38e76ddd4c78d4d9","eaccb1754fe661ae","3cc8f41d3137cbf6","f7fbc71a773c84f4","395888bce11d8592"],"x":84,"y":439,"w":492,"h":142},{"id":"38e76ddd4c78d4d9","type":"MC Read","z":"99321f37fd961305","g":"16dbc1e8e4c7b0f1","name":"","topic":"","connection":"8c926f873226d344","address":"topic","addressType":"msg","outputFormat":"1","errorHandling":"throw","outputs":1,"x":260,"y":480,"wires":[["3cc8f41d3137cbf6"]]},{"id":"eaccb1754fe661ae","type":"link in","z":"99321f37fd961305","g":"16dbc1e8e4c7b0f1","name":"Read PLC Subroutine","links":[],"x":125,"y":480,"wires":[["38e76ddd4c78d4d9"]]},{"id":"3cc8f41d3137cbf6","type":"link out","z":"99321f37fd961305","g":"16dbc1e8e4c7b0f1","name":"return","mode":"return","links":[],"x":405,"y":480,"wires":[]},{"id":"f7fbc71a773c84f4","type":"catch","z":"99321f37fd961305","g":"16dbc1e8e4c7b0f1","name":"","scope":"group","uncaught":false,"x":270,"y":540,"wires":[["395888bce11d8592"]]},{"id":"395888bce11d8592","type":"debug","z":"99321f37fd961305","g":"16dbc1e8e4c7b0f1","name":"Read Error","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":460,"y":540,"wires":[]},{"id":"8c926f873226d344","type":"MC Protocol Connection","name":"","host":"192.168.2.20","port":"5001","protocol":"TCP","frame":"1E","plcType":"Q","ascii":false,"PLCStation":"2","PCStation":"255","PLCModuleNo":"2","network":"2","octalInputOutput":false,"timeout":"1000"}]

```

show me what you get

---

<div class="post-metadata">

**Author:** ![Jayeshpitale1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jayeshpitale1/32/70216_2.png) [@Jayeshpitale1](https://discourse.nodered.org/u/Jayeshpitale1)\
**Post date:** [13 October 2024 08:14 UTC](https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340/47 "2024-10-13T08:14:03Z")

</div>

@Steve-Mcl  
I got it but the thing is would i need to sort the address list  
first screenshot  
for debug PLC data 1

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/2/a2e950d1668f703aa90bb1e8e1770337d9220eb5.png)

for debug part 1

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/2/b2c5807f701142ad9beccb718533b6540fae8be9.png)

for rest

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/2/62ec5adb263c84cd89aff3f8f120d01bf9466a4b.png)

---

<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:** [13 October 2024 08:17 UTC](https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340/48 "2024-10-13T08:17:56Z")

</div>

Good, so now you have 100 data items read in 2 chunks, all nicely assembled into a singe object.

Now if you want X, Y and M values, tell me what they are in a list like this...

| Address | Name |
| --- | --- |
| Y4 | powerOn |
| Y5 | machineReady |
| Y9 | inCycle |
| M22 | overCycle |
| etc | etc |
| etc | etc |
| etc | etc |

---

<div class="post-metadata">

**Author:** ![Jayeshpitale1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jayeshpitale1/32/70216_2.png) [@Jayeshpitale1](https://discourse.nodered.org/u/Jayeshpitale1)\
**Post date:** [13 October 2024 08:22 UTC](https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340/49 "2024-10-13T08:22:24Z")

</div>

| OUT | OUTPUT NAME | ADDRESS | TAG |
| --- | --- | --- | --- |
| Y0 | SOL PUMP COMBINATION | Y | 0 |
| Y1 | CONSTANT SPEED | Y | 1 |
| Y2 | CONTAINER FORWARD OIL RETURN | Y | 2 |
| Y3 | CONTAINER BACKWARD OIL RETURN | Y | 3 |
| Y4 | SEMI AUTO MODE | Y | 4 |
| Y5 | BACK UP | Y | 5 |
| Y6 | OUT KNOCKER UP | Y | 6 |
| Y7 | OUT KNOCKER DOWN | Y | 7 |
| Y10 | MAIN RAM PRESSURE RELIEF VALUE | Y | 10 |
| Y11 | CONTAINER HEATING | Y | 11 |
| Y12 | NO LOAD ELETRICAL CURRENT | Y | 12 |
| Y13 | SPEED 1 ADJUSTMENT CURRENT | Y | 13 |
| Y14 | SPEED 2 ADJUSTMENT CURRENT | Y | 14 |
| Y15 | SPEED 3 ADJUSTMENT CURRENT | Y | 15 |
| Y16 | SPEED 4 ADJUSMENT CURRENT | Y | 16 |
| Y17 | SPEED 5 ADJUSTMENTCURRENT | Y | 17 |
| Y20 | MAIN RAM FORWARD | Y | 20 |
| Y21 | MAIN RAM BACKWARD | Y | 21 |
| Y22 | CONTAINER FORWAD | Y | 22 |
| Y23 | CONATINER BACKWARD | Y | 23 |
| Y24 | SHEAR DOWN | Y | 24 |
| Y25 | SHEAE UP | Y | 25 |
| Y26 | OIL COMBINATION | Y | 26 |
| Y27 | SURGE VALVE OPEN | Y | 27 |
| Y30 | BILLET LOADER FORWARD | Y | 30 |
| Y31 | BILLET LOADER BACKWARD | Y | 31 |
| Y32 | PULLAR START | Y | 32 |
| Y33 | PULLER STOP | Y | 33 |
| Y34 | DIE SLIDE IN | Y | 34 |
| Y35 | DIE SLIDE OUT | Y | 35 |
| Y36 | BILLET PUSHING CYLINDER FORWARD | Y | 36 |
| Y37 | BILLET PUSHING CYLINDER BACKWARD | Y | 37 |
| Y40 | PISTON PUMP OVERFLOW VALVE 1 | Y | 40 |
| Y41 | PISTON PUMP OVERFLOW VALVE 2 | Y | 41 |
| Y42 | VANE PUMP OVERFLOW VALVE 1 | Y | 42 |
| Y43 | VANE PUMP OVERFLOW VALVE 2 | Y | 43 |
| Y44 | SURGE VALVE CLOSE | Y | 44 |
| Y45 | 120L pump overfllow valve | Y | 45 |
| Y46 | piston pump overflow valve 3# | Y | 46 |
| Y47 | 1# motor on | Y | 47 |
| Y50 | 1# motor on | Y | 50 |
| Y51 | 1# motor on | Y | 51 |
| Y52 | 2# motor on | Y | 52 |
| Y53 | 2# motor on | Y | 53 |
| Y54 | 2# motor on | Y | 54 |
| Y55 | 3# motor on | Y | 55 |
| Y56 | 3# motor on | Y | 56 |
| Y57 | 3# motor on | Y | 57 |
| Y60 | back up | Y | 60 |
| Y61 | constant speed | Y | 61 |
| Y62 | air cylinder forward | Y | 62 |
| Y63 | shear up | Y | 63 |
| Y64 | vane pump overflow valve 3# | Y | 64 |
| Y65 | piston pump overflow valve 4# | Y | 65 |
| Y66 | cooling pump on | Y | 66 |
| Y67 | die slide forward | Y | 67 |
| Y70 | die slide backward | Y | 70 |
| Y71 | container sealing 1 | Y | 71 |
| Y72 | container sealing 2 | Y | 72 |
| Y73 | stem out | Y | 73 |
| Y74 | stem in | Y | 74 |
| Y75 | billet pushing forward | Y | 75 |
| Y76 | billet pushing backward | Y | 76 |
| Y77 | stem lock-up | Y | 77 |
| Y100 | oil combination | Y | 100 |
| Y101 | container sealing on | Y | 101 |
| Y102 | main ram backward oil return | Y | 102 |
| Y103 | billet loader enable | Y | 103 |
| Y104 | forward inching | Y | 104 |
| Y105 | backward inching | Y | 105 |
| Y106 | high speed inching | Y | 106 |
| Y107 | billet loader searching home position | Y | 107 |
| Y110 | position of billet loader backward | Y | 110 |
| Y111 | position of billet loader forward | Y | 111 |
| Y112 | pistion 3 | Y | 112 |
| Y113 | billet loader reaching home position | Y | 113 |
| Y114 | power of billet loader | Y | 114 |
| Y115 | back up | Y | 115 |
| Y116 | back up | Y | 116 |
| Y117 | container heating2 | Y | 117 |

this are output y addresses

---

<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:** [13 October 2024 08:27 UTC](https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340/50 "2024-10-13T08:27:08Z")

</div>

Run this flow:

```auto
[{"id":"5cf897a3fbea442e","type":"MC Read","z":"99321f37fd961305","name":"","topic":"","connection":"8c926f873226d344","address":"topic","addressType":"msg","outputFormat":"1","errorHandling":"throw","outputs":1,"x":620,"y":1240,"wires":[["79bcbec04a949f2e"]]},{"id":"660df0a113c4dae3","type":"inject","z":"99321f37fd961305","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Y0,120","x":450,"y":1240,"wires":[["5cf897a3fbea442e"]]},{"id":"79bcbec04a949f2e","type":"debug","z":"99321f37fd961305","name":"PLC Data 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":790,"y":1240,"wires":[]},{"id":"7be52be29e860b1f","type":"inject","z":"99321f37fd961305","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"K2Y0,16","x":460,"y":1300,"wires":[["0d15654de772c499"]]},{"id":"0d15654de772c499","type":"MC Read","z":"99321f37fd961305","name":"","topic":"","connection":"8c926f873226d344","address":"topic","addressType":"msg","outputFormat":"1","errorHandling":"throw","outputs":1,"x":620,"y":1300,"wires":[["306c7cf39ba72617"]]},{"id":"306c7cf39ba72617","type":"debug","z":"99321f37fd961305","name":"PLC Data 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":790,"y":1300,"wires":[]},{"id":"f449e2485b31eef4","type":"MC Read","z":"99321f37fd961305","name":"","topic":"","connection":"8c926f873226d344","address":"topic","addressType":"msg","outputFormat":"1","errorHandling":"throw","outputs":1,"x":620,"y":1360,"wires":[["f1235dab7ede68cc"]]},{"id":"9de73af43582dd80","type":"inject","z":"99321f37fd961305","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"K4Y0,8","x":450,"y":1360,"wires":[["f449e2485b31eef4"]]},{"id":"f1235dab7ede68cc","type":"debug","z":"99321f37fd961305","name":"PLC Data 3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":790,"y":1360,"wires":[]},{"id":"8c926f873226d344","type":"MC Protocol Connection","name":"","host":"192.168.2.20","port":"5001","protocol":"TCP","frame":"1E","plcType":"Q","ascii":false,"PLCStation":"2","PCStation":"255","PLCModuleNo":"2","network":"2","octalInputOutput":false,"timeout":"1000"}]

```

Show me all three payloads

---

<div class="post-metadata">

**Author:** ![Jayeshpitale1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jayeshpitale1/32/70216_2.png) [@Jayeshpitale1](https://discourse.nodered.org/u/Jayeshpitale1)\
**Post date:** [13 October 2024 08:28 UTC](https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340/51 "2024-10-13T08:28:46Z")

</div>

@Steve-Mcl  
before that D990 and D1040 with final output in debug

```auto
{"extrusionRodNumber":0,"extrusionTime":2,"temperatureGiven":420,"temperatureSetting":195,"rapida":400,"chamdaDe":4000,"protecaob":3000,"protecaoa":2000,"freagem":1000,"limitPressureOfMasterCylinder":280,"veloc4":400,"veloc3":400,"veloc2":400,"fillingPressureGiven":100,"slopeGivenOfBreakthroughPressure":10,"velocityAttenuationRatio":0,"velocityAttenuationStroke":0,"maximumStrokeGiven":15653,"actualValueOfCoil":0,"breakthroughPressure":0,"residualPosition":12303,"masterCylinderPosition":3350,"rateOfDecay":0,"pressureOfMainCylinder":0,"speedGiven":0,"settingPointOfCoil":204,"pressureOfSideCylinder":0,"coilCurrent":0,"masterCylinderSpeed":0}

```

it does not consist 100 tag addresses from both tag

---

<div class="post-metadata">

**Author:** ![Jayeshpitale1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jayeshpitale1/32/70216_2.png) [@Jayeshpitale1](https://discourse.nodered.org/u/Jayeshpitale1)\
**Post date:** [13 October 2024 08:33 UTC](https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340/52 "2024-10-13T08:33:26Z")

</div>

> Run this flow:
> 
> ```auto
> [{"id":"5cf897a3fbea442e","type":"MC Read","z":"99321f37fd961305","name":"","topic":"","connection":"8c926f873226d344","address":"topic","addressType":"msg","outputFormat":"1","errorHandling":"throw","outputs":1,"x":620,"y":1240,"wires":[["79bcbec04a949f2e"]]},{"id":"660df0a113c4dae3","type":"inject","z":"99321f37fd961305","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Y0,120","x":450,"y":1240,"wires":[["5cf897a3fbea442e"]]},{"id":"79bcbec04a949f2e","type":"debug","z":"99321f37fd961305","name":"PLC Data 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":790,"y":1240,"wires":[]},{"id":"7be52be29e860b1f","type":"inject","z":"99321f37fd961305","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"K2Y0,16","x":460,"y":1300,"wires":[["0d15654de772c499"]]},{"id":"0d15654de772c499","type":"MC Read","z":"99321f37fd961305","name":"","topic":"","connection":"8c926f873226d344","address":"topic","addressType":"msg","outputFormat":"1","errorHandling":"throw","outputs":1,"x":620,"y":1300,"wires":[["306c7cf39ba72617"]]},{"id":"306c7cf39ba72617","type":"debug","z":"99321f37fd961305","name":"PLC Data 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":790,"y":1300,"wires":[]},{"id":"f449e2485b31eef4","type":"MC Read","z":"99321f37fd961305","name":"","topic":"","connection":"8c926f873226d344","address":"topic","addressType":"msg","outputFormat":"1","errorHandling":"throw","outputs":1,"x":620,"y":1360,"wires":[["f1235dab7ede68cc"]]},{"id":"9de73af43582dd80","type":"inject","z":"99321f37fd961305","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"K4Y0,8","x":450,"y":1360,"wires":[["f449e2485b31eef4"]]},{"id":"f1235dab7ede68cc","type":"debug","z":"99321f37fd961305","name":"PLC Data 3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":790,"y":1360,"wires":[]},{"id":"8c926f873226d344","type":"MC Protocol Connection","name":"","host":"192.168.2.20","port":"5001","protocol":"TCP","frame":"1E","plcType":"Q","ascii":false,"PLCStation":"2","PCStation":"255","PLCModuleNo":"2","network":"2","octalInputOutput":false,"timeout":"1000"}]
> 
> ```
> 
> Show me all three payloads

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/3/93b70eda067c39fea81fa2a2127c0b1fa4a506ec.png)  
@Steve-Mcl  
i got two right and the middle one got error

---

<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:** [13 October 2024 08:35 UTC](https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340/53 "2024-10-13T08:35:12Z")

</div>

> [@Jayeshpitale1](#):
>
> it does not consist 100 tag addresses from both tag

No, it contains the items specified in the Buffer Parser.

If you WANT 100 items, you will have to include them in the Buffer Parser like I did.

I did a selection for demonstration purposes.

I cannot do everything for you. I have given you the knowledge, you will have to do some things yourself.

---

<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:** [13 October 2024 08:39 UTC](https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340/54 "2024-10-13T08:39:35Z")

</div>

Now try this flow - show me the output of final Result (expand all parts)

```auto
[{"id":"ee548f43b60a3cfb","type":"inject","z":"99321f37fd961305","name":"","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":130,"y":140,"wires":[["3fc9a582ec030e99"]]},{"id":"17483553facc8081","type":"debug","z":"99321f37fd961305","name":"part 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":990,"y":140,"wires":[]},{"id":"151485cfc8585f0a","type":"buffer-parser","z":"99321f37fd961305","name":"Convert array to named values","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"int16le","name":"extrusionRodNumber","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"extrusionTime","offset":2,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"temperatureGiven","offset":4,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"temperatureSetting","offset":6,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"rapida","offset":28,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"chamdaDe","offset":30,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"protecaob","offset":32,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"protecaoa","offset":34,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"freagem","offset":36,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"limitPressureOfMasterCylinder","offset":42,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"veloc4","offset":44,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"veloc3","offset":46,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"veloc2","offset":48,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"rapida","offset":50,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"fillingPressureGiven","offset":52,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"slopeGivenOfBreakthroughPressure","offset":54,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"velocityAttenuationRatio","offset":58,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"velocityAttenuationStroke","offset":60,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"maximumStrokeGiven","offset":68,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"swap16","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload1","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"return","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":710,"y":140,"wires":[["17483553facc8081","a3c6cd2ccde899bf"]]},{"id":"3fc9a582ec030e99","type":"change","z":"99321f37fd961305","name":"D990,50","rules":[{"t":"set","p":"topic","pt":"msg","to":"D990,50","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":260,"y":140,"wires":[["a1057e4a80c0d287"]]},{"id":"a1057e4a80c0d287","type":"link call","z":"99321f37fd961305","name":"","links":["eaccb1754fe661ae"],"linkType":"static","timeout":"30","x":440,"y":140,"wires":[["151485cfc8585f0a","eef6eca7504c7085"]]},{"id":"ce9c462e93a1e8d3","type":"buffer-parser","z":"99321f37fd961305","name":"Convert array to named values","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"int16le","name":"actualValueOfCoil","offset":36,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"breakthroughPressure","offset":60,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"residualPosition","offset":72,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"masterCylinderPosition","offset":74,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"rateOfDecay","offset":76,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"pressureOfMainCylinder","offset":82,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"speedGiven","offset":84,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"settingPointOfCoil","offset":86,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"pressureOfSideCylinder","offset":88,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"coilCurrent","offset":90,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"masterCylinderSpeed","offset":92,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"swap16","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload2","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"return","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":710,"y":260,"wires":[["dd70bbf1fcc54974","fc265c85f748fb8d"]]},{"id":"a3c6cd2ccde899bf","type":"change","z":"99321f37fd961305","name":"D1040,50","rules":[{"t":"set","p":"topic","pt":"msg","to":"D1040,50","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":260,"y":260,"wires":[["bdbcd691d033c3d1"]]},{"id":"bdbcd691d033c3d1","type":"link call","z":"99321f37fd961305","name":"","links":["eaccb1754fe661ae"],"linkType":"static","timeout":"30","x":440,"y":260,"wires":[["7f04a5965542d46f","ce9c462e93a1e8d3"]]},{"id":"eef6eca7504c7085","type":"debug","z":"99321f37fd961305","name":"PLC Data 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":650,"y":100,"wires":[]},{"id":"7f04a5965542d46f","type":"debug","z":"99321f37fd961305","name":"PLC Data 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":650,"y":220,"wires":[]},{"id":"dd70bbf1fcc54974","type":"debug","z":"99321f37fd961305","name":"part 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":990,"y":260,"wires":[]},{"id":"e1898eb76bbd3abe","type":"function","z":"99321f37fd961305","name":"merge payloads","func":"msg.payload = {\n ... msg.payload1,\n ... msg.payload2,\n Y: {\n ...msg.payload3\n }\n}\ndelete msg.payload1\ndelete msg.payload2\ndelete msg.payload3\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":600,"y":420,"wires":[["dd3a59aded3ed544"]]},{"id":"dd3a59aded3ed544","type":"debug","z":"99321f37fd961305","name":"final result","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1010,"y":420,"wires":[]},{"id":"fc265c85f748fb8d","type":"change","z":"99321f37fd961305","name":"K4Y0,120","rules":[{"t":"set","p":"topic","pt":"msg","to":"Y0,120","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":260,"y":340,"wires":[["bafe2d392b393fdb"]]},{"id":"bafe2d392b393fdb","type":"MC Read","z":"99321f37fd961305","name":"","topic":"","connection":"8c926f873226d344","address":"topic","addressType":"msg","outputFormat":"0","errorHandling":"throw","outputs":1,"x":420,"y":340,"wires":[["4c29f73c76822417"]]},{"id":"4c29f73c76822417","type":"change","z":"99321f37fd961305","name":"set payload3","rules":[{"t":"move","p":"payload","pt":"msg","to":"payload3","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":340,"wires":[["e1898eb76bbd3abe"]]},{"id":"16dbc1e8e4c7b0f1","type":"group","z":"99321f37fd961305","name":"Read PLC Subroutine","style":{"label":true},"nodes":["38e76ddd4c78d4d9","eaccb1754fe661ae","3cc8f41d3137cbf6","f7fbc71a773c84f4","395888bce11d8592"],"x":64,"y":499,"w":492,"h":142},{"id":"38e76ddd4c78d4d9","type":"MC Read","z":"99321f37fd961305","g":"16dbc1e8e4c7b0f1","name":"","topic":"","connection":"8c926f873226d344","address":"topic","addressType":"msg","outputFormat":"1","errorHandling":"throw","outputs":1,"x":240,"y":540,"wires":[["3cc8f41d3137cbf6"]]},{"id":"eaccb1754fe661ae","type":"link in","z":"99321f37fd961305","g":"16dbc1e8e4c7b0f1","name":"Read PLC Subroutine","links":[],"x":105,"y":540,"wires":[["38e76ddd4c78d4d9"]]},{"id":"3cc8f41d3137cbf6","type":"link out","z":"99321f37fd961305","g":"16dbc1e8e4c7b0f1","name":"return","mode":"return","links":[],"x":385,"y":540,"wires":[]},{"id":"f7fbc71a773c84f4","type":"catch","z":"99321f37fd961305","g":"16dbc1e8e4c7b0f1","name":"","scope":"group","uncaught":false,"x":250,"y":600,"wires":[["395888bce11d8592"]]},{"id":"395888bce11d8592","type":"debug","z":"99321f37fd961305","g":"16dbc1e8e4c7b0f1","name":"Read Error","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":440,"y":600,"wires":[]},{"id":"8c926f873226d344","type":"MC Protocol Connection","name":"","host":"192.168.2.20","port":"5001","protocol":"TCP","frame":"1E","plcType":"Q","ascii":false,"PLCStation":"2","PCStation":"255","PLCModuleNo":"2","network":"2","octalInputOutput":false,"timeout":"1000"}]

```

---

<div class="post-metadata">

**Author:** ![Jayeshpitale1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jayeshpitale1/32/70216_2.png) [@Jayeshpitale1](https://discourse.nodered.org/u/Jayeshpitale1)\
**Post date:** [13 October 2024 08:40 UTC](https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340/55 "2024-10-13T08:40:56Z")

</div>

Yes i know that you helped me a lot with a real example thank you for that no doubt the other thing i have to do.  
But

> [@Steve-Mcl](#):
>
> Remember, the 99 points of data are READ starting from `D990`, Index 0, byte offset 0
> 
> | ITEM | AREA | ADDR | Nicer Property Name | Byte Offset | Index Offset |
> | --- | --- | --- | --- | --- | --- |
> | EXTRUSION ROD NUMBER | D | 990 | extrusionRodNumber | 0 | 0 |
> | EXTRUSION TIME | D | 991 | extrusionTime | 2 | 1 |
> | TEMPERATURE GIVEN | D | 992 | temperatureGiven | 4 | 2 |
> | TEMPERATURE SETTING | D | 993 | temperatureSetting | 6 | 3 |
> | RAPIDA | D | 1004 | rapida | 28 | 14 |
> | CHAMDA DE | D | 1005 | chamdaDe | 30 | 15 |
> | PROTECAOB | D | 1006 | protecaob | 32 | 16 |
> | PROTECAOA | D | 1007 | protecaoa | 34 | 17 |
> | FREAGEM | D | 1008 | freagem | 36 | 18 |
> | LIMIT PRESSURE OF MASTER CYLINDER | D | 1011 | limitPressureOfMasterCylinder | 42 | 21 |
> | VELOC 4 | D | 1012 | veloc4 | 44 | 22 |
> | VELOC 3 | D | 1013 | veloc3 | 46 | 23 |
> | VELOC 2 | D | 1014 | veloc2 | 48 | 24 |
> | RAPIDA | D | 1015 | rapida | 50 | 25 |
> | FILLING PRESSURE GIVEN | D | 1016 | fillingPressureGiven | 52 | 26 |
> | SLOPE GIVEN OF BREAKTHROGH PRESSURE | D | 1017 | slopeGivenOfBreakthroughPressure | 54 | 27 |
> | VELOCITY ATTENUATION RATIO | D | 1019 | velocityAttenuationRatio | 58 | 29 |
> | VELOCITY ATTENUATION STROKE | D | 1020 | velocityAttenuationStroke | 60 | 30 |
> | MAXIMUM STROKE GIVEN | D | 1024 | maximumStrokeGiven | 68 | 34 |
> | ACTUAL VALUE OF COIL | D | 1058 | actualValueOfCoil | 136 | 68 |
> | BREAK THROGH PRESSURE | D | 1070 | breakthroughPressure | 160 | 80 |
> | RESIDUAL POSITION | D | 1076 | residualPosition | 172 | 86 |
> | MASTER CYLNDER POSITION | D | 1077 | masterCylinderPosition | 174 | 87 |
> | RATE OF DECAY | D | 1078 | rateOfDecay | 176 | 88 |
> | PRESSURE OF MAIN CYLINDER | D | 1081 | pressureOfMainCylinder | 182 | 91 |
> | SPEED GIVEN | D | 1082 | speedGiven | 184 | 92 |
> | SETTING POINT OF COIL | D | 1083 | settingPointOfCoil | 186 | 93 |
> | PRESSURE OF SIDE CYLINDER | D | 1084 | pressureOfSideCylinder | 188 | 94 |
> | COIL CURRENT | D | 1085 | coilCurrent | 190 | 95 |
> | MASTER CYLINDER SPPED | D | 1086 | masterCylinderSpeed | 192 | 96 |

@Steve-Mcl  
i need to know that how to find bytes offset and index offset

---

<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:** [13 October 2024 08:50 UTC](https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340/56 "2024-10-13T08:50:19Z")

</div>

> [@Jayeshpitale1](#):
>
> i need to know that how to find bytes offset and index offset

Do you know what a 16 bit value is?

Do you know what a BYTE is?

1 MC READ value is 16 bit AKA 2 bytes.

therefore:

- If you get 3 16bit values ` [xxxx, yyyy, zzzz]` then `xxxx` is bytes 0 & 1, `yyyy` is bytes 2 & 3, and so on.
- if you read D990,50, then D990 is byte 0 & 1, D991 is bytes 2 & 3 ... D1024 is bytes 68 & 69, and so on.
- if you read D1040,50, then D1040 is byte 0 & 1, D1041 is bytes 2 & 3 ... and so on.

It is simple maths.

Byte Offset = (Address - Start Address) \* 2

e.g.  
Address: `D1048`  
Start Address: `D1040`  
Byte Offset = `(1048 - 1040) * 2` = `16`

Read this again:

> [@Steve-Mcl](#):
>
> That said, i can see you have entered the address `D990`. That will READ only 1 WORD of data!. How do you expect to parse things like `temperatureSetting` which is at D993?
> 
> Let me explain the point of this all.
> 
> 1. You want to READ from the PLC many things at once to make your code easier to maintain, get best performance, get good consistent data
> 2. So we read 99 16 bit integers starting from D990
> 3. Remember, D registers are 16 bit AKA 2 bytes wide
> 4. That means D990 value is at index `0` (offset byte `0`)
> 5. That means D991 value is at index `1` (offset byte `2`)
> 6. That means D992 value is at index `2` (offset byte `4`)
> 7. That means D993 value is at index `3` (offset byte `6`)

---

<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:** [13 October 2024 08:57 UTC](https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340/57 "2024-10-13T08:57:51Z")

</div>

> [@Steve-Mcl](#):
>
> Run this flow:
> 
> ```auto
> [{"id":"5cf897a3fbea442e","type":"MC Read","z":"99321f37fd961305","name":"","topic":"","connection":"8c926f873226d344","address":"topic","addressType":"msg","outputFormat":"1","errorHandling":"throw","outputs":1,"x":620,"y":1240,"wires":[["79bcbec04a949f2e"]]},{"id":"660df0a113c4dae3","type":"inject","z":"99321f37fd961305","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Y0,120","x":450,"y":1240,"wires":[["5cf897a3fbea442e"]]},{"id":"79bcbec04a949f2e","type":"debug","z":"99321f37fd961305","name":"PLC Data 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":790,"y":1240,"wires":[]},{"id":"7be52be29e860b1f","type":"inject","z":"99321f37fd961305","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"K2Y0,16","x":460,"y":1300,"wires":[["0d15654de772c499"]]},{"id":"0d15654de772c499","type":"MC Read","z":"99321f37fd961305","name":"","topic":"","connection":"8c926f873226d344","address":"topic","addressType":"msg","outputFormat":"1","errorHandling":"throw","outputs":1,"x":620,"y":1300,"wires":[["306c7cf39ba72617"]]},{"id":"306c7cf39ba72617","type":"debug","z":"99321f37fd961305","name":"PLC Data 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":790,"y":1300,"wires":[]},{"id":"f449e2485b31eef4","type":"MC Read","z":"99321f37fd961305","name":"","topic":"","connection":"8c926f873226d344","address":"topic","addressType":"msg","outputFormat":"1","errorHandling":"throw","outputs":1,"x":620,"y":1360,"wires":[["f1235dab7ede68cc"]]},{"id":"9de73af43582dd80","type":"inject","z":"99321f37fd961305","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"K4Y0,8","x":450,"y":1360,"wires":[["f449e2485b31eef4"]]},{"id":"f1235dab7ede68cc","type":"debug","z":"99321f37fd961305","name":"PLC Data 3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":790,"y":1360,"wires":[]},{"id":"8c926f873226d344","type":"MC Protocol Connection","name":"","host":"192.168.2.20","port":"5001","protocol":"TCP","frame":"1E","plcType":"Q","ascii":false,"PLCStation":"2","PCStation":"255","PLCModuleNo":"2","network":"2","octalInputOutput":false,"timeout":"1000"}]
> 
> ```

You might have missed this post ↑

---

<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:** [13 October 2024 09:00 UTC](https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340/58 "2024-10-13T09:00:48Z")

</div>

@Jayeshpitale1

I am going to leave you to do this by yourself now.

I have spent over 4 hours of my own personal time, across the last few days helping you - I think that is enough.

I have given you a LOT of demos, a LOT of information and enough tips and hints to put this all together by yourself.

Best of luck. Steve.

---

<div class="post-metadata">

**Author:** ![Jayeshpitale1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jayeshpitale1/32/70216_2.png) [@Jayeshpitale1](https://discourse.nodered.org/u/Jayeshpitale1)\
**Post date:** [13 October 2024 09:01 UTC](https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340/59 "2024-10-13T09:01:02Z")

</div>

i got it Both the thing are in one D tag and Y tag address

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/1/91c46037744863a4a4e61721da87122d22239ea1.png)

Now what about D\_bit Address Means it is show Boolean in Kep and when i add it to MC protocol a single address i need to use Like this D1088.2 for D\_bit 108802

---

<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:** [13 October 2024 09:02 UTC](https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340/60 "2024-10-13T09:02:12Z")

</div>

> [@Jayeshpitale1](#):
>
> Now what about D\_bit Address Means it is show Boolean

Add a BOOL as i have explained twice already

Here is it one last time.

Calculate the offset to the DM, enter the BIT number, give it a name

> [@Steve-Mcl](#):
>
> I have explained that before here:
> 
> > [@Steve-Mcl](#):
> >
> > So for the example I did earlier, to get bits from a D register, just chose BOOL and a byte and bit offset in the buffer parser.
> > 
> > ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/2/e21966731b1e195ac79afaed8a713104410bc56a.png)
> > 
> > Its all detailed and explained in the built-in help (node-red side bar) and the built in examples for buffer-parser (examples are access via `CTRL-I` -\> examples
> > 
> > there are also LOTS of examples and demos in the forum (search buffer parser).
> > 
> > For reading Y / M / X, you can request them from the MC READ node as a word (or multiple words) with a digit specifier like `K4` e.g. `K4Y0,10` should read 10 16bit WORDSs starting from Y0 - then you pick out the bits using buffer parser

[Previous page](https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340.md?page=2)

[Next page](https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340.md?page=4)
