Real value S7-LOGO8

Hello everyone, I am working on a project with a Siemens LOGO 8, for this I downloaded the S7-LOGO 8 node from the official node red page, where the LOGO variables are already included. The project consists of reading the pressure in the first analog channel of the LOGO and inserting it into a database, but when reading a pressure for example of 46.1 PSI, in the mysql table it appears as 461 PSI, I would like to know how to fix this matter, either scaling the value or dividing the value of 461 by 10, or if the variable of the S7-LOGO8 node can be configured in such a way that the actual measured value appears.

By the way, I also wanted to display this pressure value in the dashboard, and I solved the problem using the "range node", however, I don't know how to solve it in my database in mysql.
I appreciate your support, greetings.

Data base
image

Node S7-LOGO8 configuration and MYSQL instruction

As the value you are reading is INT you won't get a floating point value. You could put a function node after the S7 node and divide the value by 10 before writing it to the database.

Alternatively, when you query the database, divide the column by 10.

1 Like

Or, instead of a Function node you can use a Range node set to scale the values 0:1000 to 0:100

1 Like

Thanks, I already solved the matter. What I did was register the data in a flow variable and divided it by 10, like this: flow.set ("PRESSURE1", msg.payload.PRESSURE1 / 10);

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