It’s definitely null and not an empty string. The way I first discovered this was that I have a UDT which has three parameters:
Device Name
PLC Tag
PID Tag
I use Device Name and PLC Tag to build the OPC path, and PID tag is just the PID tag of the device for documentation purposes, e.g. TT1001.
Then, I have an expression tag in the UDT called PIDTag
. The expression was originally:
if({PID Tag} = "", {PLC Tag}, {PID Tag})
…basically, if a PID tag is specified when the instance is created, use the specified PID tag. If no PID tag is specified, use the PLC tag as the PID tag, because 99% of the time, the PLC tag will actually be the PID tag, so I can save 7 seconds of typing by making that the default assumption.
But, it didn’t work, because the PID Tag parameter was not “” (i.e. blank), it was null. So, I changed my expression:
if({PID Tag} = "" || isNull({PID Tag}), {PLC Tag}, {PID Tag})
…but it still doesn’t work, and I’ve established that it’s because isNull is always returning false.
So my parameter is not “” (blank), and isNull()
refuses to acknowledge that it’s null, and I’m stuck.
My workaround is to go into all my UDT definitions, and in each parameter, insert a blank space, then come back and delete it. Now my parameters are “” (blank) and no longer null, so my original expression works. But it’s a hacky workaround and I hate not knowing why it doesn’t work.