OpenTAP 9.25
API Reference
Static Public Member Functions | List of all members
OpenTap.Scpi Class Reference

Utility class for SCPI communication. More...

Static Public Member Functions

static string Format (string command, params object[] args)
 Similar to string.Format(string,object[]), but makes args SCPI compatible. Bools are ON/OFF formatted. Enum values uses ScpiAttribute.ScpiString. Arrays will have their elements formatted and separated by commas if available; if not they are converted using string.ToString(). More...
 
static object Parse (string scpiString, Type T)
 Overloaded. Parses the result of a SCPI query back to T, with special parsing for enums, bools and arrays. Bools support 1/0 and ON/OFF formats. If Enums are tagged with ScpiAttribute, ScpiAttribute.ScpiString will be used instead of string.ToString() .
More...
 
static T Parse< T > (string scpiString)
 Parses the result of a SCPI query back to T. Special parsing for enums, bools and arrays. bools supports 1/0 and ON/OFF formats. If Enums are tagged with ScpiAttribute ScpiAttribute.ScpiString will be used instead of string.ToString(). More...
 
static string[] GetUnescapedScpi (object src, PropertyInfo property)
 Parses one or more items of ScpiAttribute.ScpiString 'property', replacing '' with the value of the property given after formatting. Note that 'property' must be a property with the ScpiAttribute, and 'src' is the object containing 'property', not the value of the property. If property.PropertyType is bool, then from the ScpiAttribute.ScpiString value 'A|B' A is selected if true, and B is selected if false.

 

Detailed Description

Utility class for SCPI communication.

Member Function Documentation

◆ Format()

static string OpenTap.Scpi.Format ( string  command,
params object[]  args 
)
inlinestatic

Similar to string.Format(string,object[]), but makes args SCPI compatible. Bools are ON/OFF formatted. Enum values uses ScpiAttribute.ScpiString. Arrays will have their elements formatted and separated by commas if available; if not they are converted using string.ToString().

Parameters
command
args
Returns

◆ Parse()

static object OpenTap.Scpi.Parse ( string  scpiString,
Type  T 
)
inlinestatic

Overloaded. Parses the result of a SCPI query back to T, with special parsing for enums, bools and arrays. Bools support 1/0 and ON/OFF formats. If Enums are tagged with ScpiAttribute, ScpiAttribute.ScpiString will be used instead of string.ToString() .

Parameters
scpiString
T
Returns

◆ Parse&lt; T &gt;()

static T OpenTap.Scpi.Parse< T > ( string  scpiString)
inlinestatic

Parses the result of a SCPI query back to T. Special parsing for enums, bools and arrays. bools supports 1/0 and ON/OFF formats. If Enums are tagged with ScpiAttribute ScpiAttribute.ScpiString will be used instead of string.ToString().

Template Parameters
T
Parameters
scpiString
Returns

OpenTAP 9.25 API built Tue Aug 6 2024 07:49:24