WAGO-I/O-SYSTEM 750
758-874/000-131 WAGO-I/O-IPC-C6
13.2.2
Structures
Structures can also be transferred. In doing so, it is important that the data types
be maintained exactly. The structures must also be defined with the "packed"
attribute. Therefore, the following CoDeSys structure
TYPE t_teststruct :
STRUCT
END_STRUCT
END_TYPE
Figure 99: "Example.lib" file
would appear in C as follows:
struct t_teststruct{
char a;
unsigned short b;
signed short c;
unsigned int d;
float e;
char *f;
} __attribute__((packed));
Figure 100: "Example.h" file
Pay attention to the data types and the "packed" attribute in the "Beispiel.h" file.
Manual
Version 1.0.0
a : BYTE;
b : WORD;
c : INT;
d : DWORD;
e : REAL;
f : POINTER TO STRING;
Incorporation of C-Functions as CoDeSys Library
// Codesys-Style:
//
BYTE
//
WORD
//
INT
//
DWORD
//
REAL
//
POINTER TO STRING
175