Receiving Data With The Cp 5614 As Dp Slave - Siemens SIMATIC NET CP 5613 Manual

Dp base programming interface
Table of Contents

Advertisement

4.3.14 Receiving Data with the CP 5614 as DP Slave

Integration in the Process Image of the CP 5613/CP 5614
The received data of the slave module are stored in the input image with slave
index 127. This allows the user program to read the data sent by the controlling
master as outputs to the slave module by reading the input data area with slave
index 127.
Example of Consistent Reading
"p" is a pointer to the process image that your user program obtained with the
"DP_get_pointer" call. Then 200 bytes of the received data of the slave module are
copied to a local buffer "buf":
/* Lock the data area against updating */
p->ctr.D_lock_in_slave_adr = 127;
/* Copy data */
memcpy(buf, &p->pi.slave_in[127].data[0], 200);
/* Cancel lock again
p->ctr.D_lock_in_slave_adr = DPR_DP_UNLOCK;
The copied data is the received data of the slave module that the controlling master
sent as outputs.
Reading without Consistency
To read without consistency, the locking and release of the data area are simply
omitted.
General Notes
Note
The data are only valid when the slave module of the CP 5614 is in the READY
state and the master controlling the slave is in the OPERATE mode.
DP Base Programming Interface for CP 5613/CP 5614
C79000-G8976-C108-02
Description of the DP Functions, Data, and Error Codes
*/
175

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic net cp 5614

Table of Contents