You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@plc4x.apache.org by Ben Hutcheson <be...@gmail.com> on 2022/10/11 14:15:05 UTC

Profinet Driver - Multiple Devices

Hi,

Just looking for some comments and feedback on the approach we're going
with the Profinet Driver.

As Profinet is a fieldbus, communicating to multiple devices at once is
fairly standard, however it makes it difficult with the current connection
string format to define multiple devices.

Using the local ip address of the driver in the target and moving the
device configuration to the parameters section would allow this though.
e.g. profinet:raw://{local ip address}?devices=[00:00:01:02:03:04,
00:00:01:02:03:05]&submodules=[[submodule1, submodule2],[submodule1,
submodule2]]

I've then encapsulated the connection to each device within a
ProfinetDevice class which handles opening and closing separate UDP
connections and receives messages from the common UDP port via a handle.
Setting up the connection to multiple devices then ends up being simple.

for (Map.Entry<String, ProfinetDevice> device :
configuration.configuredDevices.entrySet()) {
    device.getValue().onConnect();
}


Ben

Re: Profinet Driver - Multiple Devices

Posted by Christofer Dutz <ch...@c-ware.de>.
No objections :-)

Holen Sie sich Outlook für Android<https://aka.ms/AAb9ysg>
________________________________
From: Łukasz Dywicki <lu...@code-house.org>
Sent: Tuesday, October 11, 2022 10:37:41 AM
To: dev@plc4x.apache.org <de...@plc4x.apache.org>
Subject: Re: Profinet Driver - Multiple Devices

Hey Ben,
I think it is a fair finding and proper pattern for all connections
which end up with multiple participants on single connection.

Looking forward to see further evolution of that API cause it could form
a pattern which can be later utilized in BACnet and CANopen drivers as
well as Modbus over serial.

Cheers,
Łukasz

On 11.10.2022 16:15, Ben Hutcheson wrote:
> Hi,
>
> Just looking for some comments and feedback on the approach we're going
> with the Profinet Driver.
>
> As Profinet is a fieldbus, communicating to multiple devices at once is
> fairly standard, however it makes it difficult with the current connection
> string format to define multiple devices.
>
> Using the local ip address of the driver in the target and moving the
> device configuration to the parameters section would allow this though.
> e.g. profinet:raw://{local ip address}?devices=[00:00:01:02:03:04,
> 00:00:01:02:03:05]&submodules=[[submodule1, submodule2],[submodule1,
> submodule2]]
>
> I've then encapsulated the connection to each device within a
> ProfinetDevice class which handles opening and closing separate UDP
> connections and receives messages from the common UDP port via a handle.
> Setting up the connection to multiple devices then ends up being simple.
>
> for (Map.Entry<String, ProfinetDevice> device :
> configuration.configuredDevices.entrySet()) {
>      device.getValue().onConnect();
> }
>
>
> Ben
>

Re: Profinet Driver - Multiple Devices

Posted by Łukasz Dywicki <lu...@code-house.org>.
Hey Ben,
I think it is a fair finding and proper pattern for all connections 
which end up with multiple participants on single connection.

Looking forward to see further evolution of that API cause it could form 
a pattern which can be later utilized in BACnet and CANopen drivers as 
well as Modbus over serial.

Cheers,
Łukasz

On 11.10.2022 16:15, Ben Hutcheson wrote:
> Hi,
> 
> Just looking for some comments and feedback on the approach we're going
> with the Profinet Driver.
> 
> As Profinet is a fieldbus, communicating to multiple devices at once is
> fairly standard, however it makes it difficult with the current connection
> string format to define multiple devices.
> 
> Using the local ip address of the driver in the target and moving the
> device configuration to the parameters section would allow this though.
> e.g. profinet:raw://{local ip address}?devices=[00:00:01:02:03:04,
> 00:00:01:02:03:05]&submodules=[[submodule1, submodule2],[submodule1,
> submodule2]]
> 
> I've then encapsulated the connection to each device within a
> ProfinetDevice class which handles opening and closing separate UDP
> connections and receives messages from the common UDP port via a handle.
> Setting up the connection to multiple devices then ends up being simple.
> 
> for (Map.Entry<String, ProfinetDevice> device :
> configuration.configuredDevices.entrySet()) {
>      device.getValue().onConnect();
> }
> 
> 
> Ben
>