Db_Write - Siemens SIMATIC S7 Operating Instructions Manual

Prodave s7 v5.5 toolbox for windows 95/98/nt/me/2000 applications for a data link of pgs/pcs to simatic s7 via mpi interface and pc/mpi cable
Hide thumbs Also See for SIMATIC S7:
Table of Contents

Advertisement

SIEMENS AG

db_write

The function db_write writes an amount of data words from a variable field of
the PG/PC into the PLC.
If the data block does not exist this is indicated by a return value = error
number.
If the data which is being written, exceeds the amount available in the data
block, the " amount" is corrected and error message 303 hex is returned.
Important!
The data words must be stored in "buffer" in accordance with STEP5-Notation
(high byte - low byte).
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).
See also db_read
C-Adapter
int
db_write
(int dbno,int dwno, int* amount, void* buffer);
Example:
DB10 consisting of 20 data words (DW 0 - DW 19) exists in the PLC.
Value 2468 hex is assigned to DW 1 and DW 2.
C-Adapter
#include <w95_s7.h>
int
buffer[100];
int
error,dbno,dwno,amount;
:
dbno
= 10;
dwno
= 1;
amount = 2;
buffer[0] = 0x6824;
buffer[1] = 0x6824;
error = db_write(dbno,dwno,&amount,buffer);
:
error = unload_tool();
:
Toolbox for Data Link PGs/PCs to SIMATIC S7
29
PRODAVE S7
(mini)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents