EasyManuals Logo

Siemens CP 243-1 User Manual

Siemens CP 243-1
142 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #131 background imageLoading...
Page #131 background image
CP 243-1
Operating Instructions, 03/2012, C79000-G8976-C244-02
131
Sample program
C
Below, you will find an example of how to handle the CP 243-1 as an S7 client. This example
shows how to use the subroutines created by the Internet wizard integrated in STEP 7
Micro/WIN 32 at the end of configuration. The data block in which the configuration is stored
by the Internet wizard is specified at the end of the program code.
The sample program is included on the QuickStart CD for SIMATIC NET along with the
configuration as a STEP 7 Micro/WIN 32 project. To run this program you will need Ethernet
access to a second S7-200 system on which there is a suitably configured S7 server.
The user name for the administrator in the sample program is "root" and the password is
"rootroot".
Program code
Project name: Example_Client
Version: 02.01
Date: 20.01.2003
Target hardware: CPU 224 with CP 243-1 in slot 0
Description: Sample program for communication between two S7-200 stations via Industrial
Ethernet.
A character string ("CP243") that is stored starting at address VB500 and with a length of 5
bytes is sent from the local S7-200 system to another S7-200 system. It is stored there at the
same address and then read back from there. This procedure is repeated continuously.
The associated server must be configured as a suitable counterpart. The user program that
runs on the server simply has to call up the ETHx_CTRL subroutine. Calls for the ETHx_XFR
subroutine are not required for operating the server.
The CRC check is enabled.
The configuration (IP addresses, …) must be adapted to the current situation. The "CP243"
string must be stored starting at address VB500.
NETWORK 1
The ETHT0_CTRL subroutine initializes and monitors the CP 243-1.
Status bit SM0.0 is generated at input "EN". This ensures that the subroutine is always
activated. As soon as the CP 243-1 has completed startup, the "CP_Ready" and
"CH_Ready" outputs are set. If an error occurred in the configuration, the "Error" output is
set. The transferred error code is stored in memory word 2. It can be read out in the status
table.
LD Always_On
CALL ETH0_CTRL, cp_ready, ch_ready, cp_error

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Siemens CP 243-1 and is the answer not in the manual?

Siemens CP 243-1 Specifications

General IconGeneral
BrandSiemens
ModelCP 243-1
CategoryCell Phone
LanguageEnglish

Related product manuals