Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Notifications
Login / Register
Community
Community
Notifications
close
  • Forums
  • Knowledge Center
  • Events & Webinars
  • Ideas
  • Blogs
Help
Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Login / Register
Sustainability
Sustainability

Join our "Ask Me About" community webinar on May 20th at 9 AM CET and 5 PM CET to explore cybersecurity and monitoring for Data Center and edge IT. Learn about market trends, cutting-edge technologies, and best practices from industry experts.
Register and secure your Critical IT infrastructure

Getting Template Name or id from an Instance

EcoStruxure Geo SCADA Expert Forum

Schneider Electric support forum about installation, configuration, integration and troubleshooting of EcoStruxure Geo SCADA Expert (ClearSCADA, ViewX, WebX).

cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Home
  • Schneider Electric Community
  • Remote Operations
  • EcoStruxure Geo SCADA Expert Forum
  • Getting Template Name or id from an Instance
Options
  • Subscribe to RSS Feed
  • Mark Topic as New
  • Mark Topic as Read
  • Float this Topic for Current User
  • Bookmark
  • Subscribe
  • Mute
  • Printer Friendly Page
Invite a Co-worker
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send Invite Cancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close
Top Experts
User Count
sbeadle
Kirk sbeadle Kirk
307
AndrewScott
Admiral AndrewScott
96
BevanWeiss
Spock BevanWeiss
90
AdamWoodlandToo
Lt. Commander AdamWoodlandToo
36
View All
Related Products
product field
Schneider Electric
EcoStruxure™ Geo SCADA Expert

Invite a Colleague

Found this content useful? Share it with a Colleague!

Invite a Colleague Invite
Back to EcoStruxure Geo SCADA Expert Forum
tkswathik
Lieutenant JG tkswathik
Lieutenant JG

Posted: ‎2021-11-23 05:21 PM . Last Modified: ‎2023-05-03 12:00 AM

0 Likes
4
1506
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2021-11-23 05:21 PM . Last Modified: ‎2023-05-03 12:00 AM

Getting Template Name or id from an Instance

Is it possible to get the corresponding template name or Id of an Instance through the Automation Interface? My goal is to be able to find out if a property is overridden in the template

 

My code snippet is 

 

InstanceFullName = "ParentGroup.InstanceName"

Set obj = server.FindObject(InstanceFullName)

TemplateId = obj.TemplateId

InstanceId = obj.InstanceId

 

I see that TemplateId is always 0 but InstanceId gives me the Id of ParentGroup if ParentGroup is another Template Instance otherwise I get 0

 

Eventually I would like to execute the following method on a few property names 

 

tobj.PropertyOverride(TemplateId, PropertyName) (tobj -> Item inside the template)

Labels
  • Labels:
  • SCADA
  • Scripting
  • Tags:
  • english
  • scada
  • SCADA app
  • SCADA software
  • SCADA tutorial
  • Telemetry and SCADA
Reply

Link copied. Please paste this link to share this article on your social media post.

  • All forum topics
  • Previous Topic
  • Next Topic
Replies 4
BevanWeiss
Spock BevanWeiss
Spock

Posted: ‎2021-11-24 08:15 PM

1 Like
3
1488
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2021-11-24 08:15 PM

I think you'll probably want the 'ParentTemplateId' property.

 

Which is described as "Reference to the template containing the object, if any."

So if the object has a ParentTemplateId that is not -1 then it is from a template, and you could reference the ID to obtain that template.


Lead Control Systems Engineer for Alliance Automation (VIC).
All opinions are my own and do not represent the opinions or policies of my employer, or of my cat..
  • Tags:
  • english
  • scada
  • SCADA app
  • SCADA software
  • SCADA tutorial
  • Telemetry and SCADA
Reply

Link copied. Please paste this link to share this article on your social media post.

tkswathik
Lieutenant JG tkswathik
Lieutenant JG

Posted: ‎2021-11-29 09:49 AM

In response to BevanWeiss
0 Likes
2
1466
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2021-11-29 09:49 AM

@BevanWeiss 

 

I don't see a ParentTemplateId method for SCXV6Object. I think you might have referred to the Property ParentTemplateId. I get -1  for both for an independent object( not part of any template) or a template object. I think the reason could be because the object I am checking is inside a template instance. So when I try ParentInstanceId, I get the "Id" of the Parent Group Instance.

 

I think I can work with this idea:

Lets say obj is the object for which I have to check if a property is overridden

1. Get the Parent Instance Id : obj.Property("ParentInstanceId")

2. Find the corresponding Group Object: 

3. Get the Template Id property from the Group Object ( we cant use this on obj because it will fail)

4. Find the Corresponding Template Object ( tObj )

5. Use the Find method under SCXV6Object to see if the Instance Name ( obj.Name ) exists in the template

6. If it exists then use the  PropertyOverride  method:  tObj.PropertyOverride( tpObj.Id, propertyName). This would return either TRUE or FALSE

 

 tpObj would be Nothing if obj.Name doesn't exist in the Template

 

Thanks!!

  • Tags:
  • english
  • scada
  • SCADA app
  • SCADA software
  • SCADA tutorial
  • Telemetry and SCADA
Reply

Link copied. Please paste this link to share this article on your social media post.

BevanWeiss
Spock BevanWeiss
Spock

Posted: ‎2021-11-29 01:41 PM

In response to tkswathik
0 Likes
1
1461
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2021-11-29 01:41 PM


I don't see a ParentTemplateId method for SCXV6Object. I think you might have referred to the Property ParentTemplateId.


Huh?  Wasn't my first sentence exactly this.. "I think you'll probably want the 'ParentTemplateId' property."

 

But yes, my mistake, the ParentTemplateId property applies to tell if a point is within a Template (and which Template), not whether it is within an Instance of a Template.  So it is the 'ParentInstanceId' property you would want.

 

ParentInstanceId should return you the ID of the CTemplateInstance in which your object is located (if it is associated with an instance).

 


Lead Control Systems Engineer for Alliance Automation (VIC).
All opinions are my own and do not represent the opinions or policies of my employer, or of my cat..
  • Tags:
  • english
  • scada
  • SCADA app
  • SCADA software
  • SCADA tutorial
  • Telemetry and SCADA
Reply

Link copied. Please paste this link to share this article on your social media post.

tkswathik
Lieutenant JG tkswathik
Lieutenant JG

Posted: ‎2021-11-29 01:51 PM

In response to BevanWeiss
0 Likes
0
1458
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2021-11-29 01:51 PM

Ah !! I overlooked it, my bad.

 

Thanks for your suggestion 

  • Tags:
  • english
  • scada
  • SCADA app
  • SCADA software
  • SCADA tutorial
  • Telemetry and SCADA
Reply

Link copied. Please paste this link to share this article on your social media post.

To The Top!

Forums

  • APC UPS Data Center Backup Solutions
  • EcoStruxure IT
  • EcoStruxure Geo SCADA Expert
  • Metering & Power Quality
  • Schneider Electric Wiser

Knowledge Center

Events & webinars

Ideas

Blogs

Get Started

  • Ask the Community
  • Community Guidelines
  • Community User Guide
  • How-To & Best Practice
  • Experts Leaderboard
  • Contact Support
Brand-Logo
Subscribing is a smart move!
You can subscribe to this board after you log in or create your free account.
Forum-Icon

Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.

Register today for FREE

Register Now

Already have an account? Login

Terms & Conditions Privacy Notice Change your Cookie Settings © 2025 Schneider Electric

This is a heading

With achievable small steps, users progress and continually feel satisfaction in task accomplishment.

Usetiful Onboarding Checklist remembers the progress of every user, allowing them to take bite-sized journeys and continue where they left.

of