Multi state expression

I’m trying to bind my multi state display state to an indirect tag with a property reference.
This is what I think I am trying to accomplish:

if ({Root Container.MotorID}/FAULT = 1, 2,
if ({Root Container.MotorID}/RUNNING} = 1, 1, 0))

The button needs 3 states, OFF, RUNNING, and FAULT
It doesn’t seem to like the nested paths, but I’m not sure how else to do this besides multiple SQL tag writes and reads.
Any ideas?

I think the BinEnc or BinEnum expression functions might make your life easier than using nested IF statements. It might be simpler to evaluate the indirect expressions separately on custom properties then run them through your function(s).

Thanks Nathan, while this does seem like a great way to do what I want to do, Using expression binding is giving me nested path errors when I use the following:

binEnum({{Root Container.MotorID}/RUNNING},{{Root Container.MotorID}/FAULT})

What should I do?

Do they work independently? If so, maybe a separate property for each “bit” may be in order.

OK I got around this by making template custom properties and indirectly binding those … Now I can use this

1 Like