S7 1200 Siemens

Node-RED version: v1.0.5
Node.js version: v12.16.2
Siemens 1214 DC/DC Firm 4.1 Tia V15

Good afternnon this is my first project with a node red and the PLC communication with out a problme on Node REd application ,

I create a DB without the optmite code and in this DB i have a 4 data (DINT).
I see the value correct but my question are :

  1. How To read the value for the single variable ?
  2. How to insert the value in the 4 different gauge object for the 4 diffrent variabile

attach the image of the my code and the function i use

Thank a lot

I'm not sure if I understood 100% your question, but if I understood correctly, all you have to do is to open the S7 node configuration, and configure it to read a single variable (instead of all), then you can copy and paste the node and use it in all your gauges.

Thanks a lot for your response .

My question are . If i enable a multi read data (data 1,2,3,4) the response of the debug are :
node: 70a046f9.9d4a68msg.payload : Object
Pwr_1: 0
Pwr_2: 0
Pwr_3: 0
Pwr_4: 0

How to extrapolate the value of the single tags (for eample Pwr_1 this is a name of my variable) to insert on the Gauge Object to show just the value of the Pwr 1

Then what I exmplained above should fix your problem.
Just click twice in your S7 node and configure it to "single item" and select the item you want, then duplicate the node and select another tag, like the image below.


If that doesn't work, please paste your flow code here

I resolve the my request with this function

let var1
let var2;
let var3;
let var4;
let var5;
let var6;
let var7;
let var8;

var1 = msg.payload.Pwr_1;
var2 = msg.payload.Pwr_2;
var3 = msg.payload.Pwr_3;
var4 = msg.payload.Pwr_4;
var5 = msg.payload.Pwr_5;
var6 = msg.payload.Pwr_6;
var7 = msg.payload.Pwr_7;
var8 = msg.payload.Pwr_8;

let msg1 = {payload: var1};
let msg2 = {payload: var2};
let msg3 = {payload: var3};
let msg4 = {payload: var4};
let msg5 = {payload: var5};
let msg6 = {payload: var6};
let msg7 = {payload: var7};
let msg8 = {payload: var8};

return [msg1, msg2, msg3, msg4,msg5, msg6,msg7,msg8];

I guess you could set
Value format :{{msg.payload.Pwr_1}} on your gauge

thanks soo much olab

And if i want to insert a char two variable wich are the sintax to insert on the function char

{{msg.payload.Pwr_1 && Pwr_2}} for example ??

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