6-121
6 Programming
NJ-series CPU Unit Software User’s Manual (W501)
6-7 Namespaces
6
6-7-2 Namespace Specifications
This section describes what namespaces can be used for, namespace notation, and namespace decla-
rations.
You can use namespaces for the entities that are listed in the following table. You cannot use them for
local variables.
Separate the levels in a namespace with backslashes (\). To use a namespace in a POU algorithm,
place two backslashes (\\) at the front of the namespace.
Examples:
Fully Qualified Names and Short Names
The fully qualified name of an entity is the name that includes the name of the namespace. The
short name of an entity is the name that does not include the name of the namespace.
In the algorithm in a POU definition, you can use the short name of any POU definition that has the
same namespace as the POU definition of the algorithm.
Example:
Restrictions on Namespace Notation
• You can use the same characters as you can for variable names. For details, refer to 6-3-12
Restrictions on Variable Names and Other Program-related Names.
• The following table gives the limits to the number of characters in the names of namespaces.
6-7-2 Namespace Specifications
Namespace Usage
Library object Details
POU definitions Function definition names and function block definition names
Data types Structure data type names, union data type names, and enumeration data
type names
Namespace Notation
Location of namespace Expression
Outside of an algorithm System_A\Read_recipe
Inside of an algorithm \\System_A\Read_recipe
Name Maximum size
Character
encoding
Names of
namespaces
93 bytes UTF-8
Short names 127 bytes