get host ip address.
This commit is contained in:
@@ -1050,8 +1050,10 @@ BEGIN
|
||||
PUSHBUTTON "Read Data",IDC_BUTTON_PLC_TCPIP_READ,203,30,63,18
|
||||
PUSHBUTTON "Write Data",IDC_BUTTON_PLC_TCPIP_WRITE,203,62,63,18
|
||||
GROUPBOX "TCP/IP Control",IDC_STATIC,110,12,174,81
|
||||
EDITTEXT IDC_EDIT_PLC_TCPIP_ADDR,139,47,40,14,ES_AUTOHSCROLL
|
||||
LTEXT "Addr",IDC_STATIC,116,50,16,8
|
||||
EDITTEXT IDC_EDIT_PLC_TCPIP_ADDR,141,32,40,14,ES_AUTOHSCROLL
|
||||
LTEXT "Addr",IDC_STATIC,116,35,16,8
|
||||
EDITTEXT IDC_EDIT_PLC_TCPIP_Data,141,61,40,14,ES_AUTOHSCROLL
|
||||
LTEXT "Data",IDC_STATIC,116,64,16,8
|
||||
END
|
||||
|
||||
|
||||
|
||||
@@ -140,13 +140,13 @@ BOOL CSo7_Option::OnInitDialog()
|
||||
((CButton *)GetDlgItem(IDC_RADIO_VIDEOCARD_TC4000))->SetCheck(FALSE);
|
||||
((CButton *)GetDlgItem(IDC_RADIO_VIDEOCARD_MV900))->SetCheck(FALSE);
|
||||
((CButton *)GetDlgItem(IDC_RADIO_SO7_IP_CAMERA))->SetCheck(FALSE);
|
||||
((CButton *)GetDlgItem(IDC_RADIO_CONTROLLER))->SetCheck(TRUE);
|
||||
((CButton *)GetDlgItem(IDC_RADIO_CONTROLLER))->SetCheck(FALSE);
|
||||
((CButton *)GetDlgItem(IDC_RADIO__SO7_RS232))->SetCheck(FALSE);
|
||||
((CButton *)GetDlgItem(IDC_RADIO_KEYENCE_LASER))->SetCheck(FALSE);
|
||||
((CButton *)GetDlgItem(IDC_RADIO_SO7_VERIFICATION_ALGORITHM))->SetCheck(FALSE);
|
||||
((CButton *)GetDlgItem(IDC_RADIO_TEST_IMAGE_DLL))->SetCheck(FALSE);
|
||||
((CButton *)GetDlgItem(IDC_RADIO_ART_PCI8622))->SetCheck(FALSE);
|
||||
((CButton *)GetDlgItem(IDC_RADIO_SO7_OMRON_PLC))->SetCheck(FALSE);
|
||||
((CButton *)GetDlgItem(IDC_RADIO_SO7_OMRON_PLC))->SetCheck(TRUE);
|
||||
|
||||
#ifdef _RELEASE_SO7_CONTROLER_ONLY
|
||||
((CButton *)GetDlgItem(IDC_RADIO_VIDEOCARD_SDK3000))->EnableWindow(FALSE);
|
||||
|
||||
@@ -48,9 +48,15 @@ END_MESSAGE_MAP()
|
||||
|
||||
void CSo7_Util_PLC_TCPIP::OnBnClickedButtonPlcTcpipConnect()
|
||||
{
|
||||
g_pSo7_TCPIP->m_hMsgWnd=m_hWnd;
|
||||
TCPIP_RETURN_CODE rCode=g_pSo7_TCPIP->Connect();
|
||||
m_csMSG.Format(_T("Connect return code:%d."),rCode);
|
||||
in_addr IPAddress;
|
||||
IPAddress.S_un.S_addr=inet_addr("192.168.0.5");
|
||||
TCPIP_RETURN_CODE rCode=g_pSo7_TCPIP->Connect(m_hWnd,IPAddress,9600);
|
||||
m_csMSG.Format(_T("Server:192.168.0.5[9600] Connect return code:%d."),rCode);
|
||||
OutputWithScroll(m_csMSG,m_edMSG);
|
||||
rCode=g_pSo7_TCPIP->GetHostIPAddr(IPAddress);
|
||||
m_csMSG.Format(_T("Client:%d.%d.%d.%d return code:%d."),
|
||||
IPAddress.S_un.S_un_b.s_b1,IPAddress.S_un.S_un_b.s_b2,
|
||||
IPAddress.S_un.S_un_b.s_b3,IPAddress.S_un.S_un_b.s_b4,rCode);
|
||||
OutputWithScroll(m_csMSG,m_edMSG);
|
||||
}
|
||||
|
||||
@@ -58,7 +64,7 @@ void CSo7_Util_PLC_TCPIP::OnBnClickedButtonPlcTcpipConnect()
|
||||
void CSo7_Util_PLC_TCPIP::OnBnClickedButtonPlcTcpipDisconnect()
|
||||
{
|
||||
TCPIP_RETURN_CODE rCode=g_pSo7_TCPIP->DisConnect();
|
||||
m_csMSG.Format(_T("Connect return code:%d."),rCode);
|
||||
m_csMSG.Format(_T("DisConnect return code:%d."),rCode);
|
||||
OutputWithScroll(m_csMSG,m_edMSG);
|
||||
}
|
||||
|
||||
@@ -71,9 +77,9 @@ void CSo7_Util_PLC_TCPIP::OnBnClickedButtonPlcTcpipRead()
|
||||
|
||||
void CSo7_Util_PLC_TCPIP::OnBnClickedButtonPlcTcpipWrite()
|
||||
{
|
||||
TCPIP_RETURN_CODE rCode=g_pSo7_TCPIP->Send();
|
||||
m_csMSG.Format(_T("Connect return code:%d."),rCode);
|
||||
OutputWithScroll(m_csMSG,m_edMSG);
|
||||
//TCPIP_RETURN_CODE rCode=g_pSo7_TCPIP->Send(1001,0);
|
||||
//m_csMSG.Format(_T("Connect return code:%d."),rCode);
|
||||
//OutputWithScroll(m_csMSG,m_edMSG);
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +119,11 @@ void CSo7_Util_PLC_TCPIP::OutputWithScroll(const CString &strNewText,CEdit &edtO
|
||||
LRESULT CSo7_Util_PLC_TCPIP::OnSocket(WPARAM w, LPARAM p)
|
||||
{
|
||||
LRESULT lResult=0;
|
||||
UNREFERENCED_PARAMETER(w);
|
||||
UNREFERENCED_PARAMETER(p);
|
||||
/*
|
||||
if( g_pSo7_TCPIP )
|
||||
lResult = g_pSo7_TCPIP->OnSocket(w,p);
|
||||
*/
|
||||
return( lResult );
|
||||
}
|
||||
@@ -1053,6 +1053,8 @@
|
||||
#define IDC_BUTTON_PLC_TCPIP_WRITE 1886
|
||||
#define IDC_EDIT_PLC_TCPIP_ADDR 1887
|
||||
#define IDC_EDIT_MSG 1888
|
||||
#define IDC_EDIT_PLC_TCPIP_ADDR2 1889
|
||||
#define IDC_EDIT_PLC_TCPIP_Data 1889
|
||||
#define IDC_BUTTON_DIY_EXIT_BUTTON 32740
|
||||
#define ID_EDIT_SO7_CONFIG_MOTION 32741
|
||||
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user