# Quality Issue in PLC with nodered

**URL:** <https://discourse.nodered.org/t/quality-issue-in-plc-with-nodered/94710>\
**Category:** General\
**Created:** [18 January 2025 09:03 UTC](https://discourse.nodered.org/t/quality-issue-in-plc-with-nodered/94710 "2025-01-18T09:03:36Z")\
**Posts on this page:** 7\
**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:** [18 January 2025 09:03 UTC](https://discourse.nodered.org/t/quality-issue-in-plc-with-nodered/94710/1 "2025-01-18T09:03:36Z")

</div>

Hi There,  
@Steve-Mcl  
As per Previous Topic Discussion and the thing worked well for read in mcprotocol for Address D Related

> [@Reading multiple addresses from MC Protocol (Mitsubishi FX PLC)](https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340):
>
> @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

Now i Have Issue with C0 it gives Quality Issue For that Address Whereas Other Address are working well in D

 ![plcs](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/5/958dd794dc91a18b998da85f4b4c11953ef43a39.png)

Also Note That When i tried with Write Node For Address Like X or M  
As discussed in Previous Topic

> [@Reading multiple addresses from MC Protocol (Mitsubishi FX PLC)](https://discourse.nodered.org/t/reading-multiple-addresses-from-mc-protocol-mitsubishi-fx-plc/92340/68):
>
> You know you can just try stuff right? try payload: 1 If you are using a change or inject node to provide the value, make sure you chose the NUM type [image] [image]

it shows True Every time, but it does not work when i implemented with plc does not change anything in real things

```auto
[
    {
        "id": "740345a62700fe61",
        "type": "inject",
        "z": "4e72602639ad151f",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "X25",
        "payload": "1",
        "payloadType": "num",
        "x": 110,
        "y": 940,
        "wires": [
            [
                "3305f3d67bd70a50"
            ]
        ]
    },
    {
        "id": "4c9a7e69f6b2988c",
        "type": "inject",
        "z": "4e72602639ad151f",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "X25",
        "payload": "0",
        "payloadType": "num",
        "x": 110,
        "y": 980,
        "wires": [
            [
                "3305f3d67bd70a50"
            ]
        ]
    },
    {
        "id": "3305f3d67bd70a50",
        "type": "MC Write",
        "z": "4e72602639ad151f",
        "name": "",
        "topic": "",
        "connection": "d74ee8972f7b510f",
        "data": "payload",
        "address": "topic",
        "addressType": "msg",
        "dataType": "msg",
        "errorHandling": "throw",
        "outputs": 1,
        "x": 340,
        "y": 960,
        "wires": [
            [
                "63beb50fbaceaa0e"
            ]
        ]
    },
    {
        "id": "63beb50fbaceaa0e",
        "type": "debug",
        "z": "4e72602639ad151f",
        "name": "debug 4",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 470,
        "y": 1080,
        "wires": []
    },
    {
        "id": "d74ee8972f7b510f",
        "type": "MC Protocol Connection",
        "name": "",
        "host": "192.168.2.30",
        "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:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [18 January 2025 09:55 UTC](https://discourse.nodered.org/t/quality-issue-in-plc-with-nodered/94710/2 "2025-01-18T09:55:11Z")

</div>

A counter has 3 parts. the Contact, the Coil and the Value.

See:

> <https://github.com/Steve-Mcl/node-red-contrib-mcprotocol/blob/8b62d040418ff18ad85bc26681a6d15f0c67bee4/mcprotocol/mcprotocol.js#L2672-L2674>

However, I strongly recommend against read or write directly to single values. It is inefficient and as a maintenance person, I have no cross-ref or visibility that some external program is reading/writing to the middle of the PLC memory locations.

I always recommend you write ladder that moves all values of interest into 1 contiguous block of memory (preferably in D or R area). That gives the maintenance folk cross-reference ability to understand which values are being read/written by an external application.

As a bonus, reading 1 large block of contiguous memory is MUCH faster and MUCH more efficient and will collect the values that are consistent with one another (i.e. not affected by PLC SCAN).

As a final bonus, since read/write operations on a Mitsi PLCs can affect the SCAN time of the ladder, reading/writing large blocks in 1 go will reduce any impact.

For further reading and understanding of the impact, have a look at this article I wrote: [Modernize your legacy industrial data. Part 2. • FlowFuse](https://flowfuse.com/blog/2023/09/modernize-your-legacy-industrial-data-part2/#data-consistency)

---

<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:** [18 January 2025 11:46 UTC](https://discourse.nodered.org/t/quality-issue-in-plc-with-nodered/94710/3 "2025-01-18T11:46:58Z")

</div>

@Steve-Mcl,  
So what should i do now For this above issue that i am facing i could not change any thing for this

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [18 January 2025 11:50 UTC](https://discourse.nodered.org/t/quality-issue-in-plc-with-nodered/94710/4 "2025-01-18T11:50:08Z")

</div>

> [@Jayeshpitale1](#):
>
> So what should i do now For this above issue that i am facing

I assume you are referring to "C0 it gives Quality Issue"?

Use the correct addressing (i.e. NOT `C0` but instead `CN0` or `CC0` or `CS0` - depending on what you need!)...

> [@Steve-Mcl](#):
>
> ```auto
> CS: {symbol: 'CS', type: 'BIT', notation: 'Decimal', binary: 0xC4, ascii: 'CS', description: 'Counter Contact CS'},
> CC: {symbol: 'CC', type: 'BIT', notation: 'Decimal', binary: 0xC3, ascii: 'CC', description: 'Counter Coil CC'},
> CN: {symbol: 'CN', type: 'WORD', notation: 'Decimal', binary: 0xC5, ascii: 'CN', description: 'Counter Current value CN'}
> 
> ```

---

<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:** [18 January 2025 11:52 UTC](https://discourse.nodered.org/t/quality-issue-in-plc-with-nodered/94710/5 "2025-01-18T11:52:27Z")

</div>

@Steve-Mcl  
WHAT ABOUT WRITE NODE

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [18 January 2025 12:09 UTC](https://discourse.nodered.org/t/quality-issue-in-plc-with-nodered/94710/6 "2025-01-18T12:09:22Z")

</div>

> [@Jayeshpitale1](#):
>
> WHAT ABOUT WRITE NODE

you are trying to write directly to an X input (always a bad idea as previously stated)

but ignoring all the "good practices" for a moment, it is likely your PLC IO Assignment is writing to that `X` input area and it CANNOT be overwritten by a network command. you can prove this with ladder:

```plaintext
   X0
---| |------------(M99) // I bet M99 stays unchanged!
    

   M100 
---| |---------(X0) // Simulate setting/resetting X0
 Toggle me 

```

As a test, try writing to an X area outside of the physical IO Assignment (like a really high X address).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [18 April 2025 12:09 UTC](https://discourse.nodered.org/t/quality-issue-in-plc-with-nodered/94710/7 "2025-04-18T12:09:50Z")

</div>

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