As200_Z_Field_Read - 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

as200_z_field_read

The function as200_z _field_read reads "amount" of counter values from the
data area of the PLC starting from "no" and stores the read values in a variable
field of the PG/PC.
Attention!
3 bytes are received per counter value, and only 2 bytes contain the requested
value (see example)
If there were no errors, the function supplies a 0 as the return value, otherwise
an error number which can be evaluated in accordance with the error table (see
error_message).
C-Adapter
int as200_z_field_read (int no,int amount,void*buffer);
Example:
Counter values 3 and 4 are read and saved in "Z3" and "Z4".
C-Adapter
#include <w95_s7.h>
int
error;
adr_table_type plc_adr_table[2] = { {2,0,2,0},{0,0,2,0} };
unsigned char buffer[10];
unsigned short Z3,Z4;
:
error = load_tool(1,"S7ONLINE",plc_adr_table);
:
error = as200_z_field_read(3,2,buffer);
Z3 = (unsigned short)buffer[2] |
(unsigned short)buffer[1] << 8;
Z4 = (unsigned short)buffer[5] |
(unsigned short)buffer[4] << 8;
:
error = unload_tool();
:
Toolbox for Data Link PGs/PCs to SIMATIC S7
47
PRODAVE S7

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents