Hi. I’m having some issues with an expression that I am writing for an expression tag within a UDT. I want the expression to run differently depending upon a property (deviceType) that is part of the UDT. I can’t seem to find why it won’t work. I keep getting an evaluation error on the tag. Any help is appreciated.
Here is the code:
switch(
{deviceType}, // value (string)
'HMI', //case 1
'PLC', //case 2
'Switch', //case 3
'SwitchCisco', //case 4
({[.]Ping_Status} = '1'), //return for HMI
({[.]OPC_Status} & ( {[.]Ping_Status} = '1')), //return for PLC
(({[.]OPC_Status} != 1) & ( {[.]Ping_Status} = '1')), //return for Switch
({[.]Ping_Status} = '1'), //return for SwitchCisco
False) //default
The Ping Status tag is a query tag within the UDT and the OPC Status tag is an OPC tag within the UDT