The accessibility of a PROGRAM is ReadWrite as default for applications compiled with the current STC.
Therefore, the definition of accessibility for the whole PROGRAM, for a complete VAR section or for individual variables in its VAR section will apply always.
CONFIGURATION config
{S7.extern=ReadOnly} // this pragma is ignored. The accessibility is always 'ReadWrite'!
PROGRAM P1 : Prg;
END_CONFIGURATION
PROGRAM Prg
VAR
{S7.extern=ReadOnly}
x : INT;
END_VAR
;
END_PROGRAM