24.01.2015 Views

PLC Programming

  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Global Variables, Variable Configuration, Document Frame<br />

Editing Remanent Global Variables Lists<br />

If they are supported by the runtime system, remanent variables may be processed. There are two<br />

types of remanent global variables:<br />

Retain variables remain unchanged after an uncontrolled shutdown of the runtime system (off/on) or<br />

an 'Online' 'Reset' in CoDeSys. Persistent variables remain unchanged after a controlled shutdown<br />

of the runtime system (stop, start) or an 'Online' 'Cold reset' or a download.<br />

Persistent variables are not automatically also Retain variables !<br />

Remanent variables are additionally assigned the keyword RETAIN or PERSISTENT.<br />

Network variables are also defined in this syntax.<br />

Syntax:<br />

VAR_GLOBAL RETAIN<br />

(* Variables declarations *)<br />

END_VAR<br />

VAR_GLOBAL PERSISTENT<br />

(* Variables declarations *)<br />

END_VAR<br />

Global Constants<br />

Network variables (target specific) are also defined using this syntax.<br />

Global constants additionally get the keyword CONSTANT.<br />

Syntax:<br />

VAR_GLOBAL CONSTANT<br />

(* Variables declarations *)<br />

END_VAR<br />

6.2.2 Variable Configuration...<br />

In function blocks it is possible to specify addresses for inputs and outputs that are not completely<br />

defined, if you put the variable definitions between the key words VAR and END_VAR. Addresses not<br />

completely defined are identified with an asterisk.<br />

Example:<br />

FUNCTION_BLOCK locio<br />

6-6 CoDeSys V2.3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!