User manual

DELIB API Referenz |Seite 59
4.6. Programmier-Beispiel
//****************************************************************
//****************************************************************
//****************************************************************
//****************************************************************
//****************************************************************
//
//
// product: usb-optoin-8-relais-8 (ModuleID = USB_OPTOIN_8_RELAIS_8)
// configuration: digital-outputs
// programming language: vc
//
//
// (c) DEDITEC GmbH, 2011
// web: http://www.deditec.de/
// mail: vertrieb@deditec.de
//
//
//****************************************************************
//****************************************************************
//****************************************************************
//****************************************************************
//****************************************************************
//
//
// Please include the following library on linking: delib.lib
//
// This can be done at the project settings (Project/Settings/Link ->
// Object/library modules) .. extend the existing line with the ending
// "$(DELIB_LIB)\delib.lib" (with quotation marks)
//
// Including the header file delib.h (Project/Settings/C/C++ -> select
category
// "Preprocessor" -> Additional inlude directories) .. enter the line
// "$(DELIB_INCLUDE)" (with quotation marks)
#include <windows.h>
#include <stdio.h>
#include "conio.h"
#include "delib.h"
// ---------------------------------------------------------------
// GetLastError function
BOOL IsError()
{
unsigned char msg[500];
if (DapiGetLastError() != DAPI_ERR_NONE)
{
DapiGetLastErrorText((unsigned char*) msg, sizeof(msg));
printf("Error Code = %x * Message = %s\n", 0, msg);