Support Forums
Using Scope Function to Map Values according to Logic

Parent Child References are the easiest to map. However, I am exploring the possibility that the hierarchy for an application might require references to properties in an adjacent tag in the hierarchy. I haven't run into issues when concatenating descriptions in this way. However, in other values that require a specific data type (Scan Intervals, Drivers, AIO Scale Min's and Max's), I have expressions that compile, but values that cannot be evaluated by the property I am mapping to.

I believe that the Scope function is intended for this very application
-->Link to Help Pages
-->Link to Function References

If I wanted a to refer to a min value that has the following Tag Name: [Parent1\VariableTagNameX\MinProperty]

How can I use scope to place the Min Property of Parent1 in the MinProperty value of Parent2?

The VariableTagName is a property I want to refer to in the "local tag" that has a different parent.

[Parent2\Child1\MinProperty]--where I want to use scope function

[Parent2\X]-value that identifies the Tag Name of VariableTagX I want to refer to

I've been trying something like the following, but believe I am misunderstanding the syntax

Scope([Parent1],Concat(..\X,"\MinProperty" ) )

Parent Child References are the easiest to map. However, I am exploring the possibility that the hierarchy for an application might require references to properties in an adjacent tag in the hierarchy. I haven't run into issues when concatenating descriptions in this way. However, in other values that require a specific data type (Scan Intervals, Drivers, AIO Scale Min's and Max's), I have expressions that compile, but values that cannot be evaluated by the property I am mapping to. I believe that the Scope function is intended for this very application [-->Link to Help Pages](file:///C:/VTScada/VTSHelp/Content/Scripting/Expressions/OpAndFunctionExamples.htm?tocpath=Scripting%7COperators%20and%20Functions%7C_____3) [-->Link to Function References](file:///C:/VTScada/VTSHelp/Content/Pro_Functions/Scope.htm?Highlight=scope) If I wanted a to refer to a min value that has the following Tag Name: [Parent1\VariableTagNameX\MinProperty] How can I use scope to place the Min Property of Parent1 in the MinProperty value of Parent2? The VariableTagName is a property I want to refer to in the "local tag" that has a different parent. [Parent2\Child1\MinProperty]--where I want to use scope function [Parent2\X]-value that identifies the Tag Name of VariableTagX I want to refer to I've been trying something like the following, but believe I am misunderstanding the syntax Scope([Parent1],Concat(..\X,"\MinProperty" ) )

If you create a custom widget based on a tag type, you can browse the property names for each property in that tag type. Note that the properties for a number of common type are detailed in the help files.

You can also move up the tag hierchy via the [../../TagName/Description] syntax or by referencing a parent tag type such as a driver via [*Driver] as a generic type specifier.

Does that make sense?

If you create a custom widget based on a tag type, you can browse the property names for each property in that tag type. Note that the properties for a number of common type are detailed in the help files. You can also move up the tag hierchy via the [../../TagName/Description] syntax or by referencing a parent tag type such as a driver via [*Driver] as a generic type specifier. Does that make sense?

Trihedral Engineering Ltd.

Thanks for the clarification on how the [*TagType] references work. I was getting unexpected results in that respect. If I rearrange my hierarchy a bit, I think I could get that to work. I suppose it works as sort of a wild card for the beginning section of the tag name. Pick the closest parent tag of this type and then drill down to the children of that type that have the name that follows.

Where I've been running into trouble is trying to concatenate parts of tag names when I reference them. The first part is standard, the last part is standard, but my goal is to store the middle section of the tag name as a parameter. When I use this method directly [../../TagName/Description], I get results, but if part of the TagName is stored in a parameter, I run into issues. Though the purpose of this method is to have an easy process for remapping changes in addresses. I suppose I can do the concatenation outside of VTScada and bulk upload as an option also. However, in that way, all of my user-defined tag types may appear to have overwrites, I think. And I'd have discrepancies if a parameter changes in the app but isn't linked to how it's used within the app.

Although I think there is a way to reference tags and tag values with variable portions of tag names stored in a parameter.

Thanks for the support! I am new to VTScada and am learning all the ins and outs. I suppose there wasn't a direct follow up question in my response, but I also wonder if there is a way to step through expressions to help troubleshoot what might not be working?

Thanks for the clarification on how the [*TagType] references work. I was getting unexpected results in that respect. If I rearrange my hierarchy a bit, I think I could get that to work. I suppose it works as sort of a wild card for the beginning section of the tag name. Pick the closest parent tag of this type and then drill down to the children of that type that have the name that follows. Where I've been running into trouble is trying to concatenate parts of tag names when I reference them. The first part is standard, the last part is standard, but my goal is to store the middle section of the tag name as a parameter. When I use this method directly [../../TagName/Description], I get results, but if part of the TagName is stored in a parameter, I run into issues. Though the purpose of this method is to have an easy process for remapping changes in addresses. I suppose I can do the concatenation outside of VTScada and bulk upload as an option also. However, in that way, all of my user-defined tag types may appear to have overwrites, I think. And I'd have discrepancies if a parameter changes in the app but isn't linked to how it's used within the app. Although I think there is a way to reference tags and tag values with variable portions of tag names stored in a parameter. Thanks for the support! I am new to VTScada and am learning all the ins and outs. I suppose there wasn't a direct follow up question in my response, but I also wonder if there is a way to step through expressions to help troubleshoot what might not be working?

Eureka! I don't know why it works but I got something that works!

Scope(\Root,Concat(String together variables of Parent tag))\PropertyName

I think I wasn't grabbing a parent object at first as the first parameter, and trying to fit the whole tag name into the second parameter string with extra [] characters. But the format above ended up working smile

Eureka! I don't know why it works but I got something that works! Scope(\Root,Concat(String together variables of Parent tag))\PropertyName I think I wasn't grabbing a parent object at first as the first parameter, and trying to fit the whole tag name into the second parameter string with extra [] characters. But the format above ended up working :)
83
3
2
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft