修改板卡
This commit is contained in:
@ -2,9 +2,10 @@
|
||||
using DH.Devices.Motion;
|
||||
using MCDLL_NET;
|
||||
using System.Diagnostics;
|
||||
using static System.Collections.Specialized.BitVector32;
|
||||
|
||||
|
||||
namespace XKRS.Device.SolidMotionCard
|
||||
namespace DH.Devices.Motion
|
||||
{
|
||||
|
||||
|
||||
@ -150,22 +151,32 @@ namespace XKRS.Device.SolidMotionCard
|
||||
.ToDictionary(a => a.AxisIndex, a => new ManualResetEvent(true));
|
||||
|
||||
// 初始化时关闭所有轴,停止筛选 begin =======
|
||||
AllMoveStop();
|
||||
AllAxisOff();
|
||||
//AllMoveStop();
|
||||
|
||||
// CMCDLL_NET.MCF_Axis_Stop_Net(0, AxisStopMode.AxisStopIMD, 0);
|
||||
|
||||
//CMCDLL_NET.MCF_Set_Axis_Stop_Profile_Net(0, 50000, 0, 0, 0);
|
||||
// CMCDLL_NET.MCF_Axis_Stop_Net(0, AxisStopMode.AxisStopDEC, 0);
|
||||
AxisStop();
|
||||
//AllAxisOff();
|
||||
var ret = CMCDLL_NET.MCF_Set_Servo_Enable_Net(0, (ushort)ServoLogic.Servo_Open, 0);
|
||||
|
||||
StopSorting();
|
||||
|
||||
// 初始化时关闭所有轴,停止筛选 end =======
|
||||
|
||||
AllAxisOn();
|
||||
//AllAxisOn();
|
||||
Start();
|
||||
MonitorPosition();
|
||||
MonitorAxisStatus();
|
||||
MonitorPieces();
|
||||
|
||||
|
||||
CustomStart();
|
||||
|
||||
|
||||
MonitorPieces();
|
||||
isconnected = true;
|
||||
|
||||
|
||||
}
|
||||
catch
|
||||
{
|
||||
@ -409,8 +420,10 @@ namespace XKRS.Device.SolidMotionCard
|
||||
public override void Stop()
|
||||
{
|
||||
//base.Stop();
|
||||
AllMoveStop();
|
||||
AllAxisOff();
|
||||
AxisStop();
|
||||
int ret = CMCDLL_NET.MCF_Set_Servo_Enable_Net(0, (ushort)ServoLogic.Servo_Open, 0);
|
||||
|
||||
// AllAxisOff();
|
||||
|
||||
for (ushort station = 0; station < BoardCount; station++)
|
||||
{
|
||||
@ -849,7 +862,14 @@ namespace XKRS.Device.SolidMotionCard
|
||||
return ret == (short)FuncRet.Function_Success;
|
||||
});
|
||||
}
|
||||
|
||||
//方案2:不使用外部文本框输入参数,直接写入参数
|
||||
|
||||
public void JOGRun(double MaxV,double MaxA)
|
||||
{
|
||||
int ret = CMCDLL_NET.MCF_Set_Pulse_Mode_Net(0, (ushort)PulseMode.Pulse_Dir_H, 0);
|
||||
ret = CMCDLL_NET.MCF_Set_Servo_Enable_Net(0, (ushort)ServoLogic.Servo_Close, 0);
|
||||
ret=CMCDLL_NET.MCF_JOG_Net(0, MaxV, MaxA, 0);
|
||||
}
|
||||
/// <summary>
|
||||
/// 点位到点位运动
|
||||
/// </summary>
|
||||
@ -1381,13 +1401,38 @@ namespace XKRS.Device.SolidMotionCard
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void AxisStop()
|
||||
{
|
||||
short rtn;
|
||||
ushort StationNumber = 0;
|
||||
for (ushort a = 0; a < 4; a++)
|
||||
{
|
||||
rtn = CMCDLL_NET.MCF_Set_Axis_Stop_Profile_Net(a, 10000, 100000, 1, StationNumber);//设置轴S型停止曲线参数
|
||||
rtn = CMCDLL_NET.MCF_Axis_Stop_Net(a, 1, StationNumber);//设置轴为平滑停止模式
|
||||
}
|
||||
}
|
||||
public bool CArdReset()
|
||||
{
|
||||
|
||||
// ConvertFromAxis(startAxisIndex, out ushort station, out ushort axis);
|
||||
|
||||
var ret = CMCDLL_NET.MCF_Set_Position_Net(0, 0, 0);
|
||||
var ret2 = CMCDLL_NET.MCF_Set_Encoder_Net(0, 0, 0);
|
||||
|
||||
return ret2 == 0 ? true : false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 某个轴运动停止
|
||||
/// </summary>
|
||||
/// <param name="axisNum">axisNo</param>
|
||||
/// <param name="option">0表示平滑停止,1表示紧急停止</param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> MoveStop(int axisNum, int option)
|
||||
public async Task<bool> MoveStop(int axisNum, int option)
|
||||
{
|
||||
return await _taskFactory.StartNew(() =>
|
||||
{
|
||||
|
Reference in New Issue
Block a user