The virus scan of your computer can cause the connection problem.
When you try to connect to the plc using "accesible devices", before you asigned an ip adres, the virusscan might block the connection. Disabling the virusscan might help.
You can also load the project to a Siemens SD card and program the PLC like this the first time. Once the plc has an IP adress connecting is ussualy easier.
The tool Proneta (free) can also help to give the device an IP adres and Profinet name.