Technical data
Linkage with PLC
170 VIPA GmbH CP486 ⋅ 00/14
6.4.4 Interface to Turbo-C (2.0 and C++ from 1.0), Microsoft-C 6.0
To facilitate calling functions of COM-driver from C-programs, a library file has been created
which makes available all functions of the service interrupt INT 78 to be easy called. For every
driver function a respective C-function is defined which supplies registers, calls interrupts and
returns values. Thus, also users being not familiar with system-oriented programming on AT, are
able to utilize fully all driver feasibilities.
Data types and constants for element sizes, element types and error numbers as well as function
prototypes of of functions in ANSI-C-style described in the following are defined in the Include File
"CP386DEF.H". The Include-File must be quoted in the application program.
All required functions are implemented in the CP386LIB.C file. The CP386LIB.O file is also to be
implemented if it is to be used in a program. Depending on the programming environment and
version, the file is to be packed into the project file (Turbo-C) or Depencie List (Microsoft-C) or
into the Make-File. For detailed information see the respective manuals.
Reference: in "CP386LIB.H" is
byte defined as unsigned char
word defined as unsigned short.
6.4.4.1 Function CP Status Call
Data structures:
typedef struct {
word CP_id; /* identification: CP386 value = $C386 */
byte VGA_ver, BIOS_ver; /* version numbers: VGA-BIOS and BIOS */
byte DRV_ver; /* identification: software version */
byte CPU_AG; /* identification CPU in PC */
byte CP_reg, S5_reg; /* CP- and PLC-status registers */
} CP386_InfoBlk; /* info-block */
Data structure for the general status info function, the components are preset according to values of
the CP486.