Programming Example For Standard Function Blocks - Siemens SIMATIC CP 340 User Manual

Ptp coupling and configuration
Hide thumbs Also See for SIMATIC CP 340:
Table of Contents

Advertisement

Programming Example for Standard Function Blocks

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
● 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
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.
PtP coupling and configuration of CP 340
Manual, 04/2011, A5E00369892-03
therefore simple and easy to follow)
P_PRINT function block and the V24_STAT and V24_SET functions
9
147

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents