?? visacomm.h
字號(hào):
/******************************************************************************/
/* File: VISACOMM.H */
/* */
/* Class: cCommunications */
/* Author: Alaster Jones */
/* Description: Encapsulate the VISA functionality aimed at comms. protocol */
/* more specific to pressure instruments. Hide some of the VISA */
/* stuff as it's a bit farty. */
/* Date: 02/03/01 */
/******************************************************************************/
//---------------------------------------------------------------------------
#ifndef VISACommH
#define VISACommH
#include "visa.h"
//---------------------------------------------------------------------------
enum COMMSTYPE
{
NOCOMMS = -1,
IEEE488 = 0,
RS232
};
enum STOPBITS
{
eNone = VI_ASRL_PAR_NONE,
eOdd = VI_ASRL_PAR_ODD,
eEven = VI_ASRL_PAR_EVEN,
eMark = VI_ASRL_PAR_MARK,
eSpace = VI_ASRL_PAR_SPACE
};
enum PARITY
{
eOneBit = VI_ASRL_STOP_ONE,
eOneandHalfBit = VI_ASRL_STOP_ONE5,
eTwoBit = VI_ASRL_STOP_TWO
};
enum FLOWCONTROL
{
eFlowNone = VI_ASRL_FLOW_NONE,
eXonXoff = VI_ASRL_FLOW_XON_XOFF,
eRTSCTS = VI_ASRL_FLOW_RTS_CTS,
eDTRDSR = VI_ASRL_FLOW_DTR_DSR
};
// global definition of the SRQ handler call back
ViStatus _VI_FUNCH SRQHandler(ViSession vi, ViEventType etype, ViEvent event, ViAddr userHandle);
//---------------------------------------------------------------------------
class cCommunications
{
public:
cCommunications();
~cCommunications();
long findResources(void);
long openCommsChannel(char * strChannel);
long closeCommunications(void);
virtual long Initialisation(void);
long setSerial(ULONG baudRate, USHORT dataBits, STOPBITS stopBits, PARITY parity, FLOWCONTROL flowControl);
long setIEEE(void);
long setTimeout(long timeout);
long setTerminationChar(bool bEnabled);
short getnumResources(void){return numResources;};
char * getResources(UCHAR resourceNum){return strResources[resourceNum];};
ULONG instr; // instrument connection session
ViUInt32 rtnCount;
ViUInt32 wrtCount;
COMMSTYPE getCommsType(void){return commsType;};
// ULONG getInstr(void){return instr);
private:
// find resources parameters
char strResources[10][50]; // resources found list
char instrDescriptor[100]; //VI_FIND_BUFLEN];
short numResources;
ViFindList findList;
ULONG defaultRM; // default resource manager session
// ULONG instr; // instrument connection session
ViUInt32 numInstrs;
COMMSTYPE commsType;
};
#endif
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -