-
TBS2104B Oscilloscope. Frequency Timeout exception
I have a function to get Osciloscope screenshot.
Following is my code segment:
string visaRsrcAddr = "TCPIP0::" + IP.ToString() + "::inst0::INSTR";
var scope = GlobalResourceManager.Open(visaRsrcAddr) as IMessageBasedSession;
using (scope)
{
scope.TimeoutMilliseconds = 60000;
scope.FormattedIO.WriteLine("SAVE:IMAGe \"eval.png\"");
scope.FormattedIO.WriteLine("*OPC?");
((IMessageBasedSession)(scope)).TerminationCharacterEnabled = false;
scope.FormattedIO.WriteLine("FILESystem:READFile \"eval.png\"");
byte[] imgData = new byte[30000000];
// Giving a large value for count to make sure all bytes are read.
imgData = scope.RawIO.Read(30000000);
scope.FormattedIO.WriteLine("*OPC?");
This is throwing Timeout exception very often. What could be the reason?
Thanks in advance,
Reena
// Save image data to local disk
File.WriteAllBytes(fileName, imgData);
// Image data has been transferred to PC and saved. Delete image file from instrument's hard disk.
scope.FormattedIO.WriteLine("FILESystem:DELEte \"eval.png\"");
-
RE: TBS2104B Oscilloscope - Reading holdup time is not consistent
I noticed that when I connect to scope via Putty and give a *IDN? command, it does not return anything! -
TBS2104B Oscilloscope - Reading holdup time is not consistent
Hi,
I have following C# code to fetch Holdup time from the Oscilloscope.
string visaRsrcAddr = "TCPIP::" + IP.ToString() + "::inst0::INSTR";
var scope = GlobalResourceManager.Open(visaRsrcAddr) as IMessageBasedSession;
using (scope)
{
scope.TimeoutMilliseconds = 60000;
scope.FormattedIO.WriteLine("MEASUrement:IMMed:TYPe DELay");
scope.FormattedIO.WriteLine("MEASUrement:IMMed:DELay EDGE1 FALL");
scope.FormattedIO.WriteLine("MEASUrement:IMMed:DELay EDGE2 FALL");
scope.FormattedIO.WriteLine("MEASUrement:IMMed:SOUrce1 CH4");
scope.FormattedIO.WriteLine("MEASUrement:IMMed:SOUrce2 CH2");
scope.FormattedIO.WriteLine("MEASUrement:IMMed:VALue?");
string val = scope.RawIO.ReadString();
if (float.TryParse(val, out holdup))
{
return true;
}
return false;
}
I see that most of the time val contains junk value or this throws Timeout exception. Occassionally (rarely) it does return the expected holduptime value.
Please suggest what is the issue and what can be done?
Thanks,
Reena -
RE: TBS2104B Scope : SCPI command to read is fetching partial data
I am using Ivi.Visa;
I do not see any other read functions like ReadByteArray() as is used in the forum
; https://forum.tek.com/viewtopic.php?t=139957.
If there is any other library that I can install and try, please let me know.
Currently, I installed from https://www.ni.com/en/support/downloads/drivers/download.ni-visa.html#494653.
I do not see NI.VISA package in my NuGet packages. If anybody knows how I can get NI.VISA
My application is in .NET 4.7.2.
Thanks,
Reena -
Does TBS2104B Oscilloscope support FTP or HTTP?
Does the TBS2104B Oscilloscope supports file transfer over a network protocol (such as FTP or HTTP) or does it exposes the USB drive as a mass storage device that can be accessed directly, ?
Can I read the file in it's USB drive from my code without using the VISA command FormattedIO.WriteLine("FILESystem:READFile ..) ? Reason why I am asking is becuase I see that FILESystem::READFile is not returning the complete file. The actual file in USB drive is 23MB while the data I got after READFile was only 1 MB.
Thanks,
Reena
-
TBS2104B Scope : SCPI command to read is fetching partial data
Hi,
I am passing Ivi.VISA command to save oscilloscope screenshot as .png file and then read it back from oscilloscope to save in my local system, using C# code. My code segment is as follows:
scope.TimeoutMilliseconds = 10000;
// Save image to instrument's local disk
scope.FormattedIO.WriteLine("SAVE:IMAGe \"eval.png\"");
scope.FormattedIO.WriteLine("*OPC?");
// Read image file from instrument
scope.FormattedIO.WriteLine("FILESystem:READFile \"eval.png\"");
byte[] imgData = new byte[5000];
imgData = scope.RawIO.Read();
scope.FormattedIO.WriteLine("*OPC?");
Though the saved image in Oscilloscope is of size 23 MB. bytes returned by RawIO.Read() (i.e. in imgData) is only 1MB.
Thanks,
Reena