EasyManuals Logo

Agilent Technologies E8267D User Manual

Agilent Technologies E8267D
366 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #341 background imageLoading...
Page #341 background image
Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide 331
Creating and Downloading User-Data Files
Save and Recall Instrument State Files
string catalog = ReadDevice(device);
/* Match the catalog listing for state files which are named
(sequence#)_(register#) e.g. 0_01, 1_01, 2_05*/
Match m = Regex.Match(catalog, "\"(\\d_\\d\\d),");
while (m.Success)
{
// Grab the matched filename from the regular expresssion
string nextFile = m.Groups[1].ToString();
// Retrieve the file and store with a .STA extension
// in the current directory
Console.WriteLine("Retrieving state file: " + nextFile);
WriteDevice(device, "MEM:DATA? \"/USER/STATE/" + nextFile + "\"\n", true);
ReadFileBlock(device, nextFile + ".STA");
// Clear newline
ReadDevice(device);
// Advance to next match in catalog string
m = m.NextMatch();
}
}
/* This method writes an ASCII text string (SCPI command) to the signal generator.
If the bool "sendEnd" is true, the END line character will be sent at the
conclusion of the write. If "sendEnd is false the END line will not be sent.*/
static public void WriteDevice(uint device, string scpiCmd, bool sendEnd)
{
byte[] buf = Encoding.ASCII.GetBytes(scpiCmd);
if (!sendEnd) // Do not send the END line character
{
VisaInterop.SetAttribute(device, VisaAttribute.SendEndEnable, 0);
}
uint retCount;
VisaInterop.Write(device, buf, (uint)buf.Length, out retCount);
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)
{

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Agilent Technologies E8267D and is the answer not in the manual?

Agilent Technologies E8267D Specifications

General IconGeneral
BrandAgilent Technologies
ModelE8267D
CategoryInverter
LanguageEnglish

Related product manuals