Overview
This section provides comprehensive guidance on managing tags in FactoryStudio by covering essential topics such as creating and editing tags, configuring tag properties, formatting tag values, and importing tag definitions. The instructions and information provided are tailored to help users effectively utilize the software and ensure a smooth user experience.
On this page:
Table of Contents | ||||
---|---|---|---|---|
|
Working with Creating and Editing Tags
This section elucidates the concepts and functionality of the creating and editing tags, organized into the following topics:
In FactoryStudio, tags can be created and edited using various methods, such as:
Using the Create Tag Icon on the main toolbar or the Unified Namespace. See Toolbar commands to Create and Edit Tags.
Using the Tag Objects DataGrid to create and edit tags using a table format. See Tags Object Data Grid.
Tag Configuration Properties
Main configuration properties are essential for defining a tag's characteristics. The key properties include:
- TagName: A unique identifier for the tag.
- Type: The data type of the tag (e.g., Integer, Digital).
Optional configuration properties offer additional customization for tags. These properties can be edited after importing the tags into the project. Examples of optional properties include:
- Alarm configurations: Settings related to alarms triggered by tag values.
- Historian settings: Configurations for data logging and archiving.
- Device Address: The address or location of the tag in the PLC or data source.
Tag value formatting allows you to display the tag values in a more readable and meaningful format. This includes the following settings:
b. Units: Appropriate units for the tag values, such as temperature or pressure.
c. Precision: The number of decimal places to display for the tag value.
c. Other project-specific attributes: Custom properties specific to the project requirements.
Column | Description |
ID | Database ID assigned to the object in the table. Numbers are assigned starting from 1 for the first object created and continue as needed. The IDs are unique only to a specific table. |
PATH | Allows users to associate tags with specific assets. Select the PATH you want to associate with the tag on the Tags . |
DateModified | Date the object was last changed. |
DateCreated | Date the object was created. |
Description | Enter a description of the object. |
The explanation for the various in on the section Tag Configuration Properties (CRIAR ESSA SEcao nesta pagina) A Parte do OBJECTS, deve dar a explicação geral de PATH e as coisas mais importantes de algumas colunas, mas nao precisa ter cada coluna descrita, ele deve apontar tamebm para a seção the Tag Configuration Properties, para o significados das colunas adicionais. Assim como ter link para a dewscricao genérica de usando grid no Project Designer.
Toolbar commands to Create and Edit Tags
1. Click on 'New Tag' Icon to create new Tags, or the Tag Properties to edit the Tag.
2. In Unified Namespace and Tags > Tags, click on the 'New Item' icon to create new tags, or the Tag Properties to edit an existing tag.
The following dialog will be presented.
The only 2 essential fields to field in are the 'NAME' and the 'TYPE' of the Tag,
Editing Tags at the Unified Namespace
When using the toolbar in the Unified Namespace > Asset Tree page, you select in which folder the Tag will be created. You can also right-click on the desired folder and select the 'New Tag' option.
To create or edit tags in the Unified Namespace view, navigate to the "Unified Namespace > Tags" section. From there, you can create new tags or edit existing ones, assigning them to specific data types or templates. When creating a tag, make sure to define the relevant attributes, such as data source, initial values, and any necessary metadata. Existing tags can be edited to update their attributes or modify their relations with other tags or assets as needed.
To import tags, ensure these properties are set correctly in the source file (Excel or CSV).
Tag Types
All tags have a specific type for its value, such an integer, text or DateTime. The many pre-defined Tag Types are the Built-in tag types. In addition, the tag type can be an UDT (User Defined Type) or Tag Template .
Tags have also pre-defined properties, such as Description and Array size. Different tag types may have specific properties, but most properties are available to all Tags.
When creating the Tag, some of those properties are defined in the configuration — such as the Description —, some of the properties are only accessible when the application is running — like Value, Quality and Timestamp. The complete set of Tag properties when running the project is referred as the Runtime Tag Properties.
Built-in Tag Types
The built-in tag types are based directly as extensions of the .NET datatypes. The tag types are summarized in the following table:
Built-in Tag Types | ||
---|---|---|
Tag Type | .Net Type | Description and Value Range |
Digital | System.Int32 | Binary value, 0 or 1. |
Integer | System.Int32 | Integer values, range -2,147,483,648 through 2,147,483,647 |
Long | System.Int64 | Long integer values, range -2,147,483,648 through 2,147,483,647 |
Double | System.Double | Floating point value. ranging -1.79769313486231570E+308 through -4.94065645841246544E-324 for negative values; 4.94065645841246544E-324 through 1.79769313486231570E+308 for positive values |
Decimal | System.Decimal | Extended precision floating point., ranging 0 through +/-79,228,162,514,264,337,593,543,950,335 with no decimal point; 0 through +/-7.9228162514264337593543950335 with 28 places to the right of the decimal; smallest nonzero number is +/-0.000 The Decimal type allows calculation with higher precision than the Double type. However, math operations using Decimal can be 40 times slower than using Double. So the Decimal type should only be used when Double precision is not enough. |
Text | System.String | Text strings composed of Unicode character. Maximum length of the sting is the integer range. |
Timer | System.Int32 | Timer is a built-in integer type that can be used to generate precise timing signals and wave pattenrs. Timers have the following models:
For SquareWave, Pulse, and Comparer, the tag toggles between 0 and the StartValue (instead of 0 and 1) if you set the tag StartValue. |
DateTime | System.DateTimeOffset | From 12:00:00 midnight, January 1, 0001 to 11:59:59 P.M., December 31, 9999 |
TimeSpan | TimeSpan | Data Interval in Days, Hours, Minutes, Seconds and Milliseconds, where each of those properties can hold a Double value |
Guid | Guid | Standard Microsoft Globally Unique Identifier (GUID) |
DataTable | System.Data.DataTable | Holds an in-memory DataTable |
Image | System.Byte[] | Can hold an Image file or any binary content. The Long value is the maximum size of the content. |
Reference Type
Reference tags allow dynamic addressing of variables.
The way you use Reference tags in the project is similar to how you use references in .NET programming, as they both have a defined type. The target type for the Reference is defined in the Parameters columns.
Typed references bring advantages in both the engineering stage and in runtime. In the engineering stage, it allows IntelliSense to directly browse the template members if a reference is pointing to a template. In runtime, it allows string data validation.
All Reference tags have an additional runtime attribute: the Link property, which specifies which tag that the reference will be linked to during execution.
Essentially, the Link property is a string property that needs to receive the target tag name before using the reference tag. You can assign a string directly or by using a string expression. The best way to set the link property is to use the method GetName()
, which will create the string based on the current tag name. This way, you can rename the tag without having to search the strings. This also shows the tag names linked on the cross-reference utility.
Examples:
Code Block | ||
---|---|---|
| ||
@Tag.Reference1.Link = @Tag.TagName.GetName(); |
Code Block | ||
---|---|---|
| ||
@Tag.Reference1.Link = @Tag.TagName.GetName(); |
Code Block | ||
---|---|---|
| ||
@Tag.Reference1.Link = "Tag.TagName"; |
Code Block | ||
---|---|---|
| ||
@Tag.Reference1.Link = "Tag.TagNa" + "me"; |
The reason for using the GetName()
method instead of using strings directly is that with GetName()
you retain the benefits of Cross-Reference and Refactoring.
Tags Object DataGrid
To create new local tags using the Object DataGrid:
- Go to Unified Namespace → Tags and insert a new row with the tag properties defined in the columns.
- or, in any configuration windows, just click the <<< IMAGE >>>. New Tag button on the Top Toolbar
- or, when at the Unified Namespace → Asset Tree, use the NewTag toolbar button to create a tag at the selected asset level
- or, by copy-paste the data form Excel or another project;
- or, using the other Importing tags tools.
To edit the properties of existing local tags:
- Go to Unified Namespace → Tags and edit the row with the tag definition you want to modify. Multiple rows selection is allowed. Learn more about Working with DataGrids here.
- Select a Tag Name at the top toolbar << IMAGE >> and click the Tag Properties button at the toolbar << IMAGE >>
Either creating a new tag, or editing tags, in the DataGrid view or the properties dialogs, the tag has the following configuration fields:
Tag main configuration properties | |
---|---|
Field | Description |
Parent | Specify the Parent Level where the Tag is located in Asset tree. |
Name | Enter a name for the tag. The system lets you know if the name is not valid.
|
Type | Select the tag type, which may be a built-in type or a user-defined Tag Template. |
Parameters | Configure any parameters. The parameters vary based on the tag type. Once the type is entered, you can double-click the parameters field to see a dropdown menu with any applicable parameters.
Example 1: If the DeadBand is Set to 5 and initial value of the tag is 0, the next input possible to be saved, need to be >=5 or <=-5. Example 2: If the current value of the tag is 100 and the deadband is set to 10%, the next input possible to be saved, need to be >=110 or <=90.
For example, a device may have a value of 0 or 1 . Rather than display "0" or "1", you can display the strings "on" or "off." The definition for the Enumeration Set dictionary is on Tags → Enumeration Sets When configuring a display component to use these tags, set the TextOutput to one of the following:
|
Array | When this field is blank, the tag is not an array. When the field contains an integer value of N, an Array is created from position 0 to N. For example, if the field contains the value 5, the Array is created from Tag[0] to Tag[5]. This means that 6 elements are created. Two programming styles are accommodated by this method; one that counts elements from 0 to less than 5, and one that counts from 1 to 5. |
Enumeration | User defined types that lists a set of values, messages and colors. They can be connected with a Tag, or used directly in script expressions. |
Description | String message with additional information about the Tag, maximum string length is 1024 |
The fields above are visible by default on the datagrid view. To add or remove columns, right-click the column heading area and check or uncheck the columns that should be visible.
Tag optional configuration properties | |||
---|---|---|---|
Field / Column | Description | ||
Min | Enter the minimum value that is valid for the object. | ||
Max | Enter the maximum value that is valid for the object. | ||
ScaleMin | Stores a minimum value to assist scaling charts or communication devices. | ||
ScaleMax | Stores a maximum value to assist scaling charts or communication devices. | ||
Units | String with the Engineering units of measure, simplifying the visualization of the value on Displays, and allowing the dynamic change of metric systems.
| ||
Format | Default format for displaying tag value. E.g.: N2 for 2 decimals; See the next table, Formatting Tag Values. | ||
StartValue | Initial value set to the Tag when the project first runs. This value is overridden if a Retentive option is used. | ||
Retentive | Select this option to save the value of the tag and its internal properties to the database every time the value changes. This retains the value when the application shuts down and makes the value available when the next next application starts.
The values for Retentive Tags are stores at the database defined at Datasets → DBs → Retentive, and it can be customize to use any database. Retentive can be applied to Tags of Domain Server, in this case, you can easily allow the cold-start from the Project, without losing Operator-Inputed values or other Tags that shall keep the last value in between a shutdown and a startup. Retentive can be applied to Tags of Domain Client, in this case, you can falsity create concepts as User Configuration settings, that are stored and located according the client or user connection. | ||
Domain | Defines if the tag value has Server (global) or Client (instance) scope. Server (Default): the value of tag is unique, synchronize across all operator stations accessing the project. All tags used by Devices Communications and Historian must be or Type Server. Client: The value of tag is local at each Client Displays Instance accessing the project. Common use for client tags are to manage the user interface. | ||
Visibility | Select the value visibility of your tag to external connection and the built-in OPC server. Private: Tag is visible only to the local project and redundant pair. If not defined, the visibility is Public by default. | ||
Comment | Enter a short comment about this tag. The comment field is typically used to show a friendly name to the operator on the displays. For instance, a tag name "LV102KP" can have the Comment as "Level Tank 102". The Description field is typically the longer engineering definition of the tag usage. | ||
Category | Allows to define metadata labels to the tag. Categories are useful for project organization during the engineering phase. Categories are also useful when copy pasting tags directly the draw area, automatically creating symbols.
| ||
DevicePoint | Read-only property. Show which communication point address is related to the tag (if any). | ||
Disable | When checked disable the use of the Tag in the project execution. Default is enabled. | ||
Other Columns | For definitions of other columns that are available in this table, see Common Column Definitions. |
Tag Value formatting
The format property defines the display format of tag values. For example, N1 defines a number with one decimal place, like 2.1
Proper formatting ensures that the tag values are displayed accurately and are easily understood by users.
These formats follow the specifications provided in Microsoft .NET.
For valid numeric formats, refer to Standard Numeric Format Strings.
For valid date and time formats, refer to Standard Date and Time Format Strings.
For a more in-depth discussion of format strings in .NET, refer to Formatting Types.
Numerical values formatting | |
---|---|
Specifier | Description |
N0 | Number with no decimal places |
Nn | Number with n decimal places (replace n by any integer number) |
X | Hexadecimal (supported only for integral types) |
C | Currency |
R | A string that can round-trip to an identical number |
P | Number multiplied by 100 and displayed with a percent symbol |
G | The more compact of either fixed-point or scientific notation |
F | Integral and decimal digits with optional negative sign |
E | Exponential notation |
D | Integer digits with optional negative sign |
Date/time formats | |
---|---|
Specifier | Description |
T (only) | Long time pattern (equivalent to HH:mm:ss). |
d (only) | Short date pattern (equivalent to M/d/yyyy (month/day/year) for en-us). |
dd | Show the day of the month as a number from 01 through 31. |
ddd | Show the abbreviated name of the day of the week. |
dddd | Show the full name of the day of the week. |
MM | Show the month as a number from 01 through 12. |
MMM | Show the abbreviated name of the month. |
yy | Show the year as a two-digit number. |
yyyy | Show the year as a four-digit number. |
hh | Show the hour as a number from 01 through 12. |
HH | Show the hour as a number from 00 through 23. |
mm | Show the minute as a number from 00 through 59. |
ss | Show the second as a number from 00 through 59. |
fff | Show the millisecond as a number from 000 through 999. |
tt | Show the A.M./P.M. designator. |
Import Tag Definitions
Importing Tag Definitions
There are many ways to import Tag definition to the project:
- Just Copy from other Projects and in this Project.
- Using the Import from Excel.
- Using the import from CSV Files.
- Using the Import Tags.
- Using the EngWrapper API.
After importing the tags, you can organize them using the Asset Modeling feature, which enables you to create a hierarchical structure for your project's tags.
Importing Tags and PLC Addresses from Excel
The "Import from Excel" enables easy importation of tags and PLC addresses. The process is as simple as copying and pasting the content of an Excel table, ensuring that you include the titles of the columns. The feature allows for flexibility in having tables with different columns or arranged differently in your project. Upon clicking the "Import" button, you choose the .CSV file that contains the tag's information, creating them automatically in your project. Additionally, the system saves your import settings for future use. For a detailed step-by-step of this process, consult the comprehensive guide in the Importing Tags and PLC Addresses section.
Importing from CSV Files
The importation of CSV files encompasses two main approaches: Individual CSV Files and Extended CSV Files.
Individual CSV Files
In this scenario, you can import items for each individual table available throughout the Engineering Environment. This feature is especially useful for adding items, such as alarms, to your project. When a grid is in focus, the import button on the top bar becomes available. Upon clicking it, a import dialog window will open, allowing you to select the CSV file to be imported. For a more detailed understanding of this process, refer to our detailed guide in Individual CSV File.
Extended CSV Files
Here, the idea is to use a single .CSV table to import information on Tags, Devices, Alarms, and historian items. In this case, the final table is a concatenation of the various grids from the project. This feature can be particularly useful for importing a large amount of correlated information at once. For more information on how to utilize this feature, refer to our comprehensive guide in the Extended CSV Files section.
In this section...
Page Tree | ||||
---|---|---|---|---|
|