Syntax error on Expression Editor
i am using the following code.
if $'OUT/SIG' = True then
OnColor
else
Red elseif $'OUT/SIG' = True then OnColor else Red
it give me syntax error how can i give three different color to a single static object
can you suggest me any guide or where i can find proper help for this
BR
Answers
I'm out of office and unable to test/verify, but I'd use something similar to this:
if ExprA then
ColorA
else
if ExprB then
ColorB
else
ColorC
For your reference, find and open the AlarmControl graphic aspect and study how it decodes AlarmState into many different apperances. It uses a multistaged construction of if-statements.
/S
Hi,
You can refer the help tool. The syntax for if else statement is
if <Condition 1> then
OnColor
else if <Condition 2> then
OffColor
else
Red
Hello,
In your expression you are ending the condition by putting else in the first level itself & then you are making one more expression so.
if 'OUT/SIG' is bool type then expression will be:
if $'OUT/SIG' = True then
OnColor
else
red
if 'OUT/SIG' is int/dint with upto 3 points(0 to 2) then:
if $'OUT/SIG' = 0 then
OnColor
else if $'OUT/SIG' = 1 then offColor else Red
Add new comment