增加so7_cofing.ini参数的配置。
This commit is contained in:
@@ -530,13 +530,25 @@ CSO7_Proto::CSO7_Proto()
|
||||
g_machine.s_machine_config.zm_axis._SpeedSlow=800;
|
||||
g_machine.s_machine_config.zm_axis._speed._short_=0;
|
||||
|
||||
|
||||
|
||||
g_machine.s_machine_config.motion._EnCloseLoop=FALSE;
|
||||
g_machine.s_machine_config.motion._RetryTimes=5;
|
||||
g_machine.s_machine_config.motion._ShiftPositionX=0.0;
|
||||
g_machine.s_machine_config.motion._ShiftPositionY=0.0;
|
||||
g_machine.s_machine_config.motion._ShiftPositionZ=0.0;
|
||||
g_machine.s_machine_config.motion._ShiftPositionZ=0.0;
|
||||
|
||||
g_machine.s_machine_config.motion.m_CntThreadSleepVal=550000;
|
||||
g_machine.s_machine_config.motion.GetInterruptMsgMethod=1;
|
||||
g_machine.s_machine_config.motion.m_WriteDataSleepTime=0;
|
||||
g_machine.s_machine_config.motion.m_AccuraErrPulseX=1;
|
||||
g_machine.s_machine_config.motion.m_AccuraErrPulseY=1;
|
||||
g_machine.s_machine_config.motion.m_AccuraErrPulseZ=1;
|
||||
g_machine.s_machine_config.motion.m_EQUIDIS_X=0;
|
||||
g_machine.s_machine_config.motion.m_EQUIDIS_Y=0;
|
||||
g_machine.s_machine_config.motion.m_EQUIDIS_Z=0;
|
||||
g_machine.s_machine_config.motion.m_MachineType=MACHINE_SO7_CONTROLLER;
|
||||
g_machine.s_machine_config.motion.m_VideoCardType=0;
|
||||
|
||||
g_machine.s_status._bIsZMMotionFinished=0;
|
||||
g_machine.x._scale_pos._long_ = 0;
|
||||
g_machine.y._scale_pos._long_ = 0;
|
||||
@@ -2080,56 +2092,44 @@ SSI_STATUS_MOTION CSO7_Proto::Save_So7_Config()
|
||||
outBuff="[7OCEANAUTOZOOM]";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
|
||||
|
||||
outBuff="ZOOM_PRODUCT_ID=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
USES_CONVERSION;
|
||||
outBuff=T2A(g_machine.s_machine_config.zm_axis._ProductID);
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
|
||||
|
||||
outBuff="ZOOM_COM_PORT=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%d", g_machine.s_machine_config.zm_axis._ComPort);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
|
||||
outBuff="ZOOM_START_DEG=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%.6f", g_machine.s_machine_config.zm_axis._StartDegree);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
|
||||
outBuff="ZOOM_END_DEG=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%.6f", g_machine.s_machine_config.zm_axis._EndDegree);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
|
||||
outBuff="ZOOM_ORG_DEG=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%.6f", g_machine.s_machine_config.zm_axis._RelativeZeroDegree);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
|
||||
outBuff="ZOOM_DEADBAND_DEG=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%.6f", g_machine.s_machine_config.zm_axis._Deadband);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
|
||||
outBuff="ZOOM_PULSE_PER_DEG=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%.15f", g_machine.s_machine_config.zm_axis._PulseScale);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
|
||||
outBuff="ZOOM_READING_INTERVAL_TIME=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%d", g_machine.s_machine_config.zm_axis._ReadingInterval);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
|
||||
outBuff="ZOOM_MOTOR_SPEED_FAST=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%d", g_machine.s_machine_config.zm_axis._SpeedFast);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
|
||||
outBuff="ZOOM_MOTOR_SPEED_SLOW=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%d", g_machine.s_machine_config.zm_axis._SpeedSlow);
|
||||
@@ -2138,35 +2138,76 @@ SSI_STATUS_MOTION CSO7_Proto::Save_So7_Config()
|
||||
outBuff="[HARDWARE]";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
|
||||
outBuff="CLOSE_LOOP_ENABLED=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%d", g_machine.s_machine_config.motion._EnCloseLoop);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
|
||||
outBuff="RETRY_TIMES=";
|
||||
outBuff="MOTION_RETRY_TIMES=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%d", g_machine.s_machine_config.motion._RetryTimes);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
|
||||
outBuff="SHIFT_POSITION_X=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%d", g_machine.s_machine_config.motion._ShiftPositionX);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
|
||||
outBuff="SHIFT_POSITION_Y=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%d", g_machine.s_machine_config.motion._ShiftPositionY);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
|
||||
outBuff="SHIFT_POSITION_Z=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%d", g_machine.s_machine_config.motion._ShiftPositionZ);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
outBuff="SDK3000_SLEEP_COUNT=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%d", g_machine.s_machine_config.motion.m_CntThreadSleepVal);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
outBuff="GET_USB_MESSAGE_METHOD=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%d", g_machine.s_machine_config.motion.GetInterruptMsgMethod);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
outBuff="WRITE_DATA_SLEEP_TIME=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%d", g_machine.s_machine_config.motion.m_WriteDataSleepTime);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
outBuff="ACCURA_ERROR_PULSE_X=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%d", g_machine.s_machine_config.motion.m_AccuraErrPulseX);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
outBuff="ACCURA_ERROR_PULSE_Y=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%d", g_machine.s_machine_config.motion.m_AccuraErrPulseY);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
outBuff="ACCURA_ERROR_PULSE_Z=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%d", g_machine.s_machine_config.motion.m_AccuraErrPulseZ);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
outBuff="EQUIDISTANCE_PULSE_X=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%d", g_machine.s_machine_config.motion.m_EQUIDIS_X);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
outBuff="EQUIDISTANCE_PULSE_Y=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%d", g_machine.s_machine_config.motion.m_EQUIDIS_Y);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
outBuff="EQUIDISTANCE_PULSE_Z=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%d", g_machine.s_machine_config.motion.m_EQUIDIS_Z);
|
||||
fprintf(m_pOutFile, "\n;\n");
|
||||
|
||||
outBuff="[HSI]";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
outBuff="MACHINE_CONTROLLER_TYPE=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%d", g_machine.s_machine_config.motion.m_MachineType);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
outBuff="MACHINE_VIDEOCARD_TYPE=";
|
||||
fprintf(m_pOutFile,"%s", outBuff);
|
||||
fprintf(m_pOutFile,"%d", g_machine.s_machine_config.motion.m_VideoCardType);
|
||||
fprintf(m_pOutFile, "\n");
|
||||
|
||||
fclose(m_pOutFile);
|
||||
|
||||
}
|
||||
return SSI_STATUS_MOTION_NORMAL;
|
||||
}
|
||||
@@ -2292,7 +2333,7 @@ SSI_STATUS_MOTION CSO7_Proto::Load_So7_Config()
|
||||
g_machine.s_machine_config.motion._EnCloseLoop=atoi(cTemp);
|
||||
}
|
||||
}
|
||||
else if (!_stricmp(token,"RETRY_TIMES"))
|
||||
else if (!_stricmp(token,"MOTION_RETRY_TIMES"))
|
||||
{
|
||||
token = strtok( NULL, seps);
|
||||
if (token)
|
||||
@@ -2328,8 +2369,106 @@ SSI_STATUS_MOTION CSO7_Proto::Load_So7_Config()
|
||||
g_machine.s_machine_config.motion._ShiftPositionZ=atof(cTemp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
else if (!_stricmp(token,"SDK3000_SLEEP_COUNT"))
|
||||
{
|
||||
token = strtok( NULL, seps);
|
||||
if (token)
|
||||
{
|
||||
strcpy(cTemp,token);
|
||||
g_machine.s_machine_config.motion.m_CntThreadSleepVal=atoi(cTemp);
|
||||
}
|
||||
}
|
||||
else if (!_stricmp(token,"GET_USB_MESSAGE_METHOD"))
|
||||
{
|
||||
token = strtok( NULL, seps);
|
||||
if (token)
|
||||
{
|
||||
strcpy(cTemp,token);
|
||||
g_machine.s_machine_config.motion.GetInterruptMsgMethod=static_cast<char>(atoi(cTemp));
|
||||
}
|
||||
}
|
||||
else if (!_stricmp(token,"WRITE_DATA_SLEEP_TIME"))
|
||||
{
|
||||
token = strtok( NULL, seps);
|
||||
if (token)
|
||||
{
|
||||
strcpy(cTemp,token);
|
||||
g_machine.s_machine_config.motion.m_WriteDataSleepTime=atoi(cTemp);
|
||||
}
|
||||
}
|
||||
else if (!_stricmp(token,"ACCURA_ERROR_PULSE_X"))
|
||||
{
|
||||
token = strtok( NULL, seps);
|
||||
if (token)
|
||||
{
|
||||
strcpy(cTemp,token);
|
||||
g_machine.s_machine_config.motion.m_AccuraErrPulseX=atoi(cTemp);
|
||||
}
|
||||
}
|
||||
else if (!_stricmp(token,"ACCURA_ERROR_PULSE_Y"))
|
||||
{
|
||||
token = strtok( NULL, seps);
|
||||
if (token)
|
||||
{
|
||||
strcpy(cTemp,token);
|
||||
g_machine.s_machine_config.motion.m_AccuraErrPulseY=atoi(cTemp);
|
||||
}
|
||||
}
|
||||
else if (!_stricmp(token,"ACCURA_ERROR_PULSE_Z"))
|
||||
{
|
||||
token = strtok( NULL, seps);
|
||||
if (token)
|
||||
{
|
||||
strcpy(cTemp,token);
|
||||
g_machine.s_machine_config.motion.m_AccuraErrPulseZ=atoi(cTemp);
|
||||
}
|
||||
}
|
||||
else if (!_stricmp(token,"EQUIDISTANCE_PULSE_X"))
|
||||
{
|
||||
token = strtok( NULL, seps);
|
||||
if (token)
|
||||
{
|
||||
strcpy(cTemp,token);
|
||||
g_machine.s_machine_config.motion.m_EQUIDIS_X=atoi(cTemp);
|
||||
}
|
||||
}
|
||||
else if (!_stricmp(token,"EQUIDISTANCE_PULSE_Y"))
|
||||
{
|
||||
token = strtok( NULL, seps);
|
||||
if (token)
|
||||
{
|
||||
strcpy(cTemp,token);
|
||||
g_machine.s_machine_config.motion.m_EQUIDIS_Y=atoi(cTemp);
|
||||
}
|
||||
}
|
||||
else if (!_stricmp(token,"EQUIDISTANCE_PULSE_Z"))
|
||||
{
|
||||
token = strtok( NULL, seps);
|
||||
if (token)
|
||||
{
|
||||
strcpy(cTemp,token);
|
||||
g_machine.s_machine_config.motion.m_EQUIDIS_Z=atoi(cTemp);
|
||||
}
|
||||
}
|
||||
//=================MSI========================
|
||||
else if(!_stricmp(token,"MACHINE_CONTROLLER_TYPE"))
|
||||
{
|
||||
token = strtok( NULL, seps);
|
||||
if (token)
|
||||
{
|
||||
strcpy(cTemp,token);
|
||||
g_machine.s_machine_config.motion.m_MachineType=atoi(cTemp);
|
||||
}
|
||||
}
|
||||
else if(!_stricmp(token,"MACHINE_VIDEOCARD_TYPE"))
|
||||
{
|
||||
token = strtok( NULL, seps);
|
||||
if (token)
|
||||
{
|
||||
strcpy(cTemp,token);
|
||||
g_machine.s_machine_config.motion.m_VideoCardType=atoi(cTemp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose(hConfigFile);
|
||||
@@ -3018,7 +3157,7 @@ SSI_STATUS_MOTION CSO7_Proto::so7_motion_set_position_xyz(double dX, double dY,
|
||||
so7_motion_is_finished(EMSG_STOPXYZ_1_MOVETOXYZ,IsFinished);
|
||||
Sleep(lSleep);
|
||||
++lLoopCnt;
|
||||
} while (g_machine.InterruptFlag[0]!=CT_STOPXYZ && lLoopCnt < lMaxLoopCnt);
|
||||
} while (!IsFinished && lLoopCnt < lMaxLoopCnt);
|
||||
|
||||
TRACE1("Presettle Time: %lf\n", TimeInSecs());
|
||||
//WaitForSettleXYZZM();
|
||||
|
||||
Reference in New Issue
Block a user