08.11.11.XX (SS6)
In OpenPlant Modeler, requirement is to include a property whose value can or can’t be null in equipment tag name.
In OpenPlant Modeler, requirement is to generate tag name for equipment with or without null value to desired property. For example, equipment has tag name format like Device Type Code-Unit-Number-Suffix. In this case equipment can contain some input value to Suffix property or can be null. In either cases, equipment tag name should generate properly. Below wiki article explain the workflow to achieve such requirement in OpenPlant Modeler.
Using IIF statement, desired result can be achieved.
Format: IIF (IsNull(this.SUFFIX), expression1,exression2)
Using nested IIF, desired result can be achieved
Format: IIF (IsNull(Property1), Expression1, IIF (IsNull(Property2), Expression2, Expression3))
In this case two properties are null, suffix & stock number. Use below expression to generate desired tag name.
ECExpression: IIF (IsNull(this.SUFFIX), this.DEVICE_TYPE_CODE & this.UNIT & this.NUMBER , IIF(IsNull(this.STOCK_NUMBER),this.DEVICE_TYPE_CODE & this.UNIT & this.NUMBER, this.DEVICE_TYPE_CODE & this.UNIT & this.NUMBER & this.SUFFIX & this.STOCK_NUMBER))
Save all the changes & verify result in OpenPlant Modeler.
Equipment Tag name when suffix has valueEquipment Tag name when suffix is null