Skip to content
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

Invalid url for TCP transport #695

Closed
floka94 opened this issue Dec 15, 2022 · 2 comments
Closed

Invalid url for TCP transport #695

floka94 opened this issue Dec 15, 2022 · 2 comments

Comments

@floka94
Copy link

floka94 commented Dec 15, 2022

I try to connect to a S7 PLC on Slot 3. I tried several connection strings:

"s7://172.16.0.12/0/3"
"s7://172.16.0.12/0/3?controller-type=S7_400"
"s7://172.16.0.12/3/0?controller-type=S7_400"
"s7://172.16.0.12/3/0"

I always get an error:

Caused by: org.apache.plc4x.java.api.exceptions.PlcRuntimeException: Invalid url for TCP transport
	at org.apache.plc4x.java.transport.tcp.TcpTransport.createChannelFactory(TcpTransport.java:57)
	at org.apache.plc4x.java.spi.connection.GeneratedDriverBase.getConnection(GeneratedDriverBase.java:148)
	at org.apache.plc4x.java.spi.connection.GeneratedDriverBase.getConnection(GeneratedDriverBase.java:99)
	at org.apache.plc4x.java.PlcDriverManager.getConnection(PlcDriverManager.java:77)
	at org.apache.plc4x.java.opm.PlcEntityInterceptor.refetchAllFields(PlcEntityInterceptor.java:218)
	... 16 more
@chrisdutz
Copy link
Contributor

Which version of PLC4X are you using? I think we've changed that rack and slot setting to use a default and to be overridable via query options ... please have a look here: https://plc4x.apache.org/users/protocols/s7.html

So I would assume you have to use something like:
"s7://172.16.0.12" "s7://172.16.0.12?remote-rack=1&remote-slot=2" "s7://172.16.0.12?remote-rack=1&remote-slot=2&controller-type=S7_400"
If you want to override the local rack and slot, there are counterparts for that.

@floka94
Copy link
Author

floka94 commented Dec 15, 2022

I use version 0.10.0.

Ah thank you very much! It seems I used an outdated code example! Now everything is working as expected!

@floka94 floka94 closed this as completed Dec 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants