![]() |
THM1176InstrumentManager 1.2
Qt Object abstraction for Metrolab THM1176
|
VISA instrument class. More...
#include <VISAInstrument.h>


Public Member Functions | |
| CVISAInstrument (CVISAResourceManager &rRM, tResourceName Rsrc) | |
| Constructor. | |
| virtual | ~CVISAInstrument () |
| Destructor. | |
| virtual bool | Open (void) |
| Open a session to this VISA instrument. | |
| bool | Open (eOpenAccessMode AccessMode, ViUInt32 Timeout_ms=0) |
| Open a session to this VISA instrument. | |
| virtual void | Close () |
| Close session to this VISA instrument. | |
| virtual bool | IsOpen () |
| Check whether a session to this instrument is open. | |
| virtual std::string | StatusDescription (I32 Status) |
| Return description of status word. | |
| const ViSession & | Session () |
| Return instrument session identifier. | |
| virtual bool | Timeout () |
| Last operation timed out. | |
| virtual bool | Write (const char *Str) |
| Write to a VISA instrument: C string variant. | |
| virtual bool | Write (const std::string &rStr) |
| Write to a VISA instrument: C++ string variant. | |
| virtual bool | Write (const CSCPIBuffer &rBuf) |
| Write to a VISA instrument: SCPI buffer class variant. | |
| bool | Write (const ViBuf WriteBuf, ViUInt32 BuffLen) |
| Write to a VISA instrument: VISA buffer variant. | |
| virtual bool | Read (CSCPIBuffer &rBuf, bool Append=false) |
| Read from a VISA instrument: SCPI buffer class variant. | |
| bool | Read (ViPBuf ReadBuf, ViUInt32 ReadLen, ViUInt32 &rRetLen) |
| Read from a VISA instrument: VISA buffer variant. | |
| virtual bool | SetTimeout (ViUInt32 Timeout) |
| Set the timeout for this instrument session. | |
| virtual bool | Clear () |
| Clear the instrument. | |
| virtual bool | ReadSTB (ViUInt16 &rSTB) |
| Read status byte. | |
| virtual bool | AssertTrigger (void) |
| Assert a trigger. | |
| bool | AssertTrigger (eTriggerProtocol Protocol) |
| Assert a trigger. | |
| virtual bool | LockExclusive (U32 Timeout) |
| Obtain an exclusive lock for this session. | |
| bool | LockShared (ViUInt32 Timeout, ViKeyId RequestedKey, ViChar AccessKey[]) |
| Obtain a shared lock for this session. | |
| virtual bool | Unlock () |
| Unlock the session. | |
| virtual bool | LockedExclusive () |
| 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. | |
| bool | EnableEvent (eEventType Type, eEventMechanism Mechanism) |
| Enable notification of a specified event. | |
| bool | DisableEvent (eEventType Type, eEventMechanism Mechanism) |
| Disable notification of a specified event. | |
| bool | WaitOnEvent (eEventType Type, ViUInt32 Timeout) |
| Wait for a specified event. | |
| bool | WaitOnAllEvents (ViUInt32 Timeout) |
| Wait for all events. | |
| bool | DiscardEvents (eEventType Type, eEventMechanism Mechanism) |
| Discard event occurrences for specified event types and mechanisms. | |
| bool | GetAttribute (ViAttr Attribute, void *Value) |
| Retrieves the state of an attribute. | |
| bool | UsbControlIn (ViInt16 bmRequestType, ViInt16 bRequest, ViUInt16 wValue, ViUInt16 wIndex, ViUInt16 wLength, ViPBuf buf, ViUInt16 &rretCnt) |
| Performs a USB control pipe transfer from the instrument. | |
| bool | UsbControlOut (ViInt16 bmRequestType, ViInt16 bRequest, ViUInt16 wValue, ViUInt16 wIndex, ViUInt16 wLength, ViBuf buf) |
| Performs a USB control pipe transfer to the instrument. | |
| bool | ConfigSerialPort (const sSerialPortSettings &rPortSettings) |
| Set all the instrument attributes to configure the serial communication. | |
| 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. | |
| virtual bool | ReadSTB (U16 &rSTB)=0 |
| Read status byte. | |
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). | |
VISA instrument class.
Definition at line 90 of file VISAInstrument.h.
| CVISAInstrument::CVISAInstrument | ( | CVISAResourceManager & | rRM, |
| tResourceName | Rsrc ) |
Constructor.
| [in] | rRM | VISA Resource Manager. |
| [out] | Rsrc | VISA resource name. |
Definition at line 348 of file VISAInstrument.cpp.
|
virtual |
Destructor.
Definition at line 353 of file VISAInstrument.cpp.
| bool CVISAInstrument::AssertTrigger | ( | eTriggerProtocol | Protocol | ) |
Assert a trigger.
| [in] | Protocol | Trigger protocol (usually Default) |
Definition at line 598 of file VISAInstrument.cpp.
|
virtual |
Assert a trigger.
Implements MTL::Instrument::CIEEE488Instrument.
Definition at line 594 of file VISAInstrument.cpp.
|
virtual |
Clear the instrument.
Implements MTL::Instrument::CIEEE488Instrument.
Definition at line 533 of file VISAInstrument.cpp.
|
virtual |
Close session to this VISA instrument.
Implements MTL::Instrument::CIEEE488Instrument.
Definition at line 388 of file VISAInstrument.cpp.
| bool CVISAInstrument::ConfigSerialPort | ( | const sSerialPortSettings & | rPortSettings | ) |
Set all the instrument attributes to configure the serial communication.
| [in] | rPortSettings | Serial port settings. |
Definition at line 839 of file VISAInstrument.cpp.
| bool CVISAInstrument::DisableEvent | ( | eEventType | Type, |
| eEventMechanism | Mechanism ) |
Disable notification of a specified event.
| [in] | Type | Logical event identifier. |
| [in] | Mechanism | How to handle the event. |
Definition at line 702 of file VISAInstrument.cpp.
|
virtual |
Disable service requests.
Implements MTL::Instrument::CIEEE488Instrument.
Definition at line 674 of file VISAInstrument.cpp.
| bool CVISAInstrument::DiscardEvents | ( | eEventType | Type, |
| eEventMechanism | Mechanism ) |
Discard event occurrences for specified event types and mechanisms.
| [in] | Type | Logical event identifier. |
| [in] | Mechanism | How to handle the event. |
Definition at line 750 of file VISAInstrument.cpp.
|
virtual |
Discard service requests.
Implements MTL::Instrument::CIEEE488Instrument.
Definition at line 682 of file VISAInstrument.cpp.
| bool CVISAInstrument::EnableEvent | ( | eEventType | Type, |
| eEventMechanism | Mechanism ) |
Enable notification of a specified event.
| [in] | Type | Logical event identifier. |
| [in] | Mechanism | How to handle the event. |
Definition at line 686 of file VISAInstrument.cpp.
|
virtual |
Enable service requests.
Implements MTL::Instrument::CIEEE488Instrument.
Definition at line 670 of file VISAInstrument.cpp.
| bool CVISAInstrument::GetAttribute | ( | ViAttr | Attribute, |
| void * | Value ) |
Retrieves the state of an attribute.
| [in] | Attribute | Attribute identifier (e.g. VI_ATTR_ASRL_PARITY). |
| [out] | Value | Attribute value. |
Definition at line 769 of file VISAInstrument.cpp.
|
virtual |
Check whether a session to this instrument is open.
Implements MTL::Instrument::CIEEE488Instrument.
Definition at line 401 of file VISAInstrument.cpp.
|
virtual |
Check whether session is locked exclusively.
Implements MTL::Instrument::CIEEE488Instrument.
Definition at line 663 of file VISAInstrument.cpp.
|
virtual |
Obtain an exclusive lock for this session.
| [in] | Timeout | Timeout value, in ms. |
Implements MTL::Instrument::CIEEE488Instrument.
Definition at line 610 of file VISAInstrument.cpp.
| bool CVISAInstrument::LockShared | ( | ViUInt32 | Timeout, |
| ViKeyId | RequestedKey, | ||
| ViChar | AccessKey[] ) |
Obtain a shared lock for this session.
| [in] | Timeout | Timeout value, in ms. |
| [in] | RequestedKey | Request this key for sharing with other sessions; can be VI_NULL. |
| [out] | AccessKey | Key for sharing with other sessions, returned by VISA; at least 256 bytes. |
Definition at line 628 of file VISAInstrument.cpp.
| bool CVISAInstrument::Open | ( | eOpenAccessMode | AccessMode, |
| ViUInt32 | Timeout_ms = 0 ) |
Open a session to this VISA instrument.
| [in] | AccessMode | Access mode (exclusive lock, no lock, load configuration). |
| [out] | Timeout_ms | Timeout for operations during this session, in ms. |
Definition at line 366 of file VISAInstrument.cpp.
|
virtual |
Open a session to this VISA instrument.
Implements MTL::Instrument::CIEEE488Instrument.
Definition at line 362 of file VISAInstrument.cpp.
|
virtual |
Read from a VISA instrument: SCPI buffer class variant.
| [in] | rBuf | Buffer to receive the data. |
| [in] | Append | Whether to append to the existing data. |
Implements MTL::Instrument::CIEEE488Instrument.
Definition at line 475 of file VISAInstrument.cpp.
| bool CVISAInstrument::Read | ( | ViPBuf | ReadBuf, |
| ViUInt32 | ReadLen, | ||
| ViUInt32 & | rRetLen ) |
Read from a VISA instrument: VISA buffer variant.
| [in] | ReadBuf | Buffer to receive the data. |
| [in] | ReadLen | Number of bytes to read. |
| [out] | rRetLen | Number of bytes actually read. |
Definition at line 501 of file VISAInstrument.cpp.
|
virtual |
Read status byte.
| [out] | rSTB | Status byte. |
Definition at line 542 of file VISAInstrument.cpp.
| const ViSession & CVISAInstrument::Session | ( | ) |
Return instrument session identifier.
Definition at line 422 of file VISAInstrument.cpp.
|
virtual |
Set the timeout for this instrument session.
| [out] | Timeout | Timeout for operations during this session, in ms. |
Definition at line 521 of file VISAInstrument.cpp.
|
virtual |
Return description of status word.
| [in] | Status | Status word. |
Implements MTL::Instrument::CIEEE488Instrument.
Definition at line 408 of file VISAInstrument.cpp.
|
virtual |
Last operation timed out.
Implements MTL::Instrument::CIEEE488Instrument.
Definition at line 428 of file VISAInstrument.cpp.
|
virtual |
Unlock the session.
Implements MTL::Instrument::CIEEE488Instrument.
Definition at line 645 of file VISAInstrument.cpp.
| bool CVISAInstrument::UsbControlIn | ( | ViInt16 | bmRequestType, |
| ViInt16 | bRequest, | ||
| ViUInt16 | wValue, | ||
| ViUInt16 | wIndex, | ||
| ViUInt16 | wLength, | ||
| ViPBuf | buf, | ||
| ViUInt16 & | rretCnt ) |
Performs a USB control pipe transfer from the instrument.
| [in] | bmRequestType | bmRequestType parameter of setup stage of a USB control transfer. |
| [in] | bRequest | bRequest parameter of setup stage of a USB control transfer. |
| [in] | wValue | wValue parameter of setup stage of a USB control transfer. |
| [in] | wIndex | wIndex parameter of setup stage of a USB control transfer. |
| [in] | wLength | wLength parameter of the setup stage of a USB control transfer. |
| [out] | buf | Data buffer for optional data stage of the control transfer. |
| [out] | rretCnt | Number of bytes actually transferred in optional data stage of control transfer. |
Definition at line 789 of file VISAInstrument.cpp.
| bool CVISAInstrument::UsbControlOut | ( | ViInt16 | bmRequestType, |
| ViInt16 | bRequest, | ||
| ViUInt16 | wValue, | ||
| ViUInt16 | wIndex, | ||
| ViUInt16 | wLength, | ||
| ViBuf | buf ) |
Performs a USB control pipe transfer to the instrument.
| [in] | bmRequestType | bmRequestType parameter of setup stage of a USB control transfer. |
| [in] | bRequest | bRequest parameter of setup stage of a USB control transfer. |
| [in] | wValue | wValue parameter of setup stage of a USB control transfer. |
| [in] | wIndex | wIndex parameter of setup stage of a USB control transfer. |
| [in] | wLength | wLength parameter of the setup stage of a USB control transfer. |
| [in] | buf | Data buffer to be sent during optional data stage of the control transfer. |
Definition at line 813 of file VISAInstrument.cpp.
| bool CVISAInstrument::WaitOnAllEvents | ( | ViUInt32 | Timeout | ) |
Wait for all events.
| [in] | Timeout | Timeout, in ms. |
Definition at line 734 of file VISAInstrument.cpp.
| bool CVISAInstrument::WaitOnEvent | ( | eEventType | Type, |
| ViUInt32 | Timeout ) |
Wait for a specified event.
| [in] | Type | Logical event identifier. |
| [in] | Timeout | Timeout, in ms. |
Definition at line 718 of file VISAInstrument.cpp.
|
virtual |
Wait for a service request.
| [in] | Timeout | Timeout value, in ms. No timeout if == 0. |
Implements MTL::Instrument::CIEEE488Instrument.
Definition at line 678 of file VISAInstrument.cpp.
|
virtual |
Write to a VISA instrument: C string variant.
| [in] | Str | Data to write. |
Implements MTL::Instrument::CIEEE488Instrument.
Definition at line 437 of file VISAInstrument.cpp.
|
virtual |
Write to a VISA instrument: SCPI buffer class variant.
| [in] | rBuf | Data to write. |
Implements MTL::Instrument::CIEEE488Instrument.
Definition at line 449 of file VISAInstrument.cpp.
|
virtual |
Write to a VISA instrument: C++ string variant.
| [in] | rStr | Data to write. |
Implements MTL::Instrument::CIEEE488Instrument.
Definition at line 443 of file VISAInstrument.cpp.
| bool CVISAInstrument::Write | ( | const ViBuf | WriteBuf, |
| ViUInt32 | BuffLen ) |
Write to a VISA instrument: VISA buffer variant.
| [in] | WriteBuf | Data to write. |
| [in] | BuffLen | Number of bytes to write. |
Definition at line 455 of file VISAInstrument.cpp.