def cvtHHHH(hhhhstr, pos=0):
  """ Convert HHHH hex [sub]string value into integer.
    
      Parameters:
        hhhhstr - HHHH [sub]string
                    format: "....HHHH...."
        pos     - starting position in string.
                    default: 0 (start of string)

      Return Value:
        Returns converted integer value on success. None on error.
  """
  h = '0x' + hhhhstr[pos:pos+4]
  try:
    val = eval(h)
    return val
  except (SyntaxError, NameError, TypeError):
    return None