#include <modbus.h>

// MRTU_MasterDlg.h : header file
//

#pragma once


// CMRTU_MasterDlg dialog
class CMRTU_MasterDlg : public CDialog
{
// Construction
public:
	CMRTU_MasterDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	enum { IDD = IDD_LM_MBMASTER_DIALOG };
	CString	m_ip;
	int		m_port;
	int		m_rcoilfrom;
	CString	m_rcoilr;
	int		m_rcoilto;
	int		m_rregsfrom;
	CString m_rInputbitr;
	int		m_rInputbitfrom;
	int		m_rInpubitto;
	CString m_rInpregsr;
	int m_rInputregfrom;
	int m_rInpuregto;
	CString	m_rregsr;
	int		m_rregsto;
	int		m_wcoil;
	int		m_wcoils;
	int		m_wreg;
	int		m_wregv;
	int		m_com;
	int		m_databit;
	int		m_parity;
	int		m_baud;
	int		m_stopbit;
	int		m_tcptime;
	int		m_rtutime;
	CString	m_reConnectCount;

	modbus_t *ctx;
	BOOL m_check;
	BOOL m_check2;
	BOOL m_which;
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	virtual BOOL OnInitDialog();
#if defined(_DEVICE_RESOLUTION_AWARE) && !defined(WIN32_PLATFORM_WFSP)
	afx_msg void OnSize(UINT /*nType*/, int /*cx*/, int /*cy*/);
#endif
	DECLARE_MESSAGE_MAP()
public:
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnPaint();
	afx_msg void OnBnClickedButton1();
	afx_msg void OnTimer(UINT_PTR nIDEvent);
	afx_msg void OnBnClickedMbtcpradio2();
	afx_msg void OnBnClickedMbrturadio();
	afx_msg void OnBnClickedButton2();
	afx_msg void OnBnClickedButton4();
	afx_msg void OnBnClickedButton5();
//	afx_msg void OnBnClickedRregsb();
	afx_msg void OnBnClickedWcoilb();
	afx_msg void OnBnClickedWregb();
	afx_msg void OnBnClickedRregsb();
	afx_msg void OnBnClickedRregsb2();
	afx_msg void OnBnClickedButton3();
};
