FUNCTION_BLOCK HASHTBL

An instance of this Function Block type stores and retrieves data as (KEY,VALUE) pairs of WSTRING s in an encapsulated instance of the Java™ Hashtable class.

  1. As shown in the init_table service sequence, an INIT event will clear the table and then initialize it from the IVAL input, which contains a comma-separated sequence of (KEY,VALUE) pairs, e.g., "KEY1,VALUE1,KEY2,VALUE2", etc.
  2. As shown in the normal_read sequence, a READ event will cause the data (if any) corresponding to the KEY input to be written to OUT, followed by a CNF+ event, i.e., a CNF event with QO = TRUE.
  3. As shown in the read_no_match sequence, if there is no data associated with the KEY, an empty string will be written to OUT, followed by a CNF- event, i.e., a CNF event with QO = FALSE.
  4. As shown in the write sequence, a WRITE event will write the VALUE data into a location in the table corresponding to the KEY input and also to OUT, followed by a CNF+ event.
    • This will over-write any previous data in the table associated with the KEY value.