Description: This function is used to create tags by starting new instances of the tag type specified in the parameter list. When creating an application that requires child tags, it is recommended that this function be used in place of the older ChildLaunch function.
StartTag can also be used to stop or to modify an existing tag.
Returns: Numeric (0)
Usage: Script
Format: StartTag([Parent], Start_Stop_Conditional, TagType, ChildParameterList )
Parameters: Parent { Object } { optional } { default: VTSDB }
An object that gives the parent for this new child tag. Defaults to VTSDB.
Start_Stop_Conditional { Boolean } { required } { no default: }
Any expression that evaluates to True or False. Please refer to the following table for the effect of this parameter
|
Value |
Condition |
Action |
|
True |
Child tag does not exist |
Launch the child tag |
|
True |
Child tag already exists |
Modify the child tag |
|
False |
Child tag already exists |
Stop the child tag |
|
False |
Child tag does not exist |
Nothing |
TagType { text } { required } { no default: }
The name of the tag type to be used for the tag. If modifying or deleting an existing child tag, you may set this parameter to invalid.
ChildParameterList { varies } { required } { no default: }
All the parameters required by the child tag should be provided here. The child tag's parameter names and matching values may be supplied in any one of three forms:
• As a comma-separated list of name-value pairs.
• As a two dimensional array of name-value pairs
• As two arrays, the first containing the parameter names and the second parallel array, containing the matching values.
While there is no requirement that the child parameters must be given in the order that they are defined in the child tag, better performance will be obtained by matching that order.
Returns: 0
Comments: When used to create a child tag, the name of that new child tag will always be unique since it will be a combination of the parent tag's name and the new child name in the format "ParentName\ChildName".
When this function is used to create an ordinary tag, as opposed to a child tag, it is the responsibility of the programmer to ensure that a unique name is used for each new tag.
Example:
In the following example, a child tag is created. ParentRoot is assumed to be a pre-existing tag object with name "Something".
\StartTag(ParentRoot, 1, "AnalogStatus",
"Name", "CylinderVolume"
"Area", Area,
"Description", Concat(Name, ": Cylinder Volume"),
"DeviceTag", PollDriverName,
"Address", "F8:0",
"ScanRate", Invalid,
"UnscaledMin", 0,
"UnscaledMax", 100,
"ScaledMin", 0,
"ScaledMax", 100,
"Units", "gal",
"AlarmLo", Invalid,
"AlarmHi", Invalid,
"PriorityLo", Invalid,
"PriorityHi", Invalid,
"InhibitLo", 1,
"InhibitHi", 1,
"AlarmSound", Invalid,
"ManualValue", Invalid,
"Threshold", 1,
"Questionable", 0,
"Quality", Invalid,
"DisplayOrder", 1,
"HelpKey", Invalid);
This creates an analog status tag named SOMETHING\CylinderVolume.