‘Project’ ‘Object’ ‘ Add’

Shortcut: <Insert>

With this command you create a new object. The type of the object (POU, data type, visualization, or global variables) depends upon the selected register card in the Object Organizer. Note that in doing so possibly a ‘Save as template’ will be used for objects of type ‘Global Variables’, ‘Data types’, ‘Function’, ‘Function Block’ or ‘Program’ ., see below, chapter ‘Save as template’.

Enter the ‘Name of the new POU’ in the dialog box which appears. Remember that the name of the object may not have already been used.

Take note of the following restrictions:

  • The name of a POU can not include any spaces
  • A POU can not have the same name as another POU, a data type and should not have the same as a visualization in order to avoid problems with visualization changes.
  • A data type can not receive the same name as another data type or a POU.
  • A global variable list can not have the same name as another global variable list.
  • An action can not have the same name as another action in the same POU.
  • A visualization can not have the same name as another visualization and should not have the same as a POU in order to avoid problems with visualization changes.

In all other cases, identical naming is allowed. Thus for example actions belonging to different POUs can have the same name, and a visualization may have the same as a POU.

In the case of a POU, the POU type (program, function or function block) and the language in which it is programmed must also be selected. ‘Program’ is the default value of ‘Type of the POU’, while that of ‘Language of the POU’ is that of most recently created POU. If a POU of the function type is created, the desired data type must be entered in the ‘Return Type’ text input field. Here all elementary and defined data types (arrays, structures, enumerations, aliases) are allowed. Input assistance (e.g. via <F2>) can be used.

../_images/4a814c5bc64d8f100a317d3129f8d6281

After pressing ‘OK’, which is only possible if there is no conflict with the naming conventions described above, the new object is set up in the Object Organizer and the appropriate input window appears.

If the command ‘Edit’ ‘Insert’ is used, the object currently in the clipboard is inserted and no dialog appears. If the name of the inserted object conflicts with the naming conventions (see above), it is made unique by the addition of a serial number appended with a leading underline character (e.g. “Rightturnsig_1”).

If the project is under source control in an ENI data base, it may be (depends on the settings in the Project options dialog for ‘Project source control’ Options for ‘Project source control’) that you will be automatically asked in which data base category you want to handle the new object. In this case the dialog ‘Properties’ will open where you can assign the object to one of the database object categories Object categories concerning the project data base.