You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old June 7th, 2019, 08:17 AM   #1
Archie
Member
United States

Archie is online now
 
Join Date: May 2002
Location: Orangeburg, SC
Posts: 1,887
PLC Benchmarking

This is a bit of an academic exercise and more so a curiosity, but I created a couple quick program tests to see how program processing time varied amongst different PLCs. My test was very simple. I loaded a small intensive program into the PLC, then checked the program scan time. It is a very basic test and doesn't give the whole picture of a PLC, but gives a comparison from one aspect.

The first program was a math test that multiplied 2 Real numbers, then converted to Dint. It was done for 100,000 elements. This is the code in AB format
Code:
FOR i:=0 TO 99999 DO
	DINTResult[i]:=(REAL1[i]*REAL2[i]);
END_FOR;
The second test was a worst case bubble sort of 1000 elements.
Code:
Result[0]:=2;
Result[999]:=-1;

REPEAT
	swapped:=0;
	FOR i:=1 TO 999 DO
		IF (Result[i-1]>Result[i]) THEN
			Temp:=Result[i];
			Result[i]:=Result[i-1];
			Result[i-1]:=Temp;
			swapped:=1;
		END_IF;
	END_FOR;
UNTIL (NOT swapped)
END_REPEAT;
The main reason I am posting here was to see if I could interest anyone in testing on different platforms and posting the scan time result. Since I do not have access to every PLC and platform, I would like to see if anyone would be willing to run these tests and posting their results. Just to list a few platforms I cannot test:

Siemens
Newer Omron
AutomationDirect
B&R
__________________
Expectations lead to disappointment. Appreciation leads to satisfaction.

AdvancedHMI - HMI Software without the license key hassles
  Reply With Quote
Old June 7th, 2019, 08:58 AM   #2
kolyur
Lifetime Supporting Member + Moderator
United States

kolyur is offline
 
kolyur's Avatar
 
Join Date: Oct 2004
Location: Wooster, Ohio
Posts: 1,438
Interesting... I'm wondering how you would do this test on a controller like Beckhoff where the scan time is specified? Run the code and adjust the scan time until the processor core usage gets close to 100%?


I'd be curious to see the results of ControlLogix vs Beckhoff.
__________________
John
  Reply With Quote
Old June 7th, 2019, 09:08 AM   #3
JesperMP
Lifetime Supporting Member + Moderator
Denmark

JesperMP is offline
 
JesperMP's Avatar
 
Join Date: Feb 2003
Location: Copenhagen.
Posts: 13,737
I can test on Siemens "classic" PLCs such as IM151-8 and 315-2PN/DP (-EH14).
And on Siemens TIA PLC such 1512SP.
These are what I have laying around for testing. These CPUs are "small" types, not the more performant types.
__________________
Jesper
See my profile interests for Q&A
  Reply With Quote
Old June 7th, 2019, 10:22 AM   #4
Archie
Member
United States

Archie is online now
 
Join Date: May 2002
Location: Orangeburg, SC
Posts: 1,887
When I get back to the office I will run the tests on a Beckhoff CX8090. I should be able to get the scan time by looking at the online monitor of the Task.
__________________
Expectations lead to disappointment. Appreciation leads to satisfaction.

AdvancedHMI - HMI Software without the license key hassles
  Reply With Quote
Old June 7th, 2019, 10:25 AM   #5
boneless
Lifetime Supporting Member + Moderator
United States

boneless is offline
 
Join Date: Feb 2008
Location: OKC
Posts: 1,532
I got a Siemens 1214C I can run it on.
  Reply With Quote
Old June 7th, 2019, 10:52 AM   #6
boneless
Lifetime Supporting Member + Moderator
United States

boneless is offline
 
Join Date: Feb 2008
Location: OKC
Posts: 1,532
To do this correct, I need some more info.


First code, do you have an array of reals and store the dint result in another array?
If so, what values do you have for the reals. I think it would be easier to just multiply the I value?
My PLC limits the array size to 65536 DINT entries.
I also believe the 100,000 * 100,000 would result in an overflow for the DINT.
  Reply With Quote
Old June 7th, 2019, 11:20 AM   #7
boneless
Lifetime Supporting Member + Moderator
United States

boneless is offline
 
Join Date: Feb 2008
Location: OKC
Posts: 1,532
I just ran an adjusted code:


Quote:
FOR "I" := L#0 TO L#49999 DO
"Result" := REAL_TO_DINT((DINT_TO_REAL("I")) * (DINT_TO_REAL("I")));
END_FOR;

300 ms cycle time in a 1214C, without monitoring.
I use a DI to start/stop the sequence and capture cycle time with standard blocks and record min and max cycle time.
  Reply With Quote
Old June 7th, 2019, 11:29 AM   #8
kamenges
Member
United States

kamenges is offline
 
kamenges's Avatar
 
Join Date: Nov 2002
Location: Brillion, WI
Posts: 3,776
Quote:
Originally posted by boneless:

I just ran an adjusted code:
I think you have a few more conversions that were intended.

The code Archie posted in the FOR loop multiplies two REALs from two different REAL arrays and stores the result in a DINT array. So you don't need the two DINT_TO_REAL conversions in the equation but the arrays need to be changed to REAL arrays.

Keith
  Reply With Quote
Old June 7th, 2019, 11:36 AM   #9
boneless
Lifetime Supporting Member + Moderator
United States

boneless is offline
 
Join Date: Feb 2008
Location: OKC
Posts: 1,532
Gotya, the code confused me, the DINTresult looked like a conversion to me, but it seems that the conversion is done automatically when assigning a real to a dint?


Edit:
I'll have to call it quits. My PLC cannot handle these large arrays. Maybe with a memory card, but I haven't got one handy.

Last edited by boneless; June 7th, 2019 at 11:45 AM.
  Reply With Quote
Old June 7th, 2019, 12:02 PM   #10
kamenges
Member
United States

kamenges is offline
 
kamenges's Avatar
 
Join Date: Nov 2002
Location: Brillion, WI
Posts: 3,776
One of the things that makes us AB users lazy is the fact that the PLC OS handles type conversion for us. Its one of the things that catch us when we move to other platforms. About the only exceptions are conversions to BCD or conversions to ASCII.

Keith
  Reply With Quote
Old June 7th, 2019, 02:29 PM   #11
Archie
Member
United States

Archie is online now
 
Join Date: May 2002
Location: Orangeburg, SC
Posts: 1,887
This would be the adjusted code for CodeSys based systems:
Code:
FOR i:=0 TO 99999 DO
	DINTResult[i]:=REAL_TO_DINT(Real1[i]*Real2[i]);
END_FOR
It seems AB has its own flavor of structured text. But it does the conversion automatically.

If the size of the array is too large, I imagine the result would be the if the same numbers were calculated in the loop like this:
Code:
FOR i:=0 TO 99999 DO
	DINTResult:=REAL_TO_DINT(Real1*Real2);
END_FOR
__________________
Expectations lead to disappointment. Appreciation leads to satisfaction.

AdvancedHMI - HMI Software without the license key hassles
  Reply With Quote
Old June 7th, 2019, 06:37 PM   #12
Archie
Member
United States

Archie is online now
 
Join Date: May 2002
Location: Orangeburg, SC
Posts: 1,887
I tested the Beckhoff CX8090. I had to add a timer in the code to get cycle time and set the task cycle time to 1 second. And I adjusted the MathTest to use less memory:

Code:
PROGRAM MathTest
VAR
	Real1 :  REAL;
	Real2 :  REAL;
	DINTResult :ARRAY[0..99999] OF DINT;
	i : DINT;
END_VAR


FOR i:=0 TO 99999 DO
	DINTResult[i]:=REAL_TO_DINT(Real1*Real2);
END_FOR
Code:
Timer1.PT:=T#9999m;
Timer1.IN:=TRUE;
Timer1();

(*MathTest(); *)

BubbleSort();

Timer1();
ScanTime:=Timer1.ET;
Timer1.IN:=FALSE;
Timer1();
The results.....

MathTest : 255ms
Bubble Sort : 631ms
__________________
Expectations lead to disappointment. Appreciation leads to satisfaction.

AdvancedHMI - HMI Software without the license key hassles
  Reply With Quote
Old June 7th, 2019, 06:56 PM   #13
Archie
Member
United States

Archie is online now
 
Join Date: May 2002
Location: Orangeburg, SC
Posts: 1,887
L16erm

I tested the CompactLogix L16ER. I had to adjust the math test to account for the limited memory, but only removing the result array:
Code:
FOR i:=0 TO 99999 DO
	DINTResult:=(Real1*Real2);
END_FOR;
The results.....

MathTest : 366ms
Bubble Sort : 1471ms
__________________
Expectations lead to disappointment. Appreciation leads to satisfaction.

AdvancedHMI - HMI Software without the license key hassles
  Reply With Quote
Old June 7th, 2019, 07:04 PM   #14
Archie
Member
United States

Archie is online now
 
Join Date: May 2002
Location: Orangeburg, SC
Posts: 1,887
L85e

ControlLogix 1756-L85E

MathTest : 6ms
Bubble Sort : 83ms
__________________
Expectations lead to disappointment. Appreciation leads to satisfaction.

AdvancedHMI - HMI Software without the license key hassles
  Reply With Quote
Old June 7th, 2019, 07:45 PM   #15
Archie
Member
United States

Archie is online now
 
Join Date: May 2002
Location: Orangeburg, SC
Posts: 1,887
Omron CP1H

It seems my tests are too aggressive for the low end PLCs, so for the Omron CP1H I had to reduce my loops by a factor of 10, then extrapolate


MathTest : 203 x 10 = 2030ms
Bubble Sort : 235 x 10 = 2350ms
__________________
Expectations lead to disappointment. Appreciation leads to satisfaction.

AdvancedHMI - HMI Software without the license key hassles
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 2 (1 members and 1 guests)
LadderLogic
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Mitsubishi PLC died. Twice. JRoss LIVE PLC Questions And Answers 11 January 29th, 2019 09:35 PM
More questions about RSemulator, PLC network, and career path... timcph2008 LIVE PLC Questions And Answers 0 March 8th, 2018 11:04 AM
PLC Update - Back Issues Collection Now Available! Phil Melore LIVE PLC Questions And Answers 11 October 22nd, 2015 02:17 AM
Siemens PLC won't auto-run after power-up Lamboom LIVE PLC Questions And Answers 5 August 19th, 2014 04:32 PM
PC to PLC Protocol TheRixta LIVE PLC Questions And Answers 13 December 17th, 2008 12:56 PM


All times are GMT -5. The time now is 07:44 PM.


.