24.01.2015 Views

PLC Programming

  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Declaration Editor...<br />

address, and that any necessary changes of an incoming or outgoing signal will only have to be made<br />

in one place (e.g., in the declaration).<br />

Notice that variables requiring an input cannot be accessed by writing. A further restriction is that AT<br />

declarations can only be made for local and global variables, and not for input- and output variables<br />

from POUs.<br />

Examples:<br />

counter_heat7 AT %QX0.0: BOOL;<br />

lightcabinetimpulse AT %IX7.2: BOOL;<br />

download AT %MX2.2: BOOL;<br />

Note:<br />

If boolean variables are assigned to a Byte, Word or DWORD address, they occupy one byte with<br />

TRUE or FALSE, not just the first bit after the offset!<br />

'Insert' 'Declaration keywords'<br />

'Insert' 'Type'<br />

Syntax Coloring<br />

You can use this command to open a list of all the keywords that can be used in the declaration part<br />

of a POU. After a keyword has been chosen and the choice has been confirmed, the word will be<br />

inserted at the present cursor position.<br />

You also receive the list, when you open the Input Assistant () and choose the Declarations<br />

category.<br />

With this command you will receive a selection of the possible types for a declaration of variables. You<br />

also receive the list when you access the Input Assistant ().<br />

The types are divided into these categories:<br />

• Standard types BOOL, BYTE, etc.<br />

• Defined types Structures, enumeration types, etc.<br />

• Standard function blocks for instance declarations<br />

• Defined function blocks for instance declarations<br />

CoDeSys supports all standard types of IEC1131-3:<br />

In all editors you receive visual support in the implementation and declaration of variables. Errors are<br />

avoided, or discovered more quickly, because the text is displayed in color.<br />

A comment left unclosed, thus annotating instructions, will be noticed immediately; keywords will not<br />

be accidentally misspelled, etc.<br />

The following color highlighting will be used:<br />

Blue<br />

Green<br />

Pink<br />

Red<br />

Keywords<br />

Comments in the text editors<br />

Special constants (e.g. TRUE/FALSE, T#3s, %IX0.0)<br />

Input error (for example, invalid time constant, keyword, written in lower case,...)<br />

Black Variables, constants, assignment operators, ...<br />

Shortcut Mode<br />

The declaration editor for CoDeSys allows you to use the shortcut mode. This mode is activated when<br />

you end a line with <br />

The following shortcuts are supported:<br />

5-6 CoDeSys V2.3

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

Saved successfully!

Ooh no, something went wrong!