Function packSmmParameterValues

  • Packs SMM (Safety Motion Module) parameter values into a binary buffer, following the specified SMM parameter structure version. It computes and appends a CRC32 checksum to ensure data integrity.

    Returns

    An object containing:

    • buffer: A Buffer with the packed values followed by the CRC32 checksum.
    • crc: The computed CRC32 checksum for the packed data.
    • crcBuffer: A Buffer representing the packed CRC32 checksum.
    • values: The original DataType[] values.
    • valuesBuffer: A Buffer containing the packed values (without the CRC).

    Throws

    Error if packing fails due to an invalid structure or value mismatch.

    Parameters

    • values: DataType[]

      An array of DataType values to be packed.

    • parameterStructureVersion: number = 0x0041

      The version of the parameter struct to use. Defaults to 0x0041.

    Returns {
        buffer: Buffer;
        crc: number;
        crcBuffer: Buffer;
        values: DataType[];
        valuesBuffer: Buffer;
    }

    • buffer: Buffer
    • crc: number
    • crcBuffer: Buffer
    • values: DataType[]
    • valuesBuffer: Buffer

Generated using TypeDoc