Siemens S5 scan time calculation

Jack Schit

Member
Join Date
Oct 2009
Location
England
Posts
35
Hi,

I wanted to know the scan time of a Siemens S5-115U 943 PLC. I couldn't find a way to measure through the PLC so I have wrote a little bit of code to give me an idea of the scan time.

I'm not sure if it is accurate though and I would appreciate any advice!

The code is as follows:

A I0.0 (Start 1sec timer)
L KT100.0
SE T50

C DB10 (call datablock to load scan value into)

AN T50 (if not timing skip)
JC =M001
L KF+1 (if timing add 1 to DW10 every PLC cycle)
L DW10
+F
T DW10 (number of scans)

=001

AN I0.1 (if on reset DW10 to 0)
JC =M002
L KF+0
T DW10

=002

The value I get in my in my datablock is a consistent 250 giving a scan time of 4ms! The program isn't particuarly large but the time seems a little quick too me.

Much appreciate any thoughts!

Thanks

Jack
 
From manual:

2.6.1 Measuring the Scan Time
The scan time is measured by the CPU and stored in the system data area. You can access the
current, the minimum and the maximum scan time in the control program at any time. The
resolution of the scan time is one millisecond, and the range of scan time values extends from 0 to
32,767 (=7FFFH) milliseconds. At the end of a scan cycle, after it has updated the process output
image (PIQ) and the interprocessor communication flags, the operating system stores the scan
time, i.e.:
• Current scan time in SD 121
• Maximum scan time in SD 122
• Minimum scan time in SD 123
If the scan time exceeds 32,767 milliseconds, bit 15 (which is the overflow bit) of the current scan
time is set and entered in system data word SD 123 (maximum scan time). Scan time measurement
begins anew in the next scan cycle.
Note
The contents of the watchdog timer are also entered in system data words 121 to 123
when the PLC stops and outputs the ”ZYK” (scan time exceeded) message.
Example:

Function block for measuring the scan time

Code:
FB99 STL                                      Description
  NAME  :ZYKLUS-Z
  DECL  :MINI        I/Q/D/B/T/C:  A BI/BY/W/D:  W
  DECL  :AKTU        I/Q/D/B/T/C:  A BI/BY/W/D:  W
  DECL  :MAXI        I/Q/D/B/T/C:  A BI/BY/W/D:  W
  DECL  :LOES        I/Q/D/B/T/C:  E BI/BY/W/D:  BI
        :   L RS 121
        :   T =AKTU
        :   L RS 122
        :   T =MAXI
        :   L RS 123
        :   T =MINI
        :   AN =LOES                        The LOES operand is used to reset system
        :   BEC                             data words 121, 122 and 123
        :   L KF +0                         (if LOES = 1).
        :   T RS 121
        :   T RS 122
        :   T RS 123
        :   BE
 
this won't help the case but think about convertion to a newer plc on S7 familly since the S5 beging to be difficult to find
 

Similar Topics

U
I have a setup in GE Plc, where PLC receives data from GBC(GENIUS BUS CONTROLLER) module,which inturn gets data from BIU module.These BIU modules...
Replies
4
Views
14,899
Hi, I want to initialise some tags on first scan only. As they are related to wall-clock time, I want to do the initialisation when the PLC first...
Replies
4
Views
968
I am working with a Siemens 1500 in portal, and I want to know if my Profinet inputs can change during the scan of the PLC code. When do local...
Replies
8
Views
2,733
Hi all, I primarily use AB PLC's, and have a reasonable understanding of the way they scan their logic. I've done a few smaller projects on...
Replies
18
Views
5,484
Dear all plz want to check my application from Virus and searching for agood too to do this plz help (program - tool - ...etc)
Replies
0
Views
1,973
Back
Top Bottom