public
    PServerEqaddr:PEquip_addr;
    { Public declarations }
  end;
------------------------------------------------------------------------------------
begin
  new(PServerEqaddr);
  new(PServerEqaddr);
  PServerEqaddr^.nport :=byte(strtoint(edtCom.Text)); ;
  PServerEqaddr^.ntype := $10;  //服务器默认的机器类型
  PServerEqaddr^.number_addr := gByteConvert(word(1)); //高低位互换 //注意:服务器默认为1号机
end;---------------------------------------------------------------------------------------
//设备信息结构定义
  type
    PEquip_addr = ^TEquip_addr;
    TEquip_addr = record
     nport:Byte;                        //串口号1 2 3 4 5 6分别表示com1,com2,com3,com4,com5,com6
       ntype:Byte;                        //设备类型:你这里直接调用为 $10或16
       number_addr:word;                  ////设备编号地址 (0X0001-0X7000)
    end;
------------------------------------------------------------------
begin
    iReturn:=Ysn_SetTempUserStatus(PServerEqaddr,gByteConvert(longword(StrToInt64("1"))),2);
end------------------------------------------------------------------------------------------
function  Ysn_SetTempUserStatus(machine_add:PEquip_addr;card_id:longWORD;stateflag:BYTE):integer; far;stdcall; external 'Ysn_Y3ID.dll';--------------------------------------------------------------------------------
function TForm1.gByteConvert(const Source: Cardinal): Cardinal;
var
  I: Integer;
  x:Byte;
  ab: array[0..3] of Byte;
  s: Cardinal absolute ab[0];
begin
  s:=source;
  for I := 1 to 2 do    // Iterate
  begin
    x:=ab[I-1];
    ab[I-1]:= ab[4-I];
    ab[4-I]:=x;
  end;    // for
  result:=s;
end;