Forum Home › Forums › Understanding the Software › Using Formulas › Change Text of dynamic text element by fomular
Tagged: Fomular
- This topic has 14 replies, 4 voices, and was last updated 5 years, 10 months ago by Mikhail.
-
AuthorPosts
-
January 11, 2017 at 3:32 pm #1874qiuqiaoanParticipant
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 7 years, 3 months ago by qiuqiaoan.
January 11, 2017 at 6:03 pm #1876MikhailModeratorYes.
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 likeVal(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.January 12, 2017 at 10:35 am #1877qiuqiaoanParticipantDear 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 !
January 12, 2017 at 1:39 pm #1878MikhailModeratorHi,
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.January 12, 2017 at 1:40 pm #1879MikhailModeratorFor example, -; Alarm; Armed; Disarmed; Fired; Normal
– equals 0,
Alarm equals 1,
Armed equals 2,
etc.December 15, 2017 at 5:57 am #2955miteshParticipantHello,
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 textDecember 15, 2017 at 11:52 am #2956MikhailModeratorHi,
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 CnlDecember 15, 2017 at 1:35 pm #2958miteshParticipantHi 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.
December 17, 2017 at 3:31 pm #2960MikhailModeratorHi,
Do you mean fore color of dynamic text component of a scheme?December 17, 2017 at 5:56 pm #2965miteshParticipantHi Mikmail,
Yes i want change the fore color of dynamic text
December 18, 2017 at 8:56 am #2966miteshParticipantHi 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.
December 18, 2017 at 11:23 am #2969MikhailModeratorHi,
Change the fore color to “Status”. The color of the component will reflect channel status.June 9, 2018 at 12:30 pm #3817jacklondonParticipantHi 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
June 9, 2018 at 4:33 pm #3823jacklondonParticipantOK, got it from the internet, same content 🙁
June 10, 2018 at 11:01 am #3824MikhailModeratorAll content of scada_guide_3_en.pdf was moved to http://doc.rapidscada.net/content/en/
Just ask here about formulas.
-
AuthorPosts
- You must be logged in to reply to this topic.