Showing results 1 to 7 of 7

Thread: assign variables in structured data type

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    09.04.2015
    Posts
    17

    Default 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:
    Code:
    // 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.
    Attached Thumbnails Attached Thumbnails Screenshot.png  
    Last edited by genakust : 7th October 2020 at 13:21

Similar Threads

  1. Structured data type composite of several variables and types
    By RaphaelVogt in forum Engineering Studio & Service Engine (former zenon Editor & Runtime)
    Replies: 2
    Last Post: 4th February 2020, 08:13
  2. Extended Trend with Structured Variables in Screen Substitution
    By nxen in forum Engineering Studio & Service Engine (former zenon Editor & Runtime)
    Replies: 0
    Last Post: 27th February 2018, 09:36
  3. Nested Structured Data Type in Combi Element
    By ansab.tp in forum Engineering Studio & Service Engine (former zenon Editor & Runtime)
    Replies: 2
    Last Post: 21st March 2012, 07:38
  4. Replies: 6
    Last Post: 17th November 2011, 00:05
  5. Nested structured Data types
    By bsneddon in forum Drivers
    Replies: 5
    Last Post: 3rd April 2011, 23:23

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •