Enumerations are a list of items in a collection, or elements within a set. They represent a set of choices, or a set of options, for the state that something exists in. For example, when creating a Motor, one would first want to assert what kind of motor is being created based on a list of of motors: DC - Series, DC - Shunt, AC 1-Phase Induction, AC 3-Phase Induction, AC 1-Phase Synchronous, AC 3-Phase Synchronous. A motor is only one of these. Enumerations are used to supply a specific, limited list of states or conditions that a thing can assume.
In manufacturing, examples of enumeration usage could be the Running State that a piece of equipment can be in: Running, Idle, Stopped, Off, or the state a valve is in: Opening, Open, Closing, Closed. That is the human-readable state of the item: PLCs and other software often return a state as a number: 0,1,2,3. Enumerations in ThinkIQ allow the platform to transform the state to a human-readable form.
Enumerations provide tremendous flexibility for defining a thing, and in ThinkIQ, end users can create their own enumerations.
A specific enumeration can be shared among instances of equipment. Taking Running State, above: once it is defined as a Type it can be added as an attribute to any equipment that shares some or all of the states: Running, Idle, Stopped, Off. The actual code that matches the running state can be edited for each piece of equipment. If a particular state doesn't exist for an equipment instance - say, Idle does not exist - you can assign the next number in the series to that item as it will never be returned from the data source, and it will simply be ignored.
Create an Enumeration Type
Enumeration Types are created and maintained under the More - Enumeration Types tab in the Model Explorer.
Click the plus button at the top right to Add Enumeration Type. Highlight a row and double click to Edit Enumeration Type.
Create an Enumeration Type
- Give the Enumeration Type a name
- Provide a description (optional)
- Add Enumeration Details
- Enumeration Names are human readable descriptions of the 'state' or 'condition'
- Descriptions can help when selecting the correct Enumeration when creating an instance.
- Enumeration Default Values are defaults expected: they can be changed when the type is added to an instance. This is usually a numeric.
- Color is optional. Click the color box to open a Color Picker. Color will display in different areas of the Platform
- Use the plus icon to add another Enumeration option.
- Drag items to reorder the list using the icons under the Order column.
- Delete items using the trash can icon.
- Local Library is the default location for a new enumeration. This can be changed.
- While building your model, it can be useful to track status.
Add an Enumeration to an Instance
In the Model Explorer, select the instance to which you want to Add an enumeration. Open the Attributes Grid for the instance to see a list of current attributes. Use the plus icon on the top left of the grid to Add an enumeration. Enumerations that you add must come from pre-existing Enumeration Types.
Add an Enumeration Attribute to an Instance
- Give the attribute a name
- Provide a description (optional)
- Select Enumeration from the Data Type drop down list.
- Click the list picker icon to browse for and select the Enumeration Type
- You can search for the Enumeration by Display Name
- Highlight your choice and click Select to insert the Enumeration Type into the attribute
- The Data Storage for the Enumeration can be
- Time Series - in which case you will choose a Data Source and Interpolation Method:
- Tag, (Choose from the Tag List)
- Internal (from a script) or
- Expression (for which you write the expression)
- Static - in which you select a Config Value from the Type's pre-configured list
- Time Series - in which case you will choose a Data Source and Interpolation Method:
Add an Enumeration to a Type
When adding an enumeration attribute to a Type, if the Data Storage method is Time Series, there are only two data sources: Dynamic - the data will come from a tag or be internally updated by script, or Expression. Determining which of these to apply will occur at the instance level.