QLIB Befehle
5.3.2
Beispiel 2
/*
**
WDOG3B.C
**
**
Beispielprogramm zur Programmierung der Watchdog 3
**
**
Stand: 07-01-2000
**
**
Compiler: Microsoft Visual C++, Borland C++
**
**
Aenderungen:
**
**
07-01-00
- Erweiterung um Relaisinversion (fuer WATCHDOG3-Karten ab
2000)
**
MAJA
*/
/*
**
Includes
*/
#include <windows.h>
#include <stdio.h>
#include <conio.h>
#include "..\..\..\include\qlib.h"
/*
**
M A I N
*/
void main (int argc, char *argv[])
{
ULONG hwdog3;
ULONG tcntr, rcntr;
ULONG inv_flag = 0L;
if (argc > 1)
{
inv_flag = 1L;
printf("Relais-Inversion aktiv\nTaste druecken\n");
getch();
}
if ((hwdog3 = QAPIExtOpenCard(WATCHDOG3, 0L)) == 0L)
{
printf("WATCHDOG3 konnte nicht geoeffnet werden.");
return;
}
QAPIExtWatchdog(hwdog3, JOB_DISABLE_WATCHDOG);
QAPIExtSpecial(hwdog3, JOB_WDOG3_INITIALIZE, 0L, 0L);
QAPIExtSpecial(hwdog3, JOB_WDOG3_SET_WATCHDOG_TIME, 100L, 50L);
Watchdogtimeout = 100 ms * 50 = 5 s
Watchdog 3
//
Seite 29