// 8k_87k_doDlg.cpp : implementation file // #include "stdafx.h" #include "8k_87k_do.h" #include "8k_87k_doDlg.h" #include "PACSDK.h" #ifdef _DEBUG #define new DEBUG_NEW #endif // CMy8k_87k_doDlg dialog CMy8k_87k_doDlg::CMy8k_87k_doDlg(CWnd* pParent /*=NULL*/) : CDialog(CMy8k_87k_doDlg::IDD, pParent) { m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); } void CMy8k_87k_doDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); } BEGIN_MESSAGE_MAP(CMy8k_87k_doDlg, CDialog) #if defined(_DEVICE_RESOLUTION_AWARE) && !defined(WIN32_PLATFORM_WFSP) ON_WM_SIZE() #endif //}}AFX_MSG_MAP ON_BN_CLICKED(IDC_BUTTON1, &CMy8k_87k_doDlg::OnBnClickedButton1) ON_BN_CLICKED(IDC_BUTTON2, &CMy8k_87k_doDlg::OnBnClickedButton2) END_MESSAGE_MAP() // CMy8k_87k_doDlg message handlers BOOL CMy8k_87k_doDlg::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 big icon SetIcon(m_hIcon, FALSE); // Set small icon // TODO: Add extra initialization here SetDlgItemText(IDC_EDIT5, L"What is pac_xxx_MF?\r\nMF is the abbreviation of Multi-function.\r\npac_xxx_MF is used to access DIO channels of the Multi-function module.\r\nAIO or counter modules equipped with DI or DO channel is known as Multi-function module.\r\nCall pac_xxxx function to access DIO channels of the DCON module equipped only with DI or DO channel.\r\nCall pac_xxx_MF functions to access DIO channel of the Multi-function module.\r\n"); return TRUE; // return TRUE unless you set the focus to a control } #if defined(_DEVICE_RESOLUTION_AWARE) && !defined(WIN32_PLATFORM_WFSP) void CMy8k_87k_doDlg::OnSize(UINT /*nType*/, int /*cx*/, int /*cy*/) { if (AfxIsDRAEnabled()) { DRA::RelayoutDialog( AfxGetResourceHandle(), this->m_hWnd, DRA::GetDisplayMode() != DRA::Portrait ? MAKEINTRESOURCE(IDD_MY8K_87K_DO_DIALOG_WIDE) : MAKEINTRESOURCE(IDD_MY8K_87K_DO_DIALOG)); } } #endif void CMy8k_87k_doDlg::OnBnClickedButton1() { // TODO: Add your control notification handler code here TCHAR temp[20]; DWORD DOValue=0; CString strTemp; char ctemp[20]={0}; int slot,DOChannel; BOOL iret; //87k module must build com port HANDLE send data HANDLE hPort = uart_Open(""); //get user insert 87k module slot GetDlgItemText(IDC_COMBO1,temp,20); slot = _wtoi(temp); //get user set 87k module DO total channel GetDlgItemText(IDC_EDIT1,temp,20); DOChannel = _wtoi(temp); //get user set 87k module DO value and change decade to hexadecimal GetDlgItemText(IDC_EDIT2,strTemp); for(int i=0;i