@staticmethod
def rel_output(output_id, percent):
    """Generate a command to change the value of an output-port.

        :param    int    output_id:    Output id 0..3
        :param    int    percent:      Relative percentage -100..100
        :return:    The PCK command (without address header) as text
        :rtype:    str
        """
    if output_id < 0 or output_id > 3:
        raise ValueError('Invalid output_id.')
    percent_round = round(percent * 2)
    if percent_round % 2 == 0:
        pck = 'A{:d}{:s}{:03d}'.format(output_id + 1, 'AD' if percent >= 0 else
            'SB', abs(percent_round // 2))
    else:
        pck = 'O{:d}{:s}{:03d}'.format(output_id + 1, 'AD' if percent >= 0 else
            'SB', abs(percent_round))
        return pck
