The following settings are needed for S7-1200 and S7-1500

1. Change the CPU protection level:

a. Open your PLC project in TIA Portal.

b. Select the PLC in the project tree and choose the Properties command.

c. Choose "Full Access".

2. Change DBs settings:

a. Open the "Program Blocks" folder in the project navigation.

b. Right-click the block the access type of which you want to change.

c. Select the "Properties..." item in the pop-up menu.

d. In the "Attributes" tab, Uncheck "Optimized block access".

For more information, review this document from Siemens website.

Note: Changing Put/get communication permission or CPU protection level requires hardware download to the PLC.

Hardware download steps:

1- Project must be offline.

2- Compile hardware. You can build changes or rebuild all.

3- Download hardware now can be selected.