2.12.5 How to Use Standard and Project Functions
Introduction
You can use any project or standard function as part of the function code, if you have first
added the line #include "apdefap.h" in the header. The project functions are found in the
navigation window in the "Project Functions" group. The standard functions are found in the
navigation window in the "Standard Functions" group.
Project functions are entered in the "Ap_pbib.h" header file; standard functions are entered in
the "Ap_glob.h" header file. These entries are made by the system. The " Ap_glob.h" header
file
is integrated into the "Ap_pbib.h" header file. The "Ap_pbib.h" header file itself is linked to
the "Apdefap.h" header file. Therefore all project and standard functions are declared in the
"Apdefap.h" file header.
To inform the compiler of the project and standard functions added, add the line #include
"apdefap.h" as the first line in the function code.
If you have used the "Assigning Parameters" dialog to add a function, the function comments
show the type of value returned.
Procedure
1. Place the cursor at the point at which the project or standard function is to be inserted.
2. In the navigation window, open the shortcut menu for the function to be added.
3.
Select "Assigning Parameters". The "Assigning Parameters" dialog is opened.
This dialog has one line for each parameter. In the "Value" column, enter the respective
current parameter.
4. In the "Value" column, enter the current value for each of the required parameters.
This can be accomplished by either a direct entry from the keyboard, or you can open the
menu in the "Value" column (single-click and then click the displayed button). From the
menu, you can open the selection dialog for tags, pictures or graphic objects.
5. Confirm the entries by clicking "OK".
Note
If the function does not require a parameter, it is added to the function code immediately
without opening the "Assigning Parameters" dialog.
If you close the "Assigning Parameters" dialog with "OK" without entering the current
parameter value, the internal function is inserted with its formal parameters. You can then
set the parameters in the edit window at a later stage.
ANSI-C for Creating Functions and Actions
2.12 Creating and Editing Functions
MDM - WinCC: Scripting (VBS, ANSI-C, VBA)
796
System Manual, 11/2008,