Skip to main content
sivasuryap0002
September 14, 2022
Question

Logic Gate

  • September 14, 2022
  • 5 replies
  • 0 views

I have added "XOR" Gate to my PM and in that i have added a condition like
"if(
totime(local(now(), "IST")) = cons!IT_TIME_CONSTANTS_FOR_VERSE,
true(),
false()
)

Where The constant holds time of 12:30 PM,
but even though that expression is true the Pm is returning false because of which XOR is failing.

Can anyone suggest what's wrong here

Thanks in advance,
SSP

5 replies

harshitb6843
September 14, 2022

It is because it is also considering seconds I guess. You might have to cast it in just the Hr and Min using text() function and then compare it. 

harshitb6843
September 14, 2022

Like this

text(totime(local(now(), "IST")),"hh:mm") = text(totime("12:58 PM"),"hh:mm")

sivasuryap0002
September 14, 2022

Hi Harshit,
But the values and type is same in the PV's ,
then how come comparison is failing?