In the ST code, the pragma S7.extern can be used to define the accessibility levels for variables:
ReadWrite: Allows an external system to read and write the variable value.ReadOnly: Restricts an external system to only read the variable value.Hidden: Makes the variable not visible to any external system.
The names are case-insensitive, so readwrite and readWRITE are both valid. However, misspelling the name will result in a warning during download. If the pragma name S7.extern is misspelled, the entry will be completely ignored due to the general definitions of pragmas of the ST Compiler (stc) .
Note
The accessibility for external systems is independent of the access modifier in the ST code. It provides a different visibility view of variables specifically for external systems of a SIMATIC PLC.
Variables of type REF_TO <any type> are always hidden and cannot be accessed or displayed by external systems. Instead of ReadOnly you can use the value Read, too.