Herunterladen Diese Seite drucken

Quancom PCIOPTOREL16 Bedienungsanleitung Seite 59

Werbung

PCIOPTOREL16 PCIOPTO16I/O
5.3.1
Einlesen der Optokoppler unter Delphi
program DIGITAL_IN_APP;
{*
// digital_in.pas : Sample project for Borland Delphi shows how to program the
// PCIOPTOREL16 under Delphi. The sample reads the input lines and displays
// their state.
//
// Author: Michael Reimer, QUANCOM Informationssysteme GmbH, Germany
//
// Website: http://www.quancom.de
// Product:
// PCIOPTOREL16 - PCI Optocoupler Relay Card
Card http://www.quancom.de/qprod01/eng/pb/pcioptorel16.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+}
var handle: longint;
lines: longint;
device: longint;
begin
{* // The following sequence tries to open the PCIOPTOREL16 Card
// Insert the CARDID of your card, to open other cards
*}
handle := QAPIExtOpenCard(PCIOPTOREL16,0);
if ( handle = 0 ) then
begin
s := 'No QUANCOM PCIOPTOREL16 found!';
writeln(s);
halt(0);
end;
{*
// Ok, we found a Card
// Now we can read the digital inputs
*}
lines := QAPIExtReadDI32(handle, 0, 0);
write(#13#10'--------------------------------------------------------------------------'#13#10);
write('Current input states'#13#10);
write('IN1
IN2
IN3
IN4
IN5
for i:=0 to 16 do
begin
if lines AND ( 1 shl i)
begin
write(' 1
');
end
else
begin
write(' 0
');
end
end;
{*
// Close the Card and release the handle
*}
QAPIExtCloseCard(handle);
end.
© QUANCOM Informationssysteme GmbH
with 16 Opto Inputs and 16 Relays
IN6
IN7
IN8
IN9
IN10 IN11 IN12 IN13 IN14 IN15 IN16'#13#10);
<> 0 then
55

Werbung

loading

Diese Anleitung auch für:

Pciopto16i/o