Advertisement

Quick Links

USB-WATCHDOG-STICK
Hardware-Description
2016
März

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the USB WATCHDOG STICK and is the answer not in the manual?

Questions and answers

Summary of Contents for Deditec USB WATCHDOG STICK

  • Page 1 USB-WATCHDOG-STICK Hardware-Description 2016 März...
  • Page 2 INDEX 1. Introduction 1.1. General remarks 1.2. Customer satisfaction 1.3. Customer response 2. Hardware description 2.1. Overview screen 2.2. Technical data 2.3. Pin assignment DSUB-9 connector 2.4. Control LED 2.5. Application examples 2.5.1. PC reset 2.5.1.1. Connection via Reset-Button 2.5.1.2. Connection via power supply 2.5.1.2.1.
  • Page 3 INDEX 3.2.8. Integration of the delib.dll in LabVIEW 3.2.8.1. Integration of the delib.dll in LabVIEW 3.2.8.2. Usage of the VIs in LabVIEW 4. DELIB API reference 4.1. Management functions 4.1.1. DapiOpenModule 4.1.2. DapiCloseModule 4.1.3. DapiGetDELIBVersion 4.1.4. DapiSpecialCMDGetModuleConfig 4.1.5. DapiOpenModuleEx 4.2. Error handling 4.2.1.
  • Page 4 Introduction Introduction | Seite...
  • Page 5: General Remarks

    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.
  • Page 6: Hardware Description

    Hardware description Hardware description | Seite...
  • Page 7 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.
  • Page 8 2.1. Overview screen Hardware description | Seite...
  • Page 9: Technical Data

    2.2. Technical data USB stick output modul with USB 2.0 / USB 1.1 interface Micro controller monitoring 10ms to 10h timeout time adjustable Windows Watchdog API 2 Relays for switching procedures Connection cable (ca 1,8m) with DSUB-9 connector Dimensions: 84,5 * 21 * 12,5 / 9,5 mm (without cable) Hardware description | Seite...
  • Page 10: Control Led

    2.3. Pin assignment DSUB-9 connector Description 3 & 7 Relay 1 2 & 6 Relay 2 1, 4, 5, 8, 9 2.4. Control LED The LED on the watchdog stick displays following status: Description LED Flash Sequence Watchdog Disabled LED permanent on (turns shortly off by PC access ) Watchdog Enabled 1*on + long pause Watchdog Retrigger...
  • Page 11: Application Examples

    2.5. Application examples 2.5.1. PC reset To reset a PC via the Watchdog-Stick, there are several connectivity options; Connection via Reset-Button If the PC is not equipped with a Reset-Button, you have to reset the PC directly via power supply. Therefore the connection cable between the power supply and mainboard has to be cut trough and connected to the Watchdog-Stick.
  • Page 12 2.5.1.1. Connection via Reset-Button If the PC is equipped with a Reset-Button, this button can be activated directly by the Watchdog-Stick. If a timeout occurs, the watchdog will activate the Reset- Button. Therefore, the connection cable between Reset-Button and Mainboard must be connected with the 1.
  • Page 13 If the PC is not equipped with a Reset-Button, you have to reset the PC directly via the power supply. Therefore, you have to disconnect the power supply plug from the mainboard and connect this plug to the slot side of the "DEDITEC ATX20/24 Connection Cable" (optional accessory for the Watchdog-Stick). After this, connect the plug of the "DEDITEC ATX20/24 Connection Cable"...
  • Page 14 5. Disconnect the power supply plug from the mainboard and connect this plug to the slot side of the "DEDITEC ATX20/24 Connection Cable" (optional accessory for the Watchdog-Stick). After this, connect the plug of the "DEDITEC ATX20/24 Connection Cable" to your mainboard. Connect the both lateral protruded wires with the 2.
  • Page 15 2.5.1.2.2. Connection direct to power supply At some PC systems, like e.g. Dell, the pin assignment and the form factor of the power supply plug diverges from the ATX-/BTX- form factor. At this systems you have to cut trough the "PS_ON'" Cable by yourself and connect it with the 2. relay (opener-relais) of the Watchdog-Stick.
  • Page 16 Software Software | Seite...
  • Page 17 The Watchdog Configuration Utility is included in the DELIB driver library. Default installation directory: 32-Bit: C:\Program Files (x86)\DEDITEC\DELIB\programs\watchdog- configuration-utility.exe 64-Bit: C:\Program Files\DEDITEC\DELIB64\programs\Watchdog-Configuration- Utility_x64.exe You can also start the Watchdog Configuration Utility via the Windows start menu. The path is "All programs -> DEDITEC -> Watchdog Configuration Utility" Software | Seite...
  • Page 18 3.1.2. Configuration 1. Open the USB-Watchdog stick which you want to configure. Note: If you want to use more than one USB-Watchdog-Stick on your pc system, you need to configure them with the DELIB Configuration Utility and give every USB-Watchdog Stick a unique Module-Nr. 2.
  • Page 19 "DapiWatchogEnable". State "Retriggered": This state can be achieved through the command "DapiWatchdogRetrigger" State "Timeout": This state will be used if the Global Watchdog Timeout occurred. For this state two relay settings can be configured. The first setting will be used immediately after the timeout. The second setting will be used after the configured timeperiod (in milliseconds).
  • Page 20 This programm enables the watchdog stick and sends every 2 seconds a retrigger signal to the stick. If the system becomes unstable and freezes, this program will also freeze and the retrigger signal will stop. Download: http://www.deditec.de/zip/devtools/vc_watchdog_retrigger_software.zip ´ find this program...
  • Page 21 Description of the DELIB integration in Visual-C/C++ The DELIB Installation defines environment variables to facilitate links to the DELIB-include and DELIB-lib directory. DELIB_LIB = C:\Programs\DEDITEC\DELIB\lib DELIB_INCLUDE = C:\Programs\DEDITEC\DELIB\include Start Visual-C/C++ and open via menu "Projekt -> Einstellungen" Software | Seite...
  • Page 22 DELIB.H entry in the Visual-C/C++ Project configurations Under the tab "C/C++" choose the "Kategorie" Präprozessor and enter on "Zusätzliche Include Verzeichnisse" "$(DELIB_INCLUDE)". Software | Seite...
  • Page 23 DELIB.LIB entry in the Visual-C/C++ Project configurations Under the tab "Linker" extend the existing line in "Zusätzliche Include Verzeichnisse" with the ending "$(DELIB_LIB)\delib.lib" Software | Seite...
  • Page 24 You can find needed files Visual-C# directory \Programme\DEDITEC\DELIB\Include\delib.cs. Start Visual-C# and open via menu "Projekt -> Vorhandes Element hinzufügen" in the directory C: \Programme\DEDITEC\DELIB\Include\ the file "delib.cs" to import. Add the following reference in your program: using DeLib; Software | Seite...
  • Page 25 3.2.3. Integration of the delib.cs in Visual-C# unter Windows 64bit Program sample for the DELIB driver library under Windows 64 Bit In the following sections there is a description how to compile the project as "x86" Show all settings Open the options via menue "Extras -> Optionen" Check “Alle Einstellungen anzeigen"...
  • Page 26 Check under "Projekte und Projektmappen" "Erweiterte Buildkonfigurationen anzeigen". Software | Seite...
  • Page 27 The Configuration Manager Open the configuration manager via "Any CPU -> Konfigurations-Manager...". In the configuration manager select under der column "Plattform" "Any CPU -> Neu...". Under "Neue Plattform" select "x86". Software | Seite...
  • Page 28 Start debugging You can start the debugging as normal via the "Start-Button". Note that the toolbar combobox for Platform Configuration now lists both "x86" and "AnyCPU" and has "x86" selected Software | Seite...
  • Page 29 3.2.4. Integration of the delib.pas in Delphi Description of the "delib.pas" integration in Delphi find needed files Delphi directory \Programme\DEDITEC\DELIB\include\delib.pas. Start Delphi and open via menu "Projekt -> dem Projekt hinzufügen" the file "delib. pas" to import. Software | Seite...
  • Page 30 3.2.5. Integration of the delib.bas in Visual Basic Description of the "delib.bas" integration in Visual Basic find needed files directory \Programme\DEDITEC\DELIB\include\delib.bas. Start Visual Basic and open via menu "Projekt -> Datei hinzufügen..." the file "delibi.bas" to import. Software | Seite...
  • Page 31 3.2.6. Integration of the delib.vb in VB.NET Description of the DELIB integration in VB.NET find needed files VB.NET directory \Programme\DEDITEC\DELIB\Include\delib.vb. Start VB.NET and open via menu "Projekt -> Vorhandes Element hinzufügen" directory \Programme\DEDITEC\DELIB\Include\ the file "delib.vb" to import. Software | Seite...
  • Page 32 3.2.7. Integration of the delib.bas in MS-Office (VBA) Description of the "delib.bas" integration in Visual Basic for Applications find needed files directory \Programme\DEDITEC\DELIB\include\delib.bas. Start Microsoft Excel and open via menu "Extras -> Makro -> Visual Basic Editor". Software | Seite...
  • Page 33 Creation of UserForm Create a new UserForm via menu "Einfügen -> UserForm". In the top left-hand corner of the project manager right click on "UserForm -> Datei importieren". Open in the directory C:\Programme\DEDITEC\DELIB\include the file "delib.bas" to import. Software | Seite...
  • Page 34 Description of the delib.dll integration in LabVIEW Version 11 - You can find the needed files for LabVIEW in the directorys "C:\Windows\System32\delib.dll" "C:\Programme\DEDITEC\DELIB\include\ delib.h" - Start LabVIEW and open the menu "Tools -> Import -> DLL ..." Software | Seite...
  • Page 35 - Choose the option "create VIs for DLL" and press continue Software | Seite...
  • Page 36 - In the next window, choose the path to the delib.h and delib.dll and press continue Software | Seite...
  • Page 37 - Press continue again - The Header-File will now be analized. Afterwards press continue. Software | Seite...
  • Page 38 - Follow the instructions and configurate the name and the saving location for the VIs. Software | Seite...
  • Page 39 - In the new window choose "Easy error correction" in the drop-down menu and press continue. Software | Seite...
  • Page 40 - VIs which are working with 64-bit values must be edited. The display must be changed from "unsigned long" to "unsigned quad". - The following VIs must be edited: -> DapiCNT48CounterGet48 (function return) -> DapiDIGet64 (function return) -> DapiDOSet64 (data) ->...
  • Page 41 - In addition for some VIs you need to change the elementype to "numeric". - The following VIs must be edited: -> DapiWriteLongLong (value) -> DapiReadLongLong (function return) - Afterwards press continue. Software | Seite...
  • Page 42 - You recive a summary of the executed steps. - Press continue - The VIs will now be created and are ready to use. Software | Seite...
  • Page 43 In the delib.h file can you read the hexadecimal values to determine the modes. The hex values must be convertet to decimal. After the installation of the DELIB-library, the delib.h file is located in the following directory: C:\Programs\Deditec\DELIB\Include\delib.h Software | Seite...
  • Page 44 The function could look like this in LabVIEW: The channel and mode are passed as unsigned long Software | Seite...
  • Page 45 Software | Seite...
  • Page 46 DELIB API reference DELIB API reference | Seite...
  • Page 47: Management Functions

    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 ->...
  • Page 48 4.1.2. DapiCloseModule Description This command closes an opened module. Definition ULONG DapiCloseModule(ULONG handle); Parameters handle=This is the handle of an opened module Return value none Example program // Close the module DapiCloseModule(handle); DELIB API reference | Seite...
  • Page 49 4.1.3. DapiGetDELIBVersion Description This function returns the installed DELIB version. Definition ULONG DapiGetDELIBVersion(ULONG mode, ULONG par); Parameters mode=Mode, with which the version is readout (must be 0). par=This parameter is not defined (must be 0). Return value version=Version number of the installed DELIB version [hex]. Example program version = DapiGetDELIBVersion(0, 0);...
  • Page 50 4.1.4. DapiSpecialCMDGetModuleConfig Description This command returns the hardware equipment (number of in-/output channels) of the module. Definition ULONG DapiSpecialCommand(ULONG handle, DAPI_SPECIAL_CMD_GET_MODULE_CONFIG, par, 0, 0); Parameters handle=This is the handle of an open module. Get number of digital input channels par=DAPI_SPECIAL_GET_MODULE_CONFIG_PAR_DI Get number of digital output channels par=DAPI_SPECIAL_GET_MODULE_CONFIG_PAR_DO Get number of digital in-/output channels...
  • Page 51 Return value Get number of digital input channels return=Number of digital input channels Get number of digital output channels return=Number of digital output channels Get number of digital in-/output channels return=Number of digital in-/output channels Get number of analog input channels return=Number of analog input channels Get number of analog output channels return=Number of analog output channels...
  • Page 52 4.1.5. DapiOpenModuleEx Description This function opens a specific RO-ETH-module.The particularity of this command is, that parameters like IP-address and portnumber can be specified. Definition ULONG DapiOpenModuleEx(ULONG moduleID, ULONG nr, unsigned char* exbuffer); Parameters moduleID=Specifies the module, which is to be opened (see delib.h) nr=Indicates No of module which is to be opened.
  • Page 53: Error Handling

    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.h) Example program ULONG error; error=DapiGetLastError(); if(error==0) return FALSE; printf("ERROR = %d", error); DELIB API reference | Seite...
  • Page 54 4.2.2. DapiGetLastErrorText Description This function reads the text of the last registered error. Definition extern ULONG __stdcall DapiGetLastErrorText(unsigned char * msg, unsigned long msg_length); Parameters msg = text buffer msg_length = length of the buffer Example program BOOL IsError () if (DapiGetLastError () != DAPI_ERR_NONE) unsigned char msg[500];...
  • Page 55 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 Return value None Example program DapiWatchdogEnable(handle); //Aktiviert den Watchdog DELIB API reference | Seite...
  • Page 56 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 Return value None Example program DapiWatchdogDisable(handle); //Deaktiviert den Watchdog DELIB API reference | Seite...
  • Page 57 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 Return value None Example program DapiWatchdogRetrigger(handle); //Retriggert den Watchdog-Timer DELIB API reference | Seite...
  • Page 58: Example Program

    4.4. Example program // **************************************************************************** // **************************************************************************** // **************************************************************************** // **************************************************************************** // **************************************************************************** // (c) DEDITEC GmbH, 2009 // web: http://www.deditec.de // mail: vertrieb@deditec.de // dtapi_prog_beispiel_input_output.cpp // **************************************************************************** // **************************************************************************** // **************************************************************************** // **************************************************************************** // **************************************************************************** // Folgende Bibliotheken beim Linken mit einbinden: delib.lib // Dies bitte in den Projekteinstellungen (Projekt/Einstellungen/Linker(Objekt- Bibliothek-Module) ..
  • Page 59 return; // Zum Testen - ein Ping senden // ---------------------------------------------------- printf("PING\n"); anz=10; for(i=0;i!=anz;++i) data=DapiPing(handle, i); if(i==data) // OK printf("."); else // No answer printf("E"); printf("\n"); // ---------------------------------------------------- // Einen Wert auf die Ausgänge schreiben data = 255; DapiWriteByte(handle, 0, data); printf("Schreibe auf Adresse=0 daten=0x%x\n", data);...
  • Page 60 Appendix Appendix | Seite...
  • Page 61 5. Appendix 5.1. Revisions Rev 1.00 First issue Rev 1.01 Added chapter "Application examples" Rev 1.02 added Watchdog Configuration Utility, new management function "DapiGetDELIBVersion", new Watchdog-Special functions "DapiSpecialWatchdogGetStatus", "DapiSpecialWatchdogGetTimeoutMsec", "DapiSpecialWatchdogGetWDCounterMsec", "DapiSpecialWatchdogGetTimeoutRelaisCounterMsec", "DapiSpecialWatchdogSetTimeoutRel1CounterMsec" and "DapiSpecialWatchdogSetTimeoutRel2CounterMsec" Rev 2.00 Added chapters "Firmware update" and "Integration of the DELIB"...
  • Page 62: Copyrights And Trademarks

    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.

Table of Contents