SCOPE

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

SCOPE

mapp Services V5.16

Pragma SCOPE overrides the default scope.

Syntax

#pragma SCOPE  [PLC_GLOBAL | NC_GLOBAL | IP_GLOBAL | LOCAL | DEFAULT]

Description

NC_GLOBAL: Declaration visible across all interpreter instances, e.g. all axis groups.

IP_GLOBAL: Declaration visible within the same interpreter instance, e.g. one axis group.

LOCAL: Declaration visible within the program.

PLC_GLOBAL: Searches for and maps elements of the same name and type on the PLC.

DEFAULT: Restores the default scope.

Example

Pragma SCOPE versus scoping in the declaration section

#pragma SCOPE IP_GLOBAL
ACTION action1:
    (* This is a global action according to #pragma SCOPE IP_GLOBAL *)
END_ACTION
TYPE {LOCAL}
    (* Types declared here are LOCAL according to {LOCAL} declaration scope *)
END_TYPE
TYPE
    (* Types declared here are IP_GLOBAL according to #pragma SCOPE IP_GLOBAL *)
END_TYPE