⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test4231430view.h

📁 一个EVC写的关于串口通信的例子,使用modbus协议进行通信,希望对您有所帮助.
💻 H
字号:
// Test4231430View.h : interface of the CTest4231430View class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_TEST4231430VIEW_H__D48D0E40_9185_4B6C_A5D4_E23F0057F680__INCLUDED_)
#define AFX_TEST4231430VIEW_H__D48D0E40_9185_4B6C_A5D4_E23F0057F680__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include "bao.h"
#include "PSerialPort.h"
class CTest4231430View : public CFormView
{
protected: // create from serialization only
	CTest4231430View();
	DECLARE_DYNCREATE(CTest4231430View)

public:
	//{{AFX_DATA(CTest4231430View)
	enum { IDD = IDD_TEST4231430_FORM };
	CString	m_shuangzi;
	CString	m_danzi;
	int		m_zhi;
	int		m_value;
	CString	m_mode;
	//}}AFX_DATA

// Attributes
public:
	CTest4231430Doc* GetDocument();
	CPSerialPort* m_pSerial;//串口类变量
// Operations
public:
    bool m_ModBussend(int cmd,int addr,int len,int *data);
	static void OnDataArrive(char *data,int length,DWORD userdata);
	void Z2down();
	void Z2up();
	void Y2up();
	void Y2down();
	void X2up();
	void X2down();
	void Z1down();
	void Z1up();
	void Y1down();
	void Y1up();
	void X1down();
	void X1up();
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CTest4231430View)
	public:
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	virtual BOOL DestroyWindow();
	virtual void OnInitialUpdate();
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
public:
	void Read8();
	virtual ~CTest4231430View();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CTest4231430View)
	afx_msg void OnStatic1();
	afx_msg void OnStatic2();
	afx_msg void OnStatic3();
	afx_msg void OnStatic23();
	afx_msg void OnStatic24();
	afx_msg void OnStatic25();
	afx_msg void OnStatic26();
	afx_msg void OnButton8();
	afx_msg void OnButton9();
	afx_msg void OnButton10();
	afx_msg void OnButton11();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnDestroy();
	afx_msg void OnDataArrivedMsg(WPARAM wParam,LPARAM lParam);
	afx_msg void OnButton14();
	afx_msg void OnStatic56();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in Test4231430View.cpp
inline CTest4231430Doc* CTest4231430View::GetDocument()
   { return (CTest4231430Doc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft eMbedded Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_TEST4231430VIEW_H__D48D0E40_9185_4B6C_A5D4_E23F0057F680__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -