PLC Benchmarking

You and I have somewhat different views on the quantity inferred by "slightly".
Probably. :) Since the numbers are there, people can draw their own conclusions.

The logic posted above is running at 103 msec in the L71. What are you seeing?
I have packed the PLC away for today. Maybe I get time to do it tomorrow.

edit: In S7, "TRUE" and "FALSE" are keywords.
 
1756-L85E v28

MathTest : 6.0
IndexTest : 3.7
BitwiseTest : 2.6


Tried to attach the RSLogix file, but it was too big.
 
Last edited:
Revised numbers on updated tests for
1769-L18ER v24

MathTest : 348.0
IndexTest : 131
BitwiseTest : 148


I have to say that I was surprised the L24ER was faster. I was thinking the L18 and L24 had the same processor, only more memory and embedded IO.
 
Last edited:
After seeing the differences in indexing arrays and ANDing, I think the test should be revised:

Math Test stays the same:
Code:
FOR i:=0 TO 99999 DO
	DINTResult:=(Real1*Real2);
END_FOR;

@Archie
What values are you using defaulting Real1 and Real2 too?

Running Math Test on an NJ101
Real1 and Real2 set at 0
32ms
Real1 and Real2 non-zero
89ms
 
Results + code for S7-1517F
Code:
CASE "TestType" OF
    1:  //indexed multiply with non-zero data - 19ms
        FOR #diIndex := 0 TO 99999 DO
            "dbResult".arData[#diIndex] := REAL_TO_DINT("dbData1".arData[#diIndex] * "dbData2".arData[#diIndex]);
        END_FOR;
        
    2:  //non indexed multiply with non-zero data - 14.5ms
        #rData1 := 100.0;
        #rData2 := 1000.0;
        FOR #diIndex := 0 TO 99999 DO
            #diResult := REAL_TO_DINT(#rData1 * #rData2 );
        END_FOR;
        
    3:  // some trig functions - 13.5ms
        #rData1 := 0.1;
        #rData2 := 0.2;
        FOR #diIndex := 0 TO 99999 DO
            #diResult := REAL_TO_DINT(TAN(#rData1) * TAN(#rData2));
        END_FOR;
        
    4:  //non indexed multiply with non-zero data, more calcs, for loop smaller - 14.2ms
        #rData1 := 1000.0;
        #rData2 := 100.0;
        FOR #diIndex := 0 TO 9999 DO
            #diResult := REAL_TO_DINT(#rData1 * #rData2);
            #diResult := REAL_TO_DINT(#rData1 * #rData2);
            #diResult := REAL_TO_DINT(#rData1 * #rData2);
            #diResult := REAL_TO_DINT(#rData1 * #rData2);
            #diResult := REAL_TO_DINT(#rData1 * #rData2);
            #diResult := REAL_TO_DINT(#rData1 * #rData2);
            #diResult := REAL_TO_DINT(#rData1 * #rData2);
            #diResult := REAL_TO_DINT(#rData1 * #rData2);
            #diResult := REAL_TO_DINT(#rData1 * #rData2);
            #diResult := REAL_TO_DINT(#rData1 * #rData2);
        END_FOR;
        
    5:  //non indexed divide with non-zero data - 14.9ms
        #rData1 := 1000.0;
        #rData2 := 100.0;
        FOR #diIndex := 0 TO 99999 DO
            #diResult := REAL_TO_DINT(#rData1 / #rData2);
        END_FOR;
        
    6:  //non indexed multiply with zero data - 7.5ms
        #rData1 := 0.0;
        #rData2 := 0.0;
        FOR #diIndex := 0 TO 99999 DO
            #diResult := REAL_TO_DINT(#rData1 * #rData2);
        END_FOR;
        
    7:  //Boolean logic - 1ms    
        FOR #diIndex := 0 TO 99999 DO
            #boolvar_1 := (#boolvar_2 AND #boolvar_3) OR (#boolvar_4 AND #boolvar_5); // logic --(=)
            IF (#boolvar_6 AND #boolvar_7) THEN
                #boolvar_10 := TRUE; // logic --(S)
            END_IF;
            IF (#boolvar_8 OR #boolvar_9) THEN
                #boolvar_10 := FALSE; // logic --(R)
            END_IF;
        END_FOR;
        
    8:  //Bitwise operation - 1ms
        FOR #diIndex:=0 TO 99999 DO
            #diResult := #diIndex AND 2730; //* Every other bit FOR 12 bits
        END_FOR;
        
    9: //bubble sort - 26ms
        #Result[0] := 2;
        #Result[999] := -1;
        
        REPEAT
            #swapped := 0;
            FOR #diIndex := 1 TO 999 DO
                IF (#Result[#diIndex - 1] > #Result[#diIndex]) THEN
                    #Temp := #Result[#diIndex];
                    #Result[#diIndex] := #Result[#diIndex - 1];
                    #Result[#diIndex - 1] := #Temp;
                    #swapped := 1;
                END_IF;
            END_FOR;
        UNTIL (NOT #swapped)
        END_REPEAT;
        
    10:  //initialise array of data to non-zero values
        FOR #diIndex := 0 TO 99999 DO
            "dbData1".arData[#diIndex] := DINT_TO_REAL(#diIndex) / 100.0;
            "dbData2".arData[#diIndex] := DINT_TO_REAL(#diIndex) / 50.0;
        END_FOR;
        
        
END_CASE;
 
Results + code for S7-319F


Code:
FUNCTION fc1:VOID
VAR_TEMP
    i:INT;
    iIndex:INT;
    diIndex:DINT;
    diResult:DINT;
    TestType, temp:INT;
    rData1,rData2:REAL;
    swapped:BOOL;
    boolvar_1:BOOL;
    boolvar_2:BOOL;
    boolvar_3:BOOL;
    boolvar_4:BOOL;
    boolvar_5:BOOL;
    boolvar_6:BOOL;
    boolvar_7:BOOL;
    boolvar_8:BOOL;
    boolvar_9:BOOL;
    boolvar_10:BOOL;
    Result:ARRAY[0..999] OF INT;
    
END_VAR
testType:=9;
CASE TestType OF
    1:  //indexed multiply with non-zero data - 85ms
        FOR iIndex := 0 TO 9999 DO
            FOR i:=0 TO 9 do
             "dbResult".diData[iIndex] := REAL_TO_DINT("dbData1".arData[iIndex] * "dbData2".arData[iIndex]);
            end_For;
        END_FOR;
        
    2:  //non indexed multiply with non-zero data - 21ms
        rData1 := 100.0;
        rData2 := 1000.0;
        FOR diIndex := 0 TO 99999 DO
            diResult := REAL_TO_DINT(rData1 * rData2 );
        END_FOR;
        
    3:  // some trig functions - 160ms
        rData1 := 0.1;
        rData2 := 0.2;
        FOR diIndex := 0 TO 99999 DO
            diResult := REAL_TO_DINT(TAN(rData1) * TAN(rData2));
        END_FOR;
        
    4:  //non indexed multiply with non-zero data, more calcs, for loop smaller - 14.0ms
        rData1 := 1000.0;
        rData2 := 100.0;
        FOR diIndex := 0 TO 9999 DO
            diResult := REAL_TO_DINT(rData1 * rData2);
            diResult := REAL_TO_DINT(rData1 * rData2);
            diResult := REAL_TO_DINT(rData1 * rData2);
            diResult := REAL_TO_DINT(rData1 * rData2);
            diResult := REAL_TO_DINT(rData1 * rData2);
            diResult := REAL_TO_DINT(rData1 * rData2);
            diResult := REAL_TO_DINT(rData1 * rData2);
            diResult := REAL_TO_DINT(rData1 * rData2);
            diResult := REAL_TO_DINT(rData1 * rData2);
            diResult := REAL_TO_DINT(rData1 * rData2);
        END_FOR;
        
    5:  //non indexed divide with non-zero data - 25ms
        rData1 := 1000.0;
        rData2 := 100.0;
        FOR diIndex := 0 TO 99999 DO
            diResult := REAL_TO_DINT(rData1 / rData2);
        END_FOR;
        
    6:  //non indexed multiply with zero data - 21ms
        rData1 := 0.0;
        rData2 := 0.0;
        FOR diIndex := 0 TO 99999 DO
            diResult := REAL_TO_DINT(rData1 * rData2);
        END_FOR;
        
    7:  //Boolean logic - 20ms    
        FOR diIndex := 0 TO 99999 DO
            boolvar_1 := (boolvar_2 AND boolvar_3) OR (boolvar_4 AND boolvar_5); // logic --(=)
            IF (boolvar_6 AND boolvar_7) THEN
                boolvar_10 := TRUE; // logic --(S)
            END_IF;
            IF (boolvar_8 OR boolvar_9) THEN
                boolvar_10 := FALSE; // logic --(R)
            END_IF;
        END_FOR;
        
    8:  //Bitwise operation - 18ms
        FOR diIndex:=0 TO 99999 DO
            diResult := DWORD_TO_DINT(DINT_TO_DWORD(diIndex) AND dw#16#aaa); //* Every other bit FOR 12 bits
        END_FOR;
        
    9: //bubble sort - 456ms
        Result[0] := 2;
        Result[999] := -1;
        
        REPEAT
            swapped := 0;
            FOR diIndex := 1 TO 999 DO
                IF (Result[diIndex - 1] > Result[diIndex]) THEN
                    Temp := Result[diIndex];
                    Result[diIndex] := Result[diIndex - 1];
                    Result[diIndex - 1] := Temp;
                    swapped := 1;
                END_IF;
            END_FOR;
        UNTIL (NOT swapped)
        END_REPEAT;
        
    10:  //initialise array of data to non-zero values
        FOR diIndex := 0 TO 9999 DO
            "dbData1".arData[diIndex] := DINT_TO_REAL(diIndex) / 100.0;
            "dbData2".arData[diIndex] := DINT_TO_REAL(diIndex) / 50.0;
        END_FOR;
        
        
END_CASE;
end_function
 
@Archie
What values are you using defaulting Real1 and Real2 too?

Running Math Test on an NJ101
Real1 and Real2 set at 0
32ms
Real1 and Real2 non-zero
89ms
That's an interesting finding I never would have expected. I was testing with values at 0. I will revise the math test and run my tests again.
 
LD, I will use your code for performing my further tests.

Btw, looks like a 1517 easily beats a 319, except for boolean logic !
Have you tested with optimized or non-optimized blocks ?
 
LD..... Can you post a complete part number or a link to the PLC you tested with. I'm interested in checking out the specs. It looks like quite a fast PLC.
 
The strange thing is the 319f has a part number of a 318 :confused:
Indeed that is strange. But that is how it is (was). My guess is they planned for a CPU above 319, but then they would run out of numbers since there are only 3 available digits in their system. The PLC above 319 never became reality. Just my (conspiracy) theory.

For your information, list price for the 319F is approx 5700 €, and 1517F is approx 5300 €.
 
I only reran the non-indexed math test with non-zero numbers. That came in at 298 msec on the L71. This compares with roughly 280 msec for the same test with zero values. Since they were that close in total time I didn't try any of the other variants.

Rockwell is obviously not performing an optimization that other manufacturers are. The S7-1517 shows a 2:1 difference in scan time for zero versus non-zero values.

Keith
 

Similar Topics

Hello, I'm trying to delve a little into rs-485 communications for a couple projects of mine. Until now I've been using a delta vfd and a delta...
Replies
2
Views
26
Greetings All, I recently decided to start freelancing in Controls and Automation part time, most of my experience has been with Rockwell...
Replies
2
Views
67
I am having a problem communicating my PLC with Drive via Modbus connection. I start by opening the port and there is no problem, but then when I...
Replies
5
Views
47
I have worked on small projects using AB Micrologix but now we want to take a photo, process it online, and sort based on returned variables...
Replies
1
Views
85
Hi, I have a 1500 that controls a station with diferents warehouses, but i also have a 1200 that controls one of those warehouses, i have been...
Replies
9
Views
208
Back
Top Bottom