robinson / gos7

Implementation of Siemens S7 protocol in golang
BSD 3-Clause "New" or "Revised" License
315 stars 124 forks source link

How do I connect to s7-1200?There are no tracks and slots in s7-1200,errors:invalid pdu received or invalid buffer passed to send/receive '19' #51

Closed XQacc closed 2 years ago

robinson commented 2 years ago

Hi, for s7-1200 just add slot=0, rack=0 and it should work. BR

XQacc commented 2 years ago

Hi, for s7-1200 just add slot=0, rack=0 and it should work. BR

set slot=0, rack=0 ,errors:client.AGReadDB: ISO : Invalid Buffer passed to Send/Receive'19' and used the packet capture tool to view protocol is ISO 8073/COTP,is need other setting? connectionTypePG = 1 // Connect to the PLC as a PG connectionTypeOP = 2 // Connect to the PLC as an OP connectionTypeBasic = 3 // Basic connection Is it related to this?

robinson commented 2 years ago

no, I think the configuration is that, but you are reading the wrong size of data... i suggest you take a look in the example

iotopo commented 2 years ago

@XQacc you may got a 8104 error code,hope help you:https://support.inductiveautomation.com/hc/en-us/articles/4414608266893-Error-reading-S7ReadResponse-Error-code-8104