PCIOPTOREL16 PCIOPTO16I/O
5.3.2
Ansteuerung der Relais / Optokoppler unter Delphi
program DIGITAL_OUT_APP;
{*
// digital_out.pas : Sample project for Borland Delphi shows how to program the
// PCIREL16 Card under Delphi. The sample sets the Relays
// a defined state.
//
// Author: Michael Reimer, QUANCOM Informationssysteme GmbH, Germany
//
// Website: http://www.quancom.de
// Product: PCIREL16 - PCI Optocoupler Relay Card
http://www.quancom.de/qprod01/eng/pb/pcirel16.htm
//
// Information:
//
// To use the QLIB Commands in your source, do the following:
//
// (1) Add statement #include "qlib.pas" to your source file.
// (2) Copy QLIB.PAS from QLIB Installation Directory
//
d:\program files\quancom\qlib32\include to your
//
working directory
*}
{$APPTYPE CONSOLE}
{$INCLUDE qlib.pas}
{$X+}
const OUT1 = $1;
OUT2 = $2;
OUT3 = $4;
OUT4 = $8;
OUT5 = $10;
OUT6 = $20;
OUT7 = $40;
OUT8 = $80;
OUT9 = $100;
OUT10 = $200;
OUT11 = $400;
OUT12 = $800;
OUT13 = $1000;
OUT14 = $2000;
OUT15 = $4000;
OUT16 = $8000;
Var
handle: longint;
lines: longint;
device: longint;
begin
{* // The following sequence tries to open the PCIREL16 card
// Insert the CARDID of your card, to open other cards
*}
handle := QAPIExtOpenCard(PCIREL16,0);
if ( handle = 0 ) then
begin
writeln('No QUANCOM PCIREL16 Card found!');
halt(0);
end;
{*
// Ok, we found a card
// Now we can write a value to the Relays
*}
{*
//
// Reset all lines to "Low"
//
*}
lines := 0;
writeln('Reset all lines to LOW ( Press return to continue ):');
QAPIExtWriteDO32(handle, 0, lines, 0);
Readln;
lines := $FFFFFFFF;
writeln('Set all lines to HIGH ( Press return to continue ):');
QAPIExtWriteDO32(handle, 0, lines, 0);
Readln;
lines := OUT4 + OUT5 + OUT7 ;
writeln('Set lines OUT4, OUT5 and OUT7 to HIGH ( Press return to continue ):');
QAPIExtWriteDO32(handle, 0, lines, 0);
Readln;
© QUANCOM Informationssysteme GmbH
to
with 16 Relays
57