176
Manual – IPOSplus®
14
Preprocessor
Compiler – Programming
14.1 Preprocessor
The IPOS
plus®
Compiler is a multi-pass Compiler that processes the source text in sev-
eral run-throughs. During the first run-through, the preprocessor processes the state-
ments – referred to below as directives – which are intended for it, tests the statements
for conditional compiling, deletes comments and finally creates a temporary file for the
Compiler. The preprocessor increases flexibility and productivity during programming in
the following areas:
• Integration of text from other files (header files) which contain prepared and/or user-
defined constants or source text functions.
• Definition of symbolic identifiers to improve the legibility of the source text.
• Definition of directives for conditional compiling to improve portability and simplify
test phases.
Each line starting with a # is treated as a preprocessor directive, unless the # is part of
a comment. Any blanks before or after the # character are ignored.
Preprocessor directives are generally written at the start of the source text. They can,
however, be located anywhere in the program. Depending on the function of the direc-
tives, they either apply as of the source text line in which they are located or for the entire
program regardless of their location.
14.2 Preprocessor statements
The comment lines in the program header are followed by the preprocessor statements.
A statement of this type is inserted as standard when you open a new Editor window.
The '#include <const.h>' statement integrates a header file called const.h when the
source text is compiled. This file has a fixed format and must not be modified. Neverthe-
less, we shall explain the function of a header file with reference to this file. An abbrevi-
ated form of the file is printed below as this is sufficient to demonstrate the main aspects.
/*=============================================
File name: Const.h
File version: 2.20
SEW Include-File for IPOSplus Compiler
Please do not modify this file!
(C) 1999 SEW-EURODRIVE
==============================================*/
#ifndef _CONST_H
#define _CONST_H
.
.
.
#define Scope474 H474
#define Scope475 H475
#define DRS_Ctrl H476
#define DRS_Status H477
#define AnaOutIPOS2 H478
#define AnaOutpIPOS H479
#define OptOutpIPOS H480
#define StdOutpIPOS H481
#define OutputLevel H482
#define InputLevel H483
#define ControlWord H484
P
i
f
kVA
Hz
n
P
i
f
kVA
Hz
n