Command Rename '<variable>'
Function: The command opens the Rename dialog for renaming an object or a variable.
Call: Context menu PLC object, context menu Editor window > Refactoring
Requirement: An object is selected in the PLC project tree, or the cursor is positioned before or on a variable identifier in the declaration part of a programming object.
You can rename:
- Variables
- POUs
- GVLs
- Methods
- Properties
Rename dialog
Current name | Name of the object or variable |
New name | Input field for a new name. If the name that is entered already exists, TwinCAT reports this directly under this input field. |
OK | Can be activated if you have entered a valid name in New Name. Opens the Refactoring dialog. The respective objects and locations are color-coded in both windows. In both windows, you can specify an action for each location. Various commands are available in the context menu. |
Refactoring dialog
The dialog shows all the usage locations within the project. The respective objects and locations are highlighted in color. | |
Left dialog part | Navigation tree of the project with the respective object. |
Right part of the dialog | Displays the position within an object where the current name occurs. |
In both windows, you can specify an action for each location. The commands described below are available in the context menu. | |
Reject this change | Discarding the individual change in the right part of the dialog. |
Accept this object | Accept all changes in the affected object |
Reject this object | Discard all changes in the affected object |
Accept the entire project | Accept all changes in the project |
Reject the entire project | Discard all changes in the project |
TwinCAT shows accepted changes with a yellow background, discarded changes with a gray background. |
See also:
- PLC documentation: Refactoring