HOOK Functions, Basics

Two types of HOOK Functions are available in the Standard Object Library: Project HOOK Functions and Library HOOK Functions.

You can find the script stdlib_hook.ctl in the sub project directory \scripts\libs of the Stdlib. This script must be available in every WinCC OA Library project since it contains default settings! The script stdlib_hook.ctl contains the Library HOOK functions. The script stdlib_hook_project.ctl again contains the Project HOOK functions.

The code in these scripts is the default implementation. In order to overwrite the functions, complete the following steps:

  1. Copy and save the file stdlib_hook.ctl in the new WinCC OA Library project directory under \scripts\libs.

  2. Rename it by saving it under <<library name in small letters>_hook.ctl (e.g."gas_hook.ctl"). Note that the <wincc_oa_library_projectname> must be written in lower case letters irrespective of the name of the library project, e.g. not "hook_MyLib_" but "hook_mylib_".

  3. Open the script in the WinCC OA script editor.

  4. Use the script editors find and replace function to change all found strings hook_stdlib_ to hook_<winccoa_library_projectname>_. Note that the <wincc_oa_library_projectname> must be written in lower case letters irrespective of the name of the library project, e.g. not "hook_MyLib_" but "hook_mylib_".

  5. Save the changes.

  6. Now you change the implementation of the functions according to your needs. See Library HOOK-Functions andProject HOOK-Functions.