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

📄 linkplcview.h

📁 VC6++ program demo source for communication with PLC to read and write data.
💻 H
字号:
// LinkPLCView.h : interface of the CLinkPLCView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_LINKPLCVIEW_H__43A91764_1AFE_11D8_84D2_FEB56A9BFD34__INCLUDED_)
#define AFX_LINKPLCVIEW_H__43A91764_1AFE_11D8_84D2_FEB56A9BFD34__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "ViewPropertySheet.h"
#include "comm1.h"
#include "PropPage.h"

class CLinkPLCSet;

class CLinkPLCView : public CDaoRecordView
{
protected: // create from serialization only
	CLinkPLCView();
	DECLARE_DYNCREATE(CLinkPLCView)

public:
	//{{AFX_DATA(CLinkPLCView)
	enum { IDD = IDD_LINKPLC_FORM };
	CLinkPLCSet* m_pSet;
	//}}AFX_DATA

	
// Attributes
public:
	CLinkPLCDoc* GetDocument();
	CWinThread* m_pComThread;
// Operations
public:
	CViewPropertySheet* m_pMyPropSheet;
	char m_sPort[8];
	int m_iBaudRate;
	int m_iByteSize;
	int m_iParity;
	int m_iStopBits;
	int m_iSended;
//	CFont m_pFont;
	
	char XReadBuf[100];
	char MReadBuf[10];
	char RunReadBuf[100];
	char YReadBuf[100];
	comm mComPort;

	char  *nTempVoidReadBuf[100];
	bool m_bFlag;

	COleDateTime	m_ViewNgay;
	double  m_ViewMa_hang;
	double  m_ViewSTT;
	double  m_ViewSo_loai;
	double	m_ViewChieu_dai_1;
	double	m_ViewSo_luong_1;
	double	m_ViewChieu_dai_2;
	double	m_ViewSo_luong_2;
	double	m_ViewChieu_dai_3;
	double	m_ViewSo_luong_3;
	double	m_ViewChieu_dai_4;
	double	m_ViewSo_luong_4;
	double	m_ViewChieu_dai_5;
	double	m_ViewSo_luong_5;
	 
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CLinkPLCView)
	public:
	virtual CDaoRecordset* OnGetRecordset();
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	virtual void OnInitialUpdate(); // called first time after construct
	//}}AFX_VIRTUAL

// Implementation
public:
	int m_ViewStation;
	void Process();
	
	void OnRecord();
	int m_NumberStation;
	void OnReadD(int nsStation);
	void CheckThread( BOOL bSuspend);
	static UINT ThreadCommunication(LPVOID pParam);
	int ParseReadBuf(char *lpBuf);
	void ReceiveStatus();
	void SendCommand();
	void OnFileUpdate(WPARAM wParam, LPARAM lParam);
	void UpdateDataFile();
	bool OnHandle(int nSubStation,char* nSubReadBuf);
	virtual ~CLinkPLCView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CLinkPLCView)
	afx_msg void OnSetting();
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnDestroy();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in LinkPLCView.cpp
inline CLinkPLCDoc* CLinkPLCView::GetDocument()
   { return (CLinkPLCDoc*)m_pDocument; }
#endif

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

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

#endif // !defined(AFX_LINKPLCVIEW_H__43A91764_1AFE_11D8_84D2_FEB56A9BFD34__INCLUDED_)

⌨️ 快捷键说明

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