Editing Functions

You can use the following commands in all editors and some of them in the Object Organizer. All of the commands are located under the menu item "Edit".

'Edit' 'Undo' Shortcut: <Ctrl>+<Z>

This command undoes the action which was most recently executed in the currently-open editor window or in the Object Organizer. By repeatedly selecting this command, all actions can be undone back to the point at which the window was opened. This applies to all actions in the editors for POUs, data types and global variables and in the Object Organizer.
With "Edit" "Redo" you can restore an action which you have undone.

'Edit' 'Redo' Shortcut: <Ctrl>+<Y>

With the command in the currently-open editor window or in the Object Organizer you can restore an action you have undone ("Edit" "Undo") .As often as you have previously executed the command "Undo" , you can also carry out the command "Redo". The commands "Undo" and "Redo" apply to the current window.

The commands "Undo" and "Redo" apply to the current window. Each window carries its own action list. If you want to undo actions in several windows, then you must activate the corresponding window. When undoing or redoing in the Object Organizer the focus must lie here.

'Edit' 'Cut' Shortcut: <Ctrl>+<X> or <Shift>+<Del>

This command transfers the current selection from the editor to the clipboard. The selection is removed from the editor. In the Object Organizer this similarly applies to the selected object, whereby not all objects can be deleted, e.g. the PLC configuration. Remember that not all editors support the cut command, and that its use can be limited in some editors. The form of the selection depends upon the respective editor: In the text editors (IL, ST, and declarations) the selection is a list of characters. In the FBD and LD editors the choice is a number of networks which are indicated by a dotted rectangle in the network number field or a box with all preceding lines, boxes, and operands. In the SFC editor the selection is a part of a series of steps surrounded by a dotted rectangle.
In order to paste the content of the clipboard you use the command "Edit" "Paste". In the SFC editor you can also use the commands "Extras" "Insert parallel branch (right)" or "Extras" "Paste after".
In order to copy a selection onto the clipboard without deleting it, use the command "Edit" "Copy".
In order to remove a selected area without changing the clipboard, use the command "Edit" "Delete".

'Edit' 'Copy' Shortcut: <Ctrl>+<C>

This command copies the current selection from the editor to the clipboard. This does not change the contents of the editor window. With the Object Organizer this similarly applies to the selected object, whereby not all objects can be copied, e.g. the PLC configuration. Remember that not all editors support copying and that it can be limited with some editors. For the type of selection the same rules apply as with "Edit" "Cut".

'Edit' 'Paste' Shortcut: <Ctrl>+<V>

Pastes the content of the clipboard onto the current position in the editor window. In the graphic editors the command can only be executed when a correct structure results from the insertion. With the Object Organizer the object is pasted from the clipboard. Remember that pasting is not supported by all editors and that its use can be limited in some editors. The current position can be defined differently according to the type of editor: With the text editors (IL, ST, Declarations) the current position is that of the blinking cursor (a vertical line) which you place by clicking with the mouse). In the FBD and LD editors the current position is the first network with a dotted rectangle in the network number area. The contents of the clipboard are inserted in front of this network. If a partial structure has been copied, then it is inserted in front of the selected element. In the SFC editor the current position is determined the selection which is surrounded by a dotted rectangle. Depending upon the selection and the contents of the clipboard, these contents are inserted either in front of the selection or into a new branch (parallel or alternative) to the left of the selection.
In SFC the commands "Extras" "Insert parallel branch (right)" or "Extras" "Paste after" can be used in order to insert the contents of the clipboard.

'Edit' 'Delete' Shortcut: <Del>

Deletes the selected area from the editor window. This does not change the contents of the clipboard. In the Object Organizer this applies likewise to the selected object, whereby not all objects can be deleted, e.g. the PLC configuration. For the type of selection the same rules apply as with "Edit" "Cut". In the library manager the selection is the currently selected library name.

'Edit' 'Find'

With this command you search for a certain text passage in the current editor window. The Find dialog box opens. It remains opens until the button Cancel is pressed.
In the field Find what you can enter the series of characters you are looking for.
In addition, you can decide whether the text you are looking for Match whole word only or not, or also whether Match case is to be considered, and whether the search should proceed Up or Down starting from the cur-rent cursor position.
The button Find next starts the search which begins at the selected position and continues in the chosen search direction. If the text passages is found, then it is highlighted. If the passage is not found, then a message announces this. The search can be repeated several times in succession until the beginning or the end of the contents of the editor window has been reached.
Remember that the found text can be covered up by the Find dialog box.
Editing Functions 1:

Find dialog box

'Edit' 'Find Next' Shortcut: <F3>

With this command you execute a search with the same parameters as with the most recent action "Edit" "Find".

'Edit' 'Replace'

With this command you search for a certain passage just as with the command "Edit" "Find", and replace it with another. After you have chosen the command the dialog box for find and replace appears. This dialog box remains open until the button Cancel or Close is pressed.

The button Replace replaces the current selection with the text in the field Replace with. The button Replace all replaces every occurrence of the text in the field Find next after the current position with the text in the field Replace with. At the end of the procedure a message announces how many replacements were made.

At the end of the procedure a message announces how many replacements were made.

Editing Functions 2:

Dialog box for find and replace

'Edit' 'Input Assistant' Shortcut: <F2>

This command provides a dialog box for choosing possible inputs at the current cursor position in the editor window. In the left column choose the desired input category, select the desired entry in the right column, and confirm your choice with OK. This inserts your choice at this position.
The categories offered depend upon the current cursor position in the editor window, i.e. upon that which can be entered at this point (e.g. variables, operators, POUs, conversions, ...).

If the option With arguments is active, then when the selected element is inserted, the arguments to be transferred are specified with it, for example: function block fu1 selected, which defines the input variable var_in: fu1(var_in:=);
Insertion of function func1, which uses var1 and var2 as transfer parameters: func1(var1,var2)
It is basically possible to switch between structured and unstructured display of the available elements. This occurs through activation/deactivation of the Structured Display option.

The in- and output variables of function blocks which are declared as local or global variables are listed in the category 'Local Variables' or 'Global Variables' under the instance name (e.g. Inst_TP ET, Inst_TP IN,...). To get there, select the instance name (e.g. Inst_TP) and confirm with OK.

If the instance of a function block is selected here, the option With arguments may be selected. In the text languages ST and IL as well as during task configuration, the instance name and the input parameters of the function block are then inserted.
For example, if Inst (DeklarationInst: TON;) is selected, the following is inserted:

Inst(IN:= ,PT:=) 

If the option is not selected, only the instance name will be inserted. In the graphical languages or in the Watch window, only the instance name is generally inserted.
Components of structures are displayed in an analog fashion to function block instances.
For enumerations, the individual enumeration values are listed under the enumeration type. The order is: enumerations from libraries, enumerations from data types, local enumerations from POUs.

The general rule is that lines containing sub-objects are not selectable (except instances, see above), but can only have their hierarchy display expanded or contracted by one level, as for multi-stage variable names.
If Input Assistant is invoked in the Watch and Recipe Manager or in the selection of trace variables in the trace configuration dialog, it is possible to make a multiple selection. When the <Shift> key is pressed, you can select a range of variables; when the <Ctrl> key is pressed you can select many individual variables. The selected variables are so marked. If, during range selection lines are selected that do not contain valid variables (e.g. POU names), these lines will not be included in the selection. When individual selections are made, such lines can not be marked.

In the watch window and in trace configuration it is possible to transfer structures, arrays or instances from the Input Assistant dialog. As a double click with the mouse button is associated with the extension or contraction of the element’s hierarchy display, selection in these cases can only be confirmed by OK. Thereafter, the selected variables are inserted line by line in the watch window, that is each selected variable is written on a separate line. In the case of trace variables, each variable is inserted in a separate line of the trace variables list.
If the maximum number of trace variables, 20, is exceeded during insertion of the selected variables, the error message „A maximum of 20 variables is allowed“ appears. Further selected variables are then not inserted in the list.

Editing Functions 5:

Some entries (e.g. Global Variables) are only updated in the Input Assistant dialog after compilation.

'Edit' 'Declare Variable' Shortcut: <Shift>+<F2>

This command opens the dialog for the declaration of a variable. This dialog also opens automatically when the option 'Project' 'Options' 'Editor' 'Autodeclaration' is switched on and when a new undefined variable is used the declaration editor.

'Edit' 'Next Error' Shortcut: <F4>

After the incorrect compilation of a project this command can show the next error. The corresponding editor window is activated and the incorrect place is selected. At the same time in the message window the corresponding error message is shown.

'Edit' 'Next Error' Shortcut: <Shift>+<F4>

After the incorrect compilation of a project this command shows the previous error. The corresponding editor window is activated and the incorrect place is selected. At the same time in the message window the corresponding error message is shown.

'Edit' 'Macros'

This menu item leads to a list of all macros, which are defined for the project. (For info on generating macros see 'Project' 'Options' 'Macros' ). When an executable macro is selected the dialog 'Process Macro'. The name of the macro and the currently active command line are displayed. The button Cancel can be used to stop the processing of the macro. In that event the processing of the current command will be finished anyway. Then an appropriate message is displayed in the message window and in the log during Online operation: "<Macro>: Execution interrupted by user“.

Macros can be executed offline and online, but in each case only those commandes are executed which are available in the respective mode.