import struct


def TMCLPack(cmdnum: int, typenum: int, motor_or_bank: int, value: int) -> bytes:
    """Construct the bytes representation of the command and send it to the
    TMCM card. The bytes are:
    - Module address (always 1)
    - Command number
    - Type number
    - Motor or Bank number
    - Value (MSB)
    - Value
    - Value
    - Value (LSB)
    - Checksum: the sum of all the previous bytes, module 256.

    In total, 9 bytes compose the sent message.
    """
    cmd = bytes([1, cmdnum, typenum, motor_or_bank]) + struct.pack('>i', int(value))
    cmd = cmd + bytes([sum(cmd) % 256])
    return cmd