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.
88 lines
2.1 KiB
C++
88 lines
2.1 KiB
C++
// Input.h: interface for the CInput class.
|
|
//
|
|
//////////////////////////////////////////////////////////////////////
|
|
#pragma once
|
|
|
|
#include "Hardware.h"
|
|
#include "Card.h"
|
|
#include "InputBase.h"
|
|
|
|
#include "DllDefines.h"
|
|
|
|
class IODLLCLASS CInputSetting
|
|
{
|
|
public:
|
|
|
|
std::string m_strName;
|
|
std::string m_strModuleName;
|
|
BOOL m_bLogic{FALSE};
|
|
int m_nPointNo{ 0 };
|
|
int m_nSlaveID{ 0 };
|
|
int m_nPtrNo{ 0 };
|
|
int m_nBoardType{ 0 };
|
|
int m_nCardNo{ 0 };
|
|
};
|
|
|
|
class IODLLCLASS CInput : public CCard
|
|
{
|
|
public:
|
|
CInput(const CInputSetting& Setting);
|
|
virtual ~CInput();
|
|
|
|
BOOL SetLastAICh(int nLastChannel);
|
|
BOOL SetAIConfig(int nSignalRange);
|
|
|
|
BOOL GetVoltage(double& dVoltage, int nRange);
|
|
|
|
// method to start read
|
|
BOOL StartRead();
|
|
|
|
// method to get voltage only
|
|
BOOL GetVoltageOnly(double& dVoltage, int nRange);
|
|
|
|
// method to stop read
|
|
BOOL StopRead();
|
|
|
|
void AbortCheck(void);
|
|
|
|
HANDLE GetEvt(BOOL bState);
|
|
|
|
void StartWait(BOOL bState, DWORD dwDebounce, DWORD dwTimeout);
|
|
|
|
BOOL Wait(BOOL bState, DWORD dwDebounce, DWORD dwTimeout);
|
|
|
|
BOOL IsOff(void);
|
|
|
|
BOOL IsOn(void);
|
|
|
|
BOOL operator==(const BOOL bState);
|
|
BOOL operator!=(const BOOL bState);
|
|
|
|
/***********************************************************************/
|
|
/*********************currently for 9222 ONLY***************************/
|
|
|
|
// method to setup general counter
|
|
BOOL SetupCounter(int nMode);
|
|
|
|
// method to clear counter
|
|
BOOL ClearCounter();
|
|
|
|
// method to enable counter counting
|
|
BOOL EnableCounter();
|
|
|
|
// method to disable counter counting
|
|
BOOL DisableCounter();
|
|
|
|
// method read the counter
|
|
unsigned long ReadCounter();
|
|
|
|
// For ECAT
|
|
bool GetPDO(unsigned short nIndex, unsigned short nSubIndex, std::vector<unsigned char>& vecData, unsigned long LenInBits, unsigned long& outLenInBit);
|
|
|
|
bool GetPDOValue(unsigned short nIndex, unsigned short nSubIndex, long& lValue);
|
|
bool GetPDOValue(unsigned short nIndex, unsigned short nSubIndex, bool& bValue);
|
|
|
|
private:
|
|
CInputBase* m_inputBase{ nullptr };
|
|
};
|