User`s manual

http://www.adtechcn.com 92
//*******************************************
UINT nIDIN1[]={
IDC_STOP0_X,IDC_STOP0_Y, //X,Y home position
IDC_STOP0_Z,IDC_STOP0_W, //Z,A home position
IDC_LIMIT_X,IDC_LIMIT_X2, //Positive/negative limit of axis Y
IDC_LIMIT_Y,IDC_LIMIT_Y2, // Positive/negative limit of axis Y
IDC_LIMIT_Z,IDC_LIMIT_Z2, // Positive/negative limit of axis Z
IDC_LIMIT_W,IDC_LIMIT_W2 }; // Positive/negative limit of axis A
CButton *btn;
int value=0;
for (i=0; i<12; i++)
{
g_CtrlCard.Read_Input(i,value);//read signal, note the status is not of the return value
btn=(CButton*)GetDlgItem(nIDIN1[i]);
btn->SetCheck(value==0?1:0);
}
//******************signal detection*****************
// Input of phase Z at the encoder as STOP1
// Axis X’s STOP1 38 Axis Y’s STOP1 39
// Axis Zs STOP1 40 Axis As STOP1 41
//*******************************************
UINT nIDIN2[]={
IDC_STOP1_X,IDC_STOP1_Y,IDC_STOP1_Z,IDC_STOP1_W };
for (i=0; i<4; i++)
{
g_CtrlCard.Read_Input(38+i,value);// Read IN38 to signal IN41
btn=(CButton*)GetDlgItem(nIDIN2[i]);
btn->SetCheck(value==0?1:0);
}
//************************** control through button****************************
if(devnum==0&&status[0]==0 && status[1]==0 && status[2]==0 && status[3]==0)
{
//**************** drive completed****************
btn=(CButton*)GetDlgItem(IDC_BUTTON_PMOVE);