public bool SetSoftLimit(I32 positiveLimit, I32 negativeLimit, CmdStatus sw, StopType stopType) { I16 rc = -1; if (axisPara.IsActive && axisPara.Enabled) { if (sw == CmdStatus.ON) { /* * 0 INT only * 1 Immediately stop * 2 Slow down then stop * 3 Reserved */ if (stopType == StopType.Emergency) { rc = CCMNet.CS_mnet_m204_enable_soft_limit(RingNoOfMNet, axisPara.SlaveIP, (U16)axisPara.AxisNo, 1); } else { rc = CCMNet.CS_mnet_m204_enable_soft_limit(RingNoOfMNet, axisPara.SlaveIP, (U16)axisPara.AxisNo, 2); } rc = CCMNet.CS_mnet_m204_set_soft_limit(RingNoOfMNet, axisPara.SlaveIP, (U16)axisPara.AxisNo, positiveLimit, negativeLimit); } else { rc = CCMNet.CS_mnet_m204_disable_soft_limit(RingNoOfMNet, axisPara.SlaveIP, (U16)axisPara.AxisNo); } } return(rc == 0 ? true : false); }
public bool EnableSoftLimit(StopType stopType) { I16 rc = -1; if (axisPara.IsActive && axisPara.Enabled) { if (stopType == StopType.Emergency) { rc = CCMNet.CS_mnet_m204_enable_soft_limit(RingNoOfMNet, axisPara.SlaveIP, (U16)axisPara.AxisNo, 1); } else { rc = CCMNet.CS_mnet_m204_enable_soft_limit(RingNoOfMNet, axisPara.SlaveIP, (U16)axisPara.AxisNo, 2); } } return(rc == 0 ? true : false); }