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.

Declaration Editor...<br />

The variable name you entered in the editor has been entered in the Name field, BOOL has been<br />

placed in the Type field. The button opens the Input Assistant dialog which allows you to select<br />

from all possible data types.<br />

If ARRAY is chosen as the variable type, the dialog for entering array boundaries appears.<br />

Dialog for determining array boundaries during automatic declaration<br />

.<br />

For each of the three possible dimensions (Dim.), array boundaries can be entered under Start and<br />

End by clicking with the mouse on the corresponding field to open an editing space. The array data<br />

type is entered in the Type field. In doing this, the<br />

dialog.<br />

button can be used to call up an input assistant<br />

Upon leaving the array boundaries dialog via the OK button, variable declarations in IEC format are<br />

set up based on the entries in the Type field in the dialog. Example: ARRAY [1..5, 1..3] OF INT<br />

In the field Initial value, you may enter the initial value of the variable being declared. If this is an<br />

array or a valid structure, you can open a special initialization dialog via the<br />

input assistant dialog for other variable types.<br />

button or , or open the<br />

In the initialization dialog for an array you are presented a list of array elements; a mouse click on the<br />

space following „:="opens an editing field for entering the initial value of an element.<br />

In the initialization dialog for a structure, individual components are displayed in a tree structure. The<br />

type and default initial value appear in brackets after the variable name; each is followed by „:=". A<br />

mouse click on the field following „:=" opens an editing field in which you can enter the desired initial<br />

value. If the component is an array, then the display of individual fields in the array can be expanded<br />

by a mouse click on the plus sign before the array name and the fields can be edited with initial<br />

values.<br />

After leaving the initialization dialog with OK, the initialization of the array or the structure appears in<br />

the field Initial value of the declaration dialog in IEC format.<br />

Example: x:=5,field:=2,3,struct2:=(a:=2,b:=3)<br />

In the Address field, you can bind the variable being declared to an IEC address (AT declaration).<br />

If applicable, enter a Comment. The comment can be formatted with line breaks by using the key<br />

combination + .<br />

By pressing OK, the declaration dialog is closed and the variable is entered in the corresponding<br />

declaration editor in accordance to the IEC syntax.<br />

Note:<br />

The dialog box for variable declaration you also get by the command 'Edit' 'Declare Variable'. If the<br />

cursor is resting on a variable in Online mode, the Autodeclare window can be opened with<br />

with the current variable-related settings displayed.<br />

Line Numbers in the Declaration Editor<br />

In offline mode, a simple click on a special line number will mark the entire text line.<br />

5-8 CoDeSys V2.3

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

Saved successfully!

Ooh no, something went wrong!