Solution
It is possible that network shared variables do not have the time to get properly started before your programs starts reading them when using the static IP mode for your real-time target. This can also happen in DHCP/Link Local mode. In all situation, it is necessary to have an initialization step at the beginning of your real-time program, to wait for the network variables to be properly started before your program starts using them: In the provided example code you can see that all the network-published shared variables have initial values and only after making sure that no errors occur on shared variables the program will go to the next steps.