SIEMENS AG
db_buch
The function db_buch checks which DBs exist in the PLC.
For this purpose a buffer of 512 words must be made available (see example).
If the value in buffer [123] is = 0 this means that block DB 123 does not exist in
the PLC.
If there were no errors, the function supplies 0 as the return value otherwise an
error message which can be evaluated in accordance with the error table (see
error_message).
C-Adapter
int
db_buch (void * buffer);
Example:
The program checks if DB 123 exists in the PLC.
C-Adapter
#include <w95_s7.h>
unsigned short buffer[512];
int
error;
:
:
error = db_buch(buffer);
if (buffer[123] != 0)
{
/* DB 123 ist im AG vorhanden */
}
:
error = unload_tool();
:
:
Toolbox for Data Link PGs/PCs to SIMATIC S7
26
PRODAVE S7