How do you read out the IP address of the S7-300 CPU in the user program at run time?
You call the "RDSYSST" instruction in order to read out the IP
address of the S7-300 CPU in the user program. With the "RDSYSST"
instruction you can read out a parts list or excerpt of a parts list of
the system status lists (SSL or in German SZL). With the SSL ID and the
INDEX you specify the parts list or excerpt of the parts list and the
type or number of an object in a parts list. Use the SSL ID = 37 (hex)
and the INDEX = 0 (hex) to read out the IP address of the S7-300 CPU.
![](https://a248.e.akamai.net/cache.automation.siemens.com/dnl/TE/TEyMTg1MwAA_81665714_FAQ/NET_RDSYSST_IP_Address_01.png)
Fig. 01
Inputs and outputs of the "RDSYSST" instructionsTable 01 shows the inputs of the "RDSYSST" instruction.
Parameter | Data type | Description |
REQ | BOOL | REQ=1: Trigger for processing |
SSL_ID | WORD | SSL_ID of the parts list or of the excerpt of the parts list SSL_ID=w#16#37: Read out of the IP address of the S7-300 CPU |
INDEX | WORD | Type or number of an object in a parts list INDEX=w#16#0: Read out of the IP address of the S7-300 CPU |
Parameter | Data type | Description |
RET_VAL | INT | If an error occurs during processing of the instruction, the RET_VAL parameter receives an error code. |
BUSY | BOOL | TRUE: Read procedure has not yet finished |
SZL_HEADER | STRUCT | The SZL_HEADER is a structure. The structure is described under "SZL_HEADER structure". |
DR | ANY | Target area for read SSL parts list or read excerpt of SSL parts list. |
SZL_HEADER: STRUCT
LENTHDR: WORD
N_DR: WORD
END_STRUCT
LENTHDR is the length of a data record of the SSL parts list or excerpt of the SSL parts list .
- If you have only read out the header information of an SSL parts list, N_DR contains the number of associated data records available.
- Otherwise N_DR contains the number of data records transferred to the target area.
![](https://a248.e.akamai.net/cache.automation.siemens.com/dnl/jU/jU0OTM0NQAA_81665714_FAQ/NET_RDSYSST_IP_Address_02_e.png)
Fig. 02
When you have read out the IP address of the CPU, you can evaluate it in the user program. In this example, the IP address is saved as a decimal value in the data block DB1 "DATA" starting at Address 8.
![](https://a248.e.akamai.net/cache.automation.siemens.com/dnl/DM/DMyMjQ5AAAA_81665714_FAQ/NET_RDSYSST_IP_Address_03_e.png)
Fig. 03
![](https://a248.e.akamai.net/cache.automation.siemens.com/dnl/jk/jk4MDAzAAAA_81665714_FAQ/NET_RDSYSST_IP_Address_04_e.png)
Fig. 04
![](https://a248.e.akamai.net/cache.automation.siemens.com/dnl/jI/jI0NzE1NQAA_81665714_FAQ/NET_RDSYSST_IP_Address_05_e.png)
Fig. 05
![](https://a248.e.akamai.net/cache.automation.siemens.com/dnl/jU/jU0ODUzOQAA_81665714_FAQ/NET_RDSYSST_IP_Address_06_e.png)
Fig. 06
![](https://a248.e.akamai.net/cache.automation.siemens.com/dnl/jk/jkyMzcyMwAA_81665714_FAQ/NET_RDSYSST_IP_Address_07_e.png)
Comments
Post a Comment