Technical data

Creating and Downloading User-Data Files 5
Agilent N8211A/N8212A Performance Upconverter Synthetic Instrument Module, 250 kHz to 20 / 40 GHz 141
if (!sendEnd) // Set the bool sendEnd true.
{
VisaInterop.SetAttribute(device, VisaAttribute.SendEndEnable, 1);
}
}
// This method reads an ASCII string from the specified device
static public string ReadDevice(uint device)
{
string retValue = "";
byte[] buf = new byte[MAX_READ_DEVICE_STRING]; // 1024 bytes maximum read
uint retCount;
if (VisaInterop.Read(device, buf, (uint)buf.Length -1, out retCount) == 0)
{
retValue = Encoding.ASCII.GetString(buf, 0, (int)retCount);
}
return retValue;
}
/* The following method reads a SCPI definite block from the signal generator
and writes the contents to a file on your computer. The trailing
newline character is NOT consumed by the read.*/
static public void ReadFileBlock(uint device, string fileName)
{
// Create the new, empty data file.
FileStream fs = new FileStream(fileName, FileMode.Create);
// Read the definite block header: #{lengthDataLength}{dataLength}
uint retCount = 0;
byte[] buf = new byte[10];