Understanding Variable Use and Scope

Are there any documents available the give a good explanation of all the different kinds of variables, preferably with graphics? Reading through the Help file is rather confusing, and terms don’t always match up with what is in the PLCnext Engineer environment. It appears to be a rather complex subject.

When you say „the Help file“, I assume you mean the PLCnext Engineer help system that is accessed via the HelpView Help menu in PLCnext Engineer? If that’s the case, it would be interesting to know what does not match between the help system and the actual software - then we can raise this as a documentation bug, if necessary.

In the "Contents" tab, the branch [b]IEC 61131-3 Programming[/b] -> [b]Data Types[/b] has a good description of the elementary data types (including Strings), and complex data types (including arrays, structures and enumerated types). The following section ("Variables") explains how these are used in POUs.

I'm afraid there isn't anything else published by Phoenix Contact on this specific topic, that I know of. If you would like to speak with someone with specific questions, then the technical specialists in your local Phoenix Contact office should be able to arrange a call with you. Please let me know if you would like us to arrange this.

Here are a couple of examples that might cause some confusion.

[b]What is the IEC 61131-3 node?[/b] From help file:
[i]Data List of the 'IEC 61131-3' node in the PLANT.
The Data List contains all resource-global variables and system variables of the resource (according to the IEC 61131-3 standard). The variables declared here can be used in all POUs within the project (by declaring an external variable there).
The same variables are also contained in the Data List of the controller node.[/i]
 
\tIt must be the PLC node…?

[b]What is a “Resource”?[/b]  From help file:
[i]The controller runtime is considered as resource.  Currently, one resource acc. to IEC 61131-3 is supported, i.e., one 'PLCnext' node is allowed in a project.[/i]
 
\tAppears to be the PLCNext node, but shouldn’t this really be the controller?  PLCnext is a node under the controller, and there are other nodes under the controller that should be able to share global data.

What is the IEC 61131-3 node?

It looks like this has been updated already. This is from the help system for PLCnext Engineer version 2021.9:

[i]Data List of the 'PLC' node in the PLANT.
The Data List contains all resource-global variables and system variables of the resource (according to the IEC 61131-3 standard). The variables declared here can be used in all POUs within the project (by declaring an external variable there).
The same variables are also contained in the Data List of the controller node.[/i]

[b]What is a “Resource”?[/b]

"Resource" is defined in the IEC 61131 standard. An explanation also appears on the [url="https://www.rtautomation.com/technologies/control-iec-61131-3/"]Real Time Automation website[/url]:

[i]A resource can be thought of as a processing facility that is able to execute IEC programs. Within a resource, one or more Tasks can be defined.[/i]

There is more to a controller than a Task execution engine - there is also the OPC UA server, HMI, I/O networks etc. that you can see alongside the PLCnext resource in PLCnext Engineer. The name of the resource - "PLCnext" - is probably a bit confusing, since (for example) we also refer to the physical hardware as a PLCnext Control device. Maybe they could have picked a better name for this resource, but that's unlikely to change now.

I hope this helps to make things clearer.