Structures; Figure 99: "Example.lib" File; Figure 100: "Example.h" File - WAGO -I/O-IPC-C6 Manual

Wago-i/o-system 750
Hide thumbs Also See for WAGO-I/O-IPC-C6:
Table of Contents

Advertisement

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

Advertisement

Table of Contents
loading

This manual is also suitable for:

I/o-system 750758-874/000-111

Table of Contents