assign variables in structured data type
Hello, I am trying to write a new value into a structured (an array )variable with C # that already exists in Zenon and has a user-defined data type.
I do following:
// create variable with var. name from Zenon
const string PV_Anlagen = "PV-Anlagen";
...
//Create a new container
_container = context.OnlineVariableContainerCollection.Create(_containerName);
//Create list of variables
List variablesList = new List();
// add variable to var. list
variablesList.Add(PV_Anlagen);
// add to container
if (!_container.AddVariable(variablesList.ToArray()))
{
Debug.Print("List of variables could not be added to the container");
return;
}
I have following questions:
1. the addition ( _container.AddVariable(VariableName) ) of pv-anlagen-variable fails. How can I make this variable known in the project?
2. How can I access the following part: for example PV-Anlagen[2].Bezeichnung?
Thank you in advance for your support.
This is a migrated post! Originally posted on 07.10.2020 by user genakust. Please be aware that information can be outdated.