1

I would like to read the spindle speed of a Siemens PLC 317-2DP with NCU 720.2.

To do that, I use the python snap 7 library. I managed the connexion to the PLC, but I would like to read the spindle speed with the function read_area(area: Areas, dbnumber: int, start: int, size: int). I am unable to find the parameters dbNumber, start and size for my case.

Does someone can help me please? I read that it depends of the configuration of the PLC, but where I can find this configuration?

Thanks for your help

I read the documentation from Siemens "SINUMERIK 840D sl NC variables and interface signals" but I didn't find what I needed...

Aux98
  • 23
  • 3
  • first of all do you have a db with this information? if you have the information in a DB you have to check if the db attribute is marked as optimized or not, optimized dbs cannot be read with snap7 – DonMiguelSanchez May 25 '23 at 08:16
  • 1
    Thanks for your answer, I didn't understand that the PLC needeat to be set in order to give DB adresses to the required parameters. I thought that the variables would be directly accessible, that's why we wasn't able to find the spindle speed's DB address... – Aux98 May 27 '23 at 06:06

1 Answers1

0

In general in order to access to a variable in the plc you need to have a db block as I previously mentioned in one of my comments, but one important thing is to marked this block as not optimized:

Optimized block access off

if you have created this db an you recently added new variables a compile is needed to recalculate the offset in the variables. If you perform these steps successfully you will be able to see the offsets like in the following image:

variable offsets

I post this information as an answer for people that need that information in the future.

Regards

Miguel

DonMiguelSanchez
  • 376
  • 3
  • 15