×
Siemens Industry Online Support
Siemens AG
Entry type: FAQ Entry ID: 10025431, Entry date: 07/19/2010
(11)
Rate

How can you install block protection for self-created blocks?

  • Entry
  • Associated product(s)

Instructions:
STEP 7 provides the KNOW_HOW_PROTECT function for protecting the programs. If you open a block protected by this function, then you can only view the block interface (IN, OUT and IN/OUT parameters) and the block comment. The program code, the temporary/static variables and the network comments are not displayed. It is not possible to change the protected block.

The table below describes the procedure for installing the KNOW_HOW_PROTECT function for your program blocks (FBs, FCs and DBs).
 

No. Procedure
1 Open the function block to be edited and in the LAD/STL/FBD editor you generate a source via "File > Generate source...".
2 In the dialog that opens you enter an object name, e.g. "Protect_FB".
3 The "Generate source <Name>" dialog opens. Here you mark the block for which the STL source is to be generated and use the arrow key to move this block into the "Blocks Selected" window on the right. Confirm with OK and the STL source is generated. Close the LAD/STL/FBD editor again.


Fig. 01

4 Open the newly created source in the "Sources" folder of your S7 program.
5 Insert a line with the "KNOW_HOW_PROTECT" command in the declaration section of the source block under "TITLE".


Fig. 02

6 Save and compile the STL source via "File > Save" and "File > Compile". The block is now protected.

Note:
The block protection can only be removed again via the STL source. If the STL sources are no longer available to the program or project via the "KNOW_HOW_PROTECT" command, you can no longer remove the protection for the blocks.

The table below describes the procedure for deactivating the KNOW_HOW_PROTECT function for your program blocks (FBs, FCs and DBs).
 

No. Procedure
1 Open your source.
2 Remove the "KNOW_HOW_PROTECT" entry or comment it out with two slashes.
3 Save and compile the STL source via "File > Save" and "File > Compile".
4 The block protection is now deactivated.

Security information
In order to protect technical infrastructures, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art IT security concept. Siemens’ products and solutions constitute one element of such a concept. For more information about cyber security, please visit
https://www.siemens.com/cybersecurity#Ouraspiration.