# 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:** 1\
**Showing post:** 14

<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 06:03 UTC](https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340/14 "2024-10-13T06:03:02Z")

</div>

that is only the MC Protocol node.

I said "Share your none working flow (Select relevant nodes..."

  

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
  1. Remember, D registers are 16 bit AKA 2 bytes wide

3. That means D990 value is at index `0` (offset byte `0`)
4. That means D991 value is at index `1` (offset byte `2`)
5. That means D992 value is at index `2` (offset byte `4`)
6. That means D993 value is at index `3` (offset byte `6`)

Here is a table of things from your PDF and how they align with D990 as the starting point

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 |

Note how `rateOfDecay` is entered in the buffer parser as using byte `Offset` `176` - and how it matches up to D1078 in the above table.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/9/5902fc2c099951e0f86f1abf6054a09ad3d02628.png)

### Recap

In order to PARSE a chunk of data all at once, into nicely formatted object, you first NEED to request 99 things. Thats why I put `D990,99` in the comments and in the inject node and wrote it explicitly for you

Does that make sense?

  

Also, in order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote `````)

````auto
``` 
   code goes here 
```

````

You can edit and correct your post by clicking the pencil ✏ icon.

See this post for more details - [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

---

_[View the full topic](https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340)._
