Omron NJ-series User Manual page 309

Machine automation controller cpu unit software
Hide thumbs Also See for NJ-series:
Table of Contents

Advertisement

6 Programming
Precautions for Correct Use
Precautions for Correct Use
• An error will occur when you build the program if the short name of a variable is also used in
the name of the namespace.
System_A\Process_A\Read_recipe\Process_A
System_A\Read_recipe\System_A\Process_A
• You can use the short name of a POU definition in the algorithm of a POU definition if it is in
the same namespace. However, an error will occur when you build the program if there is a
POU definition or data type with the same short name at a higher level in that namespace.
For example, assume that the following POU definitions are used. You can use the short name
to call System_A\Read_recipe\Process_A from within the algorithm of the Process_B function
block definition (which is in the System_A\Read_recipe namespace) because Process_A is in
the same namespace.
POU Definitions
System_A\Read_recipe\Process_A
System_A\Read_recipe\Process_B
Notation in the Algorithm of the
System_A\Read_recipe\Process_B Function Block Definition
If, however, a System_A POU definition also exists at a higher level than the
System_A\Read_recipe namespace, "Process_A" exists twice. Therefore, an error will occur
when you build the program.
In this case, you must use the fully qualified name or change the short name.
POUPOU Definitions
Process_A (no namespace)
System_A\Process_A
• If any names are the same as a reserved word, an error will occur when you check the pro-
gram.
Namespace Declarations
To program with namespaces, you can declare the namespaces in advance before you use them in the
algorithm of a POU definition.
After you declare the namespace in the POU definition, you can use the short name of any POU defini-
tion or other entity that has the same namespace. You can also use the fully qualified name even if you
declare the namespace.
In the algorithm in a POU definition, you can use the short name of any function definition or function
block definition that has the same namespace as the POU definition of the algorithm even if you do not
declare the namespace.
You can declare more than one namespace for the same POU definition.
6-122
Not
The short name is used in the name of the namespace.
allowed.
Not
The same name is used twice within the overall name of
allowed.
the namespace.
Process_A
NJ-series CPU Unit Software User's Manual (W501)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents