Deditec USB WATCHDOG STICK Guide

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

INDEX
Index | 2Seite
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
2.5. Application examples 11
11
2.5.1. PC reset 12
2.5.1.1. Connection via Reset-Button
13
2.5.1.2. Connection via power supply
13
2.5.1.2.1. Connection via ATX-/BTX-Adapter cable
15
2.5.1.2.2. Connection direct to power supply
3. Software 17
3.1. Watchdog Configuration Utility 17
17
3.1.1. Introdcution 18
3.1.2. Configuration 20
3.1.3. Retrigger Software
3.2. Integration of the DELIB 21
21
3.2.1. Integration of the delib.h in Visual-C/C++ 24
3.2.2. Integration of the delib.cs in Visual-C# 25
3.2.3. Integration of the delib.cs in Visual-C# unter Windows 64bit
29
3.2.4. Integration of the delib.pas in Delphi 30
3.2.5. Integration of the delib.bas in Visual Basic 31
3.2.6. Integration of the delib.vb in VB.NET 32
3.2.7. Integration of the delib.bas in MS-Office (VBA)

INDEX
Index | 3Seite
34
3.2.8. Integration of the delib.dll in LabVIEW 34
3.2.8.1. Integration of the delib.dll in LabVIEW
43
3.2.8.2. Usage of the VIs in LabVIEW
4. DELIB API reference 47
4.1. Management functions 47
47
4.1.1. DapiOpenModule 48
4.1.2. DapiCloseModule 49
4.1.3. DapiGetDELIBVersion 50
4.1.4. DapiSpecialCMDGetModuleConfig 52
4.1.5. DapiOpenModuleEx
4.2. Error handling 53
53
4.2.1. DapiGetLastError 54
4.2.2. DapiGetLastErrorText
4.3. Watchdog functions 55
55
4.3.1. DapiWatchdogEnable 56
4.3.2. DapiWatchdogDisable 57
4.3.3. DapiwatchdogRetrigger
4.4. Example program 58
5. Appendix 61
5.1. Revisions 61
5.2. Copyrights and trademarks 62

I
Introduction |Seite 4
Introduction

Introduction |Seite 5
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.
Therefor we can offer you high quality products at a competitive price.
Availability
Because of the modular design of our products, we have to redesign only a module
instead of the whole product, in case a specific component is no longer available.
1.2. Customer satisfaction
Our philosophy: a content customer will come again. Therefor customer
satisfaction is in first place for us.
If by any chance, you are not content with the performance of our product, please
contact us by phone or mail immediately.
We take care of the problem.
1.3. Customer response
Our best products are co-developments together with our customers. Therefor we
are thankful for comments and suggestions.

II
Hardware description |Seite 6
Hardware description

Hardware description |Seite 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.
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.
The provided test program and a configuration tool facilitate a simple start.

Hardware description |Seite 8
2.1. Overview screen

Hardware description |Seite 9
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 10
2.3. Pin assignment DSUB-9 connector
Pin
Description
3 & 7
Relay 1
2 & 6
Relay 2
1, 4, 5, 8, 9
NC
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
1*on + long pause
Watchdog Timeout
2*short on + long pause

Hardware description |Seite 11
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. There are
the following connectivity options:
Connection via ATX-/BTX-Adapter cable
Connection direct to power supply

Hardware description |Seite 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. Relay (Close-Relay) of the Watchdog-Stick.
Approach:
1. Disconnect the main power plug of your power supply .
2. Install the D-SUB-Slot-Card in the PC.
3. Connect the Watchdog-Stick (USB side) with the USB-Slot.
4. Connect the Watchdog-Stick (D-SUB side) with the D-SUB-Slot-Card (A).
5. Cut trough and strip the Reset-Button-Connection-Cable between Reset-Button
and the mainboard. Finally, connect the both cables with the 1. relay of the D-SUB-
Slot-Card (B). Regard, the correct connection and the labels of the relays
respectively, because the 1. relay is a closer relay and the 2. relay is an opener
relay.

Hardware description |Seite 13
2.5.1.2. Connection via power supply
If the PC is not equipped with a Reset-Button, you have to reset the PC directly via
the power supply. Regard the form factor of your mainboard.
2.5.1.2.1. Connection via ATX-/BTX-Adapter cable
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" to your mainboard.
Connect the both lateral protruded wires with the 2. relay of the D-SUB-Slot-Card
(B)

Hardware description |Seite 14
Approach:
1. Disconnect the main power plug of your power supply .
2. Install the D-SUB-Slot-Card in the PC.
3. Connect the Watchdog-Stick (USB side) with the USB-Slot.
4. Connect the Watchdog-Stick (D-SUB side) with the D-SUB-Slot-Card (A).
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. relay of the D-SUB-Slot-Card (B). Regard, the correct connection and
the labels of the relays respectively, because the 1. relay is a closer relay and the
2. relay is an opener relay.

Hardware description |Seite 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.
Approach:
1. Disconnect the main power plug of your power supply .
2. Install the D-SUB-Slot-Card in the PC.
3. Connect the Watchdog-Stick (USB side) with the USB-Slot.
4. Connect the Watchdog-Stick (D-SUB side) with the D-SUB-Slot-Card (A).
5. Disconnect the power supply plug (rectangular 20//24 pol. plug) from the
mainboard. Cut trough and strip the "PS_ON'#" wire of the power supply wire
harness (for pin assignment -> see power supply manual). Connect the both lateral
protruded wires with the 2. relay of the D-SUB-Slot-Card (B). Regard, the correct
connection and the labels of the relays respectively, because the 1. relay is a
closer relay and the 2. relay is an opener relay.

III
Software |Seite 16
Software

Software |Seite 17
3. Software
3.1. Watchdog Configuration Utility
3.1.1. Introdcution
With the Watchdog Configuration Utility can you configure the USB-Watchdog-
Stick. You can load and safe the configuration between your pc system and the
USB-Watchdog-Stick.
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 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. The "Global Watchdog timeout" determined the time period (in milliseconds)
in which the USB-Watchdog sticks expects a retrigger signal from you pc system. If
the stick receives no retrigger signal in the time period the stick will go into the
"Timeout" state and switches his relays accordingly.
3. In this table can you set the complete relay behaviour for all the different USB-
Watchdog states.
State "Deactivated": This state is the start state when the USB-Watchdog-Stick
receives prower from the usb connection. You can also send the stick via the
command "DapiWatchdogDisable" into this state-
State "Activated": This state can be achieved through the command

Software |Seite 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).
4. With this buttons can you save the configuration to the stick or load them from
the stick to your pc. You can also create a default configuration. Remeber to save
the default configuration to the USB-Watchdog stick.

Software |Seite 20
3.1.3. Retrigger Software
To monitor a PC-System you need to send a retrigger signal from the pc to the
USB-Watchdog stick in a intervall.
If the retrigger system stops, the USB-Watchdog stick go into the Timeout state
when the time of the Global Watchdog Timout elapsed.
For a simple start you can download our "vc_watchdog_retrigger_software"
program which you can stick to the autorun directory of your pc.
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
´
You can find this program also on our DELIB driver disc:
"vc_watchdog_retrigger_software" auch auf der DELIB Treiber CD im Verzeichnis
"\zip\devtools\vc_watchdog_retrigger_software.zip"
Extract the zip archive and you can find the exe file of this program in the debug
folder.
Table of contents