Hi
I need to test my implementation of the protocol. Therefore it could be could to have virtual ports on one PC. One application sending another receiving. This can now be done with COM0COM approach.
Hardware: there is a USB to RS-485 adapter between PC an the box with 9-pin RS-485 interface.
I hope I should be well off with this approach.
I struckled until a minute ago to find about which USB-devices on the PC is doing what.
// Uses Utilwmi
procedure TFormSerialTest.Button1Click(Sender: TObject);
var
WMIResult : TFPObjectList;
i : Integer;
PropNamesIndex : Integer;
PropNames : Array[0..2] of String =(
'DeviceId','PNPDeviceID','Description');
begin
Memo1.Clear;
WMIResult := GetWMIInfo('Win32_USBHub', PropNames,'');
for i := 0 to Pred(WMIResult.Count) do
begin
Memo1.Append('=================');
for PropNamesIndex := Low(PropNames) to High(PropNames) do
begin
Memo1.Append(TStringList(WMIResult[i]).Names[PropNamesIndex] + ' : ' +
TStringList(WMIResult[i]).ValueFromIndex[PropNamesIndex]);
end;
end;
// Clean up
WMIResult.Free;
end;
Here the field description gives the ansver.