Hi Chris, Great stuff, it works perfectly now.
Thanks for your effort and best regards, Sebastian > On 1. Sep 2020, at 09:17, Christofer Dutz <[email protected]> wrote: > > Hi Sebastian, > > I configured my S7-1200 the same way to not allow PUT/GET and indeed I missed > that the type of packet returned is slightly different. I just updated the S7 > accordingly and not I am correctly getting errors with a description on what > might be wrong if it's not enabled. > > 09:15:46.380 [nioEventLoopGroup-2-1] WARN > o.a.p.j.s.r.protocol.S7ProtocolLogic - Got an error response from the PLC. > This particular response code usually indicates that PUT/GET is not enabled > on the PLC. > 09:15:46.385 [main] ERROR o.a.p.j.e.helloplc4x.HelloPlc4x - Error[value-0]: > ACCESS_DENIED > > So ... either you update and build locally or you give the CI a few minutes > ... > > Chris > > > > > Am 31.08.20, 18:26 schrieb "Sebastian Voss" <[email protected]>: > > Hi Chris, > > Thanks to to great guide I was able to perform a local build. Also with > the local build the read blocks indefinitely. Let me know in case I can help > to run another test (you do not necessarily need to push to the repo, I can > check out any branch and run a local build now). > > Best regards, > Sebastian > >> On 31. Aug 2020, at 15:18, Stefano Bossi <[email protected]> wrote: >> >> Hi Sebastian, >> >> Chris wrote a very good page on how to compile the library which is a very >> big software: https://plc4x.apache.org/developers/building.html >> <https://plc4x.apache.org/developers/building.html> >> On Mac I found no problem to follow the guide and I think on windows should >> be fine too. >> >> As extra suggestion on the guide I could add something if you use Gradle for >> your software: the compilation build and install all the jars local in your >> machine, if you would access this local jar storage via gradle you have just >> to add mavenLocal() to the list of repositories: >> >> repositories { >> mavenCentral() >> mavenLocal() >> } >> I’s not not difficult to figure out but I spend a couple of hours wandering >> how to do so it’s worth sharing >> >> Regards, >> S. >> >> On 31/08/2020 14:45, Christofer Dutz wrote: >> >> >> >>> Hi Sebasitan, >>> >>> Just some minutes ago I submitted a fix for your problem. >>> Please give it a try :-) >>> >>> Chris >>> >>> >>> Am 31.08.20, 11:41 schrieb "Sebastian Voss" <[email protected]> >>> <mailto:[email protected]>: >>> >>> Hi Chris, >>> >>> JIRA issue with attachment is created >>> https://issues.apache.org/jira/browse/PLC4X-246 >>> <https://issues.apache.org/jira/browse/PLC4X-246> >>> <https://issues.apache.org/jira/browse/PLC4X-246> >>> <https://issues.apache.org/jira/browse/PLC4X-246>. I will try to change the >>> settings and report back the result. >>> >>> Thanks a lot and best regards, >>> Sebastian >>> >>>> On 31. Aug 2020, at 11:08, Christofer Dutz <[email protected]> >>>> <mailto:[email protected]> wrote: >>>> >>>> Hi Sebastian … >>>> >>>> Unfortunately attachments don’t work on this mailing list. Could you >>>> please create a JIRA issue? >>>> >>>> And I think I can help you with that error of yours: >>>> Go into the settings of your S7 and enable PUT/GET … the folks from >>>> NodeRed made a nice video: >>>> https://www.youtube.com/watch?v=rTUs-_EiZ3A >>>> <https://www.youtube.com/watch?v=rTUs-_EiZ3A> (Just the first 1,5 minutes) >>>> >>>> But the driver should definitely report this … as it is a known thing and >>>> if we reported that it would help a lot of others. >>>> >>>> Chris >>>> >>>> >>>> >>>> >>>> Von: Sebastian Voss <[email protected]> <mailto:[email protected]> >>>> Antworten an: "[email protected]" <mailto:[email protected]> >>>> <[email protected]> <mailto:[email protected]> >>>> Datum: Montag, 31. August 2020 um 10:49 >>>> An: "[email protected]" <mailto:[email protected]> >>>> <[email protected]> <mailto:[email protected]> >>>> Betreff: Re: S7 read issue >>>> >>>> Hi Chris, Hi Stefano, >>>> >>>> Thanks a lot for your valuable feedback. It is highly appreciated. >>>> >>>> I followed Stefanos suggestions and applied the simplifications. In >>>> addition I created a Wireshark capture which is attached to this email. >>>> >>>> It seems it replies with “[Error code: This service is not implemented on >>>> the module or a frame error was reported (0x8104)]" >>>> >>>> Does this mean the address is wrong or is it something else? >>>> >>>> Best regards, >>>> Sebastian >>>> >>>> >>>>> On 31. Aug 2020, at 09:42, Stefano Bossi <[email protected]> >>>>> <mailto:[email protected]> wrote: >>>>> >>>>> Hi Sebastian, >>>>> >>>>> if you need some help in setup the wireshark capture software or open the >>>>> jira ticket I could help. >>>>> >>>>> It’s definitely worth to follow the Chris suggestion to help him to spot >>>>> the real problem. >>>>> >>>>> In the mean time I think you could simplify the PLC query in this way: >>>>> >>>>> String Url: s7:tcp://172.3.4.5:102?controller-type=S7_1200 >>>>> >>>>> String field: %DB20:5.0:BOOL >>>>> >>>>> As far as the address of the Data Block and the bool value are correct, >>>>> should work. >>>>> There were nothing particular wrong in your query but the library is >>>>> somewhat “sensible” if something goes wrong in the dialogue with the PLC >>>>> >>>>> An another thing you should pay attention is that the Data Block MUST be >>>>> NOT optimized; reading of optimized block is not currently supported. >>>>> This shouldn’t be your case because an attempt to read an optimized block >>>>> raise an exception or a null value. >>>>> >>>>> Try and let us know. >>>>> >>>>> Regards, >>>>> Stefano >>>>> >>>>> On 31/08/2020 08:48, Christofer Dutz wrote: >>>>> >>>>> >>>>> >>>>>> Hi Sebastian, >>>>>> >>>>>> could you possibly do a wireshark recording of this, create an issue in >>>>>> our jira and attach the capture there? >>>>>> I am sure we haven't handled all things that could go wrong and with >>>>>> this information I might be able to improve the error handling. >>>>>> >>>>>> Chris >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> Am 30.08.20, 18:28 schrieb "Sebastian Voss" >>>>>> <[email protected]> <mailto:[email protected]> >>>>>> : >>>>>> >>>>>> Hi, >>>>>> >>>>>> I’m trying to read a value from an Siemens S7-1200 PLC). This is my >>>>>> first project using the S7 protocol and plc4x. When I try to read a >>>>>> value the read request is not being executed (I also do not receive an >>>>>> error message or timeout). Would this be the normal behaviour when the >>>>>> field address is wrong? I’m out of ideas how to trace this down. Any >>>>>> hints would be highly appreciated. >>>>>> >>>>>> This is the simple program I created: >>>>>> >>>>>> String url = >>>>>> "s7://172.3.4.5:102?local-rack=0&local-slot=1&remote-rack=0&remote-slot=1&controller-type=S7_1200 >>>>>> >>>>>> <s7://172.3.4.5:102?local-rack=0&local-slot=1&remote-rack=0&remote-slot=1&controller-type=S7_1200>"; >>>>>> PlcDriverManager manager = new PlcDriverManager(); >>>>>> PlcConnection connection = manager.getConnection(url); >>>>>> >>>>>> boolean isConnected = connection.isConnected(); >>>>>> boolean canRead = connection.getMetadata().canRead(); >>>>>> >>>>>> System.out.println(isConnected); // prints true >>>>>> System.out.println(canRead); // prints true >>>>>> >>>>>> String field = "%DB20:DBX05.0:BOOL"; >>>>>> PlcReadRequest request = connection >>>>>> .readRequestBuilder() >>>>>> .addItem("value-1", field) >>>>>> .build(); >>>>>> >>>>>> PlcReadResponse response = request.execute().get(); // here is hangs >>>>>> forever >>>>>> >>>>>> System.out.println(response.getFieldNames()); >>>>>> >>>>>> connection.close(); >>>>>> >>>>>> Thanks a lot in advance! >>>>>> >>>>>> Best regards, >>>>>> Sebastian >>>>>> >>>>>> >>>>> >>>>> >>> >>> >> >> > >
