/// <summary> /// 清除警報 /// </summary> /// <param name="status">OFF=Don't Output ON=Output</param> public void ResetAlarm(CmdStatus status) { if (axisPara.IsActive && axisPara.Enabled) { CCMNet.CS_mnet_m1_set_ralm(RingNoOfMNet, axisPara.SlaveIP, (U16)status); } }
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); }
/// <summary> /// 清除警報 /// </summary> /// <param name="status">OFF=Don't Output ON=Output</param> public void ResetAlarm(CmdStatus status) { if (axisPara.IsActive && axisPara.Enabled) { CMNET_L132.CS_mnet_m1_set_ralm((U16)axisPara.CardSwitchNo, (U16)axisPara.RingNoOfCard, axisPara.SlaveIP, (U16)status); } }
/// <summary> /// M2X4 裝置啟停 /// </summary> /// <param name="option">The option.</param> public void ServoOn(CmdStatus option) { I16 rc = -1; if (axisPara != null) { if (axisPara.IsActive) { setMotion(); if (option == CmdStatus.OFF) { this.IsHome = false; axisPara.Enabled = false; rc = CCMNet.CS_mnet_m204_set_svon(RingNoOfMNet, axisPara.SlaveIP, (U16)axisPara.AxisNo, 0); } if (option == CmdStatus.ON) { if (axisPara.IsActive) { axisPara.Enabled = true; rc = CCMNet.CS_mnet_m204_disable_soft_limit(RingNoOfMNet, axisPara.SlaveIP, (U16)axisPara.AxisNo); CCMNet.CS_mnet_m204_set_svon(RingNoOfMNet, axisPara.SlaveIP, (U16)axisPara.AxisNo, 1); } } } } }
public void Reset() { this.showVersion = false; this.funcName = null; this.objLen = 0; this.objState = Obj_dest.None; this.status = CmdStatus.None; }
public bool EnableDevice(CmdStatus status) { I16 rc = CA180_L132.CS_mnet_ai8_enable_device((U16)adcPara.CardSwitchNo, (U16)adcPara.RingNoOfCard, (U16)adcPara.SlaveIP, (byte)status); if (rc != 0) { return(false); } else { return(true); } }
public bool Read_from_JSON(JSON_obj jsObj) { if (jsObj == null) { return(false); } else { this.Reset(); } JSON_obj val_obj = null; if ((val_obj = jsObj["funcName"]) != null) { this.funcName = val_obj.str_val; } if ((val_obj = jsObj["objLen"]) != null) { this.objLen = (int)val_obj.num_val; } if ((val_obj = jsObj["objState"]) != null) { if (val_obj.str_val.Equals("ToServer", StringComparison.OrdinalIgnoreCase)) { this.objState = Obj_dest.ToServer; } else if (val_obj.str_val.Equals("ToClient", StringComparison.OrdinalIgnoreCase)) { this.objState = Obj_dest.ToClient; } } if ((val_obj = jsObj["status"]) != null) { if (val_obj.str_val.Equals("OK", StringComparison.OrdinalIgnoreCase)) { this.status = CmdStatus.OK; } else if (val_obj.str_val.Equals("Received", StringComparison.OrdinalIgnoreCase)) { this.status = CmdStatus.Received; } else if (val_obj.str_val.Equals("Reject", StringComparison.OrdinalIgnoreCase)) { this.status = CmdStatus.Reject; } } return(true); }
public void RespondFailed(CmdStatus status) { switch (status) { case CmdStatus.Ready: case CmdStatus.Requesting: FailReson = "RequestTimeout"; break; case CmdStatus.Responsing: case CmdStatus.Requested: FailReson = "ResponseTimeout"; break; case CmdStatus.Responsed: FailReson = "ResponseFailed"; break; } IsSuccess = false; IsEnd = true; }
/// <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); } } } } }
/// <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; CMNET_L132.CS_mnet_m1_set_svon((U16)axisPara.CardSwitchNo, (U16)axisPara.RingNoOfCard, axisPara.SlaveIP, 0); } if (option == CmdStatus.ON) { if (axisPara.IsActive) { axisPara.Enabled = true; CMNET_L132.CS_mnet_m1_set_svon((U16)axisPara.CardSwitchNo, (U16)axisPara.RingNoOfCard, axisPara.SlaveIP, 1); CMNET_L132.CS_mnet_m1_disable_soft_limit((U16)axisPara.CardSwitchNo, (U16)axisPara.RingNoOfCard, axisPara.SlaveIP); } } } } }
/// <summary> /// Initializes new instance of class with specified parameters. /// </summary> /// <param name="line">Line on which the command was executed.</param> /// <param name="commandID">Command ID (see <see cref="Diacom.Cmd.CommandID">CommandID</see> enumeration).</param> /// <param name="status">Command execution status (see <see cref="Diacom.Ev.CmdStatus">CmdStatus</see> enumeration).</param> public CommandStatus(object line, Cmd.CommandID commandID, CmdStatus status) : base(line, Ev.EventID.COMMAND_STATUS) { this.CommandID = commandID; this.Status = status; }