The accessibility of SIMATIC AX variables in SIMATIC S7-1500 PLCs from external systems via OPC UA and/or Web Server can be defined with pragmas in your ST code:
VAR_GLOBAL
{S7.extern=ReadWrite}
MotorOn : BOOL; // variable can be read and written
{S7.extern=ReadOnly}
MotorState: INT; // variable can only be read
MotorFlags: UINT; // variable is not accessible by an external system (default: hidden)
END_VAR
Read how to configure the accessibility of structured types and further details here.