# 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:** 1

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

</div>

@Steve-Mcl  
i have multiple address but i need to use function node or any node and mc protocol node to get all in their respective data  
for example i have tag like  
D1101  
D1077  
D993  
M20  
Y34  
D216  
etc

Your solution about that did not understand me because i tried it to change to my address but was not working as expected

---

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

</div>

Please Reply @Steve-Mcl

---

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

</div>

Your question is not entirely clear.

Are you asking how to read from different memory addresses in one READ node all in one network transaction?

Or are you asking how you can dynamically read different addresses with 1 node in separate network transactions?

Or something related to converting the data you have read?

Please be clear and use annotated screenshots where it is hard to explain.

---

<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:** [12 October 2024 11:44 UTC](https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340/4 "2024-10-12T11:44:46Z")

</div>

@Steve-Mcl  
i want read Multiple Address through MC protocol but using 1 node if possible but using function node to put address with their respective name i assume i might have address around 120 so i wont put 120 mc protocol node in pallet and play with it

> Are you asking how to read from different memory addresses in one READ node all in one network transaction?

YES But for FX3U only just 1 PLC as i am put SCREEN SHOT Below

 ![IMG-20241011-WA0001](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/5/35e962a6708c693dae1111976b0a4c0acb1f179f.jpeg)

---

<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:** [12 October 2024 11:55 UTC](https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340/5 "2024-10-12T11:55:29Z")

</div>

As I stated in the other post, you cannot read different device areas (e.g. D and Y and M) in a single network transaction - that is not supported by this node.

Instead, you should gather all values in a continuous D area (using ladder) and read them all in one go. This ensures consistent data as described in [the article](https://flowfuse.com/blog/2023/09/modernize-your-legacy-industrial-data-part2/) I linked you to before.

You _can_ provide an address in the `msg` and dynamically (one area at a time) read or write different addresses - but your data will be susceptible to inconsistencies (as described in the article)

QUESTION: How often do you need to poll the data?

QUESTION: Can you provide an entire list of addresses you need to read in this format:

| Address | Type | Read frequency |
| --- | --- | --- |
| Y34 | BIT | every 1 sec |
| D1101 | UINT | When Y34 == 1 |
| D1077 | UINT | When Y34 == 1 |
| ... | ... | ... |

QUESTION: Can you provide an entire list of addresses you need to write

| Address | Type | Write frequency |
| --- | --- | --- |
| M20 | BIT | when user presses dashboard button |
| D993 | UINT | Every minute |
| ... | ... | ... |

* * *

with the above info i can help you structure a more maintainable design than you have in your 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:** [12 October 2024 12:07 UTC](https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340/6 "2024-10-12T12:07:30Z")

</div>

@Steve-Mcl  
[JM\_3\_PRESS\_REG.pdf](https://discourse.nodered.org/uploads/short-url/qL3xTvl2ZoVPmTEQm3D1Z3YfzOe.pdf) (289.3 KB)

you can check it i have right now this much tag i will add if i get to know how to use it

---

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

</div>

that is as clear as mud.

for example, D1077 is listed 4 times with different comments, there are no data types (are these D values all Signed Integers? Unsigned Integers? Are they all 16 bit or are some of them 32 bit?

Any how, the majority of them are in an area reasonably sized range to be able to grab them in one hit.

Here is an example:

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

Demo Flow (use `CTRL+I` to import)

```auto
[{"id":"9d5fe86ef9060dfc","type":"buffer-parser","z":"0f909bac596182b4","name":"Convert array ro 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":""},{"type":"int16le","name":"actualValueOfCoil","offset":136,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"breakthroughPressure","offset":160,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"residualPosition","offset":172,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"masterCylinderPosition","offset":174,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"rateOfDecay","offset":176,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"pressureOfMainCylinder","offset":182,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"speedGiven","offset":184,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"settingPointOfCoil","offset":186,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"pressureOfSideCylinder","offset":188,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"coilCurrent","offset":190,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16le","name":"masterCylinderSpeed","offset":192,"length":1,"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":490,"y":1180,"wires":[["f2595a732b6b660f"]]},{"id":"69fd61c05090c7fa","type":"inject","z":"0f909bac596182b4","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"D990,99","x":200,"y":1080,"wires":[["bf28bf135f832821"]]},{"id":"f2595a732b6b660f","type":"debug","z":"0f909bac596182b4","name":"debug 390","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":550,"y":1260,"wires":[]},{"id":"a3d02109deacdab5","type":"group","z":"0f909bac596182b4","name":"FAKE: Read D990,99 \\n (99 Words starting from D990) \\n Replace me with MC READ Node","style":{"label":true},"nodes":["bf28bf135f832821","59f8997f6e58892a","354fb8229f36ba34"],"x":294,"y":967,"w":432,"h":154},{"id":"bf28bf135f832821","type":"template","z":"0f909bac596182b4","g":"a3d02109deacdab5","name":"fake PLC data","field":"payload","fieldType":"msg","format":"json","syntax":"mustache","template":"[\n 2,\n 1200,\n 350,\n 360,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 4,\n 0,\n -250,\n -245,\n 100,\n 0,\n 0,\n 2800,\n 4,\n 3,\n 2,\n 1,\n 1500,\n 50,\n 0,\n 95,\n 500,\n 0,\n 0,\n 0,\n 1024,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 300,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 2500,\n 0,\n 0,\n 10,\n 11,\n -5,\n 0,\n 0,\n 2500,\n 1200,\n 50,\n 1750,\n 0,\n 0,\n 0\n]\n","output":"json","x":400,"y":1080,"wires":[["59f8997f6e58892a","354fb8229f36ba34"]]},{"id":"59f8997f6e58892a","type":"buffer-maker","z":"0f909bac596182b4","g":"a3d02109deacdab5","name":"int16 to buffer","specification":"spec","specificationType":"ui","items":[{"name":"item1","type":"int16be","length":-1,"dataType":"msg","data":"payload"}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","x":600,"y":1080,"wires":[["9d5fe86ef9060dfc"]]},{"id":"354fb8229f36ba34","type":"debug","z":"0f909bac596182b4","g":"a3d02109deacdab5","name":"PLC Data","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":620,"y":1040,"wires":[]}]

```

In short, as the linked article states. Getting as many data items in one go will increase speed, will reduce network traffic, will improve data consistency.

So you should repeat this for other ranges.

The better solution is to re-arrange ALL parts of data into a single D area and read that all in one go then parse out the flags and WORDS and FLOATS using buffer-parser.

---

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

</div>

What about D\_bit, M, X and Y address how to get it

---

<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:** [12 October 2024 16:47 UTC](https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340/9 "2024-10-12T16:47:15Z")

</div>

The buffer parser can pick out BITs from the DM

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

---

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

</div>

I really did not understand what to do i tried to play with the example to really data but it did not worked me and as i share you my address could you please provide me with real data instead of using fake, what i means is i need to use this address to show it on UI.

---

<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 05:27 UTC](https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340/11 "2024-10-13T05:27:58Z")

</div>

> [@Jayeshpitale1](#):
>
> I really did not understand what to do i tried to play with the example to really data but it did not worked me

Share your none working flow (Select relevant nodes, press CTRL+E, copy to clipboard, paste in reply) so i can see what you did

---

<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 05:31 UTC](https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340/12 "2024-10-13T05:31:51Z")

</div>

```auto
[
    {
        "id": "e95a7b2e1151c8ce",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "a3d02109deacdab5",
        "type": "group",
        "z": "e95a7b2e1151c8ce",
        "name": "FAKE: Read D990,99 \\n (99 Words starting from D990) \\n Replace me with MC READ Node",
        "style": {
            "label": true
        },
        "nodes": [
            "354fb8229f36ba34"
        ],
        "x": 474,
        "y": 27,
        "w": 217,
        "h": 114
    },
    {
        "id": "9d5fe86ef9060dfc",
        "type": "buffer-parser",
        "z": "e95a7b2e1151c8ce",
        "name": "Convert array ro 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": ""
            },
            {
                "type": "int16le",
                "name": "actualValueOfCoil",
                "offset": 136,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "breakthroughPressure",
                "offset": 160,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "residualPosition",
                "offset": 172,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "masterCylinderPosition",
                "offset": 174,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "rateOfDecay",
                "offset": 176,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "pressureOfMainCylinder",
                "offset": 182,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "speedGiven",
                "offset": 184,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "settingPointOfCoil",
                "offset": 186,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "pressureOfSideCylinder",
                "offset": 188,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "coilCurrent",
                "offset": 190,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "masterCylinderSpeed",
                "offset": 192,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            }
        ],
        "swap1": "swap16",
        "swap2": "",
        "swap3": "",
        "swap1Type": "swap",
        "swap2Type": "swap",
        "swap3Type": "swap",
        "msgProperty": "payload",
        "msgPropertyType": "str",
        "resultType": "value",
        "resultTypeType": "return",
        "multipleResult": true,
        "fanOutMultipleResult": false,
        "setTopic": true,
        "outputs": 1,
        "x": 430,
        "y": 240,
        "wires": [
            [
                "f2595a732b6b660f"
            ]
        ]
    },
    {
        "id": "69fd61c05090c7fa",
        "type": "inject",
        "z": "e95a7b2e1151c8ce",
        "name": "",
        "props": [
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "D990,99",
        "x": 140,
        "y": 140,
        "wires": [
            [
                "9fac3f141851276c"
            ]
        ]
    },
    {
        "id": "f2595a732b6b660f",
        "type": "debug",
        "z": "e95a7b2e1151c8ce",
        "name": "debug 390",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 490,
        "y": 320,
        "wires": []
    },
    {
        "id": "354fb8229f36ba34",
        "type": "debug",
        "z": "e95a7b2e1151c8ce",
        "g": "a3d02109deacdab5",
        "name": "PLC Data",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 560,
        "y": 100,
        "wires": []
    },
    {
        "id": "9fac3f141851276c",
        "type": "MC Read",
        "z": "e95a7b2e1151c8ce",
        "name": "",
        "topic": "",
        "connection": "68f68eb02a618617",
        "address": "D990",
        "addressType": "str",
        "outputFormat": "1",
        "errorHandling": "throw",
        "outputs": 1,
        "x": 340,
        "y": 140,
        "wires": [
            [
                "354fb8229f36ba34",
                "9d5fe86ef9060dfc"
            ]
        ]
    },
    {
        "id": "68f68eb02a618617",
        "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": "20000"
    }
]

```

_admin edit: wrap flow in backticks_

---

<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 05:45 UTC](https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340/13 "2024-10-13T05:45:04Z")

</div>

sorry did send you wrong flow before  
[flows (1).json](https://discourse.nodered.org/uploads/short-url/8jI7ExqQ00bW3tHqUK9tYrnhjhE.json) (11.1 KB)  
@Steve-Mcl  
Are you there

---

<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)

---

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

</div>

```auto
[
    {
        "id": "e95a7b2e1151c8ce",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "a3d02109deacdab5",
        "type": "group",
        "z": "e95a7b2e1151c8ce",
        "name": "FAKE: Read D990,99 \\n (99 Words starting from D990) \\n Replace me with MC READ Node",
        "style": {
            "label": true
        },
        "nodes": [
            "354fb8229f36ba34"
        ],
        "x": 474,
        "y": 27,
        "w": 217,
        "h": 114
    },
    {
        "id": "9d5fe86ef9060dfc",
        "type": "buffer-parser",
        "z": "e95a7b2e1151c8ce",
        "name": "Convert array ro 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": ""
            },
            {
                "type": "int16le",
                "name": "actualValueOfCoil",
                "offset": 136,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "breakthroughPressure",
                "offset": 160,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "residualPosition",
                "offset": 172,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "masterCylinderPosition",
                "offset": 174,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "rateOfDecay",
                "offset": 176,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "pressureOfMainCylinder",
                "offset": 182,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "speedGiven",
                "offset": 184,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "settingPointOfCoil",
                "offset": 186,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "pressureOfSideCylinder",
                "offset": 188,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "coilCurrent",
                "offset": 190,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int16le",
                "name": "masterCylinderSpeed",
                "offset": 192,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            }
        ],
        "swap1": "swap16",
        "swap2": "",
        "swap3": "",
        "swap1Type": "swap",
        "swap2Type": "swap",
        "swap3Type": "swap",
        "msgProperty": "payload",
        "msgPropertyType": "str",
        "resultType": "value",
        "resultTypeType": "return",
        "multipleResult": true,
        "fanOutMultipleResult": false,
        "setTopic": true,
        "outputs": 1,
        "x": 430,
        "y": 240,
        "wires": [
            [
                "f2595a732b6b660f"
            ]
        ]
    },
    {
        "id": "69fd61c05090c7fa",
        "type": "inject",
        "z": "e95a7b2e1151c8ce",
        "name": "",
        "props": [
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "D990,99",
        "x": 140,
        "y": 140,
        "wires": [
            [
                "9fac3f141851276c"
            ]
        ]
    },
    {
        "id": "f2595a732b6b660f",
        "type": "debug",
        "z": "e95a7b2e1151c8ce",
        "name": "debug 390",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 490,
        "y": 320,
        "wires": []
    },
    {
        "id": "354fb8229f36ba34",
        "type": "debug",
        "z": "e95a7b2e1151c8ce",
        "g": "a3d02109deacdab5",
        "name": "PLC Data",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 560,
        "y": 100,
        "wires": []
    },
    {
        "id": "9fac3f141851276c",
        "type": "MC Read",
        "z": "e95a7b2e1151c8ce",
        "name": "",
        "topic": "",
        "connection": "68f68eb02a618617",
        "address": "D990",
        "addressType": "str",
        "outputFormat": "1",
        "errorHandling": "throw",
        "outputs": 1,
        "x": 340,
        "y": 140,
        "wires": [
            [
                "354fb8229f36ba34",
                "9d5fe86ef9060dfc"
            ]
        ]
    },
    {
        "id": "68f68eb02a618617",
        "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": "20000"
    }
]

```

@Steve-Mcl I have paste the code

---

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

</div>

Also, read the built in help for the nodes.

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

---

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

</div>

@Steve-Mcl  
could you help me a bit in the code, i am bit confused and i dont know how to use it proper as you are guiding me but still

---

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

</div>

> [@Jayeshpitale1](#):
>
> could you help me a bit in the code

I have given you LOTS of help already. More than most. You have all the information above. I am not sure I can do more to help than I already have!

---

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

</div>

Just try setting the MC READ node `address` field to `D990,99` - see what happens.

Use debug nodes on every node to look at what goes in, and what comes out.

---

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

</div>

@Steve-Mcl  
i set MC protocol node to D990,99 and it give me timeout error as a result it did  
not worked  
and the code i mention about is i removed ,99 from it and it worked for MC Protocol node but for buffer it say "Error: data is not an array or a buffer"

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

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