|
Beispielprogramm für OPTOLCA, OPTOLCA/LC
|
Ansteuerung der Optokoppler-Eingänge
| |
#include <windows.h> #include <stdio.h> #include <conio.h>
#include "qlib.h"
/*===================== Hauptprogramm ======================*/
void main () { ULONG handle; /* Handle der OPTOLCA */
if ((handle =QAPIExtOpenCard(OPTOLCA,0L)) == 0L) { printf("OPTOLCA konnte nicht geoeffnet werden\n"); return; }
for (;;) { if (kbhit()!=0 && getch()==27) break;
printf("%04lx\n",QAPIExtReadDI16(handle,0L,0L)); Sleep(500); printf("%04lx\n",QAPIExtReadDI16(handle,0L,0L)); Sleep(500); printf("%04lx\n",QAPIExtReadDI16(handle,0L,0L)); Sleep(500); printf("%04lx\n",QAPIExtReadDI16(handle,0L,0L)); Sleep(500); }
QAPIExtCloseCard(handle);
}
|
|
|