How to Hide Action or Method of FB

jzhvymetal
2012-12-04
2020-02-04
  • jzhvymetal - 2012-12-04

    Is there a Pragma Instruction to make an Action/Method private in a function block?

     
  • Jay - 2012-12-04

    You can assign visibility for Methods in their declaration, e.g.:
    METHOD PRIVATE DoSomething: BOOL

    I don't remember exactly in which CoDeSys version visibility of methods was implemented, but this works atleast with V3.5 SP1.

    You cannot give access specifier for Actions, and therefore you cannot hide them with PRIVATE or INTERNAL ("PUBLIC" inside the Library, otherwise PRIVATE (i.e. hidden for application that includes the library).

     
  • StoeberAs - 2020-02-04

    you can write a pragma above the method like this to hide it

    {attribute 'hide'}
    METHOD METH_XYZ : BOOL
    VAR_INPUT
    END_VAR

     

Log in to post a comment.