Hi,
im using Matlab 2202b and sucessfuly established a TCPIP connection to my oscilloscope using visadev. I was using the programming guide of the scope to receive data. Here is a very simple example of my code:
obj = visadev('TCPIP0::192.168.1.2::inst0::INSTR');
obj.Timeout = 30;
fopen(obj);
fwrite(obj, 'WAV:STAR 1');
fwrite(obj, sprintf('WAV:POIN %i', 1000));
fwrite(obj, sprintf('WAV:SOUR C%i', 1));
fwrite(obj, 'WAV:DATA?');
data = fread(obj);
% data = binblockread(obj,'int8');
clear(obj);
Short explaination: open visa device, start transmitting at waveform sample 1, transfer 1000 samples, asking for data and using fread or binblockread to read the data. The 'WAV:DATA?' command stopps the scope and queries for the (binblock)data. This works very well at my computer without any dependencies of the scope settings (timebase of the scope for example). The scope is connectd to the computer with a lan cable and a switch in between. Both devices are within the same subnetmask, the computer is using the ip address 192.168.1.1.
Now I was changing the location. Same Scope, other Laptop and Matlab version 2022a. In this case, the Laptop is directly connected to the scope via LAN cable. The communication between the two devices works very well but only in dependence of the timebase settings of the scope. If the timebase is low, lets say below 1ms, I can receive data using the script above. If I increase the timebase (the acquisition time of the scope is getting slower), i get a timout error of fread. The same script which works an my laptop causes problems now on an other one. The timeout error message appears very fast after im using the fread command. Much faster than 30 seconds, defined at the visa device. How can this happen? Binblockread also returns an error: "wrong format". Of course, binblockread is expecting something starting with #9... but did not get any values. I guess is the same timeout problem.
I was searching for hours yesterday to solve this problem, but did not find any solution. There is also an Python example at the programming guide page 638 but there are no big differences compared to my script (but i also have no experience with python). Do you have any idea?
Programming Guide:
https://www.siglenteu.com/wp-content/uploads/dlm_uploads/2022/07/SDS_ProgrammingGuide_EN11C.pdf