You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.8 KiB
C++
49 lines
1.8 KiB
C++
#pragma once
|
|
|
|
class CAdlinkCommon
|
|
{
|
|
public:
|
|
CAdlinkCommon(int nPhysicalCardID, int nPortNo, int nPointNo);
|
|
~CAdlinkCommon(void);
|
|
|
|
public:
|
|
int InitInputCard(unsigned short usCardModel, int nHardwareIniTypeCardNo, int *pPhysicalCardID);
|
|
|
|
int InitOutputCard(unsigned short usCardModel, int nHardwareIniTypeCardNo, int *pPhysicalCardID);
|
|
|
|
int ClearOutputPort(int nPhysicalCardID, int nPortNo);
|
|
|
|
int SetPortType(int nPhysicalCardID, int PortNo, int nType);
|
|
|
|
int CloseInputCard(int nPhysicalCardID);
|
|
|
|
int CloseOutputCard(int nPhysicalCardID);
|
|
|
|
bool ReadVoltage(int nRange, double *pVoltage);
|
|
|
|
bool ReadInput(unsigned short *pState);
|
|
|
|
bool WriteOutputBit(bool bState);
|
|
|
|
bool WriteVoltage(double dVoltage);
|
|
|
|
bool ConfigOutputVoltageRange(double dRange); // for 9112
|
|
|
|
bool ClearEncoder(); // for 9222
|
|
|
|
bool UseEncoder(bool bUse); // for 9222
|
|
|
|
unsigned long ReadEncoder(); // for 9222
|
|
|
|
bool SetupEncoder(unsigned short usMode, unsigned long ulReg1Val, unsigned long ulReg2Val); // for 9222
|
|
|
|
private:
|
|
unsigned short m_usPhysicalCardID; // only used for CInput and COutput class
|
|
unsigned short m_usPortNo; // only used for CInput and COutput class
|
|
unsigned short m_usPointNo; // only used for CInput and COutput class
|
|
|
|
bool InitCard(unsigned short usCardModel, int nHardwareIniTypeCardNo, int *pPhysicalCardID);
|
|
|
|
bool CloseCard(int nPhysicalCardID);
|
|
};
|