THM1176InstrumentDriver  1.0
C++ API for Metrolab THM1176
MTL::Instrument::CUSBTMCInstrument Class Reference

USBTMC instrument class. More...

#include <USBTMCInstrument.h>

Inheritance diagram for MTL::Instrument::CUSBTMCInstrument:
Collaboration diagram for MTL::Instrument::CUSBTMCInstrument:

Public Member Functions

 CUSBTMCInstrument (CUSBTMCResourceManager &rRM, tResourceName Rsrc)
 Constructor. More...
 
virtual ~CUSBTMCInstrument (void)
 Destructor. More...
 
virtual bool Open (void)
 Open this USBTMC instrument. More...
 
virtual void Close (void)
 Close this USBTMC instrument. More...
 
virtual bool IsOpen (void)
 Check whether a session to this instrument is open. More...
 
virtual std::string StatusDescription (I32 Status)
 Return description of status word. More...
 
virtual bool Timeout (void)
 Last operation timed out. More...
 
virtual bool Write (const char *Str)
 Write to a USBTMC instrument: C string variant. More...
 
virtual bool Write (const std::string &rStr)
 Write to a USBTMC instrument: C++ string variant. More...
 
virtual bool Write (const CSCPIBuffer &rBuf)
 Write to a USBTMC instrument: SCPI buffer class variant. More...
 
virtual bool Read (CSCPIBuffer &rBuf, bool Append=false)
 Read from a USBTMC instrument: SCPI buffer class variant. More...
 
virtual bool Clear (void)
 Clear the instrument. More...
 
virtual bool ReadSTB (U16 &rSTB)
 Read status byte. More...
 
virtual bool AssertTrigger (void)
 Assert a trigger. More...
 
virtual bool LockExclusive (U32 Timeout)
 Obtain an exclusive lock for this session. More...
 
virtual bool Unlock (void)
 Unlock the session. More...
 
virtual bool LockedExclusive (void)
 Check whether session is locked exclusively. More...
 
- Public Member Functions inherited from MTL::Instrument::CIEEE488Instrument
 CIEEE488Instrument (CIEEE488ResourceManager &rRM, tResourceName Rsrc)
 Constructor. More...
 
virtual ~CIEEE488Instrument ()
 
I32 Status (void)
 
bool SetTimeout (U32 Timeout)
 Set the timeout for this instrument. More...
 
U32 GetTimeout (void)
 Return the timeout for this instrument. More...
 

Additional Inherited Members

- Protected Attributes inherited from MTL::Instrument::CIEEE488Instrument
CRecursiveMutex m_Lock
 Lock onto the class interface. More...
 
CIEEE488ResourceManagerm_rRrsrcMan
 Reference to the associated resource manager. More...
 
tResourceName m_Rsrc
 Resource name of the instrument. More...
 
I32 m_Status
 Status of last operation. More...
 
U32 m_Timeout
 Timeout for operations. More...
 

Detailed Description

USBTMC instrument class.

Definition at line 87 of file USBTMCInstrument.h.

Constructor & Destructor Documentation

◆ CUSBTMCInstrument()

CUSBTMCInstrument::CUSBTMCInstrument ( CUSBTMCResourceManager rRM,
tResourceName  Rsrc 
)

Constructor.

Parameters
[in]rRMUSBTMC Resource Manager.
[out]RsrcUSBTMC resource name.

Definition at line 455 of file USBTMCInstrument.cpp.

◆ ~CUSBTMCInstrument()

CUSBTMCInstrument::~CUSBTMCInstrument ( void  )
virtual

Destructor.

Definition at line 463 of file USBTMCInstrument.cpp.

Member Function Documentation

◆ AssertTrigger()

bool CUSBTMCInstrument::AssertTrigger ( void  )
virtual

Assert a trigger.

Returns
True if successful.

Implements MTL::Instrument::CIEEE488Instrument.

Definition at line 1262 of file USBTMCInstrument.cpp.

◆ Clear()

bool CUSBTMCInstrument::Clear ( void  )
virtual

Clear the instrument.

Implements MTL::Instrument::CIEEE488Instrument.

Definition at line 1072 of file USBTMCInstrument.cpp.

◆ Close()

void CUSBTMCInstrument::Close ( void  )
virtual

Close this USBTMC instrument.

Implements MTL::Instrument::CIEEE488Instrument.

Definition at line 618 of file USBTMCInstrument.cpp.

◆ IsOpen()

bool CUSBTMCInstrument::IsOpen ( void  )
virtual

Check whether a session to this instrument is open.

Implements MTL::Instrument::CIEEE488Instrument.

Definition at line 657 of file USBTMCInstrument.cpp.

◆ LockedExclusive()

bool CUSBTMCInstrument::LockedExclusive ( void  )
virtual

Check whether session is locked exclusively.

Implements MTL::Instrument::CIEEE488Instrument.

Definition at line 1379 of file USBTMCInstrument.cpp.

◆ LockExclusive()

bool CUSBTMCInstrument::LockExclusive ( U32  Timeout)
virtual

Obtain an exclusive lock for this session.

Parameters
[in]TimeoutTimeout value, in ms.
Returns
True if successful.

Implements MTL::Instrument::CIEEE488Instrument.

Definition at line 1325 of file USBTMCInstrument.cpp.

◆ Open()

bool CUSBTMCInstrument::Open ( void  )
virtual

Open this USBTMC instrument.

Returns
True if successful.

Implements MTL::Instrument::CIEEE488Instrument.

Definition at line 475 of file USBTMCInstrument.cpp.

◆ Read()

bool CUSBTMCInstrument::Read ( CSCPIBuffer rBuf,
bool  Append = false 
)
virtual

Read from a USBTMC instrument: SCPI buffer class variant.

Parameters
[in]rBufBuffer to receive the data.
[in]AppendWhether to append to the existing data.
Returns
True if successful.

Implements MTL::Instrument::CIEEE488Instrument.

Definition at line 794 of file USBTMCInstrument.cpp.

◆ ReadSTB()

bool CUSBTMCInstrument::ReadSTB ( U16 rSTB)
virtual

Read status byte.

Parameters
[out]rSTBStatus byte.
Returns
True if successful.

Implements MTL::Instrument::CIEEE488Instrument.

Definition at line 1163 of file USBTMCInstrument.cpp.

◆ StatusDescription()

std::string CUSBTMCInstrument::StatusDescription ( I32  Status)
virtual

Return description of status word.

Parameters
[in]StatusStatus word.
Returns
Status description.

Implements MTL::Instrument::CIEEE488Instrument.

Definition at line 668 of file USBTMCInstrument.cpp.

◆ Timeout()

bool CUSBTMCInstrument::Timeout ( void  )
virtual

Last operation timed out.

Implements MTL::Instrument::CIEEE488Instrument.

Definition at line 680 of file USBTMCInstrument.cpp.

◆ Unlock()

bool CUSBTMCInstrument::Unlock ( void  )
virtual

Unlock the session.

Implements MTL::Instrument::CIEEE488Instrument.

Definition at line 1355 of file USBTMCInstrument.cpp.

◆ Write() [1/3]

bool CUSBTMCInstrument::Write ( const char *  Str)
virtual

Write to a USBTMC instrument: C string variant.

Parameters
[in]StrData to write.
Returns
True if successful.

Implements MTL::Instrument::CIEEE488Instrument.

Definition at line 765 of file USBTMCInstrument.cpp.

◆ Write() [2/3]

bool CUSBTMCInstrument::Write ( const CSCPIBuffer rBuf)
virtual

Write to a USBTMC instrument: SCPI buffer class variant.

Parameters
[in]rBufData to write.
Returns
True if successful.

Implements MTL::Instrument::CIEEE488Instrument.

Definition at line 783 of file USBTMCInstrument.cpp.

◆ Write() [3/3]

bool CUSBTMCInstrument::Write ( const std::string &  rStr)
virtual

Write to a USBTMC instrument: C++ string variant.

Parameters
[in]rStrData to write.
Returns
True if successful.

Implements MTL::Instrument::CIEEE488Instrument.

Definition at line 774 of file USBTMCInstrument.cpp.


The documentation for this class was generated from the following files: