You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@plc4x.apache.org by "Christofer Dutz (Jira)" <ji...@apache.org> on 2020/08/03 06:08:00 UTC

[jira] [Commented] (PLC4X-222) Wrong s7URIPattern

    [ https://issues.apache.org/jira/browse/PLC4X-222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17169750#comment-17169750 ] 

Christofer Dutz commented on PLC4X-222:
---------------------------------------

Hi,

this is actually not a bug. In December 2019 we did a major refactoring of all existing drivers resulting in all of them being re-implemented. While at it we streamlined the way all drivers are configured. In general drivers now use defaults for the most common use-cases and you can override these in the connection string. The S7 documentation shows this nicely: 

[https://plc4x.apache.org/users/protocols/s7.html]

One of the major issues we had with the old syntax was, that initially is only controlled the rack and slot of the client, not of the PLC so it was impossible to connect to some PLCs that weren't on the default rack and slot settings. That's why we introduced local-rack/-slot and remote-rack/-slot to be more explicit.

Chris

> Wrong s7URIPattern
> ------------------
>
>                 Key: PLC4X-222
>                 URL: https://issues.apache.org/jira/browse/PLC4X-222
>             Project: Apache PLC4X
>          Issue Type: Bug
>          Components: API
>    Affects Versions: 0.7.0
>            Reporter: Gerardo Melia
>            Priority: Minor
>              Labels: easyfix
>
> Using S7 driver in 0.7.0  I got this error: 
>  
> {code:java}
> Caused by: java.lang.IllegalArgumentException: s7://192.168.1.200/0/1 doesn't match{code}
>  
> when the connection string seems to be Ok.
> I see that in the current version you fix because It includes rack and slot  but in 0.7.0 is wrong: 
>  
> {code:java}
> private final Pattern s7URIPattern = Pattern.compile("^(?<poolablePart>s7://((?<ip>[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3})|(?<hostname>[a-zA-Z0-9\\.\\-]+))(:(?<port>[0-9]{1,5}))?)(?<params>\\?.*)?");{code}
>  
> Current pattern:
>  
> [https://github.com/apache/plc4x/blob/1e6df7563ad909d365d1402729699b61c70019bd/plc4j/tools/connection-pool/src/main/java/org/apache/plc4x/java/utils/connectionpool/PoolKeyFactory.java#L46]
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)