/// <summary> /// 吋動 (軸參設定的五個速度值) /// </summary> /// <param name="speedIndex">軸參之吋動速度</param> /// <param name="dir">吋動方向</param> public void Jog(JogSpeed jogSpeed, RotationDirection dir) { if (axisPara.IsActive && axisPara.Enabled) { double speed = 0; int i = 0; switch (jogSpeed) { case JogSpeed.Micro: speed = axisPara.JogMicroSpeed; break; case JogSpeed.Low: speed = axisPara.JogLowSpeed; break; case JogSpeed.Mid: speed = axisPara.JogMidSpeed; break; case JogSpeed.High: speed = axisPara.JogHighSpeed; break; case JogSpeed.Max: speed = axisPara.JogMaxSpeed; break; } i = MmToPulse(speed); CCMNet.CS_mnet_m1_set_tmove_speed(RingNoOfMNet, axisPara.SlaveIP, i / 2, i, axisPara.AccVelM, axisPara.DecVelM); CCMNet.CS_mnet_m1_v_move(RingNoOfMNet, axisPara.SlaveIP, Convert.ToByte(dir)); } }
/// <summary> /// 吋動 (軸參設定的五個速度值) /// </summary> /// <param name="speedIndex">軸參之吋動速度</param> /// <param name="dir">吋動方向</param> public bool Jog(JogSpeed jogSpeed, RotationDirection dir) { bool success = true; if (axisPara.IsActive && axisPara.Enabled) { double speed = 0; switch (jogSpeed) { case JogSpeed.Micro: speed = axisPara.JogMicroSpeed; break; case JogSpeed.Low: speed = axisPara.JogLowSpeed; break; case JogSpeed.Mid: speed = axisPara.JogMidSpeed; break; case JogSpeed.High: speed = axisPara.JogHighSpeed; break; case JogSpeed.Max: speed = axisPara.JogMaxSpeed; break; } success = JogM(speed, dir); } return(success); }
public void JogConsiderSoftLimit(JogSpeed jogSpeed, RotationDirection dir) { I16 rc = -1; if (axisPara.IsActive && axisPara.Enabled) { double speed = 0; switch (jogSpeed) { case JogSpeed.Micro: speed = axisPara.JogMicroSpeed; break; case JogSpeed.Low: speed = axisPara.JogLowSpeed; break; case JogSpeed.Mid: speed = axisPara.JogMidSpeed; break; case JogSpeed.High: speed = axisPara.JogHighSpeed; break; case JogSpeed.Max: speed = axisPara.JogMaxSpeed; break; } if (softLimitEnabled) { if (dir == RotationDirection.CW) { MoveM(softLimitP, speed); } else { MoveM(softLimitN, speed); } } else { if (isAllowMove(dir)) { byte bDir; if (dir == RotationDirection.CW) { bDir = 0; } else { bDir = 1; } CCMNet.CS_mnet_m1_set_tmove_speed(RingNoOfMNet, axisPara.SlaveIP, MmToPulse(checkOverMaxSpeed(speed)) / 2, MmToPulse(checkOverMaxSpeed(speed)), axisPara.AccVelM, axisPara.DecVelM); CCMNet.CS_mnet_m1_v_move(RingNoOfMNet, axisPara.SlaveIP, Convert.ToByte(dir)); } } } }
public void JogConsiderSoftLimit(JogSpeed jogSpeed, RotationDirection dir) { I16 rc = -1; if (axisPara.IsActive && axisPara.Enabled) { double speed = 0; switch (jogSpeed) { case JogSpeed.Micro: speed = axisPara.JogMicroSpeed; break; case JogSpeed.Low: speed = axisPara.JogLowSpeed; break; case JogSpeed.Mid: speed = axisPara.JogMidSpeed; break; case JogSpeed.High: speed = axisPara.JogHighSpeed; break; case JogSpeed.Max: speed = axisPara.JogMaxSpeed; break; } sbyte bDir; if (dir == RotationDirection.CW) { bDir = 1; } else { bDir = -1; } if (softLimitEnabled) { if (dir == RotationDirection.CW) { AbsolueMove(softLimitP, speed); } else { AbsolueMove(softLimitN, speed); } } else { if (isAllowMove(dir)) { CCMNet.CS_mnet_m204_tv_move(RingNoOfMNet, axisPara.SlaveIP, (U16)axisPara.AxisNo, MmToPulse(checkOverMaxSpeed(speed)) / 2 * bDir, MmToPulse(checkOverMaxSpeed(speed)) * bDir, axisPara.AccVelM); } } } }
private void parameterInitial() { ldrReady.On = axis.Status.RDY; ldrAlarm.On = axis.Status.ALM; ldrLimitP.On = axis.Status.LimitP; ldrLimitN.On = axis.Status.LimitN; ldrORG.On = axis.Status.ORG; ldrHome.On = axis.Status.Home; ldrEMG.On = axis.Status.EMG; ldrRALM.On = axis.Status.RALM; ldrSVON.On = axis.Status.SVON; ldrINP.On = axis.Status.INP; ldrSD.On = axis.Status.SD; ldrLatch.On = axis.Status.Latch; ldrZPhase.On = axis.Status.ZPhase; ldrERC.On = axis.Status.ERC; jogSpeed = JogSpeed.Micro; }
/// <summary> /// 吋動 (軸參設定的五個速度值) /// </summary> /// <param name="speedIndex">軸參之吋動速度</param> /// <param name="dir">吋動方向</param> public void Jog(JogSpeed jogSpeed, RotationDirection dir) { byte bDir; if (dir == RotationDirection.CW) { bDir = 1; } else { bDir = 0; } if (axisPara.IsActive && axisPara.Enabled) { double speed = 0; int i = 0; switch (jogSpeed) { case JogSpeed.Micro: speed = axisPara.JogMicroSpeed; break; case JogSpeed.Low: speed = axisPara.JogLowSpeed; break; case JogSpeed.Mid: speed = axisPara.JogMidSpeed; break; case JogSpeed.High: speed = axisPara.JogHighSpeed; break; case JogSpeed.Max: speed = axisPara.JogMaxSpeed; break; } i = MmToPulse(speed); CMNET_L132.CS_mnet_m1_set_tmove_speed((U16)axisPara.CardSwitchNo, (U16)axisPara.RingNoOfCard, axisPara.SlaveIP, i / 2, i, axisPara.AccVelM, axisPara.DecVelM); CMNET_L132.CS_mnet_m1_v_move((U16)axisPara.CardSwitchNo, (U16)axisPara.RingNoOfCard, axisPara.SlaveIP, bDir); } }
private void jogSpeed_Click(object sender, MouseEventArgs e) { List <LedButton> allLedBtn = new List <LedButton>(); allLedBtn.Add(lbtnMicroSpeed); allLedBtn.Add(lbtnLowSpeed); allLedBtn.Add(lbtnMidSpeed); allLedBtn.Add(lbtnHighSpeed); allLedBtn.Add(lbtnMaxSpeed); foreach (LedButton eachLedBtn in allLedBtn) { if (((LedButton)sender).Name == eachLedBtn.Name) { eachLedBtn.Active = true; jogSpeed = (JogSpeed)allLedBtn.IndexOf(eachLedBtn); } else { eachLedBtn.Active = false; } } }
private void parameterInitial() { ntxbStrVelM.Tag = "StrVelM"; ntxbDevVelM.Tag = "DevVelM"; ntxbAccVelM.Tag = "AccVelM"; ntxbDecVelM.Tag = "DecVelM"; ntxbDistPerRole.Tag = "DistPerRole"; ntxbPulsePerRole.Tag = "PulsePerRole"; ntxbInPositionPrecise.Tag = "InPositionPrecise"; ntxbStopCmdWaitSeconds.Tag = "StopCmdWaitSeconds"; ntxbDecVelA.Tag = "DecVelA"; ntxbAccVelA.Tag = "AccVelA"; ntxbDevVelA.Tag = "DevVelA"; ntxbStrVelA.Tag = "StrVelA"; ntxbOffsetH.Tag = "OffsetH"; ntxbCreepDecVelH.Tag = "CreepDecVelH"; ntxbCreepAccVelH.Tag = "CreepAccVelH"; ntxbCreepDevVelH.Tag = "CreepDevVelH"; ntxbCreepStrVelH.Tag = "CreepStrVelH"; ntxbOPRDevVelH.Tag = "OPRDevVelH"; ntxbClearDelay.Tag = "ClearDelay"; ntxbMaxSpeed.Tag = "JogMaxSpeed"; ntxbHighSpeed.Tag = "JogHighSpeed"; ntxbMidSpeed.Tag = "JogMidSpeed"; ntxbLowSpeed.Tag = "JogLowSpeed"; ntxbMicroSpeed.Tag = "JogMicroSpeed"; cbSoftLimitEnable.Tag = "SoftLimitEnabled"; ntxbSoftLimitP.Tag = "SoftLimitP"; ntxbSoftLimitN.Tag = "SoftLimitN"; cmbLTC.Tag = "LogicLTC"; cmbSD.Tag = "LogicSD"; cmbZPhase.Tag = "LogicZ"; cmbORG.Tag = "LogicORG"; cmbEL.Tag = "LogicEL"; cmbERC.Tag = "LogicERC"; cmbINP.Tag = "LogicINP"; cmbEncMode1.Tag = "EncMode"; cmbLTCSignalSource.Tag = "LTCSignalSource"; cmbPulseMode.Tag = "PulseMode"; cmbALM.Tag = "LogicALM"; cmbEncDir.Tag = "EncDir"; cmbHomeMode.Tag = "HomeMode"; cmbMotorMode.Tag = "MotorMode"; ldrReady.On = axis.Status.RDY; ldrAlarm.On = axis.Status.ALM; ldrLimitP.On = axis.Status.LimitP; ldrLimitN.On = axis.Status.LimitN; ldrORG.On = axis.Status.ORG; ldrHome.On = axis.Status.Home; ldrEMG.On = axis.Status.EMG; ldrRALM.On = axis.Status.RALM; ldrSVON.On = axis.Status.SVON; ldrINP.On = axis.Status.INP; ldrSD.On = axis.Status.SD; ldrLatch.On = axis.Status.Latch; ldrZPhase.On = axis.Status.ZPhase; ldrERC.On = axis.Status.ERC; ntxbStrVelM.Text = axis.AxisPara.StrVelM.ToString(); ntxbDevVelM.Text = axis.AxisPara.DevVelM.ToString(); ntxbAccVelM.Text = axis.AxisPara.AccVelM.ToString(); ntxbDecVelM.Text = axis.AxisPara.DecVelM.ToString(); ntxbDistPerRole.Text = axis.AxisPara.DistPerRole.ToString(); ntxbPulsePerRole.Text = axis.AxisPara.PulsePerRole.ToString(); ntxbInPositionPrecise.Text = axis.axisPara.InPositionPrecise.ToString(); ntxbStopCmdWaitSeconds.Text = axis.axisPara.StopCmdWaitSeconds.ToString(); ntxbDecVelA.Text = axis.AxisPara.DecVelA.ToString(); ntxbAccVelA.Text = axis.AxisPara.AccVelA.ToString(); ntxbDevVelA.Text = axis.AxisPara.DevVelA.ToString(); ntxbStrVelA.Text = axis.AxisPara.StrVelA.ToString(); ntxbOffsetH.Text = axis.AxisPara.OffsetH.ToString(); ntxbCreepDecVelH.Text = axis.AxisPara.CreepDecVelH.ToString(); ntxbCreepAccVelH.Text = axis.AxisPara.CreepAccVelH.ToString(); ntxbCreepDevVelH.Text = axis.AxisPara.CreepDevVelH.ToString(); ntxbCreepStrVelH.Text = axis.AxisPara.CreepStrVelH.ToString(); ntxbOPRDevVelH.Text = axis.AxisPara.OPRDevVelH.ToString(); ntxbClearDelay.Text = axis.AxisPara.ClearDelay.ToString(); ntxbMaxSpeed.Text = axis.AxisPara.JogMaxSpeed.ToString(); ntxbHighSpeed.Text = axis.AxisPara.JogHighSpeed.ToString(); ntxbMidSpeed.Text = axis.AxisPara.JogMidSpeed.ToString(); ntxbLowSpeed.Text = axis.AxisPara.JogLowSpeed.ToString(); ntxbMicroSpeed.Text = axis.AxisPara.JogMicroSpeed.ToString(); cmbLTC.SelectedIndex = Convert.ToInt16(axis.AxisPara.LogicLTC); cmbSD.SelectedIndex = Convert.ToInt16(axis.AxisPara.LogicSD); cmbZPhase.SelectedIndex = Convert.ToInt16(axis.AxisPara.LogicZ); //cmbLTCSignalSource.SelectedIndex = Convert.ToInt16(axis.AxisPara.LTCSignalSource); cmbORG.SelectedIndex = Convert.ToInt16(axis.AxisPara.LogicORG); cmbERC.SelectedIndex = Convert.ToInt16(axis.AxisPara.LogicERC); cmbINP.SelectedIndex = Convert.ToInt16(axis.AxisPara.LogicINP); cmbEncMode1.SelectedIndex = Convert.ToInt16(axis.AxisPara.EncMode); cmbPulseMode.SelectedIndex = Convert.ToInt16(axis.AxisPara.PulseMode); cmbALM.SelectedIndex = Convert.ToInt16(axis.AxisPara.LogicALM); cmbEncDir.SelectedIndex = Convert.ToInt16(axis.AxisPara.EncDir); cmbHomeMode.SelectedIndex = Convert.ToInt16(axis.AxisPara.HomeMode); cmbEL.SelectedIndex = Convert.ToInt16(axis.AxisPara.LogicEL); cmbMotorMode.SelectedIndex = Convert.ToInt16(axis.AxisPara.MotorMode); jogSpeed = JogSpeed.Micro; lbCardNumber.Text = axis.AxisPara.CardSwitchNo.ToString(); lbAxisNumber.Text = axis.AxisPara.AxisNo.ToString(); lbSlaveIP.Text = axis.AxisPara.SlaveIP.ToString(); ntxbSoftLimitN.Text = axis.AxisPara.SoftLimitN.ToString(); ntxbSoftLimitP.Text = axis.AxisPara.SoftLimitP.ToString(); cbSoftLimitEnable.Checked = axis.AxisPara.SoftLimitEnabled; }