Variable Usage types, hard time understanding

Hello guys i am practically a newbie with PLCNext and am having a little bit of hard time understanding the variable Usage. If you guys have any link to an article where the usage and the meaning of them is written please inform me. For example if i create a program “Main”, and inside this program i call three different function blocks. how i can access from the function blocks the variable declared in the Main. Do i have to declare them External? Local? Instance? Thanks in advance for your help

PLCnext Engineer is based on the IEC 61131 standard, so that standard might be a good starting point. Like most other vendors, PLCnext Engineer includes features in addition to those described in the IEC 61131 standard. For example - the concept of “Global Data Space (GDS) Ports” is unique to PLCnext Technology, as far as I know. The PLCnext Engineer help system includes information on variables: 2021 02 13 12 36 14 … which will hopefully help to make things clearer. On your specific question - an “external” variable can be accessed in Function Blocks in a few ways:

                                             * The variable value can be passed in and/or out via a Parameter on the function block.
                                             * The variable can be declared as a "resource-global" variable by declaring it in the PLC Data List (see below). Then, that variable can be accessed from _any_ POU in the PLC (program, function block or function), by declaring that resource-global variable as an "External" variable in the POU's variable table.
                                             * The variable can be declared as a "Program-global" variable in a Program POU. Then that variable can be accessed from any function or function block that is called by that Program, by declaring that global variable as an "External" variable in the Function or Function Block's variable table. This is similar to a Global variable, but it only has Program scope (hence "Program-global"). This sounds like the option that most closely matches your description.

========================= Resource-Global data list: 2021 02 13 12 30 48 Program Global variable definition (from the PLCnext Engineer help system): 2021 02 13 12 22 50 I hope this helps. ~ Martin.




image.png



image.png






image.png




image.png
image.png


image.png
image.png
image.png




image.png
image.png


image.png






image.png
image.png