OpenTAP 9.24
API Reference
Public Member Functions | List of all members
OpenTap.ScpiIO Class Reference

Implements Visa SCPI IO. More...

Inheritance diagram for OpenTap.ScpiIO:
OpenTap.IScpiIO2 OpenTap.IScpiIO

Public Member Functions

void OpenSRQ ()
 Open SRQ Callback handling.
 
void CloseSRQ ()
 Close SRQ Callback handling.
 
ScpiIOResult Close ()
 Close the connection to the instrument. More...
 
ScpiIOResult DeviceClear ()
 Clears the SCPI state, including any errors in the error queue.
 
ScpiIOResult Lock (ScpiLockType lockType, string sharedKey=null)
 Try to acquire a lock on the instrument. More...
 
ScpiIOResult Read (ArraySegment< byte > buffer, int count, ref bool eoi, ref int read)
 Reads a number of bytes from the instrument. More...
 
ScpiIOResult ReadSTB (ref byte stb)
 Reads the status byte of the instrument. More...
 
ScpiIOResult Unlock ()
 Unlock an instrument.
 
ScpiIOResult Write (ArraySegment< byte > buffer, int count, ref int written)
 Writes a number of bytes to the instrument. More...
 
- Public Member Functions inherited from OpenTap.IScpiIO2
ScpiIOResult Open (string visaAddress, bool @lock)
 Opens a connection to the instrument. More...
 

Additional Inherited Members

- Properties inherited from OpenTap.IScpiIO2
int ID [get]
 Resource ID attached to this instrument.
 
- Properties inherited from OpenTap.IScpiIO
bool SendEnd [getset]
 Indicates whether a Write(ArraySegment<byte>, int, ref int) should generate an end-of-message indicator when writing its last byte.
 
int IOTimeoutMS [getset]
 Indicates the timeout in milliseconds for any of the IO operations.
 
int LockTimeoutMS [getset]
 Indicates the timeout in milliseconds for acquiring a lock.
 
byte TerminationCharacter [getset]
 Sets the termination character, if any.
 
bool UseTerminationCharacter [getset]
 Controls whether the IO operations should use a termination character.
 
string ResourceClass [get]
 Returns the resource class of the connected instrument.
 
- Events inherited from OpenTap.IScpiIO2
ScpiIOSrqDelegate SRQ
 Callback from SRQ instrument events.
 

Detailed Description

Implements Visa SCPI IO.

Member Function Documentation

◆ Close()

ScpiIOResult OpenTap.ScpiIO.Close ( )
inline

Close the connection to the instrument.

Returns
Visa Error code.

Implements OpenTap.IScpiIO2.

◆ Lock()

ScpiIOResult OpenTap.ScpiIO.Lock ( ScpiLockType  lockType,
string  sharedKey = null 
)
inline

Try to acquire a lock on the instrument.

Parameters
lockTypeIndicates which kind of lock should be acquired.
sharedKeyIn case the type of lock is

Implements OpenTap.IScpiIO.

◆ Read()

ScpiIOResult OpenTap.ScpiIO.Read ( ArraySegment< byte >  buffer,
int  count,
ref bool  eoi,
ref int  read 
)
inline

Reads a number of bytes from the instrument.

Parameters
bufferThe target buffer to read to.
countThe number of bytes to read.
eoiThis will indicate whether an EOI indicator was received.
readThe number of bytes that was actually read if succesful.

Implements OpenTap.IScpiIO.

◆ ReadSTB()

ScpiIOResult OpenTap.ScpiIO.ReadSTB ( ref byte  stb)
inline

Reads the status byte of the instrument.

Parameters
stbThe current status byte.

Implements OpenTap.IScpiIO.

◆ Write()

ScpiIOResult OpenTap.ScpiIO.Write ( ArraySegment< byte >  buffer,
int  count,
ref int  written 
)
inline

Writes a number of bytes to the instrument.

The returned error code will indicate whether the EOI was sent.

Parameters
bufferThe buffer to write from.
countThe number of bytes to read.
writtenThe number of bytes that was actually written if succesful.

Implements OpenTap.IScpiIO.

OpenTAP 9.24 API built Tue Apr 30 2024 13:44:42