60
5.3.4
Ansteuerung der Relais / Optokoppler unter C
#include <windows.h>
#include <stdio.h>
#include <conio.h>
#include "qlib.h"
/*=====================
Main program
======================*/
void main ()
{
ULONG handle;
/*Handle of the card
// The following sequence tries to open the PCIOPTO16IO Card
// Insert the CARDID of your card, to open other cards
if ((handle=QAPIExtOpenCard(PCIOPTO16IO,0L)) == 0L) {
printf("Couldn't open PCIOPTO16IO\n");
return;
}
for (;;)
{
if (kbhit()!=0 && getch()==27) break;
QAPIExtWriteDO8(handle,0L,0x00L,0L);
Sleep(500);
QAPIExtWriteDO8(handle,0L,0xFFL,0L);
Sleep(500);
QAPIExtWriteDO8(handle,0L,0x55L,0L);
Sleep(500);
QAPIExtWriteDO8(handle,0L,0xAAL,0L);
Sleep(500);
}
QAPIExtCloseCard(handle);
}
QLIB Befehle
© QUANCOM Informationssysteme GmbH