Skip to content

Difference between Instance and Program Varible Usage for Program POU

What is the difference between Instance and Program Varible Usage for Program POU?


Help doesn't explain it clearly enough:


Do they have different scope? Can't really understand the idea between these two different usage types.

Comments

  • Thank you, I saw that, but it wasn't clear enough either.


    Is my understanding correct that:

    Local - can be used only within program, not in FBs it callls

    Program - can be used within program and in FB it calls

    Instance - can be used only within program, not in FBs it callls

    ?

  • Instance is connected to a process data variable, that is a profinet signal or a hardwired signal.

    It is used to allow several programs or FBs to access the same prosess data.


    A local variable is only accessible in the program or FB it is declared in.

    A "program" variable is accessible in the program AND the program's FBs.

  • Thank you, it's more clear now.

    What's the point of External type then? If Instance usage type already covers possible use cases with profinet / hardwired signals.

  • "External" is not a declaration per se, but it is needed to "map" global variables into your POU.

    (From other PLCs i am not used to having to map global variables either, but have gotten used to it in PLCnext engineer)

  • Thank you. Variable 'Usage' feature is overcomplicated here compared to other PLCs.

Sign In or Register to comment.