procedure TForm1.ProgramButClick(Sender: TObject);
begin
DeviceIndex := 0;
GetFTDeviceCount;
if NumDevs > 0
then repeat
case DeviceIndex
of
0: DevNumber := SR1.Text;
1: DevNumber := SR2.Text;
end;
FT_OpenEx(DevNumber,FT_OPEN_BY_SERIAL_NUMBER,@Multi_Handle);
FtData.VendorID := StrToInt('
$'+VendorID.Text);
ftData.ProductID := StrToInt('
$'+ProductID.Text);
StrNew(StrPCopy(ftData.Manufacturer, (Manufacturer.Text)));
StrNew(StrPCopy(ftData.ManufacturerID, (ManufacturerID.Text)));
StrNew(StrPCopy(ftData.Description, (Description.Text)));
StrNew(StrPCopy(ftData.SerialNumber, ((SerialNumber.Text + IntToStr(DeviceIndex)))));
ftData.MaxPower := strtoint(MaxPower.Text);
ftData.PnP := StrToInt(PnP.Items[PnP.ItemIndex]);
ftData.SelfPowered := StrToInt(SelfPowered.Items[SelfPowered.ItemIndex]);
ftData.RemoteWakeup := StrToInt(RemoteWakeup.Items[RemoteWakeup.ItemIndex]);
ftData.Rev4 := False;
ftData.IsoIn := False;
ftData.IsoOut := False;
ftData.PullDownEnable := False;
ftData.SerNumEnable := True;
ftData.USBVersionEnable := True;
if USBVersion.Text = '
USB 2.0'
then
ftData.USBVersion := $0200
else ftData.USBVersion := $0110;
ProgramEE;
Close_USB_Device;
inc(DeviceIndex);
dec(NumDevs);
until NumDevs = 0;
SerialNumber.Text := SerialNumberEdit.Text;
end;