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.

New Here? Please read this important info!!!
June 12th, 2019, 09:30 AM  #61 
Lifetime Supporting Member + Moderator

OK, I have redone LDs tests on a Siemens IM1518.
Results: 1: //indexed multiply with nonzero data  1680ms 2: //non indexed multiply with nonzero data  430ms 3: //some trig functions  1770ms 4: //non indexed multiply with nonzero data, more calcs, for loop smaller  280ms 5: //non indexed divide with nonzero data  560ms 6: //non indexed multiply with zero data  440ms 7: //Boolean logic  310ms 8: //Bitwise operation  300ms 9: //bubble sort  fails to finish within 6000ms (maximum cycle time for IM1518) edit: btw, the arrays were too big for the available memory, so I reduced them by a factor 10 and extrapolated the results accordingly.
__________________
Jesper See my profile interests for Q&A
Last edited by JesperMP; June 12th, 2019 at 10:18 AM. 
June 12th, 2019, 09:37 AM  #62  
Member

Quote:
Keith 

June 12th, 2019, 10:16 AM  #63 
Lifetime Supporting Member
Join Date: Nov 2011
Location: Corona, CA
Posts: 1,593

Interesting data...
__________________
****Control Freak**** Net is where I be and Nathan is me. 
June 12th, 2019, 10:25 AM  #64 
Lifetime Supporting Member + Moderator

LD's tests done with a Siemens S71512SP (optimized block access)
Results: 1: //indexed multiply with nonzero data  434ms 2: //non indexed multiply with nonzero data  557ms 3: //some trig functions  498ms 4: //non indexed multiply with nonzero data, more calcs, for loop smaller  455ms 5: //non indexed divide with nonzero data  540ms 6: //non indexed multiply with zero data  320ms 7: //Boolean logic  54ms 8: //Bitwise operation  51ms 9: //bubble sort  1250ms Again, due to the memory requirements I had to reduce the array sizes and extrapolate the results. edit: I think that Kamenges is right, that in test 3 (and possibly some of the other tests) the TIA compiler detects that the variable doesnt get changed, so that it is a defacto constant, and thus optimises the code by substituting the calculation by a simple value assignment of the result of the formula. edit again: That could mean that the tests should be reviewed and possibly changed to avoid that from happening. Otherwise the test results are skewed.
__________________
Jesper See my profile interests for Q&A
Last edited by JesperMP; June 12th, 2019 at 10:31 AM. 
June 12th, 2019, 10:29 AM  #65 
Member

By the way, trig functions are not friendly to the L71. I ran the math test with the real multiply replaced with TAN(REAL1). This is less than half as intense as the test L D[AR2,P#0.0] ran on the S71517. The scan time came in at 1860 msec.
X to the power of Y was a bigger hit. In the math test I replaced (Real1 * Real2) with (Real1 ** Real2), which in ABspeak is Real11^Real2. That took 3805 msec. Keith 
June 12th, 2019, 10:45 AM  #66 
Lifetime Supporting Member + Moderator

LD's tests done with a Siemens S71512SP (nonoptimized block access)
Results: 1: //indexed multiply with nonzero data  785ms (*) 2: //non indexed multiply with nonzero data  523ms 3: //some trig functions  588ms 4: //non indexed multiply with nonzero data, more calcs, for loop smaller  460ms 5: //non indexed divide with nonzero data  555ms 6: //non indexed multiply with zero data  322ms 7: //Boolean logic  119ms (**) 8: //Bitwise operation  63ms 9: //bubble sort  2200ms (*) *: One can see that when there is access from the code to global DB, there is a penalty when the DB is nonoptimized. **: Even if only TEMP memory of the block is used, nonoptimized costs a penalty for boolean code.
__________________
Jesper See my profile interests for Q&A

June 12th, 2019, 12:37 PM  #67 
Member
Join Date: Oct 2013
Location: Alabama
Posts: 45

Test Redo
1769L24ER vr 31
Using Archies File MathTest = 313ms Bubble Sort = 1.57sec IndexTest = 147ms BitwiseTest = 167ms Not Calling Routine. Using it as MAIN Last edited by Jmeadows7676; June 12th, 2019 at 12:38 PM. Reason: Add Wording 
June 12th, 2019, 06:35 PM  #68 
Member
Join Date: Jan 2012
Location: melbourne
Posts: 84

LD's tests done with a Omron NJ1019000
Results: 1: //indexed multiply with nonzero data  100ms 2: //non indexed multiply with nonzero data  84ms 3: //some trig functions  225ms 4: //non indexed multiply with nonzero data, more calcs, for loop smaller  80ms 5: //non indexed divide with nonzero data  103ms 6: //non indexed multiply with zero data  31ms 7: //Boolean logic  8ms 8: //Bitwise operation  11ms 9: //bubble sort  82ms 
June 13th, 2019, 02:19 AM  #69 
Lifetime Supporting Member
Join Date: Nov 2006
Location: UK
Posts: 5,730

The trig functions return a lower test time due to the the magnitude of the numbers involved  the smaller the number the less time a floating point multiply takes.
I modified case 3 so that the tans would return 100.0 and 1000.0 so it would be comparable with case 2 and now it does take longer to execute. Code:
3: // some trig functions  15.0ms #rData1 := LREAL_TO_REAL(ATAN(100.0)); #rData2 := LREAL_TO_REAL(ATAN(1000.0)); #diResult := REAL_TO_DINT(TAN(#rData1) * TAN(#rData2)); FOR #diIndex := 0 TO 99999 DO #diResult := REAL_TO_DINT(TAN(#rData1) * TAN(#rData2)); END_FOR;
__________________
S7300 to 1500 conversions done  email to s7conversions@hotmail.com 
June 13th, 2019, 06:39 AM  #70  
Lifetime Supporting Member + Moderator

Quote:
One should think that adding the extra trig instructions should take longer time. I wonder if it makes a difference if you change rData1 and rData2 from TEMP to STAT or to global DB.
__________________
Jesper See my profile interests for Q&A


June 13th, 2019, 08:26 AM  #71  
Member

Quote:
Keith 

June 14th, 2019, 06:59 PM  #72 
Member
Join Date: May 2002
Location: Orangeburg, SC
Posts: 1,908

I did some tests on an L85E using firmware 28 and 32. I was surprised to find a difference:
v28 MathTest 7.5 IndexTest 3.7 BitWiseTest 2.6 BubbeSort 83 v32 MathTest 9.5 IndexTest 3.5 BitWiseTest 2.4 BubbeSort 77
__________________
Expectations lead to disappointment. Appreciation leads to satisfaction. AdvancedHMI  HMI Software without the license key hassles 
June 17th, 2019, 05:54 AM  #73 
Lifetime Supporting Member + Moderator

LD's tests done with a Siemens S71515SP Open Controller (optimized block access)
This is not the latest version. As far as I know, the latest version essentially has 4 cores instead of 2 cores. It is still only 1 core for the Open Controller PLC. It is the Windows side that gets bumped from 1 to 3 cores. So the test results should be valid even for the newest version. Also of note, the 1515SP should be approximately equivalent to an S71516. I am not going to repeat the test with nonoptimized block access. Results: 1: //indexed multiply with nonzero data  28ms 2: //non indexed multiply with nonzero data  27ms 3: //some trig functions  24ms 4: //non indexed multiply with nonzero data, more calcs, for loop smaller  27ms 5: //non indexed divide with nonzero data  27ms 6: //non indexed multiply with zero data  14ms 7: //Boolean logic  1ms 8: //Bitwise operation  1ms 9: //bubble sort  51ms
__________________
Jesper See my profile interests for Q&A

June 17th, 2019, 07:19 AM  #74 
Lifetime Supporting Member + Moderator

I did nonoptimized anyway
LD's tests done with a Siemens S71515SP Open Controller (nonoptimized block access)
Results: 1: //indexed multiply with nonzero data  76ms 2: //non indexed multiply with nonzero data  27ms 3: //some trig functions  25ms 4: //non indexed multiply with nonzero data, more calcs, for loop smaller  27ms 5: //non indexed divide with nonzero data  29ms 6: //non indexed multiply with zero data  25ms 7: //Boolean logic  12ms 8: //Bitwise operation  11ms 9: //bubble sort  246ms
__________________
Jesper See my profile interests for Q&A

June 17th, 2019, 08:15 AM  #75  
Member

Quote:
Keith 

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


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 autorun after powerup  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 