Re: Help required on Beckhoff PLC connection to a JAVA OSGi Framework project

2021-06-09 Thread Cesar Garcia
Hi Palaniswamy,

Welcome to the list of PLC4X,

As Lukasz very well points out, the design of the PLC4X drivers for Java
are based on SPI, so they present some details for their use in an OSGi
environment.

I work with Karaf, I do not know the container that you indicate but I will
take the time to evaluate it since it is in my line of work.

The Apache Aries SPI project supports SPI in an OSGi environment so it is a
matter of following what the manual establishes.

There are cases of dependencies and accesses between instances that tend to
be a bit cumbersome, but generally solvable.

In the development branch 0.9.0-SNAP ... I am incorporating what is
required for the libraries to work in Karaf, eventually a dependency
problem is already solved and I have the S7 Driver working.

What is my recommendation:

1. Be patient. :-)
2. Incorporate the required  *  and
 *  instructions into the POMs, this allows
Apache Aries to do its magic. For example "plc4j-transport-tcp" is a
 and the library "plc4j-spi" is .
3. Use the appropriate libraries required by PLC4X, you must deploy them as
the case may be (I use the "features" functionality of Karaf).
4. Avoid using . Better to use , as the
case may be.

Well as you can see, there are only a few steps for the library to work.

In [1] you can see the work that I am doing for the S7 Driver and it can
serve as a reference.

Best regards,

1. https://github.com/glcj/plc4x/tree/s7event



El mié, 9 jun 2021 a las 15:33, Palaniswamy, Lakshimi Narayanan (ETI) (<
lakshimi.palanisw...@kit.edu>) escribió:

> Hello Community,
>
> I am currently working with an OSGi framework based Open-Source Energy
> Management System OpenEMS (https://openems.io/). As a part of the
> development we wanted to integrate a Beckhoff PLC, which offers a ADS
> bridge-Modbus TCP Protocol for communication. Although I found a DLL
> offered by Beckhoff (
> https://infosys.beckhoff.com/index.php?content=../content/1031/tcadscommon/html/note.htm=),
> it did not fit perfectly for the case of OpenEMS due to its OSGi Framework.
> Thankfully I found the PLC4x adaptor. It really solves half the problem for
> me. I would also like to mention I am quiet new to OSGi as well as JAVA to
> begin with and am trying to figure things out on the go.
>
> Now to my question. I wanted to use the PLC4j/ADS drivers and
> functionalities in my code. I started with the basic setup mentioned in the
> "JAVA Getting Started" page of the PLC4x. When I used the following code:
> PLCDriverManager().getConnection("ads:tcp://xxx.xx.x.xx:502") to establish
> the connection. I get an error saying "Unable to find driver for protocol
> 'ads'". It was weird because if had added all (I hope so) the dependencies
> required as follows:
>
> 
> org.apache.plc4x
> plc4j-api
> 0.8.0
> 
>
> 
>
> org.apache.plc4x
>
> plc4j-driver-ads
>
> 0.8.0
>
> runtime
>
> 
>
> Later I found out that, for OSGi framework, the Drivers are required to be
> activated (
> https://github.com/apache/plc4x/blob/develop/plc4j/osgi/src/main/java/org/apache/plc4x/java/osgi/DriverActivator.java
> ), so that it creates a bundle. But now I am really not sure how this is
> done. Could someone please help me out with this. If there are any
> tutorials or examples for such a case, please share it.
>
> As I said before, we intend in integrating a Beckhoff PLC running TwinCAT
> ADS, into a JAVA OSGi based framework, which would be communicating with
> each other over Modbus TCP protocol.
>
> Viele Grüße
> Laksh
>
>

-- 
*CEOS Automatización, C.A.*
*GALPON SERVICIO INDUSTRIALES Y NAVALES FA, C.A.,*
*PISO 1, OFICINA 2, AV. RAUL LEONI, SECTOR GUAMACHITO,*

*FRENTE A LA ASOCIACION DE GANADEROS,BARCELONA,EDO. ANZOATEGUI*
*Ing. César García*

*Cel: +58 414-760.98.95*

*Hotline Técnica SIEMENS: 0800 1005080*

*Email: support.aan.automat...@siemens.com
*


Re: Help required on Beckhoff PLC connection to a JAVA OSGi Framework project

2021-06-09 Thread Łukasz Dywicki
Hey Palaniswamy,
Welcome on mailing lists.

For OSGi to get whole thing working there are few things necessary.
Problem which you face is related to visibility of resources between
isolated class-loaders. Normally with "flat classpath" you get in
regular web or standalone applications scanning of classpath can
enumerate all resources. That's not a case with OSGi.
Driver manager in current form can't work without further enhancements
which will expose META-INF/services entries. There were some high level
attempts to solve that using Aries Spifly, yet I never really got it
working.

A proper way for most of situations within OSGi is to rely on services.
This is reason why we have activators (called only under OSGi) which can
replace META-INF/services lookups and work dynamically. Just like whole
environment does.
You can use OSGi services registered by driver itself. It will let you
calling getConnection method directly. Syntax for URI is the same as for
driver manager.

You might need some further adjustments in order to get transport stuff
which does another META-INF lookup for Transport SPI.

Best,
Łukasz


On 09.06.2021 21:33, Palaniswamy, Lakshimi Narayanan (ETI) wrote:
> Hello Community,
> 
> I am currently working with an OSGi framework based Open-Source Energy 
> Management System OpenEMS (https://openems.io/). As a part of the development 
> we wanted to integrate a Beckhoff PLC, which offers a ADS bridge-Modbus TCP 
> Protocol for communication. Although I found a DLL offered by Beckhoff 
> (https://infosys.beckhoff.com/index.php?content=../content/1031/tcadscommon/html/note.htm=),
>  it did not fit perfectly for the case of OpenEMS due to its OSGi Framework. 
> Thankfully I found the PLC4x adaptor. It really solves half the problem for 
> me. I would also like to mention I am quiet new to OSGi as well as JAVA to 
> begin with and am trying to figure things out on the go.
> 
> Now to my question. I wanted to use the PLC4j/ADS drivers and functionalities 
> in my code. I started with the basic setup mentioned in the "JAVA Getting 
> Started" page of the PLC4x. When I used the following code: 
> PLCDriverManager().getConnection("ads:tcp://xxx.xx.x.xx:502") to establish 
> the connection. I get an error saying "Unable to find driver for protocol 
> 'ads'". It was weird because if had added all (I hope so) the dependencies 
> required as follows:
> 
> 
> org.apache.plc4x
> plc4j-api
> 0.8.0
> 
> 
> 
> 
> org.apache.plc4x
> 
> plc4j-driver-ads
> 
> 0.8.0
> 
> runtime
> 
> 
> 
> Later I found out that, for OSGi framework, the Drivers are required to be 
> activated 
> (https://github.com/apache/plc4x/blob/develop/plc4j/osgi/src/main/java/org/apache/plc4x/java/osgi/DriverActivator.java
>  ), so that it creates a bundle. But now I am really not sure how this is 
> done. Could someone please help me out with this. If there are any tutorials 
> or examples for such a case, please share it.
> 
> As I said before, we intend in integrating a Beckhoff PLC running TwinCAT 
> ADS, into a JAVA OSGi based framework, which would be communicating with each 
> other over Modbus TCP protocol.
> 
> Viele Grüße
> Laksh
> 
> 


Help required on Beckhoff PLC connection to a JAVA OSGi Framework project

2021-06-09 Thread Palaniswamy, Lakshimi Narayanan (ETI)
Hello Community,

I am currently working with an OSGi framework based Open-Source Energy 
Management System OpenEMS (https://openems.io/). As a part of the development 
we wanted to integrate a Beckhoff PLC, which offers a ADS bridge-Modbus TCP 
Protocol for communication. Although I found a DLL offered by Beckhoff 
(https://infosys.beckhoff.com/index.php?content=../content/1031/tcadscommon/html/note.htm=),
 it did not fit perfectly for the case of OpenEMS due to its OSGi Framework. 
Thankfully I found the PLC4x adaptor. It really solves half the problem for me. 
I would also like to mention I am quiet new to OSGi as well as JAVA to begin 
with and am trying to figure things out on the go.

Now to my question. I wanted to use the PLC4j/ADS drivers and functionalities 
in my code. I started with the basic setup mentioned in the "JAVA Getting 
Started" page of the PLC4x. When I used the following code: 
PLCDriverManager().getConnection("ads:tcp://xxx.xx.x.xx:502") to establish the 
connection. I get an error saying "Unable to find driver for protocol 'ads'". 
It was weird because if had added all (I hope so) the dependencies required as 
follows:


org.apache.plc4x
plc4j-api
0.8.0




org.apache.plc4x

plc4j-driver-ads

0.8.0

runtime



Later I found out that, for OSGi framework, the Drivers are required to be 
activated 
(https://github.com/apache/plc4x/blob/develop/plc4j/osgi/src/main/java/org/apache/plc4x/java/osgi/DriverActivator.java
 ), so that it creates a bundle. But now I am really not sure how this is done. 
Could someone please help me out with this. If there are any tutorials or 
examples for such a case, please share it.

As I said before, we intend in integrating a Beckhoff PLC running TwinCAT ADS, 
into a JAVA OSGi based framework, which would be communicating with each other 
over Modbus TCP protocol.

Viele Grüße
Laksh



Re: Hi

2021-06-09 Thread Christofer Dutz
Hi Purushotham,

sorry for the late response ... I was in a training over the whole day.
The link will be:

   https://zoom.us/j/91591629512?pwd=Z3A1WTdNbXRmMnZIZ2c3SVdYaHo3QT09

Hope we'll see you there :-)

Chris



On 04.06.21 16:56, Purushotham Y wrote:
> Sure, I shall join the call with gives me opportunity to meet whole
> community.
> 
> Regards,
> Purushotham
> 
> On Fri, Jun 4, 2021, 7:23 PM Christofer Dutz 
> wrote:
> 
>> Hi Purushotham,
>>
>> Lukas was referring to our regular plc4x meeting. Usually we have a
>> monthly community call on the first Wednesday in the month at 19PM CET
>> (Summertime). But as we had a holiday on Thursday and sun came out for
>> the first time after a felt 9 months (At least in Germany), we shifted
>> it by a week. Anyone is happy to join. It was sort of the time that
>> worked for most contributors here.
>>
>> Chris
>>
>>
>>
>> On 04.06.21 15:10, Purushotham Y wrote:
>>> Hi Lucas,
>>> Thankyou for your email.
>>>  I would like to understand the code flow that is to communicate
>> to
>>> iot device using modbus over TCP and shall try same for RTU.
>>>
>>> The timing you propose is too late for me (12am). Could you please
>> suggest
>>> any other time please?
>>>
>>>
>>> Regards,
>>> Purushotham
>>>
>>> On Fri, Jun 4, 2021, 4:56 PM Lukas Ott  wrote:
>>>
 Hi Purus,

 Welcome to the club.

 If you need help just let us know.

 We will have a Virtual Meeting on 9th of June 2021, starting 7 PM
>> Central
 European Time.

 Regards,
 otluk

 Am Fr., 4. Juni 2021 um 11:43 Uhr schrieb Purushotham Y <
>> psha...@gmail.com
> :

> Hi,
>  I would like to be part of the development activity for plc4x.
> Regards,
> Purushotham
>

>>>
>>
> 


[GitHub] [plc4x] shblue21 opened a new pull request #256: Fix link : plc4j getting start, graphviz

2021-06-09 Thread GitBox


shblue21 opened a new pull request #256:
URL: https://github.com/apache/plc4x/pull/256


   Hello, I am using Plc4x library
   I fix the Graphviz and getting start java links in the markdown 
documentation.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org