Quantcast
Channel: Instrument Control (GPIB, Serial, VISA, IVI) topics
Viewing all articles
Browse latest Browse all 5566

Does VISA.NET API has a equivalent for VisaNS.ReadToFile() function

$
0
0

I am working on getting a hardcopy from a scope, but don't know how to set the buffer size when getting the image data.

I found the following example which using the MessageBasedSession.ReadToFile() function to streamline the instrument read and file write to a single function call. I want to use the VISA.NET API, Is there a equivalent function in VISA.NET API or any other ways to set a proper buffer size?

Thanks in advance!

 

 

 

using System; using NationalInstruments.VisaNS; namespace instr_control { public class Program { static void Main(string[] args) { MessageBasedSession Scope; string resourceString = "USB0::0x0699::0x03A6::C010000::INSTR"; Scope = (MessageBasedSession)ResourceManager.GetLocalManager().Open(resourceString); string path = @"C:\"; string fname = @"temp" + DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss") + ".bmp"; Scope.Timeout = 5000; Scope.Write("ACQuire:STATE STOP"); Scope.Write("HardCopy:FormatException bmp"); Scope.Write("Hardcopy:Layout Portrait"); Scope.Write("HARDCopy:INKSaver OFF"); Scope.Write("Hardcopy:port USB"); Scope.Write("Hardcopy Start"); try { Scope.ReadToFileAppends = true; do { Scope.ReadToFile(path + fname); } while (Scope.LastStatus.Equals(VisaStatusCode.SuccessMaxCountRead)) ; } catch (Exception exp) { Console.WriteLine(exp.Message); } Scope.Dispose(); } } }

 

 

 


Viewing all articles
Browse latest Browse all 5566

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>