Showing results 1 to 10 of 10

Thread: dynamic limits + invalid bit indication as text color

  1. #1

    Default dynamic limits + invalid bit indication as text color

    Hello!

    Our customer wants to indicate limit exceedings also as invalid value with different text colors of variable value (for examble - red as alarm, yellow as warning, white as invalid and green as normal). Also he wants to change alarm and warning limits in runtime.

    We tried to use different ways to satisfy this requirements but all they have limitations:
    1. Remas have no ability to change limits in runtime.
    2. Limits have no ability to indicate invalid values with text color.
    3. Combined Elements can indicate all we want but cannot show value of variable, only constant text, name or identification.

    Can you offer us way to satisfy all requirements listed above?

  2. #2

    Default Re: dynamic limits + invalid bit indication as text color

    We use 6.51 Build7

    btw, is there anywhere information about differences between builds?

  3. #3
    Join Date
    20.08.2009
    Posts
    293

    Default Re: dynamic limits + invalid bit indication as text color

    Hi,

    depending on your configuration/needs, there would be the possibilty to change the Rema limit(s) via VBA in the Runtime.

    I created a minimalistic demo project with a Rema and tested it successfully.

    Here is the Rema:

    Click image for larger version

Name:	rema.PNG
Views:	50
Size:	58.5 KB
ID:	819

    Here is the code to change the limit:

    Sub EditRemaLimit()
    
    Dim zrema As Remas
    Dim zrema As Rema
    
    Set zremas = thisProject.Remas
    
    'get the Rema with the name "rema"
    Set zrema = zremas.Item("rema")
    
    'set the limit of the first item to 10
    zrema.StateItem(1).ReaAlarm = 10
    
    End Sub

    For getting the properties to change (like .ReaAlarm), you can XML Export the Rema and check the file using a XML viewer like XMLNotepad.

    Click image for larger version

Name:	xml.PNG
Views:	36
Size:	74.9 KB
ID:	820

    Note that not all properties are changeable during the Runtime!

    Regards,
    Bernhard
    Last edited by bernhardf : 15th June 2012 at 09:46

  4. #4

    Default Re: dynamic limits + invalid bit indication as text color

    Yes, it works, thank you.
    But:
    1. In VBA documentation ReaAlarm property descripted as Read-only in runtime.
    2. Type of this property is Long in VBA and int in VSTA. Though i can set floating-point value to it in VBA, i cannot read it back (i can get only integer value). But property is setted - i can see it by behaviour of my limits.
    3. After project restart all information in remas will be set by default so i need some logic to cache it on my harddisk.
    Last edited by stolyarov_as : 18th June 2012 at 06:58

  5. #5
    Join Date
    20.08.2009
    Posts
    293

    Default Re: dynamic limits + invalid bit indication as text color

    Quote Originally Posted by stolyarov_as View Post
    Yes, it works, thank you.
    But:
    1. In VBA documentation ReaAlarm property descripted as Read-only in runtime.
    2. Type of this property is Long in VBA and int in VSTA. Though i can set floating-point value to it in VBA, i cannot read it back (i can get only integer value). But property is setted - i can see it by behaviour of my limits.
    3. After project restart all information in remas will be set by default so i need some logic to cache it on my harddisk.
    1: I will forward that to our documentation dept.
    2: I will check this.
    3: This is correct, you need to do some own coding/configuration to have this data remanent/persistent.

    Regards,
    Bernhard

  6. #6

    Default Re: dynamic limits + invalid bit indication as text color

    Another question.

    We use additional internal variables to store user rema setpoints. DDE active flags are checked. All variables are network and remanent.
    We want to restore user setpoint on project reload, so we just add vba function call from AUTOSTART script. This vba function get internal variables values and try to update rema setpoint according this values.
    Problem is, when AUTOSTART script running there are no remanent value yet, we just get vba exception when we try to get value.

    Is there any event, raised in scada after reload when all remanent values are updated?

    (of course, we can use some timer and check variables again and again, but this would be not beautiful solution)

  7. #7

    Default Re: dynamic limits + invalid bit indication as text color

    Hello again.

    May be my previous question was too complex.
    I will try to ask it as simplest as possible:

    I set new values in ReaAlarm in VBA (and VSTA) as early as possible - in Project_Startup event handlers.
    But after runtime start I have in Alarm messages list new alarm message, that corresponding edit-time ReaAlarm value, also as colouring of Numerical Value is corresponding with edit-time values of setpoints.
    This message is about 0.5 sec earlier then programmable generated message from Project_startup event.

    Is there any ability to prevent messages in AML and to set right coloring of Numerical Value on project startup while user setpoints are updated by the descripted above way?

  8. #8
    Join Date
    30.05.2007
    Location
    Salzburg
    Posts
    879

    Default AW: dynamic limits + invalid bit indication as text color

    3. Combined Elements can indicate all we want but cannot show value of variable, only constant text, name or identification.
    you can use the Combined element together i.e. with a "Numerical Value" element(showing the variable value) and put them together into a symbol.

    Regards,
    Herbert

  9. #9

    Default Re: dynamic limits + invalid bit indication as text color

    Herberto, thank you for reply.

    Your idea is very beatiful. But i cannot get object-orientired application of it.

    I use 6.51 SP0 Build7

    I have symbol, which containts comby-element with 2 state subsymbols - dynamic texts, one is visible when INVALID bit is 1, second - in all other cases.

    Main problem is that substitutions in comby-element subsymbols (this 2 dynamic text) is not working. No matters, what substitution rules i set to result symbol placed on screen i get same attachments in sybsymbols as they was while editing symbol...

    For example, comby-element has variable attachment to INT.TI variable.
    Dynamic text subelements both have variable attachments to INT.TI variable too.
    In screen I use substitution INT.TI => INT.TI.f to see value of INT.TI.f
    but symbol shows me values of INT.TI variables.

    If i use subsymbol substitution INT.TI => INI.TI.f inside comby-element states, i can see on screen values of INT.TI.f variable. But if I try to use this symbol to show, for example, INT.TI.Ua value with symbol substitution INT.TI => INT.TI.Ua, symbol still shows me values of INT.TI.f...

    So now as I can see we should create N library symbols for N variables.

    Or may be I did something wrong?

  10. #10

    Default Re: dynamic limits + invalid bit indication as text color

    Please look into attachment for illustrating project for my message above.
    Attached Files Attached Files

Similar Threads

  1. Why Dynamic Limit Text allows only 1 variable?
    By batabaha in forum zenon Supervisor
    Replies: 2
    Last Post: 1st May 2012, 23:51
  2. Invalid time stamp
    By jaroslav_kral in forum zenon Supervisor
    Replies: 2
    Last Post: 27th February 2012, 12:49
  3. how to change text and color of invisible button
    By tanveerali in forum zenon Supervisor
    Replies: 1
    Last Post: 14th February 2011, 00:09
  4. Dynamic color ir Button
    By softart2 in forum zenon Supervisor
    Replies: 1
    Last Post: 13th September 2010, 11:50
  5. CEL- text color
    By hoscillada in forum zenon Supervisor
    Replies: 1
    Last Post: 21st December 2009, 11:38

Posting Rules

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