Change Tag

From SysCAD Documentation
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Navigation: User Guide ➔ Windows ➔ Access Window ➔ Change Tag

SysCAD Tags Copy and Paste Tags Change Tag Data Transfer

Introduction

Each unit and link in SysCAD has a unique name, or Tag. Users may change the tag for an individual unit, or they may change a number of tags together using the Bulk Change Tag command.

Notes:

  1. SysCAD tags are NOT case sensitive, hence 'Makeup_water' is equal to 'MAKEUP_WATER'
  2. SysCAD tags cannot have spaces, but if you enter a tag with spaces, SysCAD will automatically change them to '_'.
  3. Please refer to Model Tag Naming Rules for more information.
  4. The Change Tag command will also result in tags changes to all PGM files in the project if the "Apply Tag Change in PGM files" tickbox has been selected from the General Options Project dialog box.
  5. The Change Tag command will also result in tags changes to all CSV and TXT files in the project if the "Apply Tag Change in CSV and TXT files" tickbox has been selected from the General Options Project dialog box.

Video Link

Please see this Edit Tag Displays video for a demonstration of 'Change Tag' command.
Please see this Bulk Tag Change video for a demonstration of the bulk tag change commands.

Change a Single Tag

To change the tag for a single unit:

  • Right click on the unit and the Access window for that unit will be displayed:
Every Access window allows the user to change the unit tag using the 'ChangeTag' button.
  • Click on the Change Tag Button93.png button;
    Type in the new unit name in the New Tag field.
  • Old Tag will display the unit's current tag and the user may type in the required tag into New Tag.
  • The required tag cannot contain spaces, tabs, dots or other special characters. Please see Model Tags for the tag naming rules.
  • Press OK to change the tag. The tag will be changed in the model and any other place where it is referred to within SysCAD, such as Controllers and trend windows.

Bulk Tag Change

Command Path Edit - Bulk Tag Change

(The user may also access this command by right clicking on 'Graphics' in the Explorer Window)

Bulk Tag Change Option

This allows you to change multiple unit models' tag names. A dialog box will be shown and the functions of the dialog box will be:

This section shows the filtered list of unit tags that user may change.This section allows the user to select the unit models that will be displayed in section 1.This section allows the user to select the graphics pages of interest.Apply these filters to quickly find the relevant tags to be changed.Select rules to replace multiple tags at once.These buttons allow the user to Export and Import tags from an external application, such as Excel.This section gives feedback information on the change tag process.The '''APPLY''' button will only be available if tag change requests are present with no duplicate tags.Click on the Done button to close the dialog window.BulkTagChange139.png
About this image
Button Small 1.png

Selected Tags Status

This section shows the list of unit tags in the project:

  • The Current Column lists the current tags in the project;
  • The Replacement Column shows the NEW tag names. The new tag names can be changed in any of the following ways:
    1. Manually by double clicking on the tag name on the replacement column and typing the new tag; or
    2. Use the Replacement function Button Small 5.png and press Replace; or
    3. Using Import Button Small 8.png.
  • The Status column will show the status of the tags.
    For example, in the dialog box above, the user has used the 'Replacement' function find all tags that contain P_1 and replace this with S0. This is shown by '<-' in the Status column. When the user clicks on the 'Apply' button all of the current tags will be replaced with the new tags in the 'Replacement' column.
    If the Replacement tag which already exists, then SysCAD marks the Tag with a 'Duplicate' Status. If this occurs, the Tag change cannot proceed and the Apply button Button Small 7.png will be greyed out.

Notes:

  1. The units that are displayed in Section Button Small 1.png can be filtered by ticking the appropriate boxes in Sections Button Small 2.png, Button Small 3.png and Button Small 4.png.
  2. The list can be sorted by clicking on the column headers.
Button Small 2.png

Unit Classes

This section allows the user to select the unit models that will be displayed in section Button Small 1.png.

Only units that are ticked will be visible. So, in the above image, only the Pipe-1 unit class has been ticked, and hence only pipes are displayed.

Button Small 3.png

Pages

This section allows the user to select the graphics pages of interest. The tags displayed in section Button Small 1.png will all be from the graphics pages that are ticked.

Button Small 4.png

Filters

This group contains various filters the user can apply to quickly find the relevant tags to be changed.

Button Small 5.png

Find and Replace Functionality

This section allows the user to change multiple tags based on selected rules.

NOTE: The Replace button will act as a request to change tags only, it does not actually change the tags in the database:

  • After the Replace button is pressed, SysCAD will check the tag change requests and update the status column;
  • Tags that are okay to be changed will be marked with <-;
  • Duplicate tags will be marked as x Duplicate/s.
  • The User may undo the change requests by pressing the Undo button and try again, or change the duplicate ones manually.
  • Once all duplicates are removed, the Apply Button in Section Button Small 7.png can be clicked.
Button Small 6.png

Change Tag Feedback

This section gives feedback information on the change tag process.

Button Small 7.png

Apply Changes

The APPLY button will only be available if tag change requests are present with no duplicate tags. Once the user has pressed the APPLY button, the SysCAD tags will be changed.

NOTE: There is NO undo option after the tag changes are applied. The User can only return to previous version of the tags by exiting (and not saving) the project.

Button Small 8.png

Export and Import Tags

See Import Export Example

  1. Export
    • The user can highlight a group of tags on Section Button Small 1.png and press Export to send the information to the clipboard;
    • This information can then be pasted into another application, such as Excel.
    • The user may then use the functionality in Excel to change the selected tags.
  2. Import
    • Once a group of tags has been changed in the external application, such as Excel, copy the tags and make sure that the column headings are part of the group selected and copied onto the clipboard;
    • Press Import to paste the changed tags into Section Button Small 1.png.
Button Small 9.png

Done and Cancel

To close the dialog box, press 'Done'.

The Cancel button will NOT undo any changes that have already been applied, i.e. the 'Apply' button has been clicked. However, if the user has NOT clicked on the 'Apply' button, then any proposed changes will be discarded.

Note: The Bulk Change Tag command will also result in tags changes to all PGM files in the project if the "Apply change tag in PGM & MP files" tickbox has been selected from the General Options - Project Tab.

Using Regular Expressions

The simple replace methods are generally satisfactory, but there are situations where you need more powerful techniques, and regular expressions (RE's) can do pretty much anything.

Suppose we have pipes with tags P_1, P_2, P_3,.... P_10, P_11 and so on. Now if you list these in lexicographic order in a report, then P_11 will come before P_2!. What we should have done is number the pipes P_01, P_02 and so on to ensure a numerical ordering.

Now if we just do a simple replace of each '_' with '_0', then we end up with P_01, P_02, .... P_011, which doesn't help. So we want to replace the '_' with '_0' only when there is a single digit. We can do this very easily using REs, because they can capture parts of the search result.

Rereplace.png

The RE 'P_(.?)$' means "match an underscore followed by at most one character before the end of the string". The brackets capture the corresponding part of the string into a group, that we can then use in the subsequent replace operation.

In the replace string, we insert '_0', followed by the result of the capture group. '$1' refers to the first capture group. (We can have multiple groups)

Using the capture technique, you can transform the tag in just about any way imaginable. There are a lot of other capabilities, such as ways of selecting only characters from different classes (such as digits or non-alphanumeric).

  • Note that there are various 'flavours' of RE's with slightly different grammars; the implementation in SysCAD uses ECMAScript.
  • A good summary of the rules is here: [1] There are any number of tutorials available, if you haven't used RE's before, start with one of these.
  • RE's are a valuable technique for anyone doing serious programming or text editing and many editors and IDE's (such as Visual Studio) have inbuilt RE capability.

See also: Regular Expression Syntax

HINT: To bring all the tags to 3 digits, after the above is applied. Repeat and search for tags with 2 digits, using P_(..?)$ as the expression.

Import Export Example

  • STEP 1: Press Ctrl and select a group of tags on Section Button Small 1.png and Press Export (This will add the group of tags from SysCAD to the clipboard)
STEP 2: Open Excel and paste the data
UnitType CurrentTag ReplacementTag Pages
Pipe-1 P_01 P_01 Crushing&Griding
Pipe-1 P_02 P_02 Crushing&Griding
Pipe-1 P_03 P_03 Crushing&Griding
Pipe-1 P_04 P_04 Crushing&Griding
Pipe-1 P_05 P_05 Crushing&Griding
Pipe-1 P_06 P_06 Crushing&Griding
Pipe-1 P_07 P_07 Crushing&Griding
Pipe-1 P_08 P_08 Crushing&Griding
Pipe-1 P_09 P_09 Crushing&Griding
Pipe-1 P_10 P_10 Crushing&Griding
Pipe-1 P_11 P_11 Crushing&Griding
Pipe-1 P_12 P_12 Crushing&Griding
Pipe-1 P_13 P_13 Crushing&Griding
Pipe-1 P_13_ P_13_ Crushing&Griding
Pipe-1 P_14 P_14 Crushing&Griding
Pipe-1 P_15 P_15 Crushing&Griding
Pipe-1 P_16 P_16 Crushing&Griding
Pipe-1 P_17 P_17 Crushing&Griding
Pipe-1 P_18 P_18 Crushing&Griding
Pipe-1 P_19 P_19 Crushing&Griding
Pipe-1 P_20 P_20 Crushing&Griding
STEP 3: Change the tags in Excel
UnitType CurrentTag ReplacementTag Pages
Pipe-1 P_01 P_001 Crushing&Griding
Pipe-1 P_02 P_002 Crushing&Griding
Pipe-1 P_03 P_003 Crushing&Griding
Pipe-1 P_04 P_004 Crushing&Griding
Pipe-1 P_05 P_005 Crushing&Griding
Pipe-1 P_06 P_006 Crushing&Griding
Pipe-1 P_07 P_007 Crushing&Griding
Pipe-1 P_08 P_008 Crushing&Griding
Pipe-1 P_09 P_009 Crushing&Griding
Pipe-1 P_10 P_010 Crushing&Griding
Pipe-1 P_11 P_011 Crushing&Griding
Pipe-1 P_12 P_012 Crushing&Griding
Pipe-1 P_13 P_013 Crushing&Griding
Pipe-1 P_13_ P_013_ Crushing&Griding
Pipe-1 P_14 P_014 Crushing&Griding
Pipe-1 P_15 P_015 Crushing&Griding
Pipe-1 P_16 P_016 Crushing&Griding
Pipe-1 P_17 P_017 Crushing&Griding
Pipe-1 P_18 P_018 Crushing&Griding
Pipe-1 P_19 P_019 Crushing&Griding
Pipe-1 P_20 P_020 Crushing&Griding
  • STEP 4: Select all the cells in the Excel table including Headings and Press Copy (or Ctrl+C) (This will add the group of tags from MS Excel to the clipboard)
  • STEP 5: Activate SysCAD and press Import Button Small 8.png.
The highlighted tags have been exported to Excel, changed and imported back to SysCAD.Bulk Tag Change Import Export.png
About this image

Bulk Change Tag

Command Path Graphic - Bulk Change Tag

This command is almost identical the Edit - Bulk Tag Change, the difference is documented below.

When this command is selected, it opens a pop up toolbar allowing user to select the required models for change tag.

TagChangeToolbar.png
  • Single left click on a unit will select/deselect it, click on each units that requires tag change, alternatively
  • Use the InWindow or CrossWindow buttons to draw a box around all the units that require tag change to select them.
  • Press the Tick button to open the "Bulk Tag Change" dialog box.

GraphicsBulkTagChange.png

  • The user selected unit models will be Marked with a dot next to the tick box in Section Button Small 1.png
  • The And Marked tick box is now usable, showing only the Marked units in section Button Small 1.png Replacement column.