As200_T_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_t_field_read

The functions as200_t_field_read read "amount" of bytes from the data area of
the PLC starting from "no" and store the read values in a variable field of the
PG/PC.
Attention!
5 bytes are received per timer 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_t_field_read (int no,int amount,void*buffer);
Example:
Timer values 0 and 1 are read and saved in "T0" and "T1".
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 T0,T1;
:
error = load_tool(1,"S7ONLINE",plc_adr_table);
:
error = as200_t_field_read(0,2,buffer);
T0 = (unsigned short)buffer[4] |
(unsigned short)buffer[3] << 8;
T1 = (unsigned short)buffer[9] |
(unsigned short)buffer[8] << 8;
:
error = unload_tool();
:
Toolbox for Data Link PGs/PCs to SIMATIC S7
46
PRODAVE S7

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents