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.
resourceNameVISA 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.
resourceNameVISA resource to open the instrument.idQueryCheck the identification query and throw an exception if the instrument is not supported.resetDevicePerform 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.
resourceNameVISA resource to open the instrument.idQueryCheck the identification query and throw an exception if the instrument is not supported.resetDevicePerform a reset.optionStringAdditional options, comma-separated tokens. Examples:Simulate = True- starts the session in simulation mode. Default: FalsePreferRsVisa = True- selects RohdeSchwarz Visa if present. Otherwise selects default VISA. Default: FalseQueryInstrumentStatus = False- same as driver.utilities.instrument_status_checking = False. Default: TrueWriteDelay = 20, ReadDelay = 5- Introduces delay of 20ms before each write and 5ms before each read. Default: 0ms for bothOpcWaitMode = OpcQuery- mode for all the opc-synchronised write/reads. Other modes: ServiceRequest, StbPolling, StbPollingSlow, StbPollingSuperSlow. Default: StbPollingAddTermCharToWriteBinData = True- Adds one additional LF to the end of the binary data (some instruments require that). Default: FalseAssureWriteWithLf = True- Makes sure each command/query is terminated with linefeed character. Default: Interface dependentIoSegmentSize = 10E3- Maximum size of one write/read segment. If transferred data is bigger, it is split to more segments. Default: 1E6 bytesOpcTimeout = 10000- same as driver.utilities.opc_timeout = 10000. Default: 30000msVisaTimeout = 5000- same as driver.utilities.visa_timeout = 5000. Default: 10000msViClearExeMode = 255- Binary combination where 1 means performing viClear() on a certain interface as the very first command in initOpcQueryAfterWrite = 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.
directSessionIf 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