Date: Fri, 29 Mar 2024 10:52:18 -0500 (CDT) Message-ID: <2025677302.10103.1711727538826@localhost.localdomain> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_10102_1427144454.1711727538825" ------=_Part_10102_1427144454.1711727538825 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
What are Tags and Templates?
Tags
FactoryStudio uses the term "tag" to refer to real-time variables and th= eir associated historical data. Tags usually map to devices, such as PLC re= gisters or other physical equipment in the production process. A tag can al= so be connected to entries in SQL databases, external data sources, o= r an internally calculated value.
All tags have a specific type, such as an integer, text, or date and tim= e. FactoryStudio provides over a dozen predefined types and allows users to= define new types. In addition, some tags may be defined as arrays, and som= e tags may have optional parameters.
Tags are the process variables for your application. Use tags and their = properties to set up the data model for your process.
Templates
Although FactoryStudio provides many predefined types, you may need to d= efine your own type. Templates are used to do this. Templates may be define= d with properties similar to those of predefined types. Each template repre= sents a user-defined type that can be used in the same manner as predefined= types.
Using templates, you can add to the types of tags available for your pro= ject by creating new types to fit your application needs. This could be as = machine data, equipment status, vessels, or as the representation of any as= set attributes in your plant.
FactoryStudio provides 13 built-in tag types, most of which are based di= rectly on .NET datatypes. The 13 built-in tag types are summarized in the f= ollowing table.
Ta= g Type |
.N= et Type |
Va= lue Range |
Digital |
System.Int32 |
0 through 1 |
Integer |
System.Int32 |
-2,147,483,648 through 2,147,483,647 |
Long |
System.Int64 |
-2,147,483,648 through 2,147,483,647 |
Double |
System.Double |
-1.79769313486231570E+308 through -4.94065645= 841246544E-324 for negative values; 4.94065645841246544E-324 through 1.7976= 9313486231570E+308 for positive values |
Decimal |
System.Decimal |
0 through +/-79,228,162,514,264,337,593,543,9= 50,335 with no decimal point; 0 through +/-7.9228162514264337593543950335 w= ith 28 places to the right of the decimal; smallest nonzero number is +/-0.= 000 |
Text |
System.String |
0 to approximately 2 billion Unicode characte= rs |
Timer |
System.Int32 |
Same range as Integer, but with built-in para= meters to produce a repetitive wave pattern (see notes below) |
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, Second= s and Milliseconds, where each of those properties can hold a Double value<= /p> |
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. |
Decimal
The Decimal type allows calculation with higher precision than the Doubl= e 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.
Timer
Timer is a built-in integer type that can be used to generate precise ti= ming signals. Timers have the following varieties:
For SquareWave, Pulse, and Comparer, the tag toggles between 0 and the S= tartValue (instead of 0 and 1) if you set the tag StartValue.
Reference
Reference tags allow dynamic addressing of variables.
The way you use Reference tags in FactoryStudio is closer to how you use=
references in .NET programming than it is to the old C++ pointers. Reference tags are similar to .NET ref=
erences because they both have a type. When you create a reference tag, you=
need to define the type of object the reference will point to. U
The target type for the Reference types is defined in the Parameters col= umns.
Typed references bring advantages in both the engineering stage and in r= untime. 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. This is the&nbs= p;link, and it specifies which tag that the refe= rence will be linked to during execution.
Essentially, the link property is a string property that needs to receiv= e the target tag name before using the reference tag. You can assign a stri= ng directly or by using a string expression. The best way to set the link p= roperty 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-refe= rence utility.
An example project (ReferenceTags) ships with FactoryStudio.
Examples:
@Tag.Reference1.Link =3D @Tag.TagName.GetName() (VB)
@Tag.Reference1.Link =3D @Tag.TagName.GetName(); (C#)
@Tag.Reference1.Link =3D "Tag.TagName"; (C#)
@Tag.Reference1.Link =3D "Tag.TagNa" + "me"; (C#)
The reason for using the GetName() method, instead of using strings dire= ctly, is that with GetName() you retain the benefits of Cross-Reference and= Refactoring.
Creating and Editing Tags
To create and edit tags:
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 template. |
Parameters |
Configure any parameters. The parameters vary= based on the tag type. Once the type is entered, you can double click on t= he parameters field to see a dropdown menu with any applicable parameters.<= /p>
Example 1: If the DeadBand is Set to 5 and ini= tial value of the tag is 0, the next input possible to be saved, need to be= >=3D5 or <=3D-5. Example 2: If the curren= t value of the tag is 100 and the deadband is set to 10%, the next input po= ssible to be saved, need to be >=3D110 or <=3D90. |
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.= p> Two programming styles are accommodated by this method; one that count= s elements from 0 to less than five, and one that counts from 1 to 5. = td> |
The columns above are visible by default. To add or remove one of the colum=
n below, right-click the column heading area and check or uncheck the colum=
ns that should be visible.
Units |
Enter the engineering units of measure that y= ou want to use as a label for this tag. |
StartValue |
Enter a starting value for this tag. This is = the value the tag will be initialized with when FactoryStudio starts. = td> |
Format |
Enter a default format for displaying the dat= a. For example:
|
Retentive |
Select the option to save the value of the ta= g 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 application next starts.
|
Min |
Enter the minimum value that is valid for the= object. |
Max |
Enter the maximum value that is valid for the= object. |
Visibility |
Select the value visibility on the OPC server= for remote projects:
|
Domain |
Tag value for the entire project or value spe= cific to each client display.
|
Comment |
Enter any comments about this tag. |
ReadSecurity |
Select which groups have the right to read th= e Tag. Tag Security protection can be configured in Display > Client Set= tings |
ScaleMin |
Enter the scale min value for communication.<= /p> |
ScaleMax |
Enter the scale max value for communication.<= /p> |
DevicePoint |
Read-only. Show which communication point is = related to the tag (if related) |
WriteSecurity |
Select which groups have the ability to write= in the Tag. Tag Security protection can be configured in Display > Clie= nt Settings |
[Other columns] |
For definitions of other columns that a= re available in this table, see Common Column Definitions. |
Continue adding as many tags as you need.
Notes
You can create a tag from anywhere in FactoryStudio by clicking
Like any other configuration table, you can import CSV files or copy/pas= te content directly from an Excel spreadsheet or from other applications.&n= bsp;
With FactoryStudio, you can replace names at any time. An easy way to cr= eate a tag is to click on the Name column of the insertion row, then press = space and enter. Each time you do this, the system will create the same typ= e of tag that was last created. In the insertion row, select the Type, then= click on the header or any other part of that grid. This will create a tag= with a default name. Also, you can configure more than one row at a time b= y selecting the rows with the Shift button, then right-click and select "Ed= it Combined Rows". A new popup will open with the information for the rows.= The settings changed in this window will change all of the selected rows. = If a column has , it shows that this column has more than one configuration. = p>
Tag Formats
The format property defines the display format of tag values. These form= ats follow the specifications provided in Microsoft .NET. For valid numeric= formats, refer to Standard Numeric Format Strings.&n= bsp;For example: N1 (number with 1 decimal place).
For valid date and time formats, refer to Standard Date and T= ime Format Strings. For example: d (short date).
For a more in-depth discussion of format strings, refer to = Formatting Types.
Numeric format examples |
|
N0 |
Number with no decimal places |
N3 |
Number with 3 decimal places |
X |
Hexadecimal (supported only for integral type= s) |
C |
Currency |
Date/time format examples |
|
T (only) |
Long time pattern (equivalent to HH:mm:ss).= p> |
d (only) |
Short date pattern (equivalent to M/d/yyyy (m= onth/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 w= eek. |
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. = td> |
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 5= 9. |
ss |
Show the second as a number from 00 through 5= 9. |
fff |
Show the millisecond as a number from 000 thr= ough 999. |
tt |
Show the A.M./P.M. designator. |
Templates let you create new tag types based on existing built-in types.=
To create a tag template:
Enter or select information, as needed.= The properties are the same ones for Tags. See Creating and Editing Tags a= bove.
Assets
Assets let you configure additional metadata for your project when you h= ave the Enterprise version of FactoryStudio. For example, you can organize = the objects in your project into a hierarchy. This lets you group tags that= are related to each other. The hierarchy may reflect such things as the ar= ea of your manufacturing floor or the location of your machinery.
To create assets:
Categories
If you have the Enterprise version of FactoryStudio, you can create user= -defined categories of data that you can use as tag metadata. Categories ar= e useful for filtering, both when creating the project and during runtime.<= /p>
To create categories:
All project tags are available in the runtime modules as .NET objects fo= r the Tag Namespace.
All of the built-in tag types share a common set of properties and metho= ds which are defined in the base class TagObj. The tags created from user defined = templates are implemented by the base class UserType.
TagObj |
Base classes to all Tag objects. |
Digital |
Runtime properties for tags of Type Digital.<= /p> |
Analog |
Runtime properties for all Analog Tag Types.<= /p> |
AnalogInt |
Runtime properties for tags of Type Integer.<= /p> |
AnalogLong |
Runtime properties for tags of Type Long. = |
AnalogDecimal |
Runtime properties for tags of Type Decimal.<= /p> |
AnalogDouble |
Runtime properties for tags of Type Double.= p> |
Text |
Runtime properties for tags of Type Text. = |
TDateTime |
Runtime properties for tags of Type DateTime.= |
Timer |
Runtime properties for tags of Type Timer. |
TTimeSpan |
Runtime properties for tags of Type TimeSpan.= |
Reference |
Runtime properties for tags of Type Reference= . |
TDataTable |
Runtime properties for tags of Type DataTable= . |
UserType |
Runtime properties for tags from Templates.= p> |
See Namespaces for the compl=
ete programming reference on runtime objects.