The automatic generated IEC 61850 task is optimized in such a way, that GOOSE Publisher and GOOSE Subscriber is executed the same task. Anyhow, the example B needs 60 ms for one complete ping-pong procedure. This is plausible and can be explained with the following figure.

Although the application task (“PLC_PRG”) could increase the ping or pong every 10 ms, it must wait for the IEC 61850 task (20 ms cycle time) to subscribe or publish the new data from or to the other PLC. In consequence it takes 70-10 = 60 ms for one complete ping-pong.
Optimization steps
-
Reduce the cycle time of the IEC 61850 task to 10 ms as well. This would increase the performance, but both tasks are still asynchronous and have to wait for each other.
-
Merge both tasks and by that optimize the execution order according to the IPO principle.
-
Input_ GOOSE Subscriber
-
Process: In this example - Increase ping or pong.
-
Output: GOOSE Publisher
-

This behavior can be achieved by the following configuration in the IEC 61850 editor.

-
Set “Task Prio I Interval” of IEC 61850 task to 10 ms.
-
Enter the “User application name” (was empty before), here: “PLC_PRG”.
-
Since now the “PLC_PRG” is called by the IEC 61850 task, the “normal” task calling the “PLC_PRG” must be deleted (red cross in the figure above).
-
Do the same procedure for example B1.
With these settings the total ping-pong roundtrip time is reduced to 10 ms, which can be observed in Wireshark.

The time format in Wireshark was set to “Seconds since the previous displayed packet”. In this log the ping takes ~ 4,5 ms, the pong takes ~ 5,5 ms ➔ ping-pong = 10 ms.
Depending on the CPU type and the size of the application, the performance can be further improved by reducing the IEC 61850 task interval to less than 10 ms.