Home > Back-end >  Application difficulties students bucai, graduation design, study, a great god Mr Rescue! Bow down ~
Application difficulties students bucai, graduation design, study, a great god Mr Rescue! Bow down ~

Time:10-07

My graduation design needs to count of the collected signal, and then calculate the time difference between the signal, (such as program meter number 10, the time for the 4 s), because the count with data acquisition card, businessman gave a written counting program, then, low-achieving students don't know how to modify the program to its timing, a great god, please give me a hand, let students graduate ~ ~ ~ ~ thank you very much!

Below is provided by counting program:
//IO_countDlg. CPP: implementation file
//

# include "stdafx. H"
# include "IO_count. H"
# include "IO_countDlg. H"

# ifdef _DEBUG
# define new DEBUG_NEW
# undef THIS_FILE
The static char THIS_FILE []=__FILE__;
# endif
Static int usb_open=0;
The static unsigned char io_out [8].
Extern "C" __declspec (dllimport) int OpenUsb (void);
Extern "C" __declspec (dllimport) int CloseUsb (void);
Extern "C" __declspec (dllimport) int GetDeviceCount (void);
Extern "C" __declspec (dllimport) void SetCurDevice (int Devicenum);
Extern "C" __declspec (dllimport) int DO_SOFT (unsigned char chan, unsigned char state);
Extern "C" __declspec (dllimport) unsigned char DI_Soft (void);
Extern "C" __declspec (dllimport) int AD_single (int chan, int gain, float * adResult);
Extern "C" __declspec (dllimport) int AD_continu (int chan, int gain, int Num_Sample, int Rate_Sample, float * databuf);
Extern "C" __declspec (dllimport) int MAD_continu (int chan_first, int chan_last, gainList int * and an int Num_Sample, int Rate_Sample, float * mad_data);
Extern "C" __declspec (dllimport) int DA_sigle_out (int chan, int value);
Extern "C" __declspec (dllimport) int DA_DATA_SEND (int chan, int Num, int * databuf);
Extern "C" __declspec (dllimport) int DA_scan_out (int chan, int Freq, int scan_Num);
Extern "C" __declspec (dllimport) int PWM_Out (int chan, int Freq, int DutyCycle, int mod);
Extern "C" __declspec (dllimport) int PWM_In (int mod);
Extern "C" __declspec (dllimport) int COUNT (int mod);
Extern "C" __declspec (dllimport) int Read_PWM_In (float * Freq, int * DutyCycle);
Extern "C" __declspec (dllimport) int Read_COUNT (int * count);
/////////////////////////////////////////////////////////////////////////////
//CIO_countDlg dialog

CIO_countDlg: : CIO_countDlg (pParent/*=NULL CWnd * */)
: CDialog (CIO_countDlg: : IDD, pParent)
{
//{{AFX_DATA_INIT (CIO_countDlg)
M_in1=FALSE;
M_in2=FALSE;
M_in3=FALSE;
M_in4=FALSE;
M_in5=FALSE;
M_in6=FALSE;
M_in7=FALSE;
M_in8=FALSE;
M_out1=FALSE;
M_out2=FALSE;
M_out3=FALSE;
M_out4=FALSE;
M_out5=FALSE;
M_out6=FALSE;
M_out7=FALSE;
M_out8=FALSE;
M_count=0;
//}} AFX_DATA_INIT
//Note that LoadIcon does not require a subsequent DestroyIcon in Win32
M_hIcon=AfxGetApp () - & gt; LoadIcon (IDR_MAINFRAME);
}

Void CIO_countDlg: : DoDataExchange (CDataExchange * symbol)
{
CDialog: : DoDataExchange (symbol);
//{{AFX_DATA_MAP (CIO_countDlg)
DDX_Check (symbol, IDC_in1 m_in1);
DDX_Check (symbol, IDC_in2 m_in2);
DDX_Check (symbol, IDC_in3 m_in3);
DDX_Check (symbol, IDC_in4 m_in4);
DDX_Check (symbol, IDC_in5 m_in5);
DDX_Check (symbol, IDC_in6 m_in6);
DDX_Check (symbol, IDC_in7 m_in7);
DDX_Check (symbol, IDC_in8 m_in8);
DDX_Check (symbol, IDC_out1 m_out1);
DDX_Check (symbol, IDC_out2 m_out2);
DDX_Check (symbol, IDC_out3 m_out3);
DDX_Check (symbol, IDC_out4 m_out4);
DDX_Check (symbol, IDC_out5 m_out5);
DDX_Check (symbol, IDC_out6 m_out6);
DDX_Check (symbol, IDC_out7 m_out7);
DDX_Check (symbol, IDC_out8 m_out8);
DDX_Text (symbol, IDC_count m_count);
//}} AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP (CIO_countDlg CDialog)
//{{AFX_MSG_MAP (CIO_countDlg)
ON_WM_PAINT ()
ON_WM_QUERYDRAGICON ()
ON_BN_CLICKED (ID_openusb Onopenusb)
ON_BN_CLICKED (IDC_button_count Onbuttoncount)
ON_WM_TIMER ()
//}} AFX_MSG_MAP
END_MESSAGE_MAP ()

/////////////////////////////////////////////////////////////////////////////
//CIO_countDlg message handlers

BOOL CIO_countDlg: : OnInitDialog ()
{
CDialog: : OnInitDialog ();

//Set the icon for this dialog. The framework does this automatically
//when the application 's main window is not a dialog
SetIcon (m_hIcon, TRUE);//Set the big icon
SetIcon (m_hIcon, FALSE);//Set the small icon

//TODO: Add extra initialization here

Return TRUE;//return TRUE unless you set the focus to a control
}

//If you add a minimize button to your dialog, you will need the code below
//to draw the icon. The For MFC applications using the document/view model,
//this is automatically done for you by the framework.

Void CIO_countDlg: : OnPaint ()
{
If (IsIconic ())
{
CPaintDC dc (this);//device context for painting

SendMessage (WM_ICONERASEBKGND, (WPARAM) dc. GetSafeHdc (), 0).

//Center icon in the client rectangle
Int cxIcon=GetSystemMetrics (SM_CXICON);
Int cyIcon=GetSystemMetrics (SM_CYICON);
CRect the rect.
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull