# S7 node Variables in input?

**URL:** <https://discourse.nodered.org/t/s7-node-variables-in-input/39841>\
**Category:** Industrial\
**Created:** [27 January 2021 08:03 UTC](https://discourse.nodered.org/t/s7-node-variables-in-input/39841 "2021-01-27T08:03:45Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlb](https://avatars.discourse-cdn.com/v4/letter/j/a9adbd/32.png) [@jlb](https://discourse.nodered.org/u/jlb)\
**Post date:** [27 January 2021 08:03 UTC](https://discourse.nodered.org/t/s7-node-variables-in-input/39841/1 "2021-01-27T08:03:45Z")

</div>

Hello, i'd like to know if it's possible with one of the S7 PLC nodes to send on input a list of variables in order to use only one node by changing the variables dynamically instead of using multiple nodes or read hundred of variables at once (i have to read then under conditions)

thanks if you can help !

---

<div class="post-metadata">

**Author:** ![machadotiago](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/machadotiago/32/23776_2.png) [@machadotiago](https://discourse.nodered.org/u/machadotiago)\
**Post date:** [6 February 2021 23:24 UTC](https://discourse.nodered.org/t/s7-node-variables-in-input/39841/2 "2021-02-06T23:24:38Z")

</div>

yep, you can let the variable name empty in the input node, and then send a msg.variable parameter with an array of variables.  
More details you can find in the node documentation.

---

<div class="post-metadata">

**Author:** ![jlb](https://avatars.discourse-cdn.com/v4/letter/j/a9adbd/32.png) [@jlb](https://discourse.nodered.org/u/jlb)\
**Post date:** [15 February 2021 08:39 UTC](https://discourse.nodered.org/t/s7-node-variables-in-input/39841/3 "2021-02-15T08:39:55Z")

</div>

Thanks but in the node documentation i don't find what i need... i have a flow like that:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/3/e39820e72048dd834a15285fd05e30c7bcf1bea0.png)

In the inject nodes i'd like to send different Signal variables to read their values by using only one S7 read node. But i haven't find the good syntax (in JSON ?) to use in the injetc nodes.

Is it possible ? Or sould i use another S7 node ? i try also this:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/f/9f0d010ca7cdc514126e32448b82b84501ad2713.png)  
with this in the function node:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/2/c26083a751ac31cad2e36f3bc396f42dd0ec8b30.png)  
Don't works too

---

<div class="post-metadata">

**Author:** ![machadotiago](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/machadotiago/32/23776_2.png) [@machadotiago](https://discourse.nodered.org/u/machadotiago)\
**Post date:** [15 February 2021 11:40 UTC](https://discourse.nodered.org/t/s7-node-variables-in-input/39841/4 "2021-02-15T11:40:46Z")

</div>

I’m sorry, though you wanted to write (not read) the data.  
Unfortunately what you want to do is not possible.  
What you can do is use the S7 Control and use the trigger function to read all variables, then you can configure a S7 In node and uncheck the “(diff) checkbox. That should do the trick for you.

---

<div class="post-metadata">

**Author:** ![jlb](https://avatars.discourse-cdn.com/v4/letter/j/a9adbd/32.png) [@jlb](https://discourse.nodered.org/u/jlb)\
**Post date:** [15 February 2021 12:57 UTC](https://discourse.nodered.org/t/s7-node-variables-in-input/39841/5 "2021-02-15T12:57:33Z")

</div>

> [@machadotiago](#):
>
> and uncheck the “(diff) checkbox.

Where is the and " the “**(diff) checkbox**. " ?? And i don't want to read all the variables at once that's why i want to inject the good ones under conditions

---

<div class="post-metadata">

**Author:** ![machadotiago](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/machadotiago/32/23776_2.png) [@machadotiago](https://discourse.nodered.org/u/machadotiago)\
**Post date:** [15 February 2021 13:15 UTC](https://discourse.nodered.org/t/s7-node-variables-in-input/39841/6 "2021-02-15T13:15:14Z")

</div>

here it is  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/f/6f50f39523a69f5ffd46a25f58b8ebe0aadde01b.png)

If you don't want to read all variables, the only possible way then, is to configure a new endpoint, only with the variables you want to read.

---

<div class="post-metadata">

**Author:** ![jlb](https://avatars.discourse-cdn.com/v4/letter/j/a9adbd/32.png) [@jlb](https://discourse.nodered.org/u/jlb)\
**Post date:** [15 February 2021 13:35 UTC](https://discourse.nodered.org/t/s7-node-variables-in-input/39841/7 "2021-02-15T13:35:29Z")

</div>

Thanks for your ime & help. I'm afraid that i got no solution as want only one endpoint with mulitple possible variables in input... (like it's possible with the modbus nodes)

---

<div class="post-metadata">

**Author:** ![OriolFM](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/oriolfm/32/30710_2.png) [@OriolFM](https://discourse.nodered.org/u/OriolFM)\
**Post date:** [1 March 2021 15:11 UTC](https://discourse.nodered.org/t/s7-node-variables-in-input/39841/8 "2021-03-01T15:11:56Z")

</div>

Tangentially related question:

Is there a big difference in terms of performance about reading half of the variables or, say, all of them?

I have a lot of machines with twin loading/unloading ports, but usually only one of them is working at any given time, so if it makes a big difference, I should split the nodes.

Also related to this:  
If I have a DB with several variables (about 20-30) I need to write to implement an interface between each machine and some mobile robots that pick up the material carriers and deploy empty ones. In order to do so, I have to change a few booleans according to the interface steps, triggering them in order (that's how the supplier arranged it).

I guess according to your reply, either I create as many endpoints as variables are (a lot of work, having many machines) or I read the whole block from the PLC, modify only the values I need to modify, and then feed it back to the PLC.

Would that have a lot of impact, performance-wise?

---

<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:** [30 April 2021 15:11 UTC](https://discourse.nodered.org/t/s7-node-variables-in-input/39841/9 "2021-04-30T15:11:59Z")

</div>

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