Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

My functions change to gray when I build them

Siavash-80
2012-12-19
2013-01-16
  • Siavash-80 - 2012-12-19

    Dear All,

    Recently, I am working with a source code with many function based on CR 1055 and CR 2016. When I build the code some POUs color change to Gary and when I clean them they change to black. I would be grateful if somebody tells me what the problem is?.
    Thanks a lot a head.

    Saivash

     
  • Ralph Holz - 2012-12-19

    The grey marked POU's are never called in your application. In other words they are unused. Use them anthey will turn black.

     
  • Siavash-80 - 2012-12-19

    Ralph Holz hat geschrieben:
    The grey marked POU's are never called in your application. In other words they are unused. Use them anthey will turn black.

    Thanks Ralph for your reply. I know that if I did not call a function in the main program they will change to gray, but I have several POUs or let's say I have several PRGs and FBs. Regarding those FBs I should call them in any PRGs then, they change to black. About PRGs how can I call them. Might be you mean that I should call them by Task configuration if it correct the problem can be solved. SO, I want to know by calling these PRGs in Task configuration then everything will be ok or I should do anything else.

    Thank you.

    Siavash.

     
  • MusashiAharon - 2012-12-20

    Yes, if you set up a task to call them, the PRGs will turn black.

    Or, you can also call PRGs from another PRG. In ST, just type them in as if they were functions with no return result:

    PROGRAM PRG_CALLER
    VAR
    END_VAR
    OTHER_PRG();
    

    Of course, if nothing ever calls PRG_CALLER, OTHER_PRG won't get called either.

     
  • spfeif - 2013-01-16

    Also your POU's will turn green (like commented out) if you go to Project-Options-Build-Exclude objects for any POU that are not called in your application including Libraries.

     

Log in to post a comment.