User guide
46
6000 Series Programmer's Guide
Retrieving information from the fast status area using PASCAL: The
following is a source code example written in Turbo PASCAL. This source code example is
also provided on the DOS Support Disk in subdirectory SAMPLES, file TP5ØFAST.PAS.
Program testfast;
uses Crt;
const
BASEP = $0300; { AT6nnn base port address }
REQ_STATUS = $48; { AT6nnn fast status update }
CS_UPDATED = $08; { AT6nnn card status update }
FASTSTATUS = 2; { fast status offset }
STATUS = 4; { set/clear status offset }
AXIS1_CMD = $00; { pointer to axis 1 commanded position in fast
status }
var
i:integer;
address:word;
word_high, word_low:word;
fast_status:real;
pos_storage:string;
procedure request_status;
begin
port[address+STATUS] := REQ_STATUS; {request fast status update}
{wait for fast status information to be updated}
while((port[address+STATUS] and CS_UPDATED) = 0) do
begin
end;
end;
procedure set_pointer(status_offset:integer);
begin
port[address+FASTSTATUS] := status_offset;
end;
procedure read_status(var status_high, status_low:word; var status:real);
begin
status_high := portw[address+FASTSTATUS];
status_low := portw[address+FASTSTATUS];
status_high := (status_high shl 8) + (status_high shr 8);
status_low := (status_low shl 8) + (status_low shr 8);
status := status_high * 256.0 * 256.0 + status_low;
end;
begin
address := BASEP;
request_status;
set_pointer(AXIS1_CMD);
for i := 1 to 4 do
begin
read_status(word_high, word_low, fast_status);
Writeln(fast_status:10:0);
end;
end.










