Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide 373
Creating and Downloading User–Data Files
Save and Recall Instrument State Files
// 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)
{
string retValue = "";
byte[] buf = new byte[MAX_READ_DEVICE_STRING]; // 1024 bytes
maximum read
Содержание X-Series
Страница 4: ...4 ...
Страница 10: ...10 Contents ...