Value Map (BValueMapBlock)

This block represents a map of key value pairs, which define substitution values where you configure the data type (Numeric, String, Boolean, Enum or Other) for both the key and value objects. There are frozen properties associated with the default key value pair and dynamic BValueMapEntry properties for any user defined objects. This block supports both trend and value requests, and retains the timestamp and status of input values.

The Value Map View (default view) on this block displays the current map and allows adding, editing, duplicating, deleting and reordering dynamic objects in the map. For requests where the In value does not match the Key property of any of the map entries, the Unmapped Mode property configures what, if any, value is returned.

Figure 179.   Value Map view
Image

Columns

Column Description
Key Displays the data type for the key: Numeric, String, Boolean, Enum, or Other.
Value Displays the data type for the value: Numeric, String, Boolean, Enum, or Other

Figure 180.   Value Map properties
Image

The default key facets and default value facets in this screen capture have been changed from the defaults, and there are entry and entry1 dynamic properties that correspond to the Value Map View above.

To view these properties, double-click the block on the Wire Sheet or the block name in the Nav tree.

Property Value Description
Out read-only value slot Outputs a mapped value by evaluating the In value against the entryX items in the map.
In required value slot Links from the output of other logic blocks or data sources to supply trend data to the current logic block.
Unmapped Mode drop-down list

Configures the behavior when the In value does not match the Key property of any entryX item in the map.

Pass Through uses the value of the data source.

Use Default uses the value from the Default Entry in the map.

Filter Out for a value request returns the data source value with a null status. For a trend request, excludes the record from the result.

Default Key Facets BFacets (defaults to blank range and precision = 2) Applies facets to the key property for any user defined map entry. The actual facets for each map entry key may be customized.
Default Value Facets BFacets (defaults to blank range and precision = 2) Applies facets to the value property for any user defined map entry. The actual facets for each map entry value may be customized.
Default Entry Frozen property (defaults to key type String, key = “Default”, value type Numeric, value = 0.00) Defines the value to use when Unmapped Mode is set to Use Default and the In value being evaluated does not match any of the entryX property keys.

You cannot delete this property value. The Key must remain “Default”, but you can edit the Value (property and type) and the Value Facets as needed.

entryX where X is a sequential number for each user defined map entry Value Map Entry Sets up dynamic user defined map entries. When creating a new entry, the Default Key Facets property sets the Key Facets and Value Facets. You may customize these facets.

The block evaluates the In value against the Key property for each entryX item in the map to determine if the In value matches the block outputs of the Value property from the entryX item with the matching key.

Example

Consider a BEnumWritable point with an Enum Range as shown in the capture, and a:a and b:HtgClgMode marker tags applied.

Figure 181.   Mode property configured on an Enum Writable point
Image

To determine a setpoint for some fault detection logic, you could use an algorithm with a Value Map Block based on the value of the Mode point.

Figure 182.   Value Map Block algorithm
Image

You use the Value Map View to configure the object type and value for the default map entry.

Figure 183.   Edit Variable window
Image

Clicking the gear icon on the right side of the Value property opens a Select Type field editor for configuring the object type (Numeric, String, Boolean, Enum or Other). Selecting the type makes it possible to configure the object’s value.

The Value Map View has controls at the bottom of the view to edit, duplicate, add, delete and reorder map entries.

Figure 184.   Add Entry window
Image

To create a new map entry, click the Add button, then specify the desired object type for both the Key and Value. In this case, the data source is b:HtgClgMode, which is an Enum Writable point. The Key type should be Enum. The desired value is a number, so the Value type should be Numeric.

The framework creates the map entry with default values for the configured types.

Figure 185.   Edit Variable window
Image

To launch the Edit Variable window for configuring Key and Value object type, facets and values, double click the map entry or select the map entry and click the Edit button.

Typically, the Key facets should match the point facets for the data source. In this case, the facets are purposefully set without the ordinal = 2 and tag = Econ items in the range.

The Mode point’s value is currently ordinal = 0 and tag = Heat. A numeric point with an analytic proxy extension named ModeStpt generates an analytic value request for the alg:ValueMap.

Figure 186.   ModeStpt configuration
Image

Since the Enum tag value is Heat, the Value Map Block returns the numeric value of 70.0 from the matching key value pair in the map.

You can configure the Value Map Block’s Unmapped Mode property as either Pass Through, Use Default or Filter Out. When the data source value does not match any of the keys in the map, the block uses the value of the Unmapped Mode property to determine what value to return.

The following table summarizes the result for each request type based on the value of Mode.

Mode results

Mode Condition Value Request Trend Request
Pass Through Value does not match any key The value of the data source The value of the data source
Use Default Value does not match any key The value from the default key in the map The value from the default key in the map
Filter Out Value does not match any key a BValue with a null status Excluded from the result

A trend request used with an Analytic Chart or Table returns results for each timestamp.

Figure 187.   Value Map Block chart
Image