Error Container modified by BUT

Hello community,
I have added a variable (iPushMessageErrorState) to the hist4 data channel, but I get the error shown below:

Here is the function that writes the values to hist memory:

stock PackHist4(pmBit, pmState, pmErrorState)
	new aHistData4Rec{HISTDATA4_SIZE}; //HISTDATA4_SIZE:6
	aHistData4Rec{0} = 4;
	printf("[LIB8X] [DM] Hist4 Pack: %d\r\n", rM2M_Pack(aHistData4Rec, 1, pmBit, RM2M_PACK_S8 + RM2M_PACK_BE));
	printf("[LIB8X] [DM] Hist4 Pack: %d\r\n", rM2M_Pack(aHistData4Rec, 2, pmState, RM2M_PACK_S8 + RM2M_PACK_BE));
	printf("[LIB8X] [DM] Hist4 Pack: %d\r\n", rM2M_Pack(aHistData4Rec, 3, pmErrorState, RM2M_PACK_U32 + RM2M_PACK_BE));
	printf("[LIB8X] [DM] Hist4 Rec:  %d\r\n", rM2M_RecData(0, aHistData4Rec, HISTDATA4_SIZE));

After some searching and comparing the variable sizes (number of bytes defined in DDE and pushed into memory) I couldn’t find any fault.
Please can you help me to find the cause of the error message?

Kind regards,


I think I found the problem:
HISTDATA4_SIZE must be 7 bytes instead of 6 bytes.

Kind regards,

Hello @mklueh,

is there a reason why you don’t use the DDE library? The DDE library automatically calculates the size of the datasets and the positions of the individual data fields, which reduces the error rate when adding new fields.

Kind regards,

Hi Josef,
yes, the DDE library is much nicer to use.
But it’s an existing project and all the functions that write to memory are inside a library.
So far I haven’t managed to integrate the DDE Lib into the library so that the projects that use the library have access to the DDE functionality.

Kind regards,