Procedure For Using Namespaces - Omron NJ-series User Manual

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 is detected during the program check in the following cases.
• If a namespace that does not exist is declared
• If you declare more than one namespace for one POU definition, and a POU definition, data
type, or other entity with the same name exists in two or more namespaces
• An error will occur when you build the program if the same name is used as follows for different
POU definitions or data types.
• If the same name is used for the namespace of a POU definition and at a higher level in the
namespace
• If the same name is used in a declared namespace
• If the same name is used without a namespace
Namespace
System_A\Lifter
System_A
System_B
None
The following notation is used in the namespace
declaration for the Process_A function block definition.
System_B
Additional Information
You cannot set a namespace for a program name. However, you can declare namespaces for
objects that are used in the algorithm of the program.
6-7-3

Procedure for Using Namespaces

Use the Sysmac Studio to set the namespaces and then declare them. Perform steps 1 and 2 when you
create data types or when you create function definitions, function block definitions, or other objects.
Declare a namespace with step 3 to use an object for which a namespace is set.
1
In the Data Type Editor, set the namespace for the data type.
2
Set the namespace in the properties of the function definition or function block definition.
3
In the Ladder Editor or ST Editor, declare the namespace in the properties of the function defini-
tion or function block definition.
4
Use the data types, function definitions, and function block definitions in the user program.
Refer to the Sysmac Studio Version 1 Operation Manual (Cat. No. W504-E1-03 or higher) for spe-
cific procedures.
6-124
Entity
Short name
Function block definition Process_A
Function block definition
Process_A
Function block definition
Process_B
Process_A
Function block definition
Process_A
Not
The name is used in the namespace of the POU definition.
allowed.
The name is used at a higher level than the namespace
Not
allowed.
of the POU definition.
Not
The name is used in a declared namespace.
allowed.
Not
The name is used without a namespace.
allowed.
NJ-series CPU Unit Software User's Manual (W501)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents