I have a setup where the customer wants to be able to plug in setpoint values to dynamically change values that trigger alarms. They also want to animate things on the screen based on these alarm conditions.
I made a UDT that looks like this:
“Actual” is bound to the live PLC value.
“HighSP”, “LowSP” and “Compliance Level” are adjustable setpoints which indirectly set alarm conditions.
“Low Alarm”, "High Alarm and “Compliance Alarm” are boolean flags that use expressions to be flagged if we are in their respective alarm condition. I’m doing Perspective transforms off these bits to change how the data point is styled based on alarm conditions.
All that said, the expressions that determine my bit states are sometimes (semi-inconsistent) requiring me to cast doubles to doubles before comparing them. If I don’t cast to double I am seeing some instances of my UDT throw expression errors while others do not. It’s weird.