PN4-GW2FP is an integrated Gateway module from Solidot that converts PROFINET to Free port protocol (serial). In practical applications, the Free port protocol often involves sending data of variable length, and how to reliably identify the complete transmission of a data frame is a concern for many users.
The key to handling data of variable length lies in determining when the data has been fully sent, rather than the data length itself. For this purpose, the PN4-GW2FP provides a frame end detection mechanism based on the end byte value, which is mainly used for variable data transmission in producer mode. This document describes how to set the "end byte value" parameter.

1. Software configuration and parameter setting
Download the Solidot PN4-GW2FP configuration software "SDOT-FREEPORT", create a new project, select "producer-consumer mode" as the mode selection, and select the physical standard according to the actual situation. In this example, a USB-to-RS232 serial cable is used, so select "RS232".

For "subnet", configure the parameters of the connected serial device, such as baud rate, data bits, parity and stop bit. The other parameters can be left at their default settings.

The producer, also called a request, is an output for the module. It transmits the specified data from the fieldbus network (PROFINET) to the serial device.
Right-click "subnet" to add a "Node", then right-click the "Node" to add a "producer". Leave the slave address at the default value of 1 (currently has no effect).

Right-click the "producer" to add "variable" data.


2. Mapping relationship and parameter description
The data conversion between the PROFINET network and the serial port of the PN4-GW2FP is established through a "mapping" relationship. The module has two internal data buffers: the input buffer (1500 bytes), with an address range of 0–1499; and the output buffer (1500 bytes), with an address range of 1500–2999.
Memory Mapping start address: 1500, corresponding to the start address of QB on the TIA Portal side. In this example, the TIA Portal side is set to QB100;
Maximum data length: 10 bytes, i.e. corresponding to TIA Portal addresses QB100-QB109 (note: if the start address is configured as 1502, then it corresponds to QB102–QB111);
End byte value: the default value is 0, the settable range is 0–255, and in this example it is set to 255 (FF in hexadecimal);
[note] The address length allocated on the TIA Portal side may be greater than or equal to the maximum data length set in the configuration software.
Data object definition: two options are provided, namely "end byte not visible to subnet" and "end byte visible to subnet". The difference between the two is described below.
3. Download configuration
[configuration] - [Communication configuration] - [network] - [Search] - after the module is found, double-click it, confirm and click [Yes].


[configuration] - [download configuration]

4. Monitoring verification and comparison
1. When the data object is defined as "end byte not visible to subnet"

On the TIA Portal side, send data from QB100–QB106 to the serial port debugging assistant; the end byte value will not be sent to the data area, as shown in the following figure:

2. When the data object is defined as "end byte subnet invisible"

On the TIA Portal side, send data from QB100–QB107 to the serial port debugging assistant; the end byte value will be sent to the data area, as shown in the following figure:

From the above comparison, it can be seen that in "end byte subnet invisible" mode, the end byte value does not enter the data area; whereas in "end byte subnet visible" mode, the end byte value enters the data area. Users can select the appropriate configuration method according to the actual application scenario.
The above describes how to set the end byte value in producer mode for the PN4-GW2FP. Thank you for watching.