372 Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide
Creating and Downloading User–Data Files
Save and Recall Instrument State Files
WriteDevice(device, "MEM:DATA \"/USER/STATE/" + m.ToString()
+ "\",",
false); // << on SAME line!
WriteFileBlock(device, fi.Name);
WriteDevice(device, "\n", true);
}
}
}
/* This method reads out all the sequence/register state files from
the signal
generator and stores them in your computer's local directory with a
".STA"
extension */
static public void BackupInstrumentState(uint device)
{
// Get the memory catalog for the state directory
WriteDevice(device, "MEM:CAT:STAT?\n", false);
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/" + ne
"\"\n", true);
ReadFileBlock(device, ne ".STA");
// Clear newline
ReadDevice(device);
Содержание X-Series
Страница 4: ...4 ...
Страница 10: ...10 Contents ...