def get_outputportid(port):

    """ Get the output port ID corresponding to the port letter """

    portid = {
        'a': 1,
        'b': 2,
        'c': 4,
        'd': 8
    }
    port = port.lower()
    if type(port) is not str:
        raise NameError('Invalid output port.')
    if port not in list(portid.keys()):
        raise NameError('Invalid output port.')
    return portid[port]