Array_Length_u8:=SIZEOF(SkippedElements_au8)/ SIZEOF(SkippedElements_au8[0]);
I am using this formula to find the array length but its doesn't execute and always showing 256 as result
Array_Length_u8:=SIZEOF(SkippedElements_au8)/ SIZEOF(SkippedElements_au8[0]);
I am using this formula to find the array length but its doesn't execute and always showing 256 as result
You want to use LOWER_BOUND
and UPPER_BOUND
.
For example:
ArraySize : DINT;
ThisIsAnArray : ARRAY[1..10] OF DINT;
ArraySize := ABS(UPPER_BOUND(ThisIsAnArray, 1) - LOWER_BOUND(ThisIsAnArray, 1)) + 1;