naturephoenix
Member
Code:
FOR #i := 0 TO #LoopSize BY 1 DO
#Alarm := PEEK_BOOL(area := 16#84, dbNumber := #dbNo, byteOffset := #startByteAlarm_1, bitOffset := #startAlarmBit);
#AlarmType := PEEK_BOOL(area := 16#84, dbNumber := #dbNo, byteOffset := #startByteAlarmType_1, bitOffset := #startTypeBit);
IF #Alarm AND #AlarmType THEN
#AlarmCount := #AlarmCount + 1;
#AlarmNumber[#AlarmCount] := #i + 1;
END_IF;
#startByteAlarm_1 := #startByteAlarm_1 + W#16#2;
#startByteAlarmType_1 := #startByteAlarmType_1 + W#16#2;
END_FOR;
This FB works fine but:
Size of FOR LOOP is 576. I need to call this FB 7 times with different inputs. I commented PEEK_BOOL inside FOR LOOP and
cycle time significantly decreased. Is there a way to make the same without PEEK_BOOL.