st-one-io / node-red-contrib-s7

A Node-RED node to interact with Siemens S7 PLCs
GNU General Public License v3.0
111 stars 58 forks source link

Problems accesing Sinamics parameter indexes simultaneously #28

Closed laura-mc closed 5 years ago

laura-mc commented 5 years ago

I am reading Sinamics parameter values, but I am facing problems when trying to read at the same time the value of different indexes of a parameter. For example:

Parameter r2114 (System runtime total, type floating point 32) of the CU has two subindexes:

-0: Milliseconds

-1: Days

In this case, DB2114,DWORD1024 reads the milliseconds, and DB2114,DWORD1025 read the days.

If in the S7 node I configure one of them, does not matter which, it reads perfectly, but when I configure both of them it says ("Failure: Bad values").

I have been able to read different parameters simultaneously, the problem comes when I try to read the subindexes of the same parameter.

If I create two s7 endpoint connections, both with the same configuration, this is, only one physical connection and two s7-in nodes, one with CON1 (IP 169.254.11.22) and CON2 (IP 169.254.11.22), and configure DB2114,DWORD1024 in one, and DB2114,DWORD1025 in the other, I can read both. The problem is that some of the Sinamics parameters has 19 indexes, so, creating 19 different connection it is not a viable solution

gfcittolin commented 5 years ago

Hi, sorry for the delay answering.

I don't know much about Sinamics, but something I noted is that DWORDs are 4 bytes long (32 bits), so if you're reading DB2114,DWORD1024, the next contiguous address would be DB2114,DWORD1028. This all at least from the point of view of a S7 PLC (and therefore also the nodeS7 library). So probably there's a complaint from either the Sinamics CPU or the nodeS7 library about the overlapping addresses.

When you read them independently, do you get coherent values? You could also try the array syntax, that would then be DB2114,DWORD1024.2, and then you'd get an array of two consecutive DWORDS