klasyc / ScpiNet

Scpi.NET is a pure C#.NET library for connecting measurement instruments talking the SCPI commands over USB or Ethernet.
MIT License
20 stars 3 forks source link

Hi, something wrong : "ReadFile() system call timed out.ā€ #5

Closed Jakvic closed 1 month ago

Jakvic commented 1 month ago

Iā€™ m using Tektronix TBS1102C instrument , the usbtmc driver looks like it's ok image

here is my code

using ScpiNet;

Console.WriteLine("Hello, World!");

List<string> devices = UsbScpiConnection.GetUsbDeviceList();

using (IScpiConnection connection = new UsbScpiConnection(devices[0]))
{
    await connection.Open();

    string id = await connection.GetId();
}
Console.ReadLine();

the devies has 1 item , it is the instrument , it works good. but it went wrong on string id = await connection.GetId();, ReadFile() system call timed out., help , plz

klasyc commented 1 month ago

Hi, your code looks good. There will be some compatibility issue between the oscilloscope and the library. The timeout error usually appears when the oscilloscope receives malformed data, or when the USB communication is wrongly configured. Please, give me some time, I will re-test the library with TBS1057 or TBS1072 scopes and let you know.

Does your oscilloscope work with TekVISA?

Jakvic commented 1 month ago

Yas! it works well with TekVISA image

klasyc commented 1 month ago

Hi,

the fault was on my side. My code was configuring the TransferSize field in the device request wrongly, when reading the response. Surprisingly, with Keysight multimeter it worked well, but when I connected the Tektronix scope, it did not send any response exactly as in your case.

Anyway, I made a new release 1.1.1 where the bug is fixed. Also, I added a new sample app to the repository and slightly updated the README. Please, let me know if the connection works now.

Jakvic commented 1 month ago

Ciao I tested the connection, it works good now, everything is OK, Thanks for your help šŸ‘