with AUSBList.Items[board] do
begin
FillChar(LocalData, SizeOf(LocalData), 0);
LocalData.Data[0] := byte(CMD_set_cal);
LocalData.Data[1] := position-1;
LocalData.Data[2] := 7;
LocalData.Data[3] := whattocal;
temp:=calval;
LocalData.Data[4] :=(temp MOD 256);
temp:=(temp DIV 256);
LocalData.Data[5] :=(temp MOD 256);
LocalData.Data[6] := DayOfTheMonth(Now);
LocalData.Data[7] := MonthOfTheYear(Now);
LocalData.Data[8] := (YearOf(Now) DIV 256);
LocalData.Data[9] := (YearOf(Now) MOD 256);
end;
error:=HidReadWrite(AUSBList.Items[board],False);
if (NOT error) then with AUSBList.Items[board].LocalData do
begin
if ( data[0]=byte(CMD_set_cal) ) AND ( data[1]=(position-1) ) then
begin
//do something with the data received
end else error:=True;
end;