-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How connect s7 smart200 plc #60
Comments
I konw how to connect smart200 |
@Ri0nGo same error, how to connect? |
修改源码,@iicanf // NewTCPClientHandlerWithConnType allocates a new TCPClientHandler By Connection type
func NewTCPClientHandlerWithConnType(address string, rack int, slot int, ct string) *TCPClientHandler {
h := &TCPClientHandler{}
h.Address = address
h.Timeout = tcpTimeout
h.IdleTimeout = tcpIdleTimeout
h.ConnectionType = connectionTypeOP
//h.ConnectionType = connectionTypePG // Connect to the PLC as a PG
remoteTSAP := uint16(h.ConnectionType)<<8 + (uint16(rack) * 0x20) + uint16(slot)
h.setConnectionParameters(address, 0x0100, remoteTSAP)
return h
} |
@Ri0nGo 谢谢,好使 |
same issue!that works! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hi,I can't to connect s7 smart200 plc.
This my code:
error info:
2023/06/15 19:38:16 *net.OpError read tcp 192.168.1.36:62273->192.168.2.123:102: wsarecv: An existing connection was forcibly closed by the remote host.
2023/06/15 19:38:16 connect failed, device error: ISO : Invalid PDU received
panic: ISO : Invalid PDU received
Using other client connections can succeed. May I ask if it was written incorrectly?
Looking forward to your reply, thanks.
The text was updated successfully, but these errors were encountered: