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.

4 - The Individual Components<br />

list is represented in a tree structure. The locally defined macros are positioned one below the<br />

other. If macro libraries (see below) are integrated, then the library names will be listed and by a<br />

mouse-click on the plus- resp. minus -signs in front of those entries you can open or close a list of<br />

the library elements.<br />

2. The Menu field is used to define the menu entry with which the macro will appear in the 'Edit'<br />

'Macros' menu. In order to be able to use a single letter as a short -cut, the letter must be preceded<br />

by the symbol '&'. Example: the name "Ma&cro 1" generates the menu entry "Macro 1". Example:<br />

the name "Ma&cro 1" will create a menu item "Macro 1".<br />

3. In the editor field Commands you define and/or edit the commands that are to constitute the newly<br />

created or selected macro. All the commands of the CoDeSys batch mechanism and all keywords<br />

which are valid for those are allowed. You can obtain a list by pressing the Help button. A new<br />

command line is started by pressing . The context menu with the common text editor<br />

functions is obtained by pressing the right mouse button. Command components that belong<br />

together can be grouped using quotation marks.<br />

4. If you want to create further macros, perform steps 1-3 again, before you close the dialog by<br />

pressing the OK-button.<br />

If you want to delete a macro, select it in the macro list and press button .<br />

If you want to rename a macro, select it in the macro list, insert a new name in the edit field 'Name'<br />

and then press button Rename.<br />

To edit an existing macro, select it in the macro list and edit the fields 'Menu' and/or 'Commands'. The<br />

modifications will be saved when pressing the OK-button.<br />

As soon as the dialog is closed by pressing the OK-button the actual description of all macros will be<br />

saved in the project.<br />

The macro menu entries in the 'Edit' 'Macros' menu are now displayed in the order in which they were<br />

defined. The macros are not checked until a menu selection is made.<br />

Macro libraries:<br />

• Macros can be saved in external macro libraries. These libraries can be included in other projects.<br />

• Creating a macro library containing the macros of the currently opened project:<br />

Press button Create. You get the dialog Merge project, where all available macros are listed.<br />

Select the desired entries and confirm with OK. The selection dialog will close and dialog Save<br />

Macrolibrary will open. Insert here a name and path for the new library and press button Save.<br />

The library will be created named as .mac and the dialog will be closed.<br />

• Including a macro library .mac in the currently opened project:<br />

Press button Include. The dialog Open Macrolibrary will open, which shows files with extension<br />

*.mac. Select the desired library and press button Open. The dialog will be closed and the library<br />

will be added to the tree of the Macrolist.<br />

Hint: The macros of a project also can be exported ('Project' 'Export').<br />

4.3 Managing Projects...<br />

'File' 'New'<br />

The commands which refer to entire project are found under the menu items 'File' and 'Project'.<br />

Symbol:<br />

With this command you create an empty project with the name "Untitled". This name must be changed<br />

when saving.<br />

CoDeSys V2.3 4-15

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

Saved successfully!

Ooh no, something went wrong!