General Discussions
Return a value from a custom tag type to display on the main Tag

Anyone know how to return a value of a child tag of a custom type to be display on the Parent under the value column in the tag browser?

For example, Custom tag "AI" has a child of a IO analog type called "Scaled" i want to return that value so it can be read through the parent tag (custom type) under the value column.

Anyone know how to return a value of a child tag of a custom type to be display on the Parent under the value column in the tag browser? For example, Custom tag "AI" has a child of a IO analog type called "Scaled" i want to return that value so it can be read through the parent tag (custom type) under the value column.
edited Jul 11 '23 at 3:06 pm

I believe you'll need to ensure your user has the manage tag type privilege to create the tag type in the first place. Then, you will head to the tag type source code ( Path Example: 'C:\VTScada\AI.src' )

In that file, you'll want to find the TagMain section and place your code in that section. You'll need to create a condition to watch for changes to your tag and then write those changes to the Value property of the tag type.

For example:

If Watch(1, \Scaled\Value);
  [
    \Value = \Scaled\Value;
  ]

Once you have saved the new code, remember to open the VAM ( VTScada Application Menu ) and click the Import changes button as shown below:

64ad80bb0c530

I believe you'll need to ensure your user has the manage tag type privilege to create the tag type in the first place. Then, you will head to the tag type source code ( Path Example: 'C:\VTScada\AI.src' ) In that file, you'll want to find the TagMain section and place your code in that section. You'll need to create a condition to watch for changes to your tag and then write those changes to the Value property of the tag type. For example: ```` If Watch(1, \Scaled\Value); [ \Value = \Scaled\Value; ] ```` Once you have saved the new code, remember to open the VAM ( VTScada Application Menu ) and click the Import changes button as shown below: ![64ad80bb0c530](serve/attachment&path=64ad80bb0c530)

Trihedral Engineering Ltd.

edited Jul 11 '23 at 5:18 pm

No problem. It's a great question. Maybe a good one for a future Automation Village as I expect a lot of folks would like to do this type of thing.

No problem. It's a great question. Maybe a good one for a future Automation Village as I expect a lot of folks would like to do this type of thing.

Trihedral Engineering Ltd.

40
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