BinEnc function help

Well, not conflicting, per se. One is used in expressions and the other is used for scripts. Treat them as separate entities. :slight_smile:

[quote="AndyP"]
We are trying to find a way to NOT the value - i.e., if it's true, we need false and vice versa.

Easy to do on it's own, but I can't find a way to do this when using a variable substitution. For example, is there anyway to do something like this: (I know it's wrong as it's returning a value, but I'm just illustrating what I need, ie a substitution to happen first, then applying the NOT to the value)

!{Chidd_plc/{1}/Unavailable}

Essentially, I need to display various options if the pump is available, and the PLC reports on unavailability rather than availability, thus the need to negate. We have worked around it for now by negating in the tag itself, but I'm wondering if there is a way to do this with expressions?[/quote]
That's what the castings are there for. Even if it's for boolean operations:

!toBoolean(tag("Child_plc/"+{SomeDynamicName}+"/Unavailable"))

Alternatively, you can also use custom properties to get you desired effect. As an example, I create multistate button/indicators to use in manual functions for an assembly machine, usually a cylinder and associated switches. Each is a standard button with three custom properties added: Input, Output, and State. Input and Output are bound to tags. State has the expression:

{Root Container.Button.Input}+{Root Container.Button.Output}*2

State is then used to drive the Style Customizer. So now I can also use the button to verify I/O-- is the valve being called? is a sensor being made, or stuck on/off? etc.

This method has the advantage of not having to worry about casting. It also breaks things down into nice bite-sized chunks if you have to go back later and figure out what you did. Not that it's ever happened to me... :unamused:

Here's an example button to illustrate.
ButtonExample_2014-08-26_1317.proj (7.11 KB)