Re: Contributions with Access to PLC's

2020-08-01 Thread Truran, Ryan S
I'm going to get my PLC set up this afternoon, then I will start playing with 
the sandbox.

Regards,
Ryan

From: Christofer Dutz 
Sent: Saturday, August 1, 2020 10:18 AM
To: dev@plc4x.apache.org 
Subject: Re: Contributions with Access to PLC's

Hi Ryan,

I will be happy to help you in getting started with the protocols you are 
planning on working on.
Just tell me if you need any help.

Also I would be very happy for feedback on the sandbox/plc4c part, which I'm 
currently working on hard.

Chris



Am 31.07.20, 10:24 schrieb "Truran, Ryan S" :

Hi Chris,
My plan is to get a piece of equipment setup in my office so that I can 
begin testing the modbus driver to get a feel for the codebase. Then develop a 
couple drivers, maybe DNP3 or LonWorks.

Is there a roadmap of drivers that need to be created?

C would be nice, as we could then look at the usage in embedded systems, 
I’m actually in the process of trying to get a few custom drivers ported over 
to a gateway type solution for work.

Regards,
Ryan Truran

Sent from my iPhone

> On Jul 31, 2020, at 02:41, Christofer Dutz  
wrote:
>
> Hi Turan,
>
> and also welcome ... great to have you here :-)
>
> There are generally a lot of ways you can contribute:
> - Start using PLC4X drivers and report/fix issues you encounter
> - Add features to drivers or improve existing drivers if we did things in 
a less-ideal way
> - Implement new drivers If you have some hardware you would like to talk 
to but we haven't got any drivers for yet
> - Bring PLC4X to new languages (I'm currently working on porting to C ... 
others were thinking of reinitiating the Python efforts)
>
> Implementing drivers and porting to new languages definitely sounds like 
more work than it is, but we have created tooling for code-generation that 
takes care of most of the annoying parts of this.
>
> If you want to get started with any particular thing, please tell us 
about it and we'll do our best to get you setup :-)
>
> Chris
>
>
>
> Am 30.07.20, 16:23 schrieb "Lukas Ott" :
>
>Hi Ryan,
>
>A warm welcome to PLC4X project.
>
>There are several ways to contribute to PLC4X project.
>
>If you are a developer checkout here:
>https://plc4x.apache.org/developers/contributing.html
>
>If you are a user then you may start here:
>https://plc4x.apache.org/users/plc4j/gettingstarted.html and start
>accessing you PLCs.
>-> If you get errors please add Wireshark dumps to you issue and hand 
it in
>here -> https://issues.apache.org/jira/projects/PLC4X/issues/
>

>-> A good way to contribute is to improve the documentation for users 
e.g.
>writing and helping to improve getting started etc.
>-> We also have a Hands on Webinar here: https://youtu.be/MIp_0OcDTr4
>
>So start testing and come back to mailing list (open issues, improve
>documentation) and enjoy yourself and good Toddy coffee :D.
>
>Again welcome to the PLX4X project.
>
>Kind regards
>Lukas
>
>
>>Am Do., 30. Juli 2020 um 15:58 Uhr schrieb Truran, Ryan S 
>> :
>>
>> What is the best way for me to contribute, I have access to multiple PLC
>> Types, Allen Bradley, S7, Wago (Modbus), etc.
>>
>> Regards,
>> Ryan Truran
>> Controls Engineer
>> Texas Instruments
>>
>



Re: Contributions with Access to PLC's

2020-08-01 Thread Christofer Dutz
Hi Ryan,

I will be happy to help you in getting started with the protocols you are 
planning on working on.
Just tell me if you need any help.

Also I would be very happy for feedback on the sandbox/plc4c part, which I'm 
currently working on hard.

Chris



Am 31.07.20, 10:24 schrieb "Truran, Ryan S" :

Hi Chris, 
My plan is to get a piece of equipment setup in my office so that I can 
begin testing the modbus driver to get a feel for the codebase. Then develop a 
couple drivers, maybe DNP3 or LonWorks. 

Is there a roadmap of drivers that need to be created? 

C would be nice, as we could then look at the usage in embedded systems, 
I’m actually in the process of trying to get a few custom drivers ported over 
to a gateway type solution for work. 

Regards,
Ryan Truran

Sent from my iPhone

> On Jul 31, 2020, at 02:41, Christofer Dutz  
wrote:
> 
> Hi Turan,
> 
> and also welcome ... great to have you here :-)
> 
> There are generally a lot of ways you can contribute:
> - Start using PLC4X drivers and report/fix issues you encounter
> - Add features to drivers or improve existing drivers if we did things in 
a less-ideal way
> - Implement new drivers If you have some hardware you would like to talk 
to but we haven't got any drivers for yet
> - Bring PLC4X to new languages (I'm currently working on porting to C ... 
others were thinking of reinitiating the Python efforts)
> 
> Implementing drivers and porting to new languages definitely sounds like 
more work than it is, but we have created tooling for code-generation that 
takes care of most of the annoying parts of this.
> 
> If you want to get started with any particular thing, please tell us 
about it and we'll do our best to get you setup :-)
> 
> Chris
> 
> 
> 
> Am 30.07.20, 16:23 schrieb "Lukas Ott" :
> 
>Hi Ryan,
> 
>A warm welcome to PLC4X project.
> 
>There are several ways to contribute to PLC4X project.
> 
>If you are a developer checkout here:
>https://plc4x.apache.org/developers/contributing.html
> 
>If you are a user then you may start here:
>https://plc4x.apache.org/users/plc4j/gettingstarted.html and start
>accessing you PLCs.
>-> If you get errors please add Wireshark dumps to you issue and hand 
it in
>here -> https://issues.apache.org/jira/projects/PLC4X/issues/
>

>-> A good way to contribute is to improve the documentation for users 
e.g.
>writing and helping to improve getting started etc.
>-> We also have a Hands on Webinar here: https://youtu.be/MIp_0OcDTr4
> 
>So start testing and come back to mailing list (open issues, improve
>documentation) and enjoy yourself and good Toddy coffee :D.
> 
>Again welcome to the PLX4X project.
> 
>Kind regards
>Lukas
> 
> 
>>Am Do., 30. Juli 2020 um 15:58 Uhr schrieb Truran, Ryan S 
>> :
>> 
>> What is the best way for me to contribute, I have access to multiple PLC
>> Types, Allen Bradley, S7, Wago (Modbus), etc.
>> 
>> Regards,
>> Ryan Truran
>> Controls Engineer
>> Texas Instruments
>> 
> 



Re: Reading Array of Int

2020-08-01 Thread Christofer Dutz
Hi Stefano,

I think such a Jira would be a good idea.

I’m currently working on the Beckhoff ADS and would try to have a look as soon 
as possible.

Chris



Von: Stefano Bossi 
Antworten an: 
Datum: Samstag, 1. August 2020 um 11:25
An: , Julian Feinauer 
Betreff: Re: Reading Array of Int

Hi julian,

if you need or think could simplify the development I could open a jira ticket 
and upload a couple of pcap capture for you.

As I wrote I am using the 0.7.0 version from Maven and I am talking with a real 
Siemens 1200 with firmware 1.2 (pretty old but I didn't find a way to upgrade 
it ).

Let me know.

Thanks for help.

Regards,
Stefano

On 30/07/2020 07:49, Julian Feinauer wrote:

Hey Stefano, I will try to have a look later today. Are you using plc4x version 
0.6 or 0.7?



Thank you!



Julian



Holen Sie sich Outlook für Android





Von: Stefano Bossi 

Gesendet: Mittwoch, 29. Juli 2020, 12:32

An: dev@plc4x.apache.org; Christofer Dutz

Betreff: Re: Reading Array of Int



Thanks Chris,



yes definitely this is a workaround, I am experimenting and learning.



I really appreciate your time on the investigation of the issue.



Thanks,

Stefano Bossi







On 29/07/2020 12:08, Christofer Dutz wrote:



Well that’s a workaround, but not a fix …



We should focus on fixing this.



I’ll investigate the issue as soon as I’m done with the Beckhoff ADS/AMS stuff …



Perhaps Julian could find some time to investigate?



Chris







Von: Stefano Bossi 


Antworten an: 


Datum: Mittwoch, 29. Juli 2020 um 11:41

An: 


Betreff: Re: Reading Array of Int





I have adopted a workaround reading all the INT variable separated.



--connection-string 's7:tcp://192.168.1.192?controller-type=S7_1200' 
--field-addresses '%DB1:274.0:INT' '%DB1:276.0:INT' '%DB1:278.0:INT' 
'%DB1:280.0:INT'



In this way on the wire you have:

the query:



Frame 296: 111 bytes on wire (888 bits), 111 bytes captured (888 bits) on 
interface utun2, id 0



Null/Loopback



Internet Protocol Version 4, Src: 192.168.100.4, Dst: 192.168.1.192



Transmission Control Protocol, Src Port: 57188, Dst Port: 102, Seq: 48, Ack: 
50, Len: 67



TPKT, Version: 3, Length: 67



ISO 8073/X.224 COTP Connection-Oriented Transport Protocol



S7 Communication



Header: (Job)



Parameter: (Read Var)



Function: Read Var (0x04)



Item count: 4



Item [1]: (DB 1.DBX 274.0 INT 1)



Item [2]: (DB 1.DBX 276.0 INT 1)



Item [3]: (DB 1.DBX 278.0 INT 1)



Item [4]: (DB 1.DBX 280.0 INT 1)



the answer:



Frame 297: 89 bytes on wire (712 bits), 89 bytes captured (712 bits) on 
interface utun2, id 0



Null/Loopback



Internet Protocol Version 4, Src: 192.168.1.192, Dst: 192.168.100.4



Transmission Control Protocol, Src Port: 102, Dst Port: 57188, Seq: 50, Ack: 
115, Len: 45



TPKT, Version: 3, Length: 45



ISO 8073/X.224 COTP Connection-Oriented Transport Protocol



S7 Communication



Header: (Ack_Data)



Parameter: (Read Var)



Function: Read Var (0x04)



Item count: 4



Data



Item [1]: (Success)



Item [2]: (Success)



Item [3]: (Success)



Item [4]: (Success)



[INFO ] 10:15:44.727 it.fox.datapicker.HelloPlc4x.printResponse() - 
Value[value-0]: 10



[INFO ] 10:15:44.733 it.fox.datapicker.HelloPlc4x.printResponse() - 
Value[value-1]: 11



[INFO ] 10:15:44.737 it.fox.datapicker.HelloPlc4x.printResponse() - 
Value[value-2]: 12



[INFO ] 10:15:44.741 it.fox.datapicker.HelloPlc4x.printResponse() - 
Value[value-3]: 13



Unfortunately my java knowledge are not so advanced to fix the bug in reading 
the array in a single command, anyway there’s a workaround.



Hope this mail help some newbies like me to find the right way to read data 
from the PLC.



Regards,

Stefano



On 28/07/2020 11:38, Stefano Bossi wrote:



Dear plc4x forum,



I have found a possible problem in reading an array of INT.

I am using the HelloPlc4x app for testing and I am trying to read the field 
address: '%DB1:274.0:INT[3]'



In the request, captured via wireShark I can see the query:



Frame 3: 75 bytes on wire (600 bits), 75 bytes captured (600 bits) on interface 
utun2, id 0



Null/Loopback



Internet Protocol Version 4, Src: 192.168.100.4, Dst: 192.168.1.192



Transmission Control Protocol, Src Port: 54543, Dst Port: 102, Seq: 1, Ack: 1, 
Len: 31



TPKT, Version: 3, Length: 31



ISO 8073/X.224 COTP Connection-Oriented Transport Protocol



S7 Communication



Header: (Job)



Parameter: (Read Var)



Function: 

Re: Reading Array of Int

2020-08-01 Thread Stefano Bossi
Hi julian,

if you need or think could simplify the development I could open a jira
ticket and upload a couple of pcap capture for you.

As I wrote I am using the 0.7.0 version from Maven and I am talking with
a real Siemens 1200 with firmware 1.2 (pretty old but I didn't find a
way to upgrade it ).

Let me know.

Thanks for help.

Regards,
Stefano


On 30/07/2020 07:49, Julian Feinauer wrote:
> Hey Stefano, I will try to have a look later today. Are you using plc4x 
> version 0.6 or 0.7?
>
> Thank you!
>
> Julian
>
> Holen Sie sich Outlook für Android
>
> 
> Von: Stefano Bossi 
> Gesendet: Mittwoch, 29. Juli 2020, 12:32
> An: dev@plc4x.apache.org; Christofer Dutz
> Betreff: Re: Reading Array of Int
>
> Thanks Chris,
>
> yes definitely this is a workaround, I am experimenting and learning.
>
> I really appreciate your time on the investigation of the issue.
>
> Thanks,
> Stefano Bossi
>
>
>
> On 29/07/2020 12:08, Christofer Dutz wrote:
>
> Well that’s a workaround, but not a fix …
>
> We should focus on fixing this.
>
> I’ll investigate the issue as soon as I’m done with the Beckhoff ADS/AMS 
> stuff …
>
> Perhaps Julian could find some time to investigate?
>
> Chris
>
>
>
> Von: Stefano Bossi 
> Antworten an: 
> Datum: Mittwoch, 29. Juli 2020 um 11:41
> An: 
> Betreff: Re: Reading Array of Int
>
>
> I have adopted a workaround reading all the INT variable separated.
>
> --connection-string 's7:tcp://192.168.1.192?controller-type=S7_1200' 
> --field-addresses '%DB1:274.0:INT' '%DB1:276.0:INT' '%DB1:278.0:INT' 
> '%DB1:280.0:INT'
>
> In this way on the wire you have:
> the query:
>
> Frame 296: 111 bytes on wire (888 bits), 111 bytes captured (888 bits) on 
> interface utun2, id 0
>
> Null/Loopback
>
> Internet Protocol Version 4, Src: 192.168.100.4, Dst: 192.168.1.192
>
> Transmission Control Protocol, Src Port: 57188, Dst Port: 102, Seq: 48, Ack: 
> 50, Len: 67
>
> TPKT, Version: 3, Length: 67
>
> ISO 8073/X.224 COTP Connection-Oriented Transport Protocol
>
> S7 Communication
>
> Header: (Job)
>
> Parameter: (Read Var)
>
> Function: Read Var (0x04)
>
> Item count: 4
>
> Item [1]: (DB 1.DBX 274.0 INT 1)
>
> Item [2]: (DB 1.DBX 276.0 INT 1)
>
> Item [3]: (DB 1.DBX 278.0 INT 1)
>
> Item [4]: (DB 1.DBX 280.0 INT 1)
>
> the answer:
>
> Frame 297: 89 bytes on wire (712 bits), 89 bytes captured (712 bits) on 
> interface utun2, id 0
>
> Null/Loopback
>
> Internet Protocol Version 4, Src: 192.168.1.192, Dst: 192.168.100.4
>
> Transmission Control Protocol, Src Port: 102, Dst Port: 57188, Seq: 50, Ack: 
> 115, Len: 45
>
> TPKT, Version: 3, Length: 45
>
> ISO 8073/X.224 COTP Connection-Oriented Transport Protocol
>
> S7 Communication
>
> Header: (Ack_Data)
>
> Parameter: (Read Var)
>
> Function: Read Var (0x04)
>
> Item count: 4
>
> Data
>
> Item [1]: (Success)
>
> Item [2]: (Success)
>
> Item [3]: (Success)
>
> Item [4]: (Success)
>
> [INFO ] 10:15:44.727 it.fox.datapicker.HelloPlc4x.printResponse() - 
> Value[value-0]: 10
>
> [INFO ] 10:15:44.733 it.fox.datapicker.HelloPlc4x.printResponse() - 
> Value[value-1]: 11
>
> [INFO ] 10:15:44.737 it.fox.datapicker.HelloPlc4x.printResponse() - 
> Value[value-2]: 12
>
> [INFO ] 10:15:44.741 it.fox.datapicker.HelloPlc4x.printResponse() - 
> Value[value-3]: 13
>
> Unfortunately my java knowledge are not so advanced to fix the bug in reading 
> the array in a single command, anyway there’s a workaround.
>
> Hope this mail help some newbies like me to find the right way to read data 
> from the PLC.
>
> Regards,
> Stefano
>
> On 28/07/2020 11:38, Stefano Bossi wrote:
>
> Dear plc4x forum,
>
> I have found a possible problem in reading an array of INT.
> I am using the HelloPlc4x app for testing and I am trying to read the field 
> address: '%DB1:274.0:INT[3]'
>
> In the request, captured via wireShark I can see the query:
>
> Frame 3: 75 bytes on wire (600 bits), 75 bytes captured (600 bits) on 
> interface utun2, id 0
>
> Null/Loopback
>
> Internet Protocol Version 4, Src: 192.168.100.4, Dst: 192.168.1.192
>
> Transmission Control Protocol, Src Port: 54543, Dst Port: 102, Seq: 1, Ack: 
> 1, Len: 31
>
> TPKT, Version: 3, Length: 31
>
> ISO 8073/X.224 COTP Connection-Oriented Transport Protocol
>
> S7 Communication
>
> Header: (Job)
>
> Parameter: (Read Var)
>
> Function: Read Var (0x04)
>
> Item count: 1
>
> Item [1]: (DB 1.DBX 274.0 INT 3)
>
> Variable specification: 0x12
>
> Length of following address specification: 10
>
> Syntax Id: S7ANY (0x10)
>
> Transport size: INT (5)
>
> Length: 3
>
> DB number: 1
>
> Area: Data blocks (DB) (0x84)
>
> Address: 0x000890
>
> and the response:
>
> Frame 

Re: Reading Array of Int

2020-08-01 Thread Christofer Dutz
Looking forward to it :-)

Von: Cesar Garcia 
Gesendet: Freitag, 31. Juli 2020 23:27
An: Apache PLC4X 
Betreff: Re: Reading Array of Int

Hi Chris.

With the 0.6.1 (Aka Frankenstein code :-)) I solved every problem that I
was finding to get to the handling of the subscription (Type handling,
optimization, asynchronous responses from the PLC, etc.).

J ... is helping me to incorporate the code to the development branch. I am
not a Git expert, and the last thing I want is to damage something jeje.

Also, all these points are documented in Jira (including the pcap files).

For my part, I am waiting next week to be able to install a VPN and give
access to the S7-300 / 400 equipment (physical) and the tests can be
finished.

Best regards,

El vie., 31 jul. 2020 a las 3:42, Christofer Dutz (<
christofer.d...@c-ware.de>) escribió:

> Hi Cesar,
>
> if you fixed any issues in that branch, that are not related to
> publish-subscribe and alarms, it would be great if you could port that to
> develop.
>
> Chris
>
>
>
> Am 30.07.20, 17:34 schrieb "Cesar Garcia" :
>
> Hi Stefano,
>
> I have made several modifications to the branch for a 0.6.1 revision.
>
> If you have the time to try it you can download it from here
>
> https://github.com/glcj/plc4x/tree/s7alarm
>
> and a number of examples here,
>
> https://github.com/glcj/PLC4XS7Examples
>
> What version of PLC do you have?
>
> Like the rest of the team, I will order to help you if you find any
> problem.
>
> Best regards,
>
> El mié., 29 jul. 2020 a las 6:32, Stefano Bossi (<
> stefano.bo...@gmail.com>)
> escribió:
>
> > Thanks Chris,
> >
> > yes definitely this is a workaround, I am experimenting and learning.
> >
> > I really appreciate your time on the investigation of the issue.
> >
> > Thanks,
> > Stefano Bossi
> >
> >
> >
> > On 29/07/2020 12:08, Christofer Dutz wrote:
> >
> > Well that’s a workaround, but not a fix …
> >
> > We should focus on fixing this.
> >
> > I’ll investigate the issue as soon as I’m done with the Beckhoff
> ADS/AMS stuff …
> >
> > Perhaps Julian could find some time to investigate?
> >
> > Chris
> >
> >
> >
> > Von: Stefano Bossi  <
> stefano.bo...@gmail.com>
> > Antworten an:  
> > Datum: Mittwoch, 29. Juli 2020 um 11:41
> > An:  
> > Betreff: Re: Reading Array of Int
> >
> >
> > I have adopted a workaround reading all the INT variable separated.
> >
> > --connection-string 's7:tcp://192.168.1.192?controller-type=S7_1200'
> --field-addresses '%DB1:274.0:INT' '%DB1:276.0:INT' '%DB1:278.0:INT'
> '%DB1:280.0:INT'
> >
> > In this way on the wire you have:
> > the query:
> >
> > Frame 296: 111 bytes on wire (888 bits), 111 bytes captured (888
> bits) on interface utun2, id 0
> >
> > Null/Loopback
> >
> > Internet Protocol Version 4, Src: 192.168.100.4, Dst: 192.168.1.192
> >
> > Transmission Control Protocol, Src Port: 57188, Dst Port: 102, Seq:
> 48, Ack: 50, Len: 67
> >
> > TPKT, Version: 3, Length: 67
> >
> > ISO 8073/X.224 COTP Connection-Oriented Transport Protocol
> >
> > S7 Communication
> >
> > Header: (Job)
> >
> > Parameter: (Read Var)
> >
> > Function: Read Var (0x04)
> >
> > Item count: 4
> >
> > Item [1]: (DB 1.DBX 274.0 INT 1)
> >
> > Item [2]: (DB 1.DBX 276.0 INT 1)
> >
> > Item [3]: (DB 1.DBX 278.0 INT 1)
> >
> > Item [4]: (DB 1.DBX 280.0 INT 1)
> >
> > the answer:
> >
> > Frame 297: 89 bytes on wire (712 bits), 89 bytes captured (712 bits)
> on interface utun2, id 0
> >
> > Null/Loopback
> >
> > Internet Protocol Version 4, Src: 192.168.1.192, Dst: 192.168.100.4
> >
> > Transmission Control Protocol, Src Port: 102, Dst Port: 57188, Seq:
> 50, Ack: 115, Len: 45
> >
> > TPKT, Version: 3, Length: 45
> >
> > ISO 8073/X.224 COTP Connection-Oriented Transport Protocol
> >
> > S7 Communication
> >
> > Header: (Ack_Data)
> >
> > Parameter: (Read Var)
> >
> > Function: Read Var (0x04)
> >
> > Item count: 4
> >
> > Data
> >
> > Item [1]: (Success)
> >
> > Item [2]: (Success)
> >
> > Item [3]: (Success)
> >
> > Item [4]: (Success)
> >
> > [INFO ] 10:15:44.727 it.fox.datapicker.HelloPlc4x.printResponse() -
> Value[value-0]: 10
> >
> > [INFO ] 10:15:44.733 it.fox.datapicker.HelloPlc4x.printResponse() -
> Value[value-1]: 11
> >
> > [INFO ] 10:15:44.737 it.fox.datapicker.HelloPlc4x.printResponse() -
> Value[value-2]: 12
> >
> > [INFO ] 10:15:44.741 it.fox.datapicker.HelloPlc4x.printResponse() -
> Value[value-3]: 13
>   

Re: How to compose Read requests for ADS Protocol with PLC4X?

2020-08-01 Thread Christofer Dutz
Hi Jonas,

In the end I managed to reverse engineer the missing parts with some captures I 
named to create and the documentation on the website and used that to extend 
what e had and am currently working on finishing the ads driver.

It'll probably take another few days, but I'm hopeful, that it'll be finished 
soon.

Then some testing would be highly valuable to us.

Chris


Von: Hillenbrand, Jonas (wbk) 
Gesendet: Freitag, 31. Juli 2020 13:36
An: dev@plc4x.apache.org 
Betreff: AW: How to compose Read requests for ADS Protocol with PLC4X?

Hi Chris,

I think if you figured out how to setup your system to properly use the example 
here for Java
https://infosys.beckhoff.com/english.php?content=../content/1033/tcsample_java/html/tcjavatoads_sample01.html=
you've actually reached more than I did, so far

Right now I'm using a small C# application to read from ADS Server (described 
here 
https://infosys.beckhoff.com/english.php?content=../content/1033/tcsample_java/html/tcjavatoads_sample01.html=)
 and then in the same application pass the data on via UDP Client and on the 
same machine a Java Application runs a UDP Server to capture the ADS Data and 
do some business logic.
[VERY MESSY]
I can share my stuff, if it is of interest as soon as I debugged it.

But as you see, this is nothing I want to go to production with ...

Cheers,
Jonas

-Ursprüngliche Nachricht-
Von: Christofer Dutz [mailto:christofer.d...@c-ware.de]
Gesendet: Freitag, 31. Juli 2020 10:17
An: dev@plc4x.apache.org
Betreff: Re: How to compose Read requests for ADS Protocol with PLC4X?

Hi think i found it ...

I needed the Ads.dll itself ... of course that's not documented in the 
documentation ;-)


Chris



Am 31.07.20, 09:59 schrieb "Christofer Dutz" :

Hi Jonas,

I think I can possibly help you now … as I worked on the new Beckhoff 
driver I finally got to working with the ADS protocol.
I think the problem you are having is that the address you are using is 
simply not correct.

The PLC doesn’t find an address called “BOOL1” … After discussing things 
with the Beckhoff Tech-Staff I learned, that you should address resources with 
symbolic addresses like:

main.f_trigDateiGelesen.M:BOOL

Please note that there seems to be differences between TwinCat2 and 
TwinCat3 devices regarding this symbolic address format. The older ones seem to 
simply start without the module name. Like: “.f_trigDateiGelesen.M:BOOL” (But I 
haven’t been able to verify this)

The other option would be to use fixed addresses, like:

0xf005/0x1a80:BOOL

Which is however considered bad practice, as adding one single byte to the 
PLC could ruin all of your addesses.

Hope this helps a little more.

Chris



Von: "Hillenbrand, Jonas (wbk)" 
Antworten an: 
Datum: Mittwoch, 29. Juli 2020 um 11:25
An: "dev@plc4x.apache.org" 
Betreff: How to compose Read requests for ADS Protocol with PLC4X?

Hi there,

I’m working on using the PLC4X framework within my research projects 
involving datalogging from Beckhoff PLC via ADS protocol.

I was able to connect with the PLC using the following code, but it fails 
on the line where the read request is executed:

PlcConnection plcConnection = null;
String connectionStr = " 
ads:tcp://127.0.0.1:48898/5.23.164.94.1.1:851/129.254.235.187.1.1:32835”;
try {
plcConnection = new 
PlcDriverManager().getConnection(connectionStr);
if (this.plcConnection.isConnected()){
if (!this.isAdsReadable() || 
!this.isAdsWritable() || !this.isAdsSubscribable()) {
   return false;
   }
   this.logger.log("Connected successfully 
with " + connectionStr);
   return true;
} else {
   this.logger.log(Level.ERROR, "Could not 
connect with " + connectionStr);
   return false;
}
} catch (PlcConnectionException e) {
// TODO Auto-generated catch block
this.logger.log(e);
return false;
}
PlcReadRequest.Builder builder 
=plcConnection.readRequestBuilder();
builder.addItem(“BOOL1”, "BOOL1:BOOL");  // 
Boolean variable in GVL (global) list of SPS Project
PlcReadRequest readRequest = builder.build();
PlcReadResponse response = null;
try {
response = readRequest.execute().get(); 
// CODE FAILS HERE
} catch (InterruptedException e) {
// TODO Auto-generated catch block