Siemens SIMATIC NET PROFIBUS Manuel de service Page 150

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 238
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 149
Description of the DP Functions, Data, and Error Codes
DP Base Programming Interface for CP 5613/CP 5614
150
C79000-G8976-C108-01
4.3.4 Checking the Slaves for Changed Data
Uses of the Data Changed Information
The process image of the CP 5613/CP 5614 contains a memory area where you
can see which slave data have changed.
You can use this property to quickly check where data have changed without
having to use semaphores.
Example
"p" is a pointer to the process image that your user program obtained with the
"DP_get_pointer" call. To count, for example, how many slave have changed data,
you would write a program like that shown below, where "sum" contains the result:
unsigned short sum = 0;
unsigned short i;
for (i=0; i < DPR_MAX_SLAVE_ADDR;i++)
{
if ( p->ef.input[i].req_mask == DPR_DATA_CHANGE )
{ /* Changed data found on slave i */
/* Mask released again */
p->ef.input[i].req_mask =
DPR_DATA_INT_CLEAR_AND_UNMASK;
sum++;
}
}
Vue de la page 149
1 2 ... 145 146 147 148 149 150 151 152 153 154 155 ... 237 238

Commentaires sur ces manuels

Pas de commentaire