Siemens Industry Online Support
Siemens AG
Entry type: FAQ Entry ID: 22279366, Entry date: 11/23/2005

How can you incorporate your own header files in C scripts?

  • Entry
  • Associated product(s)

You can incorporate your own header files by proceeding as follows.

No. Procedure Validity
1 Header definition as first statement in the function body
Insert your header definition as first statement after the brace.

Fig. 01
Graphics Designer,
Global Script
2 Extension of the standard header file "apdefap.h"
Open the standard header file "apdefap.h" with the Global Script editor or a simple ASCII editor (notepad.exe). The "apdefap.h" file is in the WinCC project path  ".\library\apdefap.h".

Enter you header definition.

Fig. 02
Graphics Designer,
Global Script
3 Header definition before the function declaration
In the case of Global Script functions you can insert additional header files before the function declaration.

Fig. 03
Global Script

The requirement for all three methods is that the header file to be incorporated is located in the "Search Path" for Global Script. For example, this can be:

  • "<WinCC project path>\library" or
  • <WinCC installation path>\aplib"

You must make sure that the code in the header is not executed twice. You can ensure this by using appropriate C preprocessor statements.

Fig. 04

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
Requests and feedback
What do you want to do?
Note: The feedback always relates to the current entry / product. Your message will be forwarded to our technical editors working in the Online Support. In a few days, you will receive a response if your feedback requires one. If we have no further questions, you will not hear from us.
Support to the statistics
With this function the IDs found are listed according to number (format .txt).

Generate list
Copy URL
Display page in new design
mySupport Cockpit