[jira] [Created] (PLC4X-247) initialize_interop_server.sh file missing before and after build

2020-08-31 Thread Aaron J Brown (Jira)
Aaron J Brown created PLC4X-247:
---

 Summary: initialize_interop_server.sh file missing before and 
after build
 Key: PLC4X-247
 URL: https://issues.apache.org/jira/browse/PLC4X-247
 Project: Apache PLC4X
  Issue Type: Bug
  Components: examples
Affects Versions: 0.7.0
 Environment: Ubuntu 20.04LTS
Reporter: Aaron J Brown


The sandbox calls for initialize_interop_server.sh to run to build the interop 
server however this is missing from the entire file structure both before and 
after the build

[https://github.com/apache/plc4x/tree/develop/sandbox/plc4py]



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


Re: S7 read issue

2020-08-31 Thread Sebastian Voss
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  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 
> 
> 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"  
>> :
>> 
>> Hi Chris,
>> 
>> JIRA issue with attachment is created 
>> 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  
>>  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 
>>  (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  
>> > Antworten an: "dev@plc4x.apache.org"  
>>  
>> > Datum: Montag, 31. August 2020 um 10:49
>> > An: "dev@plc4x.apache.org"  
>>  
>> > 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  
>>  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 

Re: S7 read issue

2020-08-31 Thread Sebastian Voss
Hi Stefano, Hi Chris,

I tried to pull the latest 0.8.0-SNAPSHOT from the Apache repo (I think I saw 
you pushed it there). Thanks for the link to the Wiki page for a local build, 
will try this as well later.

I did a quick run with plc4j-driver-s7-0.8.0-20200831.122123-1 (I hope this is 
the right one) but it stops at:

16:55:34.460 [nioEventLoopGroup-2-1] DEBUG 
org.apache.plc4x.java.spi.GeneratedDriverByteToMessageCodec - Sending bytes to 
PLC for message 
TPKTPacket[payload=COTPPacketData[parameters=,payload=S7MessageRequest[tpduReference=10,parameter=S7ParameterReadVarRequest[items={S7VarRequestParameterItemAddress[address=S7AddressAny[transportSize=BOOL,numberOfElements=1,dbNumber=20,area=DATA_BLOCKS,byteAddress=5,bitAddress=0]]}],payload=],eot=true,tpduRef=10]]
 as data 031f02f08a3201000a000e0401120a1001000100148428


Best regards,
Sebastian


> On 31. Aug 2020, at 15:18, Stefano Bossi  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 
> 
> 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"  
>> :
>> 
>> Hi Chris,
>> 
>> JIRA issue with attachment is created 
>> 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  
>>  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 
>>  (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  
>> > Antworten an: "dev@plc4x.apache.org"  
>>  
>> > Datum: Montag, 31. August 2020 um 10:49
>> > An: "dev@plc4x.apache.org"  
>>  
>> > 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  
>>  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 

Re: S7 read issue

2020-08-31 Thread Stefano Bossi
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

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" :
>
> Hi Chris,
>
> JIRA issue with attachment is created 
> 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  
> 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 (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 
> > Antworten an: "dev@plc4x.apache.org" 
> > Datum: Montag, 31. August 2020 um 10:49
> > An: "dev@plc4x.apache.org" 
> > 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  
> 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"
> >>> 
> >>> :
> >>> 
> >>>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=1=0=1=S7_1200
>  
> ";
> >>>PlcDriverManager 

Re: S7 read issue

2020-08-31 Thread Christofer Dutz
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" :

Hi Chris,

JIRA issue with attachment is created 
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  
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 (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 
> Antworten an: "dev@plc4x.apache.org" 
> Datum: Montag, 31. August 2020 um 10:49
> An: "dev@plc4x.apache.org" 
> 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  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"
>>> 
>>> :
>>> 
>>>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=1=0=1=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
>>> 
>>> 
>> 
>> 




Re: S7 read issue

2020-08-31 Thread Sebastian Voss
Hi Chris,

JIRA issue with attachment is created 
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  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 (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 
> Antworten an: "dev@plc4x.apache.org" 
> Datum: Montag, 31. August 2020 um 10:49
> An: "dev@plc4x.apache.org" 
> 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  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"
>>> 
>>> :
>>> 
>>>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=1=0=1=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
>>> 
>>> 
>> 
>> 



[jira] [Created] (PLC4X-246) S7 driver hangs on read

2020-08-31 Thread Sebastian Voss (Jira)
Sebastian Voss created PLC4X-246:


 Summary: S7 driver hangs on read
 Key: PLC4X-246
 URL: https://issues.apache.org/jira/browse/PLC4X-246
 Project: Apache PLC4X
  Issue Type: Bug
  Components: Driver-S7
Affects Versions: 0.7.0
Reporter: Sebastian Voss
 Attachments: s7_capture.pcapng

I’m trying to read a value from an Siemens S7-1200 PLC). When I try to read a 
value the read request is not being executed (I also do not receive an error 
message or timeout).

This is the simple program I created:
{code:java}
String url = "s7://172.29.118.20:102?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:5.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();{code}

I created a Wireshark capture and it seems the PLC is reporting:
{code:java}
[Error code: This service is not implemented on the module or a frame error was 
reported (0x8104)]{code}
Thanks to the help of [~cdutz] I figured out this is related to the protection 
settings of the PLC. I will try to adjust those settings and report back the 
result. Maybe the driver can be improved to report back those error codes to 
the user.

 


   



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


Re: S7 read issue

2020-08-31 Thread Christofer Dutz
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 (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 
Antworten an: "dev@plc4x.apache.org" 
Datum: Montag, 31. August 2020 um 10:49
An: "dev@plc4x.apache.org" 
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  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"
>> 
>> :
>>
>> 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=1=0=1=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
>>
>>
>
>


Re: S7 read issue

2020-08-31 Thread Sebastian Voss
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  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" 
>> 
>> :
>> 
>> 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=1=0=1=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
>> 
>> 
> 
> 



Re: S7 read issue

2020-08-31 Thread Stefano Bossi
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" :
>
> 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=1=0=1=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
>
​


signature.asc
Description: OpenPGP digital signature


Re: How does the code generation process for different languages currently work?

2020-08-31 Thread Christofer Dutz
Hi Mattias,

welcome here on our list. I am sure we'll be able to help you.

Sounds like a great topic to write your thesis on ... really wished I had had 
the luck to do something that cool ;-)

So am I assuming correctly that you're planning on working on the generation of 
the driver logic code? Cause the Parser/Serializer/Model stuff is what we 
already have.

Cause in general we see two parts: Syntax and Semantic ... so on the one side 
we have the syntax of the packets of a given protocol. This is what we have 
with the auto-generated model classes and the Parser and Serializer code. 
However this only is part of what defines a driver. The second half we still 
have to write by hand for every driver: Which messages are sent at which time 
and how to react when receiving the different types of message.

I think when having a look at the files ending on *IT.xml they can give you an 
impression on how this logic should work.
They are part of our testsuite which we use to test the logic. So imagine them 
the counterpart of what would be a generated driver logic. (Some people even 
suggested a generated driver logic could possibly be based on these files as 
they already define great parts of what is expected to happen.

Hope this helps you get started. 

If you have any questions, don't hesitate to ask.

Chris





Am 30.08.20, 21:50 schrieb "Matthias Richter" :

Hi all, 

my name is Matthias and I'm studying mechanical engineering at the 
University of Stuttgart. 
Currently, I'm doing my bachelor thesis at the "Institute for Control 
Engineering of Machine Tools and Manufacturing Units". 

The task of my thesis is to define and implement a model for the automatic 
generation of protocol drivers in different programming languages for PLC4X, 
using template-based code generation. 
My supervisor Matthias Strljic recommended to introduce myself to this 
mailing list to get in contact with the developers of the project and maybe get 
some help with questions that might arise during my thesis. 

In the repository and the documentation, I have seen that there are already 
different parts of the drivers which are automatically generated.
Nevertheless, I have some difficulties getting a deeper understanding of 
the current driver generation process. 
I would be pleased if someone would be willing to give me a rough overview 
of the current status of the project and the approaches used for the driver 
generation.

Regards Mattias



Re: S7 read issue

2020-08-31 Thread Christofer Dutz
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" :

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=1=0=1=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