Adding to an existing index

I’m trying to implement the logic below:
if bcc = STX or bcc = CR, then bcc := +1 (increment of 1).
bcc is a byte and i’m trying to increment it by 1 if this condition above is true.
my code is:
IF message_byte[11] = 16#0D OR message_byte[11] = 16#02 THEN
message_byte[11] := message_byte[11] + TO_BYTE(1);
END_IF

Variable :Message_byte. Type: AXL_RSUNI_ARR_B_1_1023. This type is ( ARRAY[1..1023] OF BYTES)
where message_byte is an array of bytes and I want to access a specific one. However, it gives me an error when saying it can’t be added.
any help is appreciated


The error message indicates that the addition operator can only be used on ANY_NUM types. The elements of message_byte are not ANY_NUMs (they are ANY_BITs).


One solution is to cast the byte variable to an ANY_NUM type for the addition operation, and then cast it back to a BYTE for the assignment: