RsSmw C# API Structure#

Constructors

RsSmw ( string resourceName )
var driver = new RsSmw("TCPIP::192.168.2.101::hislip0");

Opens a new session with the given resource name. Checks the *IDN? response, but does not perform reset.

resourceName VISA resource to open the instrument.

RsSmw ( string resourceName, bool idQuery, bool resetDevice )
var driver = new RsSmw("TCPIP::192.168.2.101::hislip0", true, false);

Opens a new session with the given resource name, with the option to check the identification string and reset the instrument.

resourceName VISA resource to open the instrument. idQuery Check the identification query and throw an exception if the instrument is not supported. resetDevice Perform a reset.

RsSmw ( string resourceName, bool idQuery, bool resetDevice, string optionString )
var driver = new RsSmw("TCPIP::192.168.2.101::hislip0", true, false, "Simulate = True");

Driver constructor with all parameters.

resourceName VISA resource to open the instrument. idQuery Check the identification query and throw an exception if the instrument is not supported. resetDevice Perform a reset. optionString Additional options, comma-separated tokens. Examples:

  • Simulate = True - starts the session in simulation mode. Default: False

  • PreferRsVisa = True - selects RohdeSchwarz Visa if present. Otherwise selects default VISA. Default: False

  • QueryInstrumentStatus = False - same as driver.utilities.instrument_status_checking = False. Default: True

  • WriteDelay = 20, ReadDelay = 5 - Introduces delay of 20ms before each write and 5ms before each read. Default: 0ms for both

  • OpcWaitMode = OpcQuery - mode for all the opc-synchronised write/reads. Other modes: ServiceRequest, StbPolling, StbPollingSlow, StbPollingSuperSlow. Default: StbPolling

  • AddTermCharToWriteBinData = True - Adds one additional LF to the end of the binary data (some instruments require that). Default: False

  • AssureWriteWithLf = True - Makes sure each command/query is terminated with linefeed character. Default: Interface dependent

  • IoSegmentSize = 10E3 - Maximum size of one write/read segment. If transferred data is bigger, it is split to more segments. Default: 1E6 bytes

  • OpcTimeout = 10000 - same as driver.utilities.opc_timeout = 10000. Default: 30000ms

  • VisaTimeout = 5000 - same as driver.utilities.visa_timeout = 5000. Default: 10000ms

  • ViClearExeMode = 255 - Binary combination where 1 means performing viClear() on a certain interface as the very first command in init

  • OpcQueryAfterWrite = True - same as driver.utilities.opc_query_after_write = True. Default: False

RsSmw ( byte[] directSession )
var driver2 = new RsSmw(driver.Session);

Creates a new driver object using the existing session from another driver. Does not check the *IDN? response, and does not perform reset.

directSession If not null, a new session is not opened. The entered session is reused.

Global RepCaps

// Initialize the driver
var driver = new RsSmw("TCPIP::192.168.2.101::hislip0");
// HwInstance range: InstA .. InstH
var rc = driver.RepCapHwInstance;
driver.RepCapHwInstance = HwInstanceRepCap.InstA;

Clone Driver

// Clone Driver with other Global RepCap value
RsSmw driverInstB = driver.Clone();
driverInstB.RepCapHwInstance = HwInstanceRepCap.InstB;

No Direct SCPI Members


Subgroups