Profinet (In Development)

The PROFINET driver implements a class 3 real time controller. Which is able to communicate with multiple devices on the same network segment.

Connection String Options

On linux as the Java executable won’t have permission to capture raw packets, this needs to be enabled via:-

sudo setcap cap_net_raw,cap_net_admin=eip /usr/lib/jvm/jdk-19/bin/java

The executable will change based on the jdk and OS you are using.

Name

Type

Default Value

Required

Description

Name

Profinet

Code

profinet

Maven Dependency

<dependency>
  <groupId>org.apache.plc4x</groupId>
  <artifactId>plc4j-driver-profinet-ng</artifactId>
  <version>0.12.0</version>
</dependency>

Default Transport

raw

Supported Transports

  • raw

Config options:

gsd-directory

STRING

~/.gsd

required

dap-id

STRING

ip-address

STRING

Transport config options:

raw

raw.resolve-mac-address

BOOLEAN

If set to true, the transport will automatically resolve the MAC address for a given IP address (Allows connecting to a raw-socket device using the devices host-name or ip-address).

raw.support-vlans

BOOLEAN

false

Should VLan packets be automatically unpacked?

raw.protocol-id

INT

-1

When provided, filters all packets to let only packets matching this ethernet protocol-id pass.

Name Value Description

Supported Operations

subscribe

Only the subscription service is currently supported.

Connection String

The Profinet driver uses the connection string

profinet:raw://{ip-address}:{port}?{options}

Where the {ip-address}, unlike other PLC4X driver, uses the local IP address of the network interface you would like to bind to. This allows us to connect to multiple devices at once via the devices parameter.

An example of this connection string which has two devices test-device-1 and test-device-2, connected on the localhost interface would be:-

profinet:raw://127.0.0.1?gsddirectory=/Profinet/GSD&devices=[[test-device-1,MOD_1,(SUBMOD_1,,SUBMOD_1,)],[test-device-2,MOD_1,(SUBMOD_1,,SUBMOD_1,)]]

Note the transport, port fields shouldn’t have to be changed

Address Format

The format of address will be in the format.

device.slot.id.module_name.channel.bit:format

An example would be

device-1.1.1.DIGITAL_INPUT.0.1:BOOL

Note:-

Data Types

The following data types are supported

  • BOOL (boolean)

  • SINT (int 8)

  • USINT (uint 8)

  • BYTE (uint 8)

  • INT (int 16)

  • UINT (uint 16)

  • WORD (uint 16)

  • DINT (int 32)

  • UDINT (uint 32)

  • DWORD (uint 32)

  • LINT (int 64)

  • ULINT (uint 64)

  • LWORD (uint 64)

  • REAL (float)

  • LREAL (double)

  • CHAR (char)

  • WCHAR (2 byte char)

  • STRING (utf-8)

  • WSTRING (utf-16)

Some useful tips

Although the GSD file contains all the information needed to configure which data will be available from a device. The easiest approach is to use the browsing function of the Profinet driver to return a list of all available tags. Then only the addresses of interest can be selected.