Add ex-trig test.
This commit is contained in:
@@ -405,6 +405,7 @@ enum E_DIS_TRIG_PULSE_METHOD
|
||||
{
|
||||
E_DIS_TRIG_PULSE_EQDIS=0,
|
||||
E_DIS_TRIG_PULSE_SPEC_LOCA,
|
||||
E_DIS_TRIG_PULSE_EQDIS_II,
|
||||
E_DIS_TRIG_PULSE_TOTAL=255
|
||||
};
|
||||
enum E_ACTIVE_AXIS
|
||||
|
||||
@@ -4850,6 +4850,11 @@ SSI_STATUS_MOTION CSO7_Proto::so7_motion_set_trig_para(char _cAxis,char _TrigMod
|
||||
SetParaNumber=_ParaNumber;
|
||||
_send_cmd_SO7_CMD_WRITE_TRIG_PULSE_PARA(_cAxis,_TrigMode,SetStartIndex,SetParaNumber,_ParaData);
|
||||
}
|
||||
else if (_TrigMode==E_DIS_TRIG_PULSE_EQDIS_II)
|
||||
{
|
||||
SetParaNumber=_ParaNumber;
|
||||
_send_cmd_SO7_CMD_WRITE_TRIG_PULSE_PARA(_cAxis,_TrigMode,SetStartIndex,SetParaNumber,_ParaData);
|
||||
}
|
||||
else
|
||||
{
|
||||
do
|
||||
@@ -6254,6 +6259,10 @@ SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_WRITE_TRIG_PULSE_PARA(char Activ
|
||||
{
|
||||
lSetParaNumber=1;
|
||||
}
|
||||
else if (TrigMode==E_DIS_TRIG_PULSE_EQDIS)
|
||||
{
|
||||
lSetParaNumber=2;
|
||||
}
|
||||
else
|
||||
{
|
||||
lSetParaNumber=ParaNumber;
|
||||
|
||||
@@ -607,12 +607,7 @@ void CSo7_TCPIP_Server::m_ProcessSocketReadEvent(SOCKET s)
|
||||
m_TCPIPMsg._CmdType=0;
|
||||
m_TCPIPMsg._DataAddr=iAddr;
|
||||
m_TCPIPMsg._DataSize=iDataSize;
|
||||
if (iAddr>=200)
|
||||
{
|
||||
Response_PLC_DM200_R(iAddr,iDataSize);
|
||||
m_TCPIPMsg._MsgType=RESPONSE_READ_PLC_STATE;
|
||||
}
|
||||
else if (iAddr>=20000)
|
||||
if (iAddr>=20000)
|
||||
{
|
||||
m_TCPIPMsg._MsgType=RESPONSE_READ_ERRCODE;
|
||||
}
|
||||
@@ -631,6 +626,11 @@ void CSo7_TCPIP_Server::m_ProcessSocketReadEvent(SOCKET s)
|
||||
Response_PLC_DM5000_R(iAddr,iDataSize);
|
||||
m_TCPIPMsg._MsgType=RESPONSE_READ_PLC_STATE;
|
||||
}
|
||||
else if (iAddr>=200)
|
||||
{
|
||||
Response_PLC_DM200_R(iAddr,iDataSize);
|
||||
m_TCPIPMsg._MsgType=RESPONSE_READ_PLC_STATE;
|
||||
}
|
||||
else
|
||||
{
|
||||
RESPONSE_PLC_DM_UNKNOWN();
|
||||
@@ -694,9 +694,12 @@ void CSo7_TCPIP_Server::m_ProcessSocketReadEvent(SOCKET s)
|
||||
}
|
||||
BOOL bStatus(false);
|
||||
bStatus=DM200[35]&0x0002;
|
||||
TRACE1("DM235=%d\r\n",DM200[35]);
|
||||
if (bStatus)
|
||||
{
|
||||
TRACE1("DM225=%d\r\n",DM200[25]);
|
||||
DM200[25]=DM200[25]&0xFFFB;
|
||||
TRACE1("DM225=%d\r\n",DM200[25]);
|
||||
}
|
||||
m_TCPIPMsg._UpdateData=2;
|
||||
RESPONSE_PLC_DM_UNKNOWN();
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// 中文(简体,中国) resources
|
||||
// Chinese (Simplified, PRC) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)
|
||||
LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
|
||||
@@ -1004,12 +1004,13 @@ BEGIN
|
||||
CONTROL "Y",IDC_RADIO_SO7_EXTRIG_Y,"Button",BS_AUTORADIOBUTTON,77,33,20,10
|
||||
CONTROL "Z",IDC_RADIO_SO7_EXTRIG_Z,"Button",BS_AUTORADIOBUTTON,113,33,20,10
|
||||
CONTROL "等间距触发",IDC_RADIO_SO7_EXTRIG_EQDIS,"Button",BS_AUTORADIOBUTTON | WS_GROUP,36,75,56,10
|
||||
CONTROL "指定位移触发",IDC_RADIO_SO7_EXTRIG_SPECLOCATION,"Button",BS_AUTORADIOBUTTON,36,93,64,10
|
||||
CONTROL "等间距触发II",IDC_RADIO_SO7_EXTRIG_EQDIS2,"Button",BS_AUTORADIOBUTTON | WS_GROUP,36,86,61,10
|
||||
CONTROL "指定位移触发",IDC_RADIO_SO7_EXTRIG_SPECLOCATION,"Button",BS_AUTORADIOBUTTON,36,97,64,10
|
||||
CONTROL "",IDC_LIST_SO7_EXTRIG_SPECLOCATION,"SysListView32",LVS_REPORT | WS_BORDER | WS_TABSTOP,33,113,254,77
|
||||
LTEXT "触发间距",IDC_STATIC,113,74,33,8
|
||||
LTEXT "触发点数",IDC_STATIC,113,92,33,8
|
||||
EDITTEXT IDC_EDIT_SO7_EXTRIG_EQDIS,158,71,40,14,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDIT_SO7_EXTRIG_SPECLOCATION,158,89,40,14,ES_AUTOHSCROLL
|
||||
CONTROL "",IDC_LIST_SO7_EXTRIG_SPECLOCATION,"SysListView32",LVS_REPORT | WS_BORDER | WS_TABSTOP,33,113,254,77
|
||||
EDITTEXT IDC_EDIT_SO7_EXTRIG_RESULT,19,208,296,80,ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL
|
||||
PUSHBUTTON "Exit",IDCANCEL,276,295,50,14
|
||||
PUSHBUTTON "开始",IDC_BUTTON_SO7_EXTRIG_START,238,23,50,14
|
||||
@@ -1859,12 +1860,12 @@ BEGIN
|
||||
IDS_SO7_ABOUTBOX "&About Utility for SO7..."
|
||||
END
|
||||
|
||||
#endif // 中文(简体,中国) resources
|
||||
#endif // Chinese (Simplified, PRC) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// 英语(美国) resources
|
||||
// English (United States) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
@@ -2823,7 +2824,7 @@ BEGIN
|
||||
END
|
||||
END
|
||||
|
||||
#endif // 英语(美国) resources
|
||||
#endif // English (United States) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@ BEGIN_MESSAGE_MAP(CSo7_Util_External_Trig, CDialog)
|
||||
ON_BN_CLICKED(IDC_BUTTON_SO7_EXTRIG_GET_PARA, &CSo7_Util_External_Trig::OnBnClickedButtonSo7ExtrigGetPara)
|
||||
ON_BN_CLICKED(IDCANCEL, &CSo7_Util_External_Trig::OnBnClickedCancel)
|
||||
ON_BN_CLICKED(IDC_BUTTON_SO7_EXTRIG_CLEAR_MSG, &CSo7_Util_External_Trig::OnBnClickedButtonSo7ExtrigClearMsg)
|
||||
ON_BN_CLICKED(IDC_RADIO_SO7_EXTRIG_EQDIS2, &CSo7_Util_External_Trig::OnBnClickedRadioSo7ExtrigEqdis2)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
@@ -178,6 +179,12 @@ void CSo7_Util_External_Trig::OnBnClickedRadioSo7ExtrigEqdis()
|
||||
m_UpdateCtrls(1);
|
||||
}
|
||||
//=====================================================================
|
||||
void CSo7_Util_External_Trig::OnBnClickedRadioSo7ExtrigEqdis2()
|
||||
{
|
||||
m_TrigMode=E_DIS_TRIG_PULSE_EQDIS_II;
|
||||
m_UpdateCtrls(1);
|
||||
}
|
||||
//=====================================================================
|
||||
void CSo7_Util_External_Trig::OnBnClickedRadioSo7ExtrigSpeclocation()
|
||||
{
|
||||
m_TrigMode=E_DIS_TRIG_PULSE_SPEC_LOCA;
|
||||
@@ -284,6 +291,20 @@ void CSo7_Util_External_Trig::m_UpdateCtrls(int _type)
|
||||
GetDlgItem(IDC_EDIT_SO7_EXTRIG_SPECLOCATION)->SetWindowTextW(csTmp);
|
||||
}
|
||||
}
|
||||
else if (m_TrigMode==E_DIS_TRIG_PULSE_EQDIS_II)
|
||||
{
|
||||
((CEdit*)GetDlgItem(IDC_EDIT_SO7_EXTRIG_EQDIS))->EnableWindow(FALSE);
|
||||
((CButton*)GetDlgItem(IDC_LIST_SO7_EXTRIG_SPECLOCATION))->EnableWindow(TRUE);
|
||||
if (_type==0)
|
||||
{
|
||||
((CButton *)GetDlgItem(IDC_RADIO_SO7_EXTRIG_EQDIS))->SetCheck(false);
|
||||
((CButton *)GetDlgItem(IDC_RADIO_SO7_EXTRIG_SPECLOCATION))->SetCheck(true);
|
||||
csTmp.Format(_T("%.4f"),dTmp);
|
||||
m_ParaList.SetItemText(m_ParaListSelectedRow,m_ParaListSelectedCol,csTmp);
|
||||
csTmp.Format(_T("%d"),m_ParaNumber);
|
||||
GetDlgItem(IDC_EDIT_SO7_EXTRIG_SPECLOCATION)->SetWindowTextW(csTmp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
((CEdit*)GetDlgItem(IDC_EDIT_SO7_EXTRIG_EQDIS))->EnableWindow(FALSE);
|
||||
@@ -344,6 +365,21 @@ void CSo7_Util_External_Trig::m_UpdatePara(BOOL _bSave)
|
||||
iParaNumber=m_ParaNumber;
|
||||
dEndPos+=m_ParaNumber*dTmp;
|
||||
}
|
||||
else if (m_TrigMode==E_DIS_TRIG_PULSE_EQDIS_II)
|
||||
{
|
||||
iParaNumber=m_ParaNumber;
|
||||
int iCol=1;
|
||||
for (int iRow=0;iRow<2;iRow++)
|
||||
{
|
||||
csTmp=m_ParaList.GetItemText(iRow,iCol);
|
||||
cTmp=T2A(csTmp);
|
||||
dTmp=atof(cTmp);
|
||||
dEndPos+=dTmp;
|
||||
m_TrigPara[iRow]=static_cast<long>(m_pSO7_Proto->MMtoScale(dTmp,dResolution));
|
||||
}
|
||||
dEndPos+=m_TrigPara[0];
|
||||
dEndPos+=(m_ParaNumber-1)*m_TrigPara[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
iParaNumber=m_ParaNumber;
|
||||
@@ -573,3 +609,5 @@ void CSo7_Util_External_Trig::OnBnClickedButtonSo7ExtrigClearMsg()
|
||||
{
|
||||
((CEdit*)GetDlgItem(IDC_EDIT_SO7_EXTRIG_RESULT))->SetWindowTextW(_T(""));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -54,4 +54,5 @@ public:
|
||||
afx_msg void OnBnClickedButtonSo7ExtrigGetPara();
|
||||
afx_msg void OnBnClickedCancel();
|
||||
afx_msg void OnBnClickedButtonSo7ExtrigClearMsg();
|
||||
afx_msg void OnBnClickedRadioSo7ExtrigEqdis2();
|
||||
};
|
||||
|
||||
@@ -790,8 +790,6 @@ void CSo7_Util_PLC_TCPIP_SERVER::m_UpdateListControl(int _type)
|
||||
for (int i=iStartRow;i<iEndRow;i++)
|
||||
{
|
||||
str.Format(_T("%d"),g_pSo7_TCPIP_Server->DM200[i]);
|
||||
if(i==25)
|
||||
str.Format(_T("0x%X"),g_pSo7_TCPIP_Server->DM200[i]);
|
||||
m_DataList.SetItemText(i,1,str);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1060,6 +1060,7 @@
|
||||
#define IDC_RADIO_SO7_EXTRIG_Z 1868
|
||||
#define IDC_EDIT_SO7_EXTRIG_EQDIS 1869
|
||||
#define IDC_LIST_SO7_EXTRIG_SPECLOCATION 1870
|
||||
#define IDC_RADIO_SO7_EXTRIG_EQDIS2 1871
|
||||
#define IDC_EDIT_SO7_EXTRIG_TEST_TIMES 1872
|
||||
#define IDC_EDIT_SO7_MOTION_STOP_CNTS 1873
|
||||
#define IDC_EDIT_SO7_MOTION_START_CNTS 1874
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user