@staticmethod
def lock_regulator(reg_id, state):
    """Generate a command to lock a regulator.

        :param    int    reg_id:    Regulator id 0..1
        :param    bool   state:     The lock state
        :return:  The PCK command (without address header) as text
        :rtype:   str
        """
    if reg_id < 0 or reg_id > 1:
        raise ValueError('Wrong reg_id.')
    return 'RE{:s}X{:s}'.format('A' if reg_id == 0 else 'B', 'S' if state else
        'A')
