Siemens SIMATIC NET CP 5613 Manual page 161

Dp base programming interface
Table of Contents

Advertisement

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 slaves are in the READY
state, 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->info_watch.slave_info[i].slave_state ==
{
sum++;
}
}
There is also the DPR_SLV_NOT_READY state that also includes non-configured
slaves.
Note 1
The DP master automatically attempts to reinitialize slaves in the NOT READY
state and to include them in cyclic processing.
Note 2
The user program must not overwrite the slave_state variable.
Note 3
The memory area with index 127 contains the state of the slave module of the
CP 5614.
Note 4
If the slave is in the READY state, this does not necessarily mean that its data are
valid. Diagnostic data may mean that the validity of the data is restricted.
DP Base Programming Interface for CP 5613/CP 5614
C79000-G8976-C108-02
Description of the DP Functions, Data, and Error Codes
/* found */
DPR_SLV_READY)
161

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic net cp 5614

Table of Contents