Andreaz - 2014-03-04


I have a customer that wants to use conditional compilation to configure his machine (today they've done it using exp files).

They want to generate a pou or variable list using PLCopenXML containing conditional pragmas that they want to import to the project. The problem is that i cant seem to get the conditional pragmas to be global for the application:

I've created the program as below.


// Only way i get temp to get value 1 is to uncomment the following row.
//{define MODULE_TEST}
{IF defined(MODULE_TEST)}
Β  Β Temp:= 1;
Β  Β Temp:= 2;

I have tested using a configuration program:


{define MODULE_TEST}

As well as a configuration global variable list:


Β  Β {define MODULE_TEST}

But the only way I've got it to work is to put it in the local program where I'm using it or in the compiler define property dialog of the application.

Anyone got an idea why this doesn't work?