Forum Home › Forums › Understanding the Software › Change Led colour
Tagged: formula
- This topic has 9 replies, 3 voices, and was last updated 6 years, 11 months ago by
jeff.
-
AuthorPosts
-
December 7, 2018 at 1:28 am #4710
jeff
ParticipantHi,
I want to change the led colour according to the conditions.
1. if (Val(1007) = Val(1015))
{Led Green;}
else
{Red}
2. if (Val(1001)=Val(1002) && Val(1007)=Val(1015))
{Led Green;}
else if (Val(1001)=Val(1002) && Val(1007)!=Val(1015))
{led yellow;)
else if (Val(1001)!=Val(1002) && Val(1007)=Val(1015))
{led yellow;)
else if (Val(1001)!=Val(1002) && Val(1007)!=Val(1015))
{led red;)May I know how to do it in Rapid Scada.
Thank you.
Jeff
December 7, 2018 at 1:08 pm #4714
MikhailModeratorHi,
Create a new input channel of calculated type which uses a formula to calculate a number of color. Then use this channel in a scheme component to switch led color.December 8, 2018 at 5:21 pm #4716Muhd Afham
ParticipantHi,
How to create a led condition based on value from different channel. As example, if the value channel 1 is less than value in channel 2, led turn to red. if the value in channel 1 and channel 2 is equal, the led turn to green.It is possible to do it using Rapid Scada?
Thank you.
December 9, 2018 at 2:46 pm #4724
MikhailModeratorHi,
It is possible to do it using Rapid Scada?
Yes, you should create an extra input channel of the calculated type and use a forumula. For example: Val(1) < Val(2) ? 0 : 1
December 20, 2018 at 9:08 am #4757jeff
ParticipantHi,
Can you explain how the formula work as you shown in (example: Val(1) < Val(2) ? 0 : 1)?
How to set condition in rapid scada scheme for the led indicator regarding to the formula above?Thank you.
December 21, 2018 at 1:31 pm #4760
MikhailModeratorVal(n) is described here.
Expression a ? b : c is usual for C++/C# and means if a then return b else return c
December 21, 2018 at 1:32 pm #4761
MikhailModeratorHow to set condition in rapid scada scheme for the led indicator regarding to the formula above?
You need to create an new exrta channel in Administrator and bind a led to the new channel.
December 28, 2018 at 9:55 am #4792jeff
ParticipantSorry for late reply and thanks for your explanation. I get it and it works. Thank you.
Can I do it for 2 conditions?December 28, 2018 at 12:57 pm #4794
MikhailModeratorCan I do it for 2 conditions?
Yes.
a ? b ? c : d : eI forget how the above works ))
December 31, 2018 at 1:40 am #4799jeff
ParticipantThank you very much.
Hopes it work. Thanks again. -
AuthorPosts
- You must be logged in to reply to this topic.