Protecting POUs in Projects
Note
The POU protection password provides only basic protection. It does not represent protection in the sense of valid security guidelines. |
Note
Only standard POUs can be protected. Safety-related POUs cannot be protected. |
This topic contains the following sections:
- General information
- Notes on protected POUs
- Setting, changing, and removing a password for POU protection in the project
- Log in / Log off to a project with activated POU protection
- Setting the protection level (read or write access) for a POU
General information
This topic describes how to add password protection to POUs in your project, and how to change and remove the password. For each POU, the protection level (read access or write access) can be individually defined. This ensures that only authorized users get read or write access to a POU. There is one POU protection password associated with the PLCnext Engineer project.
If a POU is read-protected, the editor group of the POU cannot be opened. If a POU is write-protected, the editor group of the POU is opened in read-only mode, i.e., the user can view the POU data only but cannot edit the data. For each POU, the protection level is set in the 'Settings' editor of the POU in the 'POU Protection' group.
The sub-menu items of the 'Project > POU Protection' menu are used to set, change, and remove the POU protection password. After setting a password, the user must log in with the password to get full access to protected POUs (done with the 'Project > POU Protection > Log in' command). The 'Project > POU Protection > Log Off' command removes the permission to edit protected POUs.
The status bar (in the lower left corner) indicates whether you are logged in or logged off to the project for which a POU protection password is set.
Notes on protected POUs
Observe the following notes for POUs with activated protection level (read or write protected):
- A project with set POU protection password can be compiled without entering the password.
- The protection level is inherited from the parent POU to child objects (for example, methods, SFC actions, ...).
- Protected POUs cannot be renamed.
- Protected POUs cannot be copied, pasted, dragged, or dropped.
- Protected POUs can only be inserted into the code using IntelliSense. Insertion via the clipboard or by drag and drop is not possible.
- In the COMPONENTS area, protected POUs and folders containing protected POUs cannot be deleted.
- Protected POUs are found by a search query. Replace is not possible.
- Protected POUs cannot be refactored.
- Protected POUs cannot be printed. A read-protected POU is not shown in the items list in the 'Print' dialog.
- In online/debug mode:
- All POUs are shown. Read-protected POUs cannot be opened.
- A step into operation to a read-protected POU is not possible.
- A jump to a read-protected POU is not possible.
- Projects containing protected POUs cannot be released or exported.
- A 'Write and Start Project (with Sources)' or 'Write and Start Project Changes (with Sources)' command cannot be executed.
Setting, changing, and removing a password for POU protection in the project
Operation | Procedure |
---|---|
Set password |
|
Change password |
|
Remove password |
|
Log in / Log off to a project with activated POU protection
Once you have set a password for POU protection in the project, you must log in to the project with the password to get full access to protected POUs. To log in, select 'Project > POU Protection > Log In' and enter the POU protection password.
Once you have logged in, the status bar (in the lower left corner) indicates that you are logged in and have full access to the POUs.
To log off and reactivate the POU protection in the project, i.e., to remove the permission to edit protected POUs, select 'Project > POU Protection > Log Off' and enter the POU protection password. The status bar indicates the status.
Setting the protection level (read or write access) for a POU
To set the read or write protection for a POU, proceed as follows:
- Ensure that you are logged in to the project with activated POU protection (see the section above). You must be logged in to have full access to the POUs.
- In the COMPONENTS area, double-click the POU for which you want to set up read or write protection and open its 'Settings' editor in the editors area.
- In the 'POU Protection' group, select the desired protection level ('read protected', 'write protected', or 'none'). The 'Protection Level' field is inactive if no POU protection password is defined or if you are not logged in to the project with activated POU protection.
- Log off from the project with activated POU protection by selecting the 'Project > POU Protection > Log Off' command.