Obsidean_VM/01-Documentation/Siemens/PLC Siemens/RDSYSST - SFC51.md

26 KiB

Reading a System Status List or Partial List with SFC 51 "RDSYSST"

Description

With system function SFC 51 "RDSYSST" (read system status), you read a system status list or a partial system status list.

You start the reading by assigning the value 1 to the input parameter REQ when SFC 51 is called. If the system status could be read immediately, the SFC returns the value 0 at the BUSY output parameter. If BUSY has the value 1, the read function is not yet completed.

Note

If you call SFC 51 "RDSYSST" in the diagnostic interrupt OB with the SSL-ID W#16#00B1 or W#16#00B2 or W#16#00B3 and access the module that initiated the diagnostic interrupt, the system status is read immediately.

With SFC51 "RDSYSST" only complete data records are transferred.

System Resources

If you start several asynchronous read functions (the jobs with SSL_ID W#16#00B4 and W#16#4C91 and W#16#4092 and W#16#4292 and W#16#4692 and possibly W#16#00B1 and W#16#00B3) one after the other at brief intervals, the operating system ensures that all the read jobs are executed and that they do not interfere with each other. If the limits of the system resources are reached, this is indicated in RET_VAL. You can remedy this temporary error situation by repeating the job.

The maximum number of "simultaneously" active SFC 51 jobs depends on the CPU. You will find this information in /70/ and /101/.

Note

For S7-400 CPUs, a maximum of 432 bytes can be transferred to the target area by the SFC 51-
Parameter Declaration Data Type Memory Area Description
REQ INPUT BOOL I, Q, M, D, L,
constant
REQ=1: Starts processing
SSL_ID INPUT WORD I, Q, M, D, L,
constant
SSL-ID of the system status list or
partial list to be read.
INDEX INPUT WORD I, Q, M, D, L,
constant
Type or number of an object in a
partial list.
RET_VAL OUTPUT INT I, Q, M, D, L If an error occurs while executing the
SFC, the RET_VAL parameter
contains an error code.
BUSY OUTPUT BOOL I, Q, M, D, L TRUE: Reading not yet completed.
SSL_HEADER OUTPUT STRUCT D, L See below.
DR OUTPUT ANY I, Q, M, L, D Destination area of the SSL list read
or the SSL partial list read:

If you have only read out the header information of an SSL list,
you must not evaluate DR but
only SSL_HEADER.

Otherwise, the product of
LENTHDR and N_DR indicates
how many bytes were entered in
DR.

SSL_HEADER

The SSL_HEADER parameter is a structure defined as follows:

SSL_HEADER: STRUCT
 LENTHDR: WORD
 N_DR:  WORD
END_STRUCT

LENTHDR is the length of a data record of the SSL list or the SSL partial list.

  • If you have only read out the header information of an SSL list, N_DR contains the number of data records belonging to it.

  • Otherwise, N_DR contains the number of data records transferred to the destination area.

Error Information

Error Code
(W#16#...)
Description
0000 No error.
0081 Result field too short. (Nevertheless as many data records as possible are supplied. The
SSL header indicates this number.)
7000 First call with REQ=0: No data transfer active; BUSY has the value 0.
7001 First call with REQ=1: Data transfer started; BUSY has the value 1.
7002 Interim call (REQ irrelevant): Data transfer already active; BUSY has the value 1.
8081 Result field too short (not enough space for one data record).
8082 SSL_ID is wrong or is unknown in the CPU or SFC.
8083 INDEX wrong or not permitted.
8085 Due to a problem in the system, information is not currently available (for example, due
to a lack of resources).
8086 The data record cannot be read due to a system error (bus, modules, operating system).
8087 Data record cannot be read because the module does not exist or does not acknowledge.
8088 Data record cannot be read because the actual module identifier is different from the
expected module identifier.
8089 Data record cannot be read because the module is not capable of diagnostics or the data record is not supported.
80A2 DP protocol error (layer 2 error) (temporary error)
80A3 DP protocol error with user interface/user (temporary error)
80A4 Communication problem on communication bus (error occurs between the CPU and the
external DP interface module)
80C5 Distributed I/Os not available (temporary error).
80C6 Data record transfer stopped due to priority class abort (restart or background)
80D2 Data record cannot be read because the module is not capable of diagnostics.
8xyy General error information, see Evaluating Errors with the Output Parameter RET_VAL

SSL_IDs

Note

For the partial lists that can be read out with SFC 51 "RDSYSST" refer to

- /72/ for the S7-300

- The following table for the S7-400.
SSL_ID (W#16#...) Partial List INDEX (W#16#...)
Module ID
0111 One identification data record
Identification of the module 0001
Identification of the system expansion card 0004
Identification of the basic hardware 0006
Identification of the basic firmware 0007
CPU characteristics
0012 All characteristics Irrelevant
0112 Characteristics of one group
MC7 processing unit 0000
Time system 0100
System behavior 0200
MC7 language description 0300
Availability of SFC 87 and SFC 88 0400
0F12 Only SSL partial list header information Irrelevant
User memory areas
0113 One data record for the memory area specified
Work memory 0001
System areas
0014 Data records of all system areas Irrelevant
0F14 Only SSL partial list header information Irrelevant
Block types
0015 Data records of all block types Irrelevant
Identification of one component
001C Identification of all components Irrelevant
011C Identification of one component
Name of the automation system 0001
Name of the module 0002
System ID of the module 0003
Copyright entry 0004
Serial number of the module 0005
Module type name 0007
Serial number of the memory card 0008
Manufacturer and profile of a CPU module 0009
Location designation of a module 000B
Serial number of sync module 1 000C
Serial number of sync module 2 000D
Serial number of the system expansion card 000E
021C Identification of all components in a CPU of an H system Rack no.
031C Identification of one component in all redundant CPUs of an H system Index
0F1C Only SSL partial list header information Irrelevant
Interrupt status
0222 Data record for indicated interrupt OB number
Assignment of process image partitions and CPUs
0025 Assigning all process image partitions to OBs Irrelevant
0125 Assignment of a process image partition to the corresponding OB Process image partition number.
0225 Assignment of an OB to the corresponding process image partitions OB number.
0F25 Only info on SSL partial list headers Irrelevant
Communication status data
0132 Status data for one communication unit
Diagnostics 0005
Time system 0008
0232 Status data for one communication unit
CPU protection level and operator control settings 0004
H CPU group information
0071 Information about the current state of the H system Irrelevant
0F71 Only SSL partial list header information Irrelevant
Status of the module LEDs (cannot be read out from all CPUs, see /102/).
0174 Status of an LED LED ID
Switched DP slaves in the H system
0C75 Communication status between the H system and a switched DP slave Diagnostics address of the DP slave interface
DP Master system information
0090 Information DP Master systems known to the CPU 0000
0190 Information about a DP Master system DP master system ID
0F90 Only SSL partial list header information 0000
Module status information (a maximum of 27 data records is supplied)
0091 Status information of all modules / submodules inserted Irrelevant
0191 Module status information of all non-deactivated modules / racks with
incorrect type ID
Irrelevant
0291 Module status information of all faulty and non-deactivated modules Irrelevant
0391 Module status information of all unobtainable modules Irrelevant
0591 Module status information of all submodules of the host
module
Irrelevant
0991 Module status information of a DP master system DP master
system ID
0C91 Module status information of a module in a central
configuration or connected to an integrated DP
communications processor or on a PROFINET interface module (integrated or external)
Logical base address
4C91 Module status information of a module connected to an
external DP communications processor
Logical base address
0D91 Module status information of all modules in the rack / DP
station specified (DP or PROFINET)
Rack or DP master system ID and station number or station number and the last two positions of the PNIO subsystem ID
0E91 Module status information of all assigned modules Irrelevant
0F91 Only SSL partial list header information irrelevant
Rack/station status information
0092 Expected status of the rack in the central configuration /
of the stations of a DP master system
0 / DP master system
ID
4092 Expected status of the stations of a DP master system
connected to an external DP interface
DP master system ID
0192 Activation status of the stations in a DP master system that is connected via an integrated DP interface DP master system ID
0292 Current status of the rack in the central configuration / of the
stations of a DP master system
0 / DP master system
ID
4292 Current status of the stations in a DP master system that is connected via an external DP interface module. DP master system
ID
0392 Status of the backup batteries in a rack/module rack of a CPU after at least one battery has failed 0
0492 Status of the overall battery backup status of all racks/module racks of a CPU 0
0592 Status of the 24-V power supply to all racks/module racks of a CPU 0
0692 Diagnostic status of the expansion racks in a central configuration /
of the stations of a DP master system connected via an
integrated DP interface module
0 / DP master system
ID
4692 Diagnostic status of the stations of a DP master system connected
via an external DP interface module
DP master system ID
Rack /station status information
0094 Expected status of the rack in the central rack / stations of an IO controller system 0 / PNIO subsystem ID
0194 Activation status of an IO controller system that is configured and deactivated PNIO subsystem ID
0294 Actual status of the rack in the central rack / stations of an IO controller system 0 / PNIO subsystem ID
0694 Diagnostic status of the expansion units in the central rack / stations of an IO controller system 0 / PNIO subsystem ID
0794 Maintenance status of the central rack / stations of an IO controller system 0 / PNIO subsystem ID
0F94 Only header information -
Extended DP master system / PROFINET IO system information
0195 Extended information about a DP master system DP master system ID
0F95 Only SSL partial list header information 0000
Module status information PROFINET IO and PROFIBUS DP
0696 Module status information of all submodules of a specified module (only with PROFINET IO on an integrated interface module) Address with I/O ID
0C96 Module status information of a module / a submodule centrally or on an integrated PROFIBUS DP interface module or an a PROFINET interface module (integrated or external) Start address with I/O ID
Tool changer information (PROFINET IO)
009C Information on all tool changers and their tools in a PROFINET IO system PROFINET IO system ID
019C Information on all tool changers in a PROFINET IO system PROFINET IO system ID
029C Information on one tool changer and its tools Logical address of the tool changer
039C Information on a tool and its IO devices Logical address of one of the IO devices of the tool
0F9C Only SSL partial list header information irrelevant
Diagnostic buffer (a maximum of 21 data records is supplied)
00A0 All entries that can be supplied in the currently active
operating mode
Irrelevant
01A0 The most recent entries, the number is specified in the
index
Quantity
0FA0 Only SSL partial list header information Irrelevant
Diagnostic data on modules
00B1 The first four diagnostic bytes of one module (data record 0) Logical base address
00B2 All diagnostic data of one module (< 220 bytes, data record 1) (no DP module) Rack, slot
00B3 All diagnostic data of one module (< 220 bytes, data record 1) Logical base address
00B4 Diagnostic data of a DP slave Configured diagnostic
address

Evaluating Errors with Output Parameter RET_VAL

Types of Error Information

A system function (SFC) executed in your user program indicates whether or not the CPU was able to execute the function of the SFC successfully.
You can obtain information about any errors that occurred in two ways:

  • In the BR bit of the status word

  • In the output parameter RET_VAL (return value)

Note

Before evaluating the output parameters specific to an SFC, you should always follow the steps below:

- First, evaluate the BR bit of the status word.

- Then check the output parameter RET_VAL.


If the BR bit indicates that an error has occurred or if RET_VAL contains a general error code, you must not evaluate the SFC output parameter!

Error Information in the Return Value

A system function (SFC) indicates that an error occurred during its execution by entering the value "0" in the binary result bit (BR) of the status word. Some system functions provide an additional error code at an output known as the return value (RET_VAL) output. If a general error is entered in the output parameter RET_VAL (see below for explanation), this is only indicated by the value "0" in the BR bit of the status word.

The return value is of the data type integer (INT). The relationship of the return value to the value "0" indicates whether or not an error occurred during execution of the function.

CPU Execution of the SFC BR Return Value Sign of the Integer
With error(s) 0 less than "0" negative
(sign bit is "1")
Without error 1 greater than or
equal to "0"
positive
(sign bit is "0")

Reactions to Error Information

There are two different types of error code in RET_VAL as follows:

  • A general error code, that all system functions can output and

  • A specific error code, that the system function can output and which relates to its specific function.

You can write your program so that it reacts to the errors that occur during execution of a system function. This way you prevent further errors occurring as a result of the first error.

General and Specific Error Information

The return value (RET_VAL) of a system function provides one of the two following types of error codes:

  • A general error code, that relates to errors that can occur in any system function.

  • A specific error code, that relates only to the particular system function.

Although the data type of the output parameter RET_VAL is integer (INT), the error codes for system functions are grouped according to hexadecimal values. If you want to examine a return value and compare the value with the error codes listed in this manual, then display the error code in hexadecimal format.

The figure below shows the structure of a system function error code in hexadecimal format.

image/S7RS0157_b.gif

General Error Information

The general error code indicates errors that can occur in any system function. A general error code consists of the following two numbers:

  • A parameter number from 1 to 111, where 1 indicates the first parameter, 2 indicates the second parameter of the SFC, etc.

  • An event number from 0 to 127. The event number indicates that a synchronous error occurred.

The following table lists the codes for general errors and an explanation of each error.

image/S7RS0158_b.gif

Note

If a general error code was entered in RET_VAL, the following situations are possible:

- The action associated with the SFC may have been started or already completed.

- A specific SFC error may have occurred when the action was performed. As a result of a general error that occurred later, the specific error could, however, no longer be indicated.

Specific Error Information

Some system functions (SFCs) have a return value that provides a specific error code. This error code indicates that an error pertaining to a particular system function occurred during the execution of the function (see figure). A specific error code consists of the following two numbers:

  • An error class from 0 to 7.

  • An error number from 0 to 15.

image/S7RS0159_b.gif

General Error Codes

The following table explains the general error codes of a return value. The error code is shown in hexadecimal format. The letter x in each code number is simply a place holder and represents the number of the system function parameter that caused the error.

Error Code (W#16#...) Explanation
8x7F Internal error

This error code indicates an internal error at parameter x.
8x01 Illegal syntax ID at an ANYparameter
8x22

8x23
Range length error when reading a parameter.
Range length error when writing a parameter.
This error code indicates that the parameter x is located either entirely or partly outside the range of an address or that the length of a bit range is not a multiple of 8 with an ANY parameter.
8x24

8x25
Range error when reading a parameter.

Range error when writing a parameter.

This error code indicates that the parameter x is located in a range that is illegal for the system function. Refer to the descriptions of the individual functions for information about the illegal ranges.
8x24
8x25
Range error when reading a parameter.
Range error when writing a parameter.
This error code indicates that the parameter x is located in a range that is illegal for the system function. Refer to the descriptions of the individual functions for information about the illegal ranges.
8x26 The parameter contains a timer number that is too high.
This error code indicates that the timer specified in parameter x does not exist.
8x27 The parameter contains a counter number that is too high (counter number error).
This error code indicates that the counter specified in parameter x does not exist.
8x28
8x29
Alignment error when reading a parameter.
Alignment error when writing a parameter.
This error code indicates that the reference to parameter x is a bit address that is not equal to 0.
8x30
8x31
The parameter is located in a read-only global DB.
The parameter is located in a read-only instance DB.
This error code indicates that parameter x is located in a read-only data block. If the data block was opened by the system function itself, the system function always returns the value W#16#8x30.
8x32
8x34
8x35
The parameter contains a DB number that is too high (DB number error).
The parameter contains an FC number that is too high (FC number error).
The parameter contains an FB number that is too high (FB number error).
This error code indicates that parameter x contains a block number higher than the highest permitted number.
8x3A
8x3C
8x3E
The parameter contains the number of a DB that is not loaded.
The parameter contains the number of an FC that is not loaded.
The parameter contains the number of an FB that is not loaded.
8x42

8x43
An access error occurred while the system was attempting to read a parameter from the peripheral input area.
An access error occurred while the system was attempting to write a parameter to the peripheral output area.
8x44

8x45
Error in the nth (n > 1) read access after an error occurred.

Error in the nth (n > 1) write access after an error occurred.

This error code indicates that access to the required parameter is denied.