Q:

How to call a dll C function in Delphi with the correct variable values?

I've converted the following from "RFIDAPI.dll" C function to Delphi:
bool SAAT_YTagSelect( void *pHandle, 
                      unsigned char nOpEnable, 
                      unsigned char nMatchType, 
                      unsigned char *MatchData, 
                      unsigned char nLenth )

to
function SAAT_YTagSelect( pHandle: Pointer; 
                          nOpEnable, 
                          nMatchType, 
                          MatchData, 
                          nLenth: PAnsichar): Boolean; stdcall;

I am trying to call the function and I am getting an Access Violation.  Apparently I am not assigning the correct value to the nOpEnable 1Byte variable. 
Variable nOpEnable Buzzer or LED enable(1byte):

1: enable
0: disable
7   6   5   4   3   led buzzer
N/A N/A N/A N/A N/A 1   1

procedure TForm5.Button4Click(Sender: TObject);
 var
  hp: Pointer;
  b: array[0..7] of AnsiChar;
begin
   b[0] := '1';
   b[1] := '1';
   b[2] := '0';
   b[3] := '0';
   b[4] := '0';
   b[5] := '0';
   b[6] := '0';
   b[7] := '0';
    if SAAT_YTagSelect(hp, b, '0x01', '84500080', '8') then
      StatusBar1.Panels[1].Text := 'Tag Selected';
end;

A:

The correct translation of the function signature is:
function SAAT_YTagSelect(pHandle: Pointer; nOpEnable, nMatchType: Byte; MatchData: PByte; nLenth: Byte): Boolean; stdcall;

And the usage would look something like this:
var
  hp: Pointer;
  b: Byte;
  Data: PAnsiChar;
begin
   SAAT_TCPInit(hp, '192.168.0.238', 7086);
   SAAT_Open(hp);
   ...
   b := 1 or 2;
   data := '84500080';
   if SAAT_YTagSelect(hp, b, 1, PByte(data), 8) then
     StatusBar1.Panels[1].Text := 'Tag Selected';
   ...
   SAAT_Close(hp);
end;

I can't find any documentation for the SAAT_YTagSelect() function, so it is difficult to know for sure exactly what the MatchData parameter is expecting.  Considering that you have a habit of using strings for numeric parameters, it might even be something more like this:
var
  hp: Pointer;
  b: Byte;
  Data: array[0..7] of Byte;
begin
   SAAT_TCPInit(hp, '192.168.0.238', 7086);
   SAAT_Open(hp);
   ...
   b := 1 or 2;
   data[0] := 8;
   data[1] := 4;
   data[2] := 5;
   data[3] := 0;
   data[4] := 0;
   data[5] := 0;
   data[6] := 8;
   data[7] := 0;
   if SAAT_YTagSelect(hp, b, $01, @data[0], 8) then
     StatusBar1.Panels[1].Text := 'Tag Selected';
   ...
   SAAT_Close(hp);
end;

