News:

  • June 26, 2026, 01:28:42 AM

Login with username, password and session length

Author Topic: Scan time versus Boolean Execution Time  (Read 18099 times)

Ingeniero

  • Full Member
  • ***
  • Posts: 45
Scan time versus Boolean Execution Time
« on: February 25, 2017, 10:10:08 PM »
I was going through the BRX manual, CH 11.

Scan Time is given as 50 micro seconds per 1 K boolean instructions. Boolean execution time as 50 Msec per 1k boolean.Is this a Typo? Sounds like the same thing.

I need a fast PLC.



« Last Edit: February 25, 2017, 10:57:40 PM by Ingeniero »

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3609
  • Darth Ladder
Re: Scan time versus Boolean Execution Time
« Reply #1 on: February 25, 2017, 10:29:51 PM »
It's got to be 50us per K.  I've got a 200 rung program with around 200 MATH boxes, a couple of which replace 32 rungs of boolean apiece, and typical scan time is 6-10ms (though it can get higher when I run some programs that iterate a lot).
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

Ingeniero

  • Full Member
  • ***
  • Posts: 45
Re: Scan time versus Boolean Execution Time
« Reply #2 on: February 25, 2017, 11:49:35 PM »
How can I calculate runtime without spending time and money to move my old AB programs over to a BRX.

the analog scan times on the BRX are given as 1 millisec, very fast.

5 millisecond scan time should use 100,000 boolean expressions. 20,000 per millisecond.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6161
  • Yes Pinky, Do-more will control the world!
Re: Scan time versus Boolean Execution Time
« Reply #3 on: February 26, 2017, 12:24:24 AM »
Boolean and most integer math functions are executed by a coprocessor. The actual execution time can vary due to cache conditions, but is generally around 50ns per instruction. There is about 250us of scan overhead, plus communications time. Ethernet on the local port will cause the biggest bump. If you want Ethernet and want to minimize the scan bump, you should probably use an ECOMLT POM.

Non-coprocessor instructions are considerably slower, although still pretty fast.

The BRX local analog input channels do update at roughly 1ms.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Ingeniero

  • Full Member
  • ***
  • Posts: 45
Re: Scan time versus Boolean Execution Time
« Reply #4 on: February 26, 2017, 01:46:23 AM »
So the processor has an overhead of about 250usec.

Each boolean and most integer functions uses about 50 nano seconds, so 20 to a micro second and and 50 micro seconds would equal (50X20) 1,000 boolean commands. ok ok.

Wow, I have no idea on how to estimate what an AB program would use as a scan time without converting it to domore. no easy way to estimate.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6161
  • Yes Pinky, Do-more will control the world!
Re: Scan time versus Boolean Execution Time
« Reply #5 on: February 26, 2017, 08:49:11 AM »
Wow, I have no idea on how to estimate what an AB program would use as a scan time without converting it to domore. no easy way to estimate.

I'm sorry. I'm not that familiar with AB instructions or performance.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: Scan time versus Boolean Execution Time
« Reply #6 on: February 26, 2017, 02:15:16 PM »
Its difficult to compare and depends greatly on which Rockwell series you are talking about. The BRX will probably blow Micrologix, SLC500 or 800 series out of the water. CompactLogix  varies. Newer units are much faster than the older series.  As in the BRX, communications has an effect on scan time. But how you write your program makes a huge difference too. if it is mostly Boolean and you rewrite the program in the BRX using stage, you could see a huge improvement in scan time.

Ingeniero

  • Full Member
  • ***
  • Posts: 45
Re: Scan time versus Boolean Execution Time
« Reply #7 on: February 26, 2017, 03:52:48 PM »
If you want Ethernet and want to minimize the scan bump, you should probably use an ECOMLT POM.


So if I set fixed scan time to 5 Milli sec it will be delayed when the ethernet server is updated?

The ECOMLT lowers but does not stop the bump.

I think I need stable control, at about 5 millisecons.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6161
  • Yes Pinky, Do-more will control the world!
Re: Scan time versus Boolean Execution Time
« Reply #8 on: February 26, 2017, 03:56:47 PM »
Do-more does not have a fixed scan option.

If you are doing mostly Boolean logic you will have a hard time getting the scan time up to 5ms...It's very fast.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Mike Nash

  • Hero Member
  • *****
  • Posts: 652
Re: Scan time versus Boolean Execution Time
« Reply #9 on: February 26, 2017, 05:18:05 PM »
Do-more does not have a fixed scan option.

If you are doing mostly Boolean logic you will have a hard time getting the scan time up to 5ms...It's very fast.

You can get in the ballpark with a nice big ugly infinite loop in a program and set yield a little shy.

 ;D

Ingeniero

  • Full Member
  • ***
  • Posts: 45
Re: Scan time versus Boolean Execution Time
« Reply #10 on: February 27, 2017, 12:09:05 PM »
A couple more questions:

--How big is the ethernet bump?  Is there a way to make the ethernet a low priority? Ethernet can skip a few scans or be done partially.

--Does the simulator actually track or simulate what scan time would be? somehow I doubt this.

Thanks for the help BRX buddies.


BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6161
  • Yes Pinky, Do-more will control the world!
Re: Scan time versus Boolean Execution Time
« Reply #11 on: February 27, 2017, 12:51:42 PM »
--How big is the ethernet bump?  Is there a way to make the ethernet a low priority? Ethernet can skip a few scans or be done partially.

It's about 1ms on scans that the IP stack does work. You cannot change that. The ECOMLT POM uses a high speed serial connection and the IP stack exists in the module itself, so it's hit to the PLC scan is much smaller.

--Does the simulator actually track or simulate what scan time would be? somehow I doubt this.

No.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Ingeniero

  • Full Member
  • ***
  • Posts: 45
Re: Scan time versus Boolean Execution Time
« Reply #12 on: February 27, 2017, 03:53:50 PM »
thanks BobO. great answers.