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_m1_enable_soft_limit(RingNoOfMNet, axisPara.SlaveIP, 1); } else { rc = CCMNet.CS_mnet_m1_enable_soft_limit(RingNoOfMNet, axisPara.SlaveIP, 2); } rc = CCMNet.CS_mnet_m1_set_soft_limit(RingNoOfMNet, axisPara.SlaveIP, positiveLimit, negativeLimit); } else { rc = CCMNet.CS_mnet_m1_disable_soft_limit(RingNoOfMNet, axisPara.SlaveIP); } } return(rc == 0 ? true : false); }
public bool DisableSoftLimit() { I16 rc = -1; if (axisPara.IsActive && axisPara.Enabled) { rc = CCMNet.CS_mnet_m1_disable_soft_limit(RingNoOfMNet, axisPara.SlaveIP); } return(rc == 0 ? true : false); }
/// <summary> /// M1X1 裝置啟停 /// </summary> /// <param name="option">The option.</param> public void ServoOn(CmdStatus option) { if (axisPara != null) { if (axisPara.IsActive) { if (option == CmdStatus.OFF) { status.Home = false; axisPara.Enabled = false; CCMNet.CS_mnet_m1_set_svon(RingNoOfMNet, axisPara.SlaveIP, 0); } if (option == CmdStatus.ON) { if (axisPara.IsActive) { axisPara.Enabled = true; CCMNet.CS_mnet_m1_disable_soft_limit(RingNoOfMNet, axisPara.SlaveIP); CCMNet.CS_mnet_m1_set_svon(RingNoOfMNet, axisPara.SlaveIP, 1); } } } } }