📄 mydaqcard.cpp
字号:
// MyDAQCard.cpp: implementation of the CMyDAQCard class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "MyDAQCard.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CMyDAQCard::CMyDAQCard()
{
hInst = LoadLibrary("StoneDAQ.dll");
if (hInst != NULL)
{
tbdml_init = ( LPUCV)GetProcAddress(hInst, "_tbdml_init@0");
tbdml_open = ( LPUCUC)GetProcAddress(hInst, "_tbdml_open@4");
tbdml_close = ( LPVV)GetProcAddress(hInst, "_tbdml_close@0");
tbdml_read_channel = ( LPVUIPUC)GetProcAddress(hInst,"_tbdml_read_channel@8");
tbdml_write_channel = (LPVUIPUC)GetProcAddress(hInst,"_tbdml_write_channel@8");
tbdml_read_channel3 = (LPVUIPUC)GetProcAddress(hInst,"_tbdml_read_channel3@8");
}
}
CMyDAQCard::~CMyDAQCard()
{
if(hInst != NULL)
FreeLibrary(hInst);
}
unsigned char CMyDAQCard::Init()
{
return tbdml_init();
}
unsigned char CMyDAQCard::Open(unsigned char nNum)
{
return tbdml_open(nNum);
}
void CMyDAQCard::Close()
{
tbdml_close();
}
int CMyDAQCard::ReadData(int nCount, unsigned char *pData)
{
tbdml_read_channel(nCount,pData);
return *pData;
}
void CMyDAQCard::WriteData(int nCount, unsigned char *pData)
{
tbdml_write_channel(nCount,pData);
}
void CMyDAQCard::ReadCh3(unsigned int Count, unsigned char *pData)
{
tbdml_read_channel3(Count,pData);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -