14#include "../resources/visatype.h"
15#include "../resources/visa.h"
42 ViSession m_DefaultRM;
93 ViSession m_InstrSession;
107 virtual bool Open(
void);
115 virtual void Close();
131 virtual bool Write(
const char * Str);
136 virtual bool Write(
const std::string & rStr);
147 bool Write(
const ViBuf WriteBuf, ViUInt32 BuffLen);
160 bool Read(ViPBuf ReadBuf, ViUInt32 ReadLen, ViUInt32 & rRetLen);
168 virtual bool Clear();
173 virtual bool ReadSTB(ViUInt16 & rSTB);
265 bool UsbControlIn(ViInt16 bmRequestType, ViInt16 bRequest, ViUInt16 wValue, ViUInt16 wIndex, ViUInt16 wLength, ViPBuf buf, ViUInt16 & rretCnt);
275 bool UsbControlOut(ViInt16 bmRequestType, ViInt16 bRequest, ViUInt16 wValue, ViUInt16 wIndex, ViUInt16 wLength, ViBuf buf);
Abstract IEEE488 instrument class: interface definition.
int I32
32-bit signed integer.
unsigned int U32
32-bit unsigned integer.
IEEE488.2 / SCPI instrument I/O: Instrument buffer management.
Synchronization primitives.
C++ wrapper for NI-VISA: type definitions.
CIEEE488Instrument(CIEEE488ResourceManager &rRM, tResourceName Rsrc)
Constructor.
CIEEE488ResourceManager()
Parsed resource information for a list of instruments.
List of VISA resource names.
virtual bool Unlock()
Unlock the session.
virtual bool Open(void)
Open a session to this VISA instrument.
const ViSession & Session()
Return instrument session identifier.
virtual ~CVISAInstrument()
Destructor.
virtual bool LockExclusive(U32 Timeout)
Obtain an exclusive lock for this session.
virtual bool Read(CSCPIBuffer &rBuf, bool Append=false)
Read from a VISA instrument: SCPI buffer class variant.
virtual bool Timeout()
Last operation timed out.
virtual bool Clear()
Clear the instrument.
virtual bool ReadSTB(ViUInt16 &rSTB)
Read status byte.
virtual bool LockedExclusive()
Check whether session is locked exclusively.
virtual bool DiscardEvents(void)
Discard service requests.
bool WaitOnAllEvents(ViUInt32 Timeout)
Wait for all events.
virtual void Close()
Close session to this VISA instrument.
virtual bool IsOpen()
Check whether a session to this instrument is open.
bool ConfigSerialPort(const sSerialPortSettings &rPortSettings)
Set all the instrument attributes to configure the serial communication.
virtual bool AssertTrigger(void)
Assert a trigger.
virtual bool Write(const char *Str)
Write to a VISA instrument: C string variant.
virtual bool SetTimeout(ViUInt32 Timeout)
Set the timeout for this instrument session.
virtual bool DisableEvent(void)
Disable service requests.
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 LockShared(ViUInt32 Timeout, ViKeyId RequestedKey, ViChar AccessKey[])
Obtain a shared lock for this session.
bool UsbControlOut(ViInt16 bmRequestType, ViInt16 bRequest, ViUInt16 wValue, ViUInt16 wIndex, ViUInt16 wLength, ViBuf buf)
Performs a USB control pipe transfer to the instrument.
virtual bool WaitOnEvent(U32 Timeout)
Wait for a service request.
bool GetAttribute(ViAttr Attribute, void *Value)
Retrieves the state of an attribute.
virtual std::string StatusDescription(I32 Status)
Return description of status word.
CVISAInstrument(CVISAResourceManager &rRM, tResourceName Rsrc)
Constructor.
virtual bool EnableEvent(void)
Enable service requests.
VISA Resource Manager class.
virtual ~CVISAResourceManager()
Destructor.
virtual bool Initialize()
Initialize the Resource Manager.
const ViSession & Session()
Return Resource Manager session identifier.
virtual std::string StatusDescription(I32 Status)
Return description of status word.
CVISAResourceManager()
Constructor.
virtual bool Timeout()
Last operation timed out.
ViStatus Status()
Return Resource Manager status.
bool ResourceInfo(tResourceName &rRsrc, eInterfaceType &rIntfType, tInterfaceNumber &rIntfNumber)
Get the interface type and number for the given VISA resource name.
virtual bool FindResources(CResourceList &rList, std::string Filter="?*")
Find VISA resources.
Information about a VISA resource.
std::string tResourceName
IEEE488 resource name.
eEventMechanism
Event mechanisms.
std::string StatusDescription(ViSession Session, ViStatus Status)
Return user-readable description of the given status code.
ViUInt16 tInterfaceNumber
Interface number.
eOpenAccessMode
Access modes for VISA resources.
eInterfaceType
VISA interface types.
eTriggerProtocol
Trigger protocols.