var
nBuff : array of PChar;
ipBuff : array of PChar;
SerStrBuff : array of PChar;
DipArrayBuff : array of PUint16;
name : Array[0..MAX_TCP_NM_LENGTH] of pChar;
ip: Array[0..MAX_TCP_IP_LENGTH] of pChar;
ser: Array[0..MAX_TCP_SN_LENGTH] of pChar;
ppName, ppIp, ppSer : pPchar;
begin
err := KMInitialize;
NumDevices :=0;
refresh := KMTCPRefreshDevices();
getNum := KMTCPGetNumDevices(@NumDevices);
SetLength(nBuff, NumDevices);
SetLength(ipBuff, NumDevices);
SetLength(serStrBuff, NumDevices);
SetLength(DipArrayBuff, NumDevices);
for lLoop := 0 to NumDevices-1 do
begin
for c:= 0 to MAX_TCP_NM_LENGTH do name[c] := new(pChar);
nBuff[lLoop] := name[0];
for c:= 0 to MAX_TCP_IP_LENGTH do
ip[c] := new(pChar);
ipBuff[lLoop] :=
ip[0];
for c:= 0 to MAX_TCP_SN_LENGTH do ser[c] := new(pChar);
serStrBuff[lLoop] := ser[0];
DipArrayBuff[lLoop] := new(PUint16);
end;
ppName := @nBuff[0];
ppIp := @ipBuff[0];
ppSer := @serStrBuff[0];
if getNum = 0 then
begin
err := KMTCPGetDeviceInformation(ppName, ppIp, ppSer, DipArrayBuff[0], NumDevices);
end;