Siemens SIMATIC NET PROFIBUS Manual de Serviço Página 162

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 238
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 161
Description of the DP Functions, Data, and Error Codes
DP Base Programming Interface for CP 5613/CP 5614
162
C79000-G8976-C108-01
4.3.11 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
from slave 5 */
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:
x
DPR_DATA_INT_CLEAR_AND_MASK
– Waiting for an event, but then no
setting of the semaphore, and
x
DPR_DATA_CHANGE
– an event has arrived.
Vista de página 161
1 2 ... 157 158 159 160 161 162 163 164 165 166 167 ... 237 238

Comentários a estes Manuais

Sem comentários