User manual
2.3 Synchronous Interface
Implementation of the main
program with synchronous
interface allows simple and
clearly arranged programs
with sequential control flow.
It is suitable mainly for simple
applications, which allow a
predefinition of events to
process. This is true if, for
example, only CAN
messages are to be received
or only bus load
measurement is to be
realized.
2.4 Asynchronous Interface
The asynchronous interface
provides enhanced flexibility
in reaction to events which
are not predictable in their
sequence of occurrence.
Communication objects can
be processed independent of
program state, reactions can
be configured flexible. For this
purpose every communication
object is handed on to a set of
handling functions. Such
functions are provided within
the programming library. The
application programmer can
add routines as required by
application purposes.
User Manual CPC-XTI
EMS Dr. Thomas Wünsche 5
command
execution
by CPC-XTI
command
initiation
wait for result
continue
main
program
command
execution
by CPC-XTI
command
initiation
further
program
execution
use result
main
program
2.5 Data Structures and Library Functions
2.5.1 Data Structures
The following structures are declared in the
include file CPC.H.
Please notice that the structures and
functions described in the following refer
to the old DOS and Windows libraries and
are included in this manual for
compatibility reasons. The new structures
and functions are described within the
manual ‘CPC Series Development Kit for
MS Windows Environment’.
struct CPC_MSG
Declaration: struct CPC_MSG {
unsigned char typ;
unsigned char length;
union {
unsigned char genericmsg[];
unsigned char textmsg[];
char versionmsg[];
char serialmsg[];
struct CPC_CAN_MSG canmsg;
unsigned char busloadmsg;
unsigned char canstatemsg;
struct CPC_CAN_PARAMS
can_params_msg;
};
};
Description: CPC_MSG serves for parameter transfer
between application program and interface
library.
CPC-XTI User Manual
6 EMS Dr. Thomas Wünsche