Edit Tags Outside of VTScada
Some developers find that it is efficient to create or edit tags in a tabular format, such as a spreadsheet, especially when there are a large number of similar changes to make. VTScada makes it easy for you to export your tag database to Microsoft Excel™, Microsoft Access™, or to Microsoft SQL Server™, SQLServerExpress™, MySQL™ (using the MySQL 8.0 or later Unicode driver), or MariaDB™ (using the ODBC 3.1 or later driver) via ODBC. After editing in your preferred program, you can synchronize the changes made in that file or database with the running application.
If your goal is to copy a custom tag type definition from one application to another, the best option is to use an OEM layer (Reusable Application Layers).
Certain specialized applications may contain parameter data that exceeds the 8k cell limit of Excel. An export will proceed, but those parameters will not be included. VTScada will not allow the spreadsheet to be synchronized back into the application.
Tags are both exported and imported using the same page of the Application Properties dialog, "Export/Sync Tags".
- If selecting the Excel format, the Microsoft Excel program must be installed on the computer. Microsoft COM objects, provided only with a copy of Excel, must be present to create a spreadsheet that is fully compatible with Excel. (After the export file is created, you can work with it in any Excel-compatible spreadsheet program.)
- Excel must be activated. If installed but not activated, this procedure will not work.
- Tags that are created automatically as children of a complex type (those within a MultiSmart or MPE station, or your own user-defined types) will be exported without configuration data that would be generated automatically when the complex type is created. Override values will be exported, and you may apply or remove override values in the exported file.
- Tags with override values are marked with a * before the name (example: *Station 1\\Pump 1\\Set Speed)
- Blank tag names: An entry with a blank tag name or only a * is one that duplicates another tag name. This can happen if a tag is disabled and you then create another with the same name, disregarding the warning message, or sometimes following a series of override and delete operations in a user-defined tag type.
The enabled tag takes precedence during export / synchronize operations. The row with the blank tag name should be examined to see if it is worth retrieving by adding a new name, but otherwise deleted. - If copying a row in order to create a new tag, you must exclude the data in column A, and the name of your new tag must not begin with a *.
- A * in front of the tag name signifies that the tag contains an override. This is handled by VTScada automatically. Never add or remove the *.
- If you change a text property in an existing tag, the result is to change the phrase in the current language database. The phrase key remains the same as do all translations using that key.
- You cannot use the procedure described in this topic to modify the structure of a complex type by adding or removing child tags. A separate tool exists for that purpose - See: Manage Types Using a Spreadsheet or Database.
- If you have custom tags with a large number of parameters, you should be aware of the following limits: If exporting to Access, the maximum number of tag parameters is 256. If exporting to Excel, the maximum number of parameters is 65,536. None of the tags built into VTScada approach these limits.
- If you use Microsoft OneDrive®, you may experience problems if OneDrive insists on synchronizing a newly exported file with one that was exported earlier. Problems are especially likely if you open the local file before it is synchronized to the cloud. OneDrive will assume that the older version in the cloud is the correct one. Outcomes may vary.
- Tag parameters that are longer than 8192 characters exceed Excel's limits. A placeholder will be substituted so that the operation can proceed without causing an error. Upon import, that placeholder will be matched with the existing tag and the old parameter used without change. Do not edit the placeholder.
If the tag is deleted, moved, or if a new tag is created by copying one with the placeholder, the import operation will fail. In this case, you must delete the placeholder. The text of the placeholder follows: <Parameter_value_unable_to_be_exported_to_Excel>
The export file will contain information that identifies both the application and its current version. This will be used by the VTScada version control system when synchronizing the modified database. Look for the table or worksheet, VTS_Reserved. The synchronization process gives you the following option for what will happen to the spreadsheet or table after you import it back to the application.
- You may direct VTScada to update the file by performing a fresh export, thereby ensuring that you can continue editing the file and synchronizing those changes. Choose this option when you are making a series of consecutive edits and synchronizations.
- You may direct VTScada to delete the file, thereby ensuring that you must perform a fresh export before the next editing session. Choose this option when you expect to work in the Tag Browser before going back to the external database.
In general, it is best to work on an exported file that matches the current tag database. Importing an older file that does not include recent changes, may lead to errors.
Only if you have a large number of tags.
Tags can be imported (synchronized) without re-starting your application. Note that if there are a large number of tags to import or export, the operation may take a few minutes. The operation will be faster if the application is not running. When you request either operation, a dialog will remind you of this:
When exported to an external data file, each tag type will be stored in its own table or worksheet. Within a tag type table, each instance of a tag will be stored on a separate row, with a field for each attribute of the tag. (See following example) If a tag is part of a parent-child tag structure, the full name of the tag within the structure will be shown.
Relative tag references and parameter expressions will be adjusted to avoid conflicts with Excel conventions. Backslashes and other expression operators will be preceded by an extra backslash. Commonly-seen formats include the following:
..\\*TagType | Reference to a parent tag of the named type |
\= | Optimized tag parameter expression follows (snapshot expression) |
\% | Non-optimized tag parameter expression follows (refreshing expression) |
If adding expressions to tags in an exported Excel file, you cannot use relative references such as [TagName]. All existing expressions are exported using the full syntax, "Scope(Self, "TagName")\\Value". You must do the same.
Exported tags as seen in an Excel workbook
When adding new tags, you must leave the field in column A blank.
Do not change the value in column A for any existing tag, unless your goal is to delete the tag.
Do not begin new tag names with a *. This symbol is used to indicate existing tags that have an override.