Change Text of dynamic text element by fomular

Forum Home Forums Understanding the Software Using Formulas Change Text of dynamic text element by fomular

Tagged: 

This topic contains 14 replies, has 4 voices, and was last updated by Mikhail Mikhail 7 months, 2 weeks ago.

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #1874

    qiuqiaoan
    Participant

    Is it possible to dynamically change the text of dynamic text element based on values on several different channels.
    for example:
    i have discrete input 1, 2 and 3
    when 1=true and 2=false and 3=false
    display “Opened”
    when 1=false and 2=true and 3=false
    display “Closed”
    etc…

    • This topic was modified 2 years ago by  qiuqiaoan.
    #1876
    Mikhail
    Mikhail
    Moderator

    Yes.
    1. Create a new input channel number 4 (number must be greater than existings) of type Calculated discrete.
    2. Create a record in Units table for “Opened and Closed”. See No-Yes as an example.
    3. Set Formula field for the new input channel. Something like

    Val(1)>0 && Val(2)<=0 && Val(3)<=0 ? 1 : 0
    

    4. Set Unit field for the new input channel to your unit that you just created.
    5. Set Format field to Text.

    #1877

    qiuqiaoan
    Participant

    Dear Mikhail,
    Thanks for the quick reply. i tested it according to your way and works good.
    but, actually in my case i have 4 inputs called Opened, Closed, Opening, and Closing. and I need to display this status by one text.
    so the fake code could be like:

    if ((Opened) && (!Closed) && (!Openning) && (!Closing))
    	{
    		return "Opened";
    	}
    else if((!Opened) && (Closed) && (!Openning) && (!Closing))
    	{
    		return "Closed";
    	}
    else if((!Opened) && (!Closed) && (Openning) && (!Closing))
    	{
    		return "Openning";
    	}	
    else if((!Opened) && (!Closed) && (!Openning) && (Closing))
    	{	
    		return "Closing";
    	}
    else 
    	{
    		return "Error";
    	}

    and i have several same equipment, so i want to reuse the code (folumar).
    i see alarm;Armed;Disamed:Fired;Normal in the Units table which maybe is similar to my case, but i don’t know how to do.

    IN GENERAL, IN MY SYSTEM I WILL NEED TO DO SOME LOGICAL AND MATH CALCULATION BASED ON DIGITAL AND ANALOG INPUTS AND SEND OUT COMMAND BASED ON THE CALCULATION. DO WE HAVE SOME GUIDE ON HOW TO THIS ?

    Thanks in advance !

    #1878
    Mikhail
    Mikhail
    Moderator

    Hi,

    See this guide page 6. I hope we will create new documentation system soon.
    You can create formulas in Formulas table for reusing, and you can define any number of strings, not only Opened and Closed.

    #1879
    Mikhail
    Mikhail
    Moderator

    For example, -; Alarm; Armed; Disarmed; Fired; Normal
    – equals 0,
    Alarm equals 1,
    Armed equals 2,
    etc.

    #2955

    mitesh
    Participant

    Hello,

    I have 10 input channels and i want to change the text color of channel 1 to 9 data when the value of channel 1 to 9 is equal to or greater than the data of channel-10.

    Example: Channel-1 channel-10 alert

    value –> 620 800 no need to change the color of the text
    value –> 850 800 change the color of text

    #2956
    Mikhail
    Mikhail
    Moderator

    Hi,
    Formula example for channel 1:
    Cnl; Cnl < Val(10) ? 12 : 14 12 and 14 are the existing statuses. If channel 1 has "calculated" type, use Val() instead of Cnl

    #2958

    mitesh
    Participant

    Hi Mikhail,

    I got change of text color in events but i didn’t got on Dashboard Dynamic Text. I want to change the dynamic text color of channel 1 when the value of channel 1 goes high or equal to channel 10.

    If channel 1 dynamic text color is Blue, if it is greater than or equal to channel 10, i want channel 1 dynamic text color change to red.

    with the above solution i get color change in events.

    #2960
    Mikhail
    Mikhail
    Moderator

    Hi,
    Do you mean fore color of dynamic text component of a scheme?

    #2965

    mitesh
    Participant

    Hi Mikmail,

    Yes i want change the fore color of dynamic text

    #2966

    mitesh
    Participant

    Hi Mikhail,

    Any solution for changing the fore color of dynamic text for channel 1-9 compaing the value with channel 10 if it cross above the value of channel 10.

    #2969
    Mikhail
    Mikhail
    Moderator

    Hi,
    Change the fore color to “Status”. The color of the component will reflect channel status.

    #3817

    jacklondon
    Participant

    Hi Mikhail,

    i am stuck with one formula and was searching for a tutorial (even it’s outdated ;-). I saw the link http://rapidscada.org/download/scada_guide_3_en.pdf. But it isn’t available at the moment. Could you please upload it again?

    Regards

    #3823

    jacklondon
    Participant

    OK, got it from the internet, same content ­čÖü

    #3824
    Mikhail
    Mikhail
    Moderator

    All content of scada_guide_3_en.pdf was moved to http://doc.rapidscada.net/content/en/

    Just ask here about formulas.

Viewing 15 posts - 1 through 15 (of 15 total)

You must be logged in to reply to this topic.