Tag enabled binding expression error, error trying to coerce to number

Under a UDT, I have an OPC tag that I want to bind an expression to the “enabled” property. I’m getting and “trying to coerce to a number” error in the Gateway logs.

My expression is:

if({Drive_Channel} like “%_E”, 0, 1)

java.lang.ClassCastException: Error trying to coerce ‘if(wellname4_ste_s like “%_e”, 0, 1)’ to a number.

I’ve tried different syntax to try to get it to work, but unable to. I want to use “like” to match part of the string to be true or false. What am I doing wrong?

Tag properties (with the exception of certain alarm properties) can’t use expression bindings, only bindings to UDT parameters. The reason the editor is there is in case someone wants to make a parameter reference using an offset, such as {someparam+1}. The editor is confusing in that it uses syntax highlighting for expression functions, and we have an outstanding ticket in our system to revamp that editor page to make it more clear that expressions aren’t allowed.

Thanks, that explains why. Is there any ways to handle what I’m looking for? We have hundreds of sites and each one has either one of two particular device drivers installed. I would like to put both sets of tags in the UDT that passes down to all and have an expression somewhere that dynamically determines what tags get used (scanned or enabled/disabled). I don’t want to manually go through and disable these. We have a database set up that has a column of which device driver it has, which is what I was trying to reference.