1

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

Sailesh Babu Doppalapudi
  • 1,534
  • 1
  • 10
  • 22
jeram .j
  • 11
  • 3

1 Answers1

0

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;
Jakob
  • 1,288
  • 7
  • 13