Beispielprogramm für OPTOLCA, OPTOLCA/LC  

Ansteuerung der Optokoppler-Ausgä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;

 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);

}