Activating/Deactivating The Generation Of Hardware Events - Siemens SIMATIC NET CP 5613 Manual

Dp base programming interface
Table of Contents

Advertisement

Description of the DP Functions, Data, and Error Codes

4.3.12 Activating/Deactivating the Generation of Hardware Events

Overview
In the process image of the CP 5613/CP 5614, there is a memory area in which
you can activate the triggering of hardware events for a new DP cycle, data
changes, or the arrival of diagnostic data.
Hardware events for changes in slave input data and diagnostic data can be set
separately for each individual slave.
The events are indicated by incrementing semaphores.
Example of Activation
"p" is a pointer to the process image that your user program obtained with the
"DP_get_pointer" call. To activate events at the start of the cycle, when data
changes and when diagnostic data arrive, you would write a program like the one
below:
/* Activate event at the start of the cycle */
p->ctr.D_cycle_start_mask = 0;
/* Activate event if slave 5 data changes 5 */
p->ef.input[5].req_mask = DPR_DATA_INT_CLEAR_AND_UNMASK;
/* Activate event if diagnostic data arrive
p->ef.diag[5].req_mask = DPR_DATA_INT_CLEAR_AND_UNMASK;
Afterwards, when events arrive, the semaphores initialized by your user program
with DP_init_sema_object are incremented.
The other possible values for "req_mask" are:
DPR_DATA_INT_CLEAR_AND_MASK – Waiting for an event, but then no
setting of the semaphore, and
DPR_DATA_CHANGE – an event has arrived.
172
from slave 5 */
DP Base Programming Interface for CP 5613/CP 5614
C79000-G8976-C108-02

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic net cp 5614

Table of Contents