PtP coupling and configuration of CP 340
Manual, 04/2011, A5E00369892-03
147
Programming Example for Standard Function Blocks
9
Introduction
The programming example given here describes standard functions for operating the CP 340
communications processor.
Objective
The programming example
●
aims to show examples of the most important functions
●
enables the correct functioning of the connected hardware to be checked (and is
therefore simple and easy to follow)
●
can easily be extended for your own purposes.
The example shows how a connection to a communications partner can be configured using
the standard function blocks P_SEND and P_RCV (to send and receive data respectively).
The example also shows how data can be output to a printer using the P_PRINT function
block and how the inputs and outputs of the CP 340 can be controlled and monitored using
the V24_STAT and V24_SET standard functions.
There are two SIMATIC stations in the example because the CP 340 has to be
parameterized differently for sending/receiving data and for printer output:
●
1st station: Computer link with the P_SEND and P_RCV function blocks
●
2nd station: Printing and reading and controlling RS 232C secondary signals with the
P_PRINT function block and the V24_STAT and V24_SET functions
The CP 340 is parameterized by the CPU when the latter is started up (system service).
Prerequisite
The example can be executed with the minimum hardware equipment (2 bytes for inputs, 2
bytes for outputs). The STEP 7 function Monitor/Modify Variables is also used (e.g. to modify
transmitted data).
The program example
The program example of the CP 340 is supplied on a CD which comes with this manual. The
CD also contains the parameterization interface and the function blocks.
It is available both compiled and as an ASCII source file. A list of all the symbols used in the
example is also included.
Содержание SIMATIC CP 340
Страница 6: ...Preface PtP coupling and configuration of CP 340 6 Manual 04 2011 A5E00369892 03 ...
Страница 10: ...Table of contents PtP coupling and configuration of CP 340 10 Manual 04 2011 A5E00369892 03 ...
Страница 186: ...Accessories and Order Numbers PtP coupling and configuration of CP 340 186 Manual 04 2011 A5E00369892 03 ...
Страница 190: ...Literature on SIMATIC S7 PtP coupling and configuration of CP 340 190 Manual 04 2011 A5E00369892 03 ...
Страница 200: ...Index PtP coupling and configuration of CP 340 200 Manual 04 2011 A5E00369892 03 ...