Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Array_Length_u8:=SIZEOF(SkippedElements_au8)/ SIZEOF(SkippedElements_au8[0]);
我正在使用这个公式来查找数组长度,但它没有执行并且总是显示 256 作为结果
您想使用LOWER_BOUND和UPPER_BOUND。例如:
LOWER_BOUND
UPPER_BOUND
ArraySize : DINT; ThisIsAnArray : ARRAY[1..10] OF DINT; ArraySize := ABS(UPPER_BOUND(ThisIsAnArray, 1) - LOWER_BOUND(ThisIsAnArray, 1)) + 1;