# S7 out Write character to plc

**URL:** <https://discourse.nodered.org/t/s7-out-write-character-to-plc/88520>\
**Category:** Industrial\
**Created:** [5 June 2024 11:47 UTC](https://discourse.nodered.org/t/s7-out-write-character-to-plc/88520 "2024-06-05T11:47:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohamed\_1711](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@Mohamed\_1711](https://discourse.nodered.org/u/Mohamed_1711)\
**Post date:** [5 June 2024 11:47 UTC](https://discourse.nodered.org/t/s7-out-write-character-to-plc/88520/1 "2024-06-05T11:47:16Z")

</div>

I want to write character in PLC using S7 out

```auto
[
    {
        "id": "38f3c2940deeca4e",
        "type": "s7 out",
        "z": "f9c426c7c1a7d831",
        "endpoint": "7f825fb64ea359e2",
        "variable": "INE",
        "name": "Write on Datablock DB1010 on PLC E63",
        "x": 600,
        "y": 460,
        "wires": []
    },
    {
        "id": "e20e843113e6cb5c",
        "type": "inject",
        "z": "f9c426c7c1a7d831",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 160,
        "y": 460,
        "wires": [
            [
                "11bd049435e09b4a"
            ]
        ]
    },
    {
        "id": "11bd049435e09b4a",
        "type": "function",
        "z": "f9c426c7c1a7d831",
        "name": "function 1",
        "func": "msg.payload ='E'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 320,
        "y": 460,
        "wires": [
            [
                "38f3c2940deeca4e"
            ]
        ]
    },
    {
        "id": "7f825fb64ea359e2",
        "type": "s7 endpoint",
        "transport": "iso-on-tcp",
        "address": "172.31.51.13",
        "port": "102",
        "rack": "0",
        "slot": "4",
        "localtsaphi": "01",
        "localtsaplo": "00",
        "remotetsaphi": "01",
        "remotetsaplo": "00",
        "connmode": "rack-slot",
        "adapter": "",
        "busaddr": "2",
        "cycletime": "1000",
        "timeout": "2000",
        "name": "Connection to E63",
        "vartable": [
            {
                "addr": "DB1010,CHAR130",
                "name": "INE"
            }
        ]
    }
]

```

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [5 June 2024 20:10 UTC](https://discourse.nodered.org/t/s7-out-write-character-to-plc/88520/2 "2024-06-05T20:10:14Z")

</div>

Please continue the discussion on your original post.

> [@S7 Out \[Send the Variable List in Run Time\]](https://discourse.nodered.org/t/s7-out-send-the-variable-list-in-run-time/88515):
>
> To write in PLC using S7 Out I have to write all Variables in it and before this code, I have to make to array one for variables and another for values (payload) Desired Output: I want to remove the variables from the S7 out and send it from the prepare Data function. [ { "id": "247e3fda1f9e7969", "type": "inject", "z": "4b831203ffade23e", "name": "", "props": [ { "p": "payload" }, …

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [5 June 2024 20:10 UTC](https://discourse.nodered.org/t/s7-out-write-character-to-plc/88520/3 "2024-06-05T20:10:24Z")

</div>


