USB-WATCHDOG-STICK Hardware-Description 2011 Februar
INDEX 1. Introduction 5 1.1. General remarks 5 1.2. Customer satisfaction 5 1.3. Customer response 5 2. Hardware description 7 2.1. Overview screen 8 2.2. Technical data 9 2.3. Pin assignment DSUB-9 connector 10 2.4. Control LED 10 3. Software 12 3.1. Using our products 12 12 3.1.1. Access via graphical applications 3.1.2. Access via the DELIB driver library 3.1.3. Access via protocol 3.1.4. Access via provided test programs 12 12 13 3.2. DELIB driver library 14 14 3.2.1.
INDEX 4.1. Management functions 4.1.1. DapiOpenModule 4.1.2. DapiCloseModule 4.2. Error handling 4.2.1. DapiGetLastError 4.2.2. DapiGetLastErrorText 4.3. Watchdog functions 4.3.1. DapiWatchdogEnable 4.3.2. DapiWatchdogDisable 4.3.3. DapiWatchdogRetrigger 4.4. Example program 5. Appendix 22 22 23 24 24 25 26 26 27 28 29 32 5.1. Revisions 32 5.2.
Introduction I Introduction | Seite 4
1. Introduction 1.1. General remarks First of all, we would like to congratulate you to the purchase of a high quality DEDITEC product. Our products are being developed by our engineers according to quality requirements of high standard. Already during design and development we take care that our products have -besides quality- a long availability and an optimal flexibility. Modular design The modular design of our products reduces the time and the cost of development.
Hardware description II Hardware description | Seite 6
2. Hardware description The electronic, which is taken in an USB stick case, cares for the monitoring with watchdog functions. The used micro controller is scanned in periodic intervals by the PC via the USB bus. If a timeout occurs, the watchdog will switch independently both relays with a procedure, which is specified by the user. In case of a timeout, the relays, if correspondingly wired, are able to e.g. reset the PC, an external SMS modem can send warnings or a connected horn can alarm.
2.1.
2.2. Technical data USB stick output modul with USB 2.0 / USB 1.
2.3. Pin assignment DSUB-9 connector Pin 3&7 2&6 1, 4, 5, 8, 9 Description Relay 1 Relay 2 NC 2.4.
Software III Software | Seite 11
3. Software 3.1. Using our products 3.1.1. Access via graphical applications We provide driverinterfaces e.g. for LabVIEW and ProfiLab. The DELIB driver library is the basis, which can be directly activated by ProfiLAB. For LabVIEW, we provide a simple driver connection with examples! 3.1.2. Access via the DELIB driver library In the appendix, you can find the complete function reference for the integration of our API-functions in your software.
3.1.4. Access via provided test programs We provide simple handling test programs for the most important functions of our products. These will be installed automatically by the installation of the DELIB driver library. So you can test directly e.g. relays or you can check the voltage of an A/D converter.
3.2. DELIB driver library 3.2.1. Overview The following figure explains the structure of the DELIB driver library The DELIB driver library allows an uniform response of DEDITEC hardware with particular consideration of the following viewpoints: Independent of operating system Independent of programming language Independent of the product 3.2.1.1. Program under diverse operating systems The DELIB driver library allows an uniform response of our products on diverse operating systems.
3.2.1.2. Program with diverse programming languages We provide uniform commands to create own applications. This will be solved by the DELIB driver library. You choose the programming language! It can be simply developed applications under C++, C, Visual Basic, Delphi or LabVIEW®. 3.2.1.3. Program independent of the interface Write your application independent of the interface ! Program an application for an USB product of us. - Also, it will work with an ethernet or RS-232 product of us ! 3.2.1.4.
3.2.2. Supported operating systems Our products support the following operating systems: Windows 7 Windows Vista Windows XP Windows 2000 Linux 3.2.3. Supported programming languages Our products are responsive via the following programming languages: C C++ C# Delphi VisualBasic VB.
3.2.4. Installation DELIB driver library DELIB stands for DEDITEC Library and contains the necessary libraries for the modules in the programming languages C, Delphi and Visual Basic. Insert the DEDITEC driver CD into the drive and start „delib_install.exe“. The DELIB driver library is also available on http://www.deditec.en/delib Click on „Install“.
The drivers will be installed. The DELIB driver library is now installed. Press „Close“ to finish the installation. You can configure your module with the „DELIB Configuration Utility“ (see next chapter). This is only necessary, if more than one module is present.
3.2.5. DELIB Configuration Utility Start the “DELIB Configuration Utility” as follows: Start Programs DEDITEC DELIB DELIB Configuration Utility. The „DELIB Configuration Utility“ is a program to configure and subdivide identical USB-modules in the system. This is only necessary if more than one module is present.
3.3. Test programs 3.3.1. Watchdog Demo Start "Watchdog Demo" as follows: Programme -> DEDITEC -> DELIB -> Watchdog Demo This screenshot shows a test of the watchdog stick. The configuration of the module is shown on the upper left side.
DELIB API reference IV DELIB API reference | Seite 21
4. DELIB API reference 4.1. Management functions 4.1.1. DapiOpenModule Description This function opens a particular module. Definition ULONG DapiOpenModule(ULONG moduleID, ULONG nr); Parameters moduleID=Specifies the module, which is to be opened (see delib.h) nr=Indicates No of module which is to be opened. nr=0 -> 1. module nr=1 -> 2.
4.1.2. DapiCloseModule Description This command closes an opened module.
4.2. Error handling 4.2.1. DapiGetLastError Description This function returns the last registered error. Definition ULONG DapiGetLastError(); Parameters None Return value Error code 0=no error. (see delib.
4.2.2. DapiGetLastErrorText Description This function reads the text of the last registered error.
4.3. Watchdog functions 4.3.1. DapiWatchdogEnable Description This function enables the watchdog. Definition void DapiWatchdogEnable(ULONG handle); Parameters handle=This is the handle of an opened module.
4.3.2. DapiWatchdogDisable Description This function disables the watchdog. Definition void DapiWatchdogDisable(ULONG handle); Parameters handle=This is the handle of an opened module.
4.3.3. DapiWatchdogRetrigger Description This function retriggers the watchdog timer. Definition void DapiWatchdogRetrigger(ULONG handle); Parameters handle=This is the handle of an opened module.
4.4. Example program // **************************************************************************** // **************************************************************************** // **************************************************************************** // **************************************************************************** // **************************************************************************** // // (c) DEDITEC GmbH, 2011 // // Samples for USB-WATCHDOG // // vc-usb-watchdog-sample.
} // ---------------------------------------------------// activate watchdog DapiWatchdogEnable(handle); printf("watchdog is activated\n"); printf("Taste für weiter\n"); getch(); // ---------------------------------------------------// activate watchdog DapiWatchdogDisable(handle); printf("watchdog is deactivated\n"); printf("Taste für weiter\n"); getch(); // ---------------------------------------------------// activate watchdog + retrigger DapiWatchdogEnable(handle); DapiWatchdogRetrigger(handle); printf
Appendix V Appendix | Seite 31
5. Appendix 5.1. Revisions Rev 2.
5.2. Copyrights and trademarks Linux is registered trade-mark of Linus Torvalds. Windows CE is registered trade-mark of Microsoft Corporation. USB is registered trade-mark of USB Implementers Forum Inc. LabVIEW is registered trade-mark of National Instruments. Intel is registered trade-mark of Intel Corporation AMD is registered trade-mark of Advanced Micro Devices, Inc.