Turning a folder into a namespace folder
A namespace folder is a folder within the application navigator in which the included objects are automatically declared within a →namespace. The namespace is the name of the namespace folder.
The advantages of a namespace folder are:
-
Neuron Power Engineer is updating the namespace in case of actions within the application navigator, for example when objects are moved. This means that you do not have to update the namespace yourself.
-
Neuron Power Engineer is validating the objects in a namespace folder based on belonging rules. If – for example – a namespace within an object and the namespace folder do not match, this deviation is immediately reported so that you are able to correct the deviation at once.
How to create a namespace folder:
-
Make the application navigator visible.
-
Within the application navigator, create a subfolder below the existing folder
Application
. Details on how to create: See "Creating new objects and folders". -
Optional: Create the required objects (e.g. POUs and/or data types) in this subfolder.
Restriction
Avoid creating POUs with the name of a language element from the global namespace and declaring them within a namespace. Reason: At present, it is not possible to use language elements with the same name from the global namespace. This restriction applies to all language elements declared in the global namespace, but in particular to the system blocks. Neuron Power Engineer changes the call of the language element declared in the global namespace to the call of the language element declared in the same namespace.
Example: ATON
block declared within the namespaceStandard
results in the fact that the standardTON
block of the global namespace cannot be used. In particular, ifStandard
is provided as a namespace folder and there is aUSING
instruction fo this namespace folder. When callingTON
, theTON
block from the same namespaceStandard
will be called instead of the standardTON
block.
-
In the context menu of this subfolder, select Assign Namespace.
Result:-
The folder is displayed as a namespace folder with the icon within the application navigator.
-
The name of the namespace folder is entered as a namespace in the existing objects.
-
If you create a new object in the namespace folder, the name of the namespace folder is also entered as a namespace in the new object. When creating an object, the field Namespace name in the wizard will be disabled.
-
Example for folders that are turned into namespace folders:
|
The folders |
|
|
The folders |
|
|
The content of one function block of each namespace folder in order to illustrate that the respective namespace has automatically been entered in the function blocks. |
|
Good to know |
---|
As mentioned in the introduction, Neuron Power Engineer updates the namespace within the objects of the namespace folder, when certain actions are executed in the application navigator. Hence, the following is valid:
After each action in the application navigator check the messages in the Problems view whether deviations are reported. For example, that a namespace in an object and the namespace folder do not match. If you change a namespace within the editor of the object yourself and you save the change, a deviation to the namespace folder is also reported by Neuron Power Engineer. The best practice is to undo the change in the editor of the object.
The name of a namespace folder is also used as namespace for objects that are located in a regular subfolder of the namespace folder. |