WAGO-I/O-SYSTEM 750 Incorporation of C-Functions as CoDeSys Library 175
758-874/000-131 WAGO-I/O-IPC-C6
Manual
Version 1.0.0
TYPE t_teststruct :
STRUCT
a : BYTE;
b : WORD;
c : INT;
d : DWORD;
e : REAL;
f : POINTER TO STRING;
END_STRUCT
END_TYPE
struct t_teststruct{ // Codesys-Style:
char a; // BYTE
unsigned short b; // WORD
signed short c; // INT
unsigned int d; // DWORD
float e; // REAL
char *f; // POINTER TO STRING
} __attribute__((packed));
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
Figure 99: "Example.lib" file
would appear in C as follows:
Figure 100: "Example.h" file
Pay attention to the data types and the "packed" attribute in the "Beispiel.h" file.