Technical data
Linkage with PLC
CP 486 ⋅ 00/14 VIPA GmbH 157
6.4.3 Interface for Turbo-Pascal (from Version 4.0)
To facilitate calling functions of COM-driver from Pascal programs, a Turbo-Pascal-Unit has been
created which makes available all functions of the service interrupt INT 78 to be easy called. For
every driver function an adequate Pascal-procedure 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.
All required functions, data types and constants are included in the Unit CP386LIB. This has to be
entered with "USES CP386Lib" into the application program if it should be used in a Pascal-
program. It must be ensured that the compiled Unit CP386LIB.TPU is contained in the directory
where Turbo-Pascal traces for units. Setting occurs via the menu items "Options| Directories| EXE
& TPU-directory" (cf. Manual or Help-Functions for Turbo-Pascal).
Following sections show only a survey of the individual functions. For a detailed description
including all important information see function descriptions of the previously described sections.
6.4.3.1 Function CP-Status Call
FUNCTION CP_Info(VAR inforec : CP386InfoRec) : INTEGER;
Data structures:
TYPE CP386InfoRec =
RECORD
CP_id : WORD; (* identification: CP386 value= $C386 *)
VGA_ver, BIOS_ver : BYTE; (* version numbers: VGA-BIOS and BIOS *)
DRV_ver: BYTE; (* identification: software version *)
CPU_AG : BYTE; (* identification CPU in PC *)
CP_reg, S5_reg : BYTE; (* CP- and PLC-status register *)
END;
Data structure for the general status info function and the components are defined corresponding to
CP486 values.
This function calls the driver function "general status information", but previously it is checked
whether the driver is installed. If not, the function returns the value -1. If the COM-driver is
installed, value 0 is returned and the components of info-structure inforec are set adequate. The
component CP_id is always identified with the value $C386.