Set ReleasedProperty via c# doesn't update in the runtime after compilation
Hello everyone,
I have created a C# Addin Wizard for the Engineering Studio to create a SmartObject via a json configuration file. The addin first creates the smart object and then updates all the released properties of each symbol to have updated symbols for drag and drop. Everything seems to work in the editor, the alarm zone, the group, the variables and the texts are modified according to the configuration file. However, after compiling the project and taking the runtime, the properties are not updated correctly. Therefore, I have to go to each property field released in the engineering studio and press Enter to save the change which then works.
Is this normal behavior or a known bug in the com library / translation layer? Here is a sample of the code I have made:
internal void SetReleasedProperty<TValue>(string name, TValue value)
{
ISoReleasedProperty property = GetReleasedProperty(name);
if (property != null)
{
property.SetValue(value);
Debug.WriteLine($"--->Set:{property.Name}={property.Value}");
}
else
{
Debug.WriteLine($"ReleasedProperty: {name} doesn't exist");
}
}
protected ISoReleasedProperty GetReleasedProperty(string name)
{
return SmartObject.ReleasedPropertyCollection.Where(x => x.Name == name).FirstOrDefault();
}
Disclaimer
This document governs the use of our Community Forum. By registering and using the platform, you accept these conditions.
The COPA-DATA Community Forum serves to encourage the exchange of information and experience about the zenon software between forum users respectively zenon users.
Please mind that any published information on the Community Forum is the subjective opinion and view based on the experience and the level of knowledge of the author. COPA-DATA does not overtake any responsibility for the content and the accuracy of the shared information.
Users of the Community Forum are encouraged to share only well-founded experiences and to point out any risks associated with the implementation of proposed solutions to problems. COPA-DATA at its absolute discretion, reserves the right to moderate the forum. In this connection COPA-DATA may remove any information containing false facts, potentially dangerous solutions, bad language or content that may insult, degrade or discriminate others. COPA-DATA may block a non-complying user from forum access if the user violated this provision.
COPA-DATA reserves the right to change this document from time to time at own discretion.
Ing. Punzenberger COPA-DATA GmbH
Karolingerstraße 7b · 5020 Salzburg · Austria
www.copadata.com