# S7 Endpoint configuration

**URL:** <https://discourse.nodered.org/t/s7-endpoint-configuration/76496>\
**Category:** General\
**Created:** [13 March 2023 07:46 UTC](https://discourse.nodered.org/t/s7-endpoint-configuration/76496 "2023-03-13T07:46:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ameer.ghoniem85](https://avatars.discourse-cdn.com/v4/letter/a/90db22/32.png) [@ameer.ghoniem85](https://discourse.nodered.org/u/ameer.ghoniem85)\
**Post date:** [13 March 2023 07:46 UTC](https://discourse.nodered.org/t/s7-endpoint-configuration/76496/1 "2023-03-13T07:46:37Z")

</div>

Hi there,

i need to set the variables of the s7 endpoint node dynamically, i mean from out side the node

i have an idea to connect to oracle database to fetch the following Data:  
PLC IP, Rack, Slot and also the variables

then send those values (via a function node or something else) to the s7 Endpoint node

i search a lot for any thing like that but i couldn't do it

any help will be highly highly appreciated

---

<div class="post-metadata">

**Author:** ![KarolisL](https://avatars.discourse-cdn.com/v4/letter/k/a4c791/32.png) [@KarolisL](https://discourse.nodered.org/u/KarolisL)\
**Post date:** [13 March 2023 15:10 UTC](https://discourse.nodered.org/t/s7-endpoint-configuration/76496/2 "2023-03-13T15:10:27Z")

</div>

Welcome to the forum,

please take a look at [Siemens reading from PLC with nodeS7 npm - Industrial - Node-RED Forum (nodered.org)](https://discourse.nodered.org/t/siemens-reading-from-plc-with-nodes7-npm/68926)

also for more information:  
[plcpeople/nodeS7: Node.JS library for communication to Siemens S7 PLCs (github.com)](https://github.com/plcpeople/nodeS7)

---

<div class="post-metadata">

**Author:** ![ameer.ghoniem85](https://avatars.discourse-cdn.com/v4/letter/a/90db22/32.png) [@ameer.ghoniem85](https://discourse.nodered.org/u/ameer.ghoniem85)\
**Post date:** [13 March 2023 18:14 UTC](https://discourse.nodered.org/t/s7-endpoint-configuration/76496/4 "2023-03-13T18:14:31Z")

</div>

Many thanks, really your reply is very very helpful  
do me a favor and send me how to write to PLC

---

<div class="post-metadata">

**Author:** ![KarolisL](https://avatars.discourse-cdn.com/v4/letter/k/a4c791/32.png) [@KarolisL](https://discourse.nodered.org/u/KarolisL)\
**Post date:** [13 March 2023 19:04 UTC](https://discourse.nodered.org/t/s7-endpoint-configuration/76496/5 "2023-03-13T19:04:44Z")

</div>

sorry, don't have an example of writing, but it looks pretty straight forward from github example:

```auto
function connected(err) {
  if (typeof(err) !== "undefined") {
    // We have an error. Maybe the PLC is not reachable.
    console.log(err);
    process.exit();
  }
  conn.setTranslationCB(function(tag) { return variables[tag]; }); // This sets the "translation" to allow us to work with object names
  conn.addItems(['TEST1', 'TEST4']);
  conn.addItems('TEST6');
  // conn.removeItems(['TEST2', 'TEST3']); // We could do this.
  // conn.writeItems(['TEST5', 'TEST6'], [867.5309, 9], valuesWritten); // You can write an array of items as well.
  // conn.writeItems('TEST7', [666, 777], valuesWritten); // You can write a single array item too.
  conn.writeItems('TEST3', true, valuesWritten); // This writes a single boolean item (one bit) to true
  conn.readAllItems(valuesReady);
}

```

---

<div class="post-metadata">

**Author:** ![ameer.ghoniem85](https://avatars.discourse-cdn.com/v4/letter/a/90db22/32.png) [@ameer.ghoniem85](https://discourse.nodered.org/u/ameer.ghoniem85)\
**Post date:** [13 March 2023 22:24 UTC](https://discourse.nodered.org/t/s7-endpoint-configuration/76496/6 "2023-03-13T22:24:04Z")

</div>

your support is highly appreciated

---

<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 May 2023 22:24 UTC](https://discourse.nodered.org/t/s7-endpoint-configuration/76496/7 "2023-05-12T22:24:31Z")

</div>

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