# Mitsubishi MC Write Node always writing True

**URL:** <https://discourse.nodered.org/t/mitsubishi-mc-write-node-always-writing-true/60502>\
**Category:** General\
**Created:** [29 March 2022 17:01 UTC](https://discourse.nodered.org/t/mitsubishi-mc-write-node-always-writing-true/60502 "2022-03-29T17:01:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jts450](https://avatars.discourse-cdn.com/v4/letter/j/ee59a6/32.png) [@jts450](https://discourse.nodered.org/u/jts450)\
**Post date:** [29 March 2022 17:01 UTC](https://discourse.nodered.org/t/mitsubishi-mc-write-node-always-writing-true/60502/1 "2022-03-29T17:01:51Z")

</div>

I am able to write directly to a digital output on my Mitsubishi PLC, in my case Y6 and Y7 but when I try to write False to turn the output off it always says true and never turns the output off?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/1/51c1d5e1dc66885faed8c438d311662fcc334773.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:** [29 March 2022 18:05 UTC](https://discourse.nodered.org/t/mitsubishi-mc-write-node-always-writing-true/60502/2 "2022-03-29T18:05:31Z")

</div>

This is because a string of False is NOT `false` which is basically `true`. Change the drop-down to number and enter 0 or 1.

Better still, change it to `msg.payload` and pass the value in from the inject node.

As for returning true, that is to signify the value was received by the plc.

---

<div class="post-metadata">

**Author:** ![jts450](https://avatars.discourse-cdn.com/v4/letter/j/ee59a6/32.png) [@jts450](https://discourse.nodered.org/u/jts450)\
**Post date:** [29 March 2022 19:21 UTC](https://discourse.nodered.org/t/mitsubishi-mc-write-node-always-writing-true/60502/3 "2022-03-29T19:21:21Z")

</div>

Thought I tried it every which way but apparently not.. got it working but for the Address dropdown I have it at string since there is not number option.

```auto
[
    {
        "id": "0e4c4e876be57fe0",
        "type": "MC Write",
        "z": "1edb34811118b980",
        "name": "Output Y6",
        "topic": "",
        "connection": "8bf9ce709d0bac70",
        "data": "payload",
        "address": "Y6",
        "addressType": "str",
        "dataType": "msg",
        "errorHandling": "throw",
        "outputs": 1,
        "x": 1080,
        "y": 1020,
        "wires": [
            [
                "d40f63709511ea3f"
            ]
        ]
    },
    {
        "id": "478c742ed3ad45e1",
        "type": "inject",
        "z": "1edb34811118b980",
        "name": "ON",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "1",
        "payloadType": "num",
        "x": 870,
        "y": 1020,
        "wires": [
            [
                "0e4c4e876be57fe0"
            ]
        ]
    },
    {
        "id": "d40f63709511ea3f",
        "type": "debug",
        "z": "1edb34811118b980",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1270,
        "y": 1020,
        "wires": []
    },
    {
        "id": "ca625bb2e78d2101",
        "type": "inject",
        "z": "1edb34811118b980",
        "name": "OFF",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "0",
        "payloadType": "num",
        "x": 870,
        "y": 1100,
        "wires": [
            [
                "0e4c4e876be57fe0"
            ]
        ]
    },
    {
        "id": "56b584be43b166f3",
        "type": "MC Write",
        "z": "1edb34811118b980",
        "name": "Output Y7",
        "topic": "",
        "connection": "8bf9ce709d0bac70",
        "data": "payload",
        "address": "Y7",
        "addressType": "str",
        "dataType": "msg",
        "errorHandling": "throw",
        "outputs": 1,
        "x": 1080,
        "y": 1180,
        "wires": [
            [
                "9ba76175f1fea81d"
            ]
        ]
    },
    {
        "id": "7c1013dc01ca015e",
        "type": "inject",
        "z": "1edb34811118b980",
        "name": "ON",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "1",
        "payloadType": "num",
        "x": 870,
        "y": 1180,
        "wires": [
            [
                "56b584be43b166f3"
            ]
        ]
    },
    {
        "id": "9ba76175f1fea81d",
        "type": "debug",
        "z": "1edb34811118b980",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1270,
        "y": 1180,
        "wires": []
    },
    {
        "id": "c05b335492076ce5",
        "type": "inject",
        "z": "1edb34811118b980",
        "name": "OFF",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "0",
        "payloadType": "num",
        "x": 870,
        "y": 1260,
        "wires": [
            [
                "56b584be43b166f3"
            ]
        ]
    },
    {
        "id": "8bf9ce709d0bac70",
        "type": "MC Protocol Connection",
        "name": "PLC1",
        "host": "192.168.1.15",
        "port": "3001",
        "protocol": "UDP",
        "frame": "3E",
        "plcType": "Q",
        "ascii": false,
        "PLCStation": "",
        "PCStation": "",
        "PLCModuleNo": "",
        "network": "",
        "octalInputOutput": false,
        "timeout": "1000"
    }
]

```

---

<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:** [12 April 2022 19:21 UTC](https://discourse.nodered.org/t/mitsubishi-mc-write-node-always-writing-true/60502/4 "2022-04-12T19:21:51Z")

</div>

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