Use this border node to access and modify a value in a map without copying the value out of the map. Use the border node on the left side of the structure to retrieve a value in a map. Use the border node on the right side of the structure to modify or discard the retrieved value.

To place this border node on the In Place Element structure, right-click the border of an In Place Element structure and select the Add Map Get / Replace Value option from the shortcut menu. Alternatively, you can use the In Place Map Access VI, which places an In Place Element structure on the block diagram with this border node added.


icon

Inputs/Outputs

  • cmap.png map

    map specifies the map in which you want to look for a key. This input accepts a map of any data type. The default data type is a map of 32-bit signed integers.

  • cstr.png key

    key specifies the key to look for in the map. The key must be of the same data type as the existing keys in the map.

  • ci32.png default value

    default value specifies the value to return in value if the specified key does not exist in the map. This input must be of the same data type as the existing values in the map.

  • ibool.png key not found?

    key not found? returns TRUE if map does not include an entry with the specified key. Otherwise, key not found? returns FALSE .

    This output exists on both the left and right border nodes. The two key not found? outputs return the same value.

  • ii32.png value

    value returns the value of the entry with the associated key if key not found? is FALSE. If key not found? is TRUE, this output returns the value in default value.

  • cenum.png action

    action specifies the operation to perform on the map based on the TRUE or FALSE value of key not found?. This input assumes the value 0 if unwired.

    2Delete Entry—If key not found? is FALSE, this node deletes the entry with the specified key from the map. If key not found? is TRUE, this node does nothing.
    0Modify Entry only if found (default)—If key not found? is FALSE, this node replaces the existing associated value with the new value. If key not found? is TRUE, this node does nothing.
    1Add or Modify Entry—If key not found? is FALSE, this node replaces the existing associated value with the new value. If key not found? is TRUE, this node adds the new key and the associated value to the map.
  • ci32.png value

    value specifies the new value of the entry with the associated key.

  • imap.png map

    map returns the resulting map.

  • istr.png key

    key returns the same value as the key input on the left side of the border node.

  • ibool.png key not found?

  • Examples

    Refer to the following example files included with LabVIEW.

    • labview\examples\Collections\Map Collection - Word Counting.vi
    • labview\examples\Design Patterns\Registration Map\Registration Map Usage.lvproj