Hello everybody!!
First I will try to describe my problem....maybe you can help me!!!
I am using PLCopen in my application.
I also have 3 different PLCopen Libraries from different companies allready added on my REFERENCES tab and before i compile my project i will like to select(im code) which library(implementation) i will use!
Important is also to mention that all plcopen libraries have functions with same names (MC_Home, MC_Reset.......)
I tried something like this but it doesnt work(pragmas {if elsif...} not supported on declaration!!)
{define plcopen_companyA}
FUNCTION_BLOCK FB_Motor
VAR
{if defined (plcopen_companyA)}
fbMCMoveAbsolute: companyA_lib.MC_MoveAbsolute;
{else}
fbMCMoveAbsolute: companyB_lib.MC_MoveAbsolute;
{end_if}
END_VAR
any Ideas!!
I would not like to adding or removing libraries on the IDE library manager for this! In other languages you just use a #include!! I hate IDEs :D
The Goal is to implement one ST software for 3 diferent hardwares(drivers)!!
I was also thinking about implementing a interface and three diferent declarations, one for each company!!?? ideas??
regards
carlos
First I will try to describe my problem....maybe you can help me!!!
I am using PLCopen in my application.
I also have 3 different PLCopen Libraries from different companies allready added on my REFERENCES tab and before i compile my project i will like to select(im code) which library(implementation) i will use!
Important is also to mention that all plcopen libraries have functions with same names (MC_Home, MC_Reset.......)
I tried something like this but it doesnt work(pragmas {if elsif...} not supported on declaration!!)
{define plcopen_companyA}
FUNCTION_BLOCK FB_Motor
VAR
{if defined (plcopen_companyA)}
fbMCMoveAbsolute: companyA_lib.MC_MoveAbsolute;
{else}
fbMCMoveAbsolute: companyB_lib.MC_MoveAbsolute;
{end_if}
END_VAR
any Ideas!!
I would not like to adding or removing libraries on the IDE library manager for this! In other languages you just use a #include!! I hate IDEs :D
The Goal is to implement one ST software for 3 diferent hardwares(drivers)!!
I was also thinking about implementing a interface and three diferent declarations, one for each company!!?? ideas??
regards
carlos