Posted Tue, 18 Jul 2023 15:03:51 GMT by AGAT, Kaz 担当員
I hope to get hard copy of MSO58 by NI-VISA and MS VC# (WPF) without TekVISA.  When I tried it, I saw query is very late or no response.  If no response, I must restart MSO58.  MSO44 was same.  I confirmed it via USB 2.0 and LAN.
I found Tekscope Utility can communicate with MSO58 by NI-VISA without TekVISA.  But I do not understand how to communicate with MSO58.

Code of query is below,
MessageBasedSession instrument;
instrument = (MessageBasedSession)new ResourceManager().Open(VISA Address);
instrument.TimeoutMilliseconds = 20000;
instrument.RawIO.Write("*IDN?");
string result = instrument.RawIO.ReadString().Trim();
instrument.Dispose();
Posted Tue, 18 Jul 2023 19:28:24 GMT by R, Martin
Hi

I made good experiences if I configure write-termination and read-termination characters =\n

And it was more stable with firmware 2.0.3.

See release notes of FW 2.0.3:
• Disabling and re-enabling USBTMC interface via I/O menu breaks USBTMC connection on Linux
• Oscilloscope crashes after connecting to socket server, toggling socket server off and back on, then sending *OPC? on socket server
• On Windows 5 and 6 Series MSO, when the USB cable is hot-plugged more than once, the oscilloscope no longer communicates over
USBTMC
Posted Sat, 22 Jul 2023 13:36:55 GMT by AGAT, Kaz 担当員
Thank you for a response.

I have memory to try nearly that way.
But I will try it with new C# program when I get my turn to use MSO58.
I will report that result.
Posted Sun, 06 Aug 2023 10:42:34 GMT by AGAT, Kaz 担当員

I tried new C# code. I succeed to get hard copy. But it occurred failure if I repeated. This phenomenon is I know.  And if it was stopped data acquisition by c# code, it occurred failure anytime.

Code is below,
MessageBasedSession instrument;
bool running = false;
instrument = (MessageBasedSession)new ResourceManager().Open(VISA Address);
instrument.TimeoutMilliseconds = 500;
instrument.TerminationCharacterEnabled = true;
instrument.TerminationCharacter = 0x0A;
instrument.RawIO.Write("ACQ:STATE?\n");
if (instrument.RawIO.ReadString().Trim() == "1")
{
    running = true;
    instrument.RawIO.Write("ACQ:STATE STOP\n");
}
instrument.RawIO.Write("SAVEON:IMAG:FILEF PNG\n");
instrument.RawIO.Write("SAV:IMAG:COMP NORM\n");
instrument.RawIO.Write("SAV:IMAG \"C:/temp.png\"";*OPC?\n");
instrument.RawIO.ReadString();
osc.RawIO.Write("FILES:READF \"C:/temp.png\"\n");
Thread.Sleep(100);
instrument.TerminationCharacterEnabled = false;
File.WriteAllBytes("temp.png", instrument.RawIO.Read(2000000));
instrument.TerminationCharacterEnabled = true;
instrument.RawIO.Write("FILES:DELE \"C:/temp.png\"\n");
if (running) instrument.RawIO.Write("ACQ:STATE RUN\n");
instrument.Dispose();

Posted Sun, 27 Aug 2023 11:58:24 GMT by AGAT, Kaz 担当員

I saw effect of VISA timeout.  When acquisition stopping, I get response of query if timeout is 500 ms.  But when same, I do not get response if timeout is 10 s.  When it is 500 ms, the response of query is received by the timing of nearly timeout.  I felt to read the response by timeout event.

You must be signed in to post in this forum.