EasyManuals Logo

Siemens SIMATIC CP 340 User Manual

Siemens SIMATIC CP 340
200 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 #157 background imageLoading...
Page #157 background image
Programming Example for Standard Function Blocks
9.7 Activation, Start-Up Program and Cyclic Program
PtP coupling and configuration of CP 340
Manual, 04/2011, A5E00369892-03
157
Description of "reading and controlling the CP 340 inputs/outputs"
The "read and control RS 232C accompanying signals" functions can only be carried out
with the ASCII driver. A prerequisite is that you have not set the “Automat. control of V24
signals" parameter on the "Transfer" tab.
To enable the CP 340 inputs/outputs to be read and controlled, input I 0.0 must be showing
the "0" signal and input I 0.1 the "1" signal. The signal states SET_DTR and SET_RTS can
be preselected by means of inputs I 1.6 and I 1.7. When the signal at I 0.7 changes from "0"
to "1", this state is transferred to the CP by the V24_SET function.
The V24_STAT standard function is called cyclically. The state of the CP 340 inputs/outputs
is displayed at output byte QB 5.
Description of "printing"
To enable printing, input I 0.0 must be showing the "0" signal and input I 0.1 the "1" signal.
Inputs I 1.0, I 1.1, I 1.2, and I 1.3 allow you to select between four PRINT jobs. The PRINT
jobs are located in data block DB 30. This points to the actual data (variables 1 to 4 and the
format string) to be sent to the CP 340.
Job 1 sends the data of variables 1 to 4 and the format string. Data is read as follows:
Variable 1 is read from DB 31 starting at data double word DBD 0
Variable 2 is read from DB 32 starting at data word DBW 0
Variable 3 is read from DB 33 starting at data word DBW 0
Variable 4 is read from DB 34 starting at data word DBW 0
Format string is read from DB 35 from DBB 2 to DBB 43
Job 2 sends the data of variables 1 to 4 and the format string. Data is read as follows:
Variable 1 is read from DB 31 starting at data double word DBD 8
Variable 2 is read from DB 32 starting at data word DBW 2
Variable 3 is read from DB 33 starting at data word DBW 2
Variable 4 is read from DB 34 starting at data word DBW 2
Format string is read from DB 35 from DBB 2 to DBB 43
Job 3 sends the data of variables 1 to 4 and the format string. Data is read as follows:
Variable 1 is read from DB 31 starting at data double word DBD 16
Variable 2 is read from DB 32 starting at data word DBW 4
Variable 3 is read from DB 33 starting at data word DBW 4
Variable 4 is read from DB 34 starting at data word DBW 4
Format string is read from DB 35 from DBB 2 to DBB 43
Job 4 sends the data of variable 1 and the format string. Data is read as follows:
Variable 1 is read from DB 31 starting at data double word DBD 24
Format string is read from DB 35 from DBB 68 to DBB 111

Table of Contents

Other manuals for Siemens SIMATIC CP 340

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Siemens SIMATIC CP 340 and is the answer not in the manual?

Siemens SIMATIC CP 340 Specifications

General IconGeneral
BrandSiemens
ModelSIMATIC CP 340
CategoryComputer Hardware
LanguageEnglish

Related product manuals