How to access global variables from Diagrams ?
New (Compact) AC800M CBM 5.1.1/1 introduced Diagrams.
Anyone knows how to access global (application) variables from such a Diagram ?
Voted best answer
There are two aspects to be looked into this question.
Are the Function diagram based on SCM(Prior to SV 5.1) or Diagram (From 5.1)
SCM based Function diagrams can still be used in SV 5.1 but newly created function diagrams will be by default under Diagram based Function diagrams.
In digaram based function diagrams Communication variables can be used to communiae between diagram.These variables are not added in the Global variables under application.
In Single control modle based Function Diagram you can communicate using Communication variables and Diagram variables.These diagram variables are allocated as Global variables also.
In the sense of a structural Programming language, diagram references and diagram variables refer to gobal variables.
Communication Variables are used to connect various diagrams which are placed in same or across applications / controllers.
The global variable facilitates communication between restored diagrams (created
upto System Version 5.0 SP2).
The communication variable facilitates communication between:
• Newly created Function Diagrams in System Version 5.1 or later.
• A restored diagram (created upto System Version 5.0 SP2) and a newly created
diagram in System Version 5.1 or later.
In effect, diagram references consist of an input/output reference and
From 800xA 5.1 onwards, the output diagram reference symbol indicates if the connected variable is a communication variable (CV) or a global variable (GV).
global variable facilitates communicati
on between restored diagrams (created
Therefore it depends the environment on which you have done the engineering on.
With the introduction of Communication Variables (IAC) the inter-diagram communication can be easier engineered with CVs than using application (global) variables. Control Builder provides advanced data flow analysis when using Communication Variables and Diagrams. Compiler switches allow to configure data flow findings to be ingnored, shown as warnings or treated as errors. In exeptional cases one may want to use Access Variables and Read and Write blocks in order to access Application Variables in Diagrams.