| THM1176InstrumentDriver 1.2 C++ API for Metrolab THM1176

Loading...
Searching...
No Matches
MTL::Instrument::CUSBTMCInstrument Class Reference

USBTMC instrument class. More...

`#include <USBTMCInstrument.h>`

Inheritance diagram for MTL::Instrument::CUSBTMCInstrument:
[legend]
Collaboration diagram for MTL::Instrument::CUSBTMCInstrument:
[legend]

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

## Additional Inherited Members
Protected Attributes inherited from MTL::Instrument::CIEEE488Instrument
CRecursiveMutex | m_Lock
| Lock onto the class interface.
CIEEE488ResourceManager & | m_rRrsrcMan
| Reference to the associated resource manager.
tResourceName | m_Rsrc
| Resource name of the instrument.
I32 | m_Status
| Status of last operation.
U32 | m_Timeout
| Timeout for operations.
Static Protected Attributes inherited from MTL::Instrument::CIEEE488Instrument
static const I32 | IEEE488_DEFAULT_TIMEOUT = 100
| Default timeout (ms).

## Detailed Description

USBTMC instrument class.

Definition at line 92 of file USBTMCInstrument.h.

## Constructor & Destructor Documentation

## ◆ CUSBTMCInstrument()

CUSBTMCInstrument::CUSBTMCInstrument | ( | CUSBTMCResourceManager & | rRM,
|  | tResourceName | Rsrc )

Constructor.

Parameters

  [in] | rRM | USBTMC Resource Manager.
  [out] | Rsrc | USBTMC resource name.

Definition at line 457 of file USBTMCInstrument.cpp.

## ◆ ~CUSBTMCInstrument()

CUSBTMCInstrument::~CUSBTMCInstrument | ( | void |  | ) |
| virtual

Destructor.

Destructor.

Definition at line 465 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 1295 of file USBTMCInstrument.cpp.

## ◆ Clear()

bool CUSBTMCInstrument::Clear | ( | void |  | ) |
| virtual

Clear the instrument.

Returns
  True if successful.

Implements MTL::Instrument::CIEEE488Instrument.

Definition at line 1081 of file USBTMCInstrument.cpp.

## ◆ Close()

void CUSBTMCInstrument::Close | ( | void |  | ) |
| virtual

Close this VXI-11 instrument.

Implements MTL::Instrument::CIEEE488Instrument.

Definition at line 620 of file USBTMCInstrument.cpp.

## ◆ DisableEvent()

bool CUSBTMCInstrument::DisableEvent | ( | void |  | ) |
| virtual

Disable service requests.

Returns
  True if successful.

Implements MTL::Instrument::CIEEE488Instrument.

Definition at line 1439 of file USBTMCInstrument.cpp.

## ◆ DiscardEvents()

bool CUSBTMCInstrument::DiscardEvents | ( | void |  | ) |
| virtual

Discard service requests.

Returns
  True if successful.

Implements MTL::Instrument::CIEEE488Instrument.

Definition at line 1517 of file USBTMCInstrument.cpp.

## ◆ EnableEvent()

bool CUSBTMCInstrument::EnableEvent | ( | void |  | ) |
| virtual

Enable service requests.

Returns
  True if successful.

Implements MTL::Instrument::CIEEE488Instrument.

Definition at line 1429 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 659 of file USBTMCInstrument.cpp.

## ◆ LockedExclusive()

bool CUSBTMCInstrument::LockedExclusive | ( | void |  | ) |
| virtual

Check whether session is locked exclusively.

Returns
  True if successful.

Implements MTL::Instrument::CIEEE488Instrument.

Definition at line 1412 of file USBTMCInstrument.cpp.

## ◆ LockExclusive()

bool CUSBTMCInstrument::LockExclusive | ( | U32 | Timeout | ) |
| virtual

Obtain an exclusive lock for this session.

Parameters

  [in] | Timeout | Timeout value, in ms.

Returns
  True if successful.

Implements MTL::Instrument::CIEEE488Instrument.

Definition at line 1358 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 477 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] | rBuf | Buffer to receive the data.
  [in] | Append | Whether to append to the existing data.

Returns
  True if successful.

Implements MTL::Instrument::CIEEE488Instrument.

Definition at line 796 of file USBTMCInstrument.cpp.

## ◆ ReadSTB()

bool CUSBTMCInstrument::ReadSTB | ( | U16 & | rSTB | ) |
| virtual

Read status byte.

Parameters

  [out] | rSTB | Status byte.

Returns
  True if successful.

Implements MTL::Instrument::CIEEE488Instrument.

Definition at line 1174 of file USBTMCInstrument.cpp.

## ◆ StatusDescription()

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

Return description of status word.

Parameters

  [in] | Status | Status word.

Returns
  Status description.

Implements MTL::Instrument::CIEEE488Instrument.

Definition at line 670 of file USBTMCInstrument.cpp.

## ◆ Timeout()

bool CUSBTMCInstrument::Timeout | ( | void |  | ) |
| virtual

Last operation timed out.

Implements MTL::Instrument::CIEEE488Instrument.

Definition at line 682 of file USBTMCInstrument.cpp.

## ◆ Unlock()

bool CUSBTMCInstrument::Unlock | ( | void |  | ) |
| virtual

Unlock the session.

Returns
  True if successful.

Implements MTL::Instrument::CIEEE488Instrument.

Definition at line 1388 of file USBTMCInstrument.cpp.

## ◆ WaitOnEvent()

bool CUSBTMCInstrument::WaitOnEvent | ( | U32 | Timeout | ) |
| virtual

Wait for a service request.

Parameters

  [in] | Timeout | Timeout value, in ms. No timeout if == 0.

Returns
  True if successful.

Implements MTL::Instrument::CIEEE488Instrument.

Definition at line 1449 of file USBTMCInstrument.cpp.

## ◆ Write() [1/3]

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

Write to a USBTMC instrument: C string variant.

Parameters

  [in] | Str | Data to write.

Returns
  True if successful.

Implements MTL::Instrument::CIEEE488Instrument.

Definition at line 767 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] | rBuf | Data to write.

Returns
  True if successful.

Implements MTL::Instrument::CIEEE488Instrument.

Definition at line 785 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] | rStr | Data to write.

Returns
  True if successful.

Implements MTL::Instrument::CIEEE488Instrument.

Definition at line 776 of file USBTMCInstrument.cpp.

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

- Common/USBTMCInstrument/include/USBTMCInstrument.h
- Common/USBTMCInstrument/src/USBTMCInstrument.cpp