Appendix B Example - Siemens SIMATIC NET CP 243-1 Technical Manual

Communications processor for industrial ethernet
Hide thumbs Also See for SIMATIC NET CP 243-1:
Table of Contents

Advertisement

09/02

Appendix B Example

The following example shows how the CP243-1 is handled as a client. It explains
how subroutines generated by the Ethernet Wizard, which is integrated in STEP 7
Micro/WIN 32, at the end of configuration are used in the program. The data block
in which the associated configuration is stored by the Ethernet Wizard is presented
after the program code.
The sample program provided here and the associated configuration is contained
on the QuickStart CD for SIMATIC NET as a STEP 7 Micro/WIN 32 project. To run
this program, a second S7-200 system on which an appropriately configured server
will run must be accessible through Ethernet.
Program code
Project name:
Version:
Date
Target hardware: CPU 224 with CP 243-1 in slot 0
Description:
A character string ("CP243") that is stored at address VB200 and higher and that
has a length of 5 bytes is sent from the local S7-200 system to another S7-200
system, stored there at the same address and then read back from there. This pro-
cedure is repeated continuously.
The associated server must be configured as a corresponding counterpart. The
user program that runs on the server merely has to call up the ETHx_CTRL sub-
routine. Calls of the ETHx_XFR subroutine are not required for operating the ser-
ver.
The CRC check is switched on.
The configuration (IP address, ...) must be adapted to the current conditions. The
"CP243" character string must be stored at address VB200 and higher.
Copyright: SIEMENS AG, A&D PT2 (c) 2002
NETWORK 1
The ETHT0_CTRL subroutine initializes and monitors the CP 243-1.
The SM0.0 status bit is generated at input "EN". It ensures that the subroutine is
always active. As soon as the CP 243-1 has finished booting, the "CP_Ready" and
"CH_Ready" outputs are set. If an error occurred in the configuration, the "Error"
output is set. The error code that is carried over is stored in flag word 2. It can be
read out in the status table.
CP 243-1
J31069-D0428-U001-A1-7618
Beispielprogramm_Client
01.00
25.07.2002
Sample program for communication between 2 S7-200 stations
via Industrial Ethernet.
Example
67

Advertisement

Table of Contents
loading

Table of Contents