Andreaz - 2014-03-04

Hello,

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.

PlcProg:

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

I have tested using a configuration program:

ConfigProg:

{define MODULE_TEST}

As well as a configuration global variable list:

ConfigVars:

VAR_GLOBAL
Β  Β {define MODULE_TEST}
END_VAR

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?