修改板卡
This commit is contained in:
@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace XKRS.Device.SolidMotionCard
|
||||
namespace DH.Devices.Motion
|
||||
{
|
||||
|
||||
public enum FuncRet
|
||||
|
@ -73,7 +73,7 @@ namespace DH.Devices.Motion
|
||||
[Category("机台配置")]
|
||||
[DisplayName("机台类型")]
|
||||
[Description("机台类型")]
|
||||
public MachineDiskType MachineDiskType { get; set; } = MachineDiskType.DoubleDisk;
|
||||
public MachineDiskType MachineDiskType { get; set; } = MachineDiskType.SingleDisk;
|
||||
|
||||
|
||||
|
||||
@ -111,12 +111,12 @@ namespace DH.Devices.Motion
|
||||
[DisplayName("输出IO总数")]
|
||||
public int OutputNums { get; set; } = 16;
|
||||
|
||||
//[Category("IO配置")]
|
||||
//[DisplayName("IO定义集合")]
|
||||
//[Description("IO定义集合")]
|
||||
[Category("IO配置")]
|
||||
[DisplayName("IO定义集合")]
|
||||
[Description("IO定义集合")]
|
||||
//[TypeConverter(typeof(CollectionCountConvert))]
|
||||
//[Editor(typeof(ComplexCollectionEditor<IODefinition>), typeof(UITypeEditor))]
|
||||
//public List<IODefinition> IODefinitionCollection { get; set; } = new List<IODefinition>();
|
||||
// [Editor(typeof(ComplexCollectionEditor<IODefinition>), typeof(UITypeEditor))]
|
||||
public List<IODefinition> IODefinitionCollection { get; set; } = new List<IODefinition>();
|
||||
|
||||
[Category("IO配置")]
|
||||
[DisplayName("是否信号模式")]
|
||||
@ -194,35 +194,35 @@ namespace DH.Devices.Motion
|
||||
public List<BlowSetting> BlowSettings { get; set; } = new List<BlowSetting>();
|
||||
|
||||
|
||||
//[Category("筛选配置")]
|
||||
//[DisplayName("转盘运转方向")]
|
||||
//[Description("转盘运转方向,顺时针或逆时针")]
|
||||
[Category("筛选配置")]
|
||||
[DisplayName("转盘运转方向")]
|
||||
[Description("转盘运转方向,顺时针或逆时针")]
|
||||
//[TypeConverter(typeof(EnumDescriptionConverter<RotationDirectionEnum>))]
|
||||
//public RotationDirectionEnum MotionDir { get; set; } = RotationDirectionEnum.Clockwise;
|
||||
public RotationDirectionEnum MotionDir { get; set; } = RotationDirectionEnum.Clockwise;
|
||||
|
||||
|
||||
|
||||
[Category("筛选配置")]
|
||||
[DisplayName("物料尺寸最大值")]
|
||||
[Description("物料尺寸最大值,单位:脉冲")]
|
||||
public uint PieceMaxSize { get; set; } = 2000;
|
||||
public uint PieceMaxSize { get; set; } = 20000;
|
||||
|
||||
|
||||
[Category("筛选配置")]
|
||||
[DisplayName("物料尺寸最小值")]
|
||||
[Description("物料尺寸最小值,单位:脉冲")]
|
||||
public uint PieceMinSize { get; set; } = 1500;
|
||||
public uint PieceMinSize { get; set; } = 10;
|
||||
|
||||
|
||||
[Category("筛选配置")]
|
||||
[DisplayName("物料最小间隔")]
|
||||
[Description("物料最小间隔,单位:脉冲")]
|
||||
public uint MinDistance { get; set; } = 2000;
|
||||
public uint MinDistance { get; set; } = 10;
|
||||
|
||||
[Category("筛选配置")]
|
||||
[DisplayName("两个物料之间触发最小间隔时间")]
|
||||
[Description("两个物料之间触发最小间隔时间,单位:ms")]
|
||||
public uint MinTimeInterval { get; set; } = 10;
|
||||
public uint MinTimeInterval { get; set; } = 1;
|
||||
|
||||
|
||||
|
||||
@ -550,7 +550,7 @@ namespace DH.Devices.Motion
|
||||
[Category("回原点参数")]
|
||||
[DisplayName("回原点方式")]
|
||||
[Description("HomeMode:回原点方式")]
|
||||
public GoHomeMode HomeMode { get; set; } = GoHomeMode.Negative_Ne_Center_H_Positive_N_Stop_HNeO_Offset_Po;
|
||||
public GoHomeMode HomeMode { get; set; } = GoHomeMode.Negative_Ne_Center_H_Positive_N_Index_HPoO_Offset_Po;
|
||||
|
||||
|
||||
[Category("回原点参数")]
|
||||
|
@ -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