Hi,
we have problems reading data from an S7-1500 via snap7. We have created a global DB in Tia Portal, set protection level to "no protection", and "access via put/get communication" in project settings is also ticked.
We tried to read the DB "Send_DB", which is DB2 in our case, and which holds three variables:
VarName
Type
Offset
W1
word
0.0
I1
Int
2.0
B1
Bool
4.0
byte buffer[66536]
res = Client->DBRead(2,0,5,&buffer)
res returned the error code for "errCliFunctionRefused".
We tried several other function calls, for example ReadMultiVars (res returned "errCliFunctionNotAvailable") and ReadArea (also "errCliFunctionRefused").
We tried different buffer sizes, different WordLengths, different "Amounts", but all attempts failed.
We would be very grateful for further advice!
Cheers,
Arne
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello Davide, thanks a lot for your answer! You were right, we changed the slot to 0. We found the main issue though, which had nothing to do with snap7: We used a different PC to set the project up with TIA, than the one where snap7 runs on. Thus we had set up a wrong IP address in TIA, the PLC rightfully declined requests from other IPs.
Thanks again, best regards,
Arne
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
we have problems reading data from an S7-1500 via snap7. We have created a global DB in Tia Portal, set protection level to "no protection", and "access via put/get communication" in project settings is also ticked.
We manage to establish a connection:
We tried to read the DB "Send_DB", which is DB2 in our case, and which holds three variables:
res returned the error code for "errCliFunctionRefused".
We tried several other function calls, for example ReadMultiVars (res returned "errCliFunctionNotAvailable") and ReadArea (also "errCliFunctionRefused").
We tried different buffer sizes, different WordLengths, different "Amounts", but all attempts failed.
We would be very grateful for further advice!
Cheers,
Arne
The settings are ok but don't forget that the DB must be unoptimized (Into DB broperties the "optimization" option must be unchecked).
Then, why you are connecting to Slot 1 ?
Rack and Slot should be both 0 in S71200/1500 systems.
Hello Davide, thanks a lot for your answer! You were right, we changed the slot to 0. We found the main issue though, which had nothing to do with snap7: We used a different PC to set the project up with TIA, than the one where snap7 runs on. Thus we had set up a wrong IP address in TIA, the PLC rightfully declined requests from other IPs.
Thanks again, best regards,
Arne