Herunterladen Inhalt Inhalt Diese Seite drucken

Pepperl+Fuchs VAM-CTR-PC2 Handbuch Seite 44

Inhaltsverzeichnis

Werbung

{
{ RETURNS:
{ ============================================================= }
procedure DPread(var dat: byte);
begin
dat := port[BASE_ADDRESS + DATA];
end;
{ DPread }
{ ============================================================= }
{ PROCEDURE:
{ DESCRIPTION:
{
{
{ PARAMETERS:
{ ============================================================= }
procedure DPwrite(dat : byte);
begin
port[BASE_ADDRESS + DATA] := dat;
end;
{ DPwrite }
{ ============================================================= }
{ FUNCTION:
{ DESCRIPTION:
{
{ USAGE:
{
{ PARAMETERS:
{
{
{ RETURNS:
{
{
{
{
{ ============================================================= }
function send_cmd(command : byte): integer;
var
hour, minute, second, sec100
the_sec100
c
begin
c := command;
DPpage(D_COMMAND);
DPindex(D_COMMAND);
DPwrite(command);
GetTime(hour, minute, second, sec100);
the_sec100 := sec100;
repeat
until ( (sec100 - the_sec100 > 5) OR (c <> command) );
{ end loop, if command byte is changing... }
{ ... or after 500 ms (timeout) }
{ return codes depending on the command byte }
Zumutbare Änderungen aufgrund technischer Verbesserungen vorbehalten.
44
Pepperl+Fuchs GmbH · 68301 Mannheim · Telefon (06 21) 7 76-11 11 · Telefax (06 21) 7 76-10 00 · Internet http://www.pepperl-fuchs.com
dat: DATA register of the DPRAM
DPwrite
write to the address specified by page and
index register of the DPRAM
variable: dat
send_cmd
send a command to AS-i PC board
error := send_cmd(command);
command: value for 'command'
0:
o.k. (ACK)
1:
o.k. (NAK)
3:
invalid response
4:
timeout
{ write command... }
{ ...to DPRAM }
DPindex(D_COMMAND);
DPread(c);
GetTime(hour, minute, second, sec100);
: word;
: word;
: byte;
{ read command byte }
{ from DPRAM }
Copyright Pepperl+Fuchs, Printed in Germany
AS-Interface
Anhang
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}

Werbung

Inhaltsverzeichnis
loading

Inhaltsverzeichnis