Siemens SIMATIC S7 Operating Instructions Manual page 42

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
Example:
Input byte 0, output byte 3 and DW 5 from DB 10 are read and the values are
stored in variables e, a and d:
C-Adapter
#include <w95_s7.h>
#pragma pack(1)
typedef struct {
data_type data[10];
#pragma pack()
char
buffer[100];
char
e,a;
int
d;
int
error;
:
:
data[0].typ = 'e';
data[0].size= 'b';
data[0].no
data[1].typ = 'a';
data[1].size= 'b';
data[1].no
data[2].typ = 'd';
data[2].size= 'w';
data[2].dbno= 10;
data[2].no
data[3].typ = 0;
error = mix_read((char*)data,buffer);
e = buffer[0];
a = buffer[1];
d = ((int)buffer[2] << 8) | (int)buffer[3];
:
:
Toolbox for Data Link PGs/PCs to SIMATIC S7
char typ;
char size;
unsigned short dbno;
unsigned short no;
} data_type;
= 0;
= 3;
= 5;
/* endekennung der liste */
38
PRODAVE S7

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents