Showing results 1 to 5 of 5

Thread: How to add limit value to variable by Editor wizard?

  1. #1
    Join Date
    01.02.2016
    Posts
    27

    Default How to add limit value to variable by Editor wizard?

    Hi all.
    I would like to make internal bool variable with Limit Value[1] and Limit Value [2] activated and with limit value text.
    How to add Limit value text to variable limit?
    I have add-in Editor wizard for creating variables, but I'm not sure how to set limit values and texts?

    Thanks in advance,
    MK

  2. #2
    Join Date
    03.11.2015
    Posts
    24

    Default Re: How to add limit value to variable by Editor wizard?

    Hi,

    the variable has a LimitValueCollection. Create a new LimitValue, set the text and add it to the collection.

    BR

     

  3. #3
    Join Date
    01.02.2016
    Posts
    27

    Default Re: How to add limit value to variable by Editor wizard?

    Quote Originally Posted by c.f. View Post
    Hi,

    the variable has a LimitValueCollection. Create a new LimitValue, set the text and add it to the collection.

    BR

    Thanks a lot.
    But which method to use for creating limit value, and set text?

    pseudo code:
    IVariable var = prj.VariableCollection.Create(name, drv, ChannelType.SystemDriverVariable, tip);
    if (var != null) // varijabla nije postojala i kreirana je uspešno
    {
    var.Identification = "identification text";
    ILimitValueCollection limitCollection = var.LimitValueCollection;
    // ??? how to add limit text
    }

  4. #4
    Join Date
    01.02.2016
    Posts
    27

    Default Re: How to add limit value to variable by Editor wizard?

    Quote Originally Posted by milosh View Post
    Thanks a lot.

    But which method to use for creating limit value, and set text?



    pseudo code:

    IVariable var = prj.VariableCollection.Create(name, drv, ChannelType.SystemDriverVariable, tip);

    if (var != null) // varijabla nije postojala i kreirana je uspešno

    {

    var.Identification = "identification text";

    ILimitValueCollection limitCollection = var.LimitValueCollection;

    // ??? how to add limit text

    }


    I found solution:

    var.GetEditorLimitValue(1).Text = limitText; // limit 1
    var.GetEditorLimitValue(1).IsInAlarmMessageList = true;
    var.GetEditorLimitValue(1).IsToAcknowledge = true;

  5. #5
    Join Date
    01.02.2016
    Posts
    27

    Default Re: How to add limit value to variable by Editor wizard?

    Quote Originally Posted by milosh View Post




    I found solution:

    var.GetEditorLimitValue(1).Text = limitText; // limit 1
    var.GetEditorLimitValue(1).IsInAlarmMessageList = true;
    var.GetEditorLimitValue(1).IsToAcknowledge = true;

    There is also one interesting thing...
    If you try to put limit color
    var.GetEditorLimitValue(1).Color= Color.Red;
    In editor it set as Automatic (black)

    If you put:
    var.GetEditorLimitValue(1).Color= 16711680; // color Red in hex #ff0000, converted to int
    In editor it is Blue.

    But when you put
    var.GetEditorLimitValue(1).Color= 255; // hex for Blue #0000ff
    In editor it is red

    Maybe you have some good idea how to set limit value color?

    Here is situation like in Java...0-7 bits red, 8-15 bits green, 16-23 bits blue component...
    Last edited by milosh : 31st January 2021 at 20:54

Similar Threads

  1. Wizard im Zenon Editor automatisch starten
    By a_werner in forum Add-In Framework
    Replies: 18
    Last Post: 18th December 2020, 11:27
  2. Rename variable based on structure datatype in editor wizard
    By bartsmets in forum Add-In Framework
    Replies: 1
    Last Post: 23rd December 2019, 13:38
  3. Replies: 2
    Last Post: 16th August 2012, 14:19
  4. Why Dynamic Limit Text allows only 1 variable?
    By batabaha in forum zenon Supervisor
    Replies: 2
    Last Post: 1st May 2012, 23:51
  5. Limit Text - Display ID or Name of variable
    By craigdouglas in forum zenon Supervisor
    Replies: 5
    Last Post: 9th December 2008, 15: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
  •