Property binding not working

hi,

In Perspective,

I’m trying to enable a button with 2 conditions and wrote an expression that works directly with the PLC tags:

{[PLC]Valves/Valve1/Manual_Mode.value} & {[PLC]Valves/Valve1/Manual_Interlock.value}

But when I insert a property binding in the tags, it’s not accepted.

{[PLC]Valves/{view.params.valve_tag}/Manual_Mode.value} & {[PLC]Valves/{view.params.valve_tag}/Manual_Interlock.value}

I can’t figure out what I’m doing wrong

When the tag path is dynamic you have to first build the string path and pass it into tag() function.

A better approach would be to have custom parameters for each tag, and do an indirect tag binding using your view parameter to store the value in them. Then, use these custom parameters in your expression binding of the button.

It's a trap!

Don't use the tag() expression function in user interfaces--it causes problems. (The only valid uses are in expression tags, not user interface bindings.)

The right answer is to make two custom properties for the two PLC tags, and include the property reference in their indirect tag bindings. Then use the custom properties in the final expression.

3 Likes