|
|
|
@ -34,27 +34,27 @@ namespace Rs.Motion.GugaoPulse
|
|
|
|
|
public override ErrorCode Init()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
mc_pulse_cfg.TAxisConfig axisConfig;
|
|
|
|
|
apiResult = mc_pulse_cfg.GT_GetAxisConfig((short)Config.CardId,(short)Config.AxisId,out axisConfig);
|
|
|
|
|
mc_pulse_cfg.TDiConfig diConfig;
|
|
|
|
|
if (!cardManager.IsInitialized)
|
|
|
|
|
{
|
|
|
|
|
return ErrorCode.CardNotInit;
|
|
|
|
|
}
|
|
|
|
|
HomeStatus = EHomeStatus.NotStart;
|
|
|
|
|
if (Config.EnableAlarm == 0)
|
|
|
|
|
{
|
|
|
|
|
mc_pulse.GT_AlarmOff((short)Config.CardId, (short)Config.AxisId);
|
|
|
|
|
}
|
|
|
|
|
else if (Config.EnableAlarm == 1)
|
|
|
|
|
{
|
|
|
|
|
axisConfig.alarmIndex = (short)Config.AxisId;
|
|
|
|
|
apiResult = mc_pulse_cfg.GT_GetDiConfig((short)Config.CardId, mc_pulse.MC_ALARM, (short)Config.AxisId, out diConfig);
|
|
|
|
|
diConfig.active = 1;
|
|
|
|
|
diConfig.reverse = (short)Config.AlarmLogic;
|
|
|
|
|
diConfig.filterTime = 3;
|
|
|
|
|
apiResult = mc_pulse_cfg.GT_SetDiConfig((short)Config.CardId, mc_pulse.MC_ALARM, (short)Config.AxisId, ref diConfig);
|
|
|
|
|
}
|
|
|
|
|
//mc_pulse_cfg.TAxisConfig axisConfig;
|
|
|
|
|
//apiResult = mc_pulse_cfg.GT_GetAxisConfig((short)Config.CardId,(short)Config.AxisId,out axisConfig);
|
|
|
|
|
//mc_pulse_cfg.TDiConfig diConfig;
|
|
|
|
|
//if (!cardManager.IsInitialized)
|
|
|
|
|
//{
|
|
|
|
|
// return ErrorCode.CardNotInit;
|
|
|
|
|
//}
|
|
|
|
|
//HomeStatus = EHomeStatus.NotStart;
|
|
|
|
|
//if (Config.EnableAlarm == 0)
|
|
|
|
|
//{
|
|
|
|
|
// mc_pulse.GT_AlarmOff((short)Config.CardId, (short)Config.AxisId);
|
|
|
|
|
//}
|
|
|
|
|
//else if (Config.EnableAlarm == 1)
|
|
|
|
|
//{
|
|
|
|
|
// axisConfig.alarmIndex = (short)Config.AxisId;
|
|
|
|
|
// apiResult = mc_pulse_cfg.GT_GetDiConfig((short)Config.CardId, mc_pulse.MC_ALARM, (short)Config.AxisId, out diConfig);
|
|
|
|
|
// diConfig.active = 1;
|
|
|
|
|
// diConfig.reverse = (short)Config.AlarmLogic;
|
|
|
|
|
// diConfig.filterTime = 3;
|
|
|
|
|
// apiResult = mc_pulse_cfg.GT_SetDiConfig((short)Config.CardId, mc_pulse.MC_ALARM, (short)Config.AxisId, ref diConfig);
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
//mc_pulse_cfg.GT_GetDoConfig((short)Config.CardId, mc_pulse.MC_GPO, 11, out mc_pulse_cfg.TDoConfig oConfig);
|
|
|
|
|
//oConfig.reverse = 0;
|
|
|
|
@ -108,11 +108,11 @@ namespace Rs.Motion.GugaoPulse
|
|
|
|
|
// diConfig.reverse = (short)Config.InpLogic;
|
|
|
|
|
// apiResult = mc_pulse_cfg.GT_SetDiConfig((short)Config.CardId, mc_pulse.MC_ARRIVE, (short)Config.AxisId, ref diConfig);
|
|
|
|
|
//}
|
|
|
|
|
apiResult = mc_pulse_cfg.GT_GetDiConfig((short)Config.CardId, mc_pulse.MC_HOME, (short)Config.AxisId, out diConfig);
|
|
|
|
|
diConfig.active = 1;
|
|
|
|
|
diConfig.reverse = (short)Config.HomeOrgLogic;
|
|
|
|
|
diConfig.filterTime = 3;
|
|
|
|
|
apiResult = mc_pulse_cfg.GT_SetDiConfig((short)Config.CardId, mc_pulse.MC_HOME, (short)Config.AxisId, ref diConfig);
|
|
|
|
|
//apiResult = mc_pulse_cfg.GT_GetDiConfig((short)Config.CardId, mc_pulse.MC_HOME, (short)Config.AxisId, out diConfig);
|
|
|
|
|
//diConfig.active = 1;
|
|
|
|
|
//diConfig.reverse = (short)Config.HomeOrgLogic;
|
|
|
|
|
//diConfig.filterTime = 3;
|
|
|
|
|
//apiResult = mc_pulse_cfg.GT_SetDiConfig((short)Config.CardId, mc_pulse.MC_HOME, (short)Config.AxisId, ref diConfig);
|
|
|
|
|
|
|
|
|
|
//apiResult = mc_pulse_cfg.GT_SetAxisConfig((short)Config.CardId, (short)Config.AxisId, ref axisConfig);
|
|
|
|
|
// mc_cfg.GT_SetDiConfig(short diType, short diIndex, ref TDiConfig pDi);
|
|
|
|
|