|
@@ -13,6 +13,9 @@ namespace TeamAAS_VP.Models.PLC
|
|
|
public class PlcPoint : BindableBase
|
|
public class PlcPoint : BindableBase
|
|
|
{
|
|
{
|
|
|
private int _Number;
|
|
private int _Number;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 点位编号
|
|
|
|
|
+ /// </summary>
|
|
|
public int Number
|
|
public int Number
|
|
|
{
|
|
{
|
|
|
get { return _Number; }
|
|
get { return _Number; }
|
|
@@ -20,6 +23,9 @@ namespace TeamAAS_VP.Models.PLC
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private string _Label;
|
|
private string _Label;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 点位标签
|
|
|
|
|
+ /// </summary>
|
|
|
public string Label
|
|
public string Label
|
|
|
{
|
|
{
|
|
|
get { return _Label; }
|
|
get { return _Label; }
|
|
@@ -27,6 +33,9 @@ namespace TeamAAS_VP.Models.PLC
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private float _X_Position;
|
|
private float _X_Position;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// X轴位置
|
|
|
|
|
+ /// </summary>
|
|
|
public float X_Position
|
|
public float X_Position
|
|
|
{
|
|
{
|
|
|
get { return _X_Position; }
|
|
get { return _X_Position; }
|
|
@@ -34,6 +43,9 @@ namespace TeamAAS_VP.Models.PLC
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private float _X_Velocity;
|
|
private float _X_Velocity;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// X轴速度
|
|
|
|
|
+ /// </summary>
|
|
|
public float X_Velocity
|
|
public float X_Velocity
|
|
|
{
|
|
{
|
|
|
get { return _X_Velocity; }
|
|
get { return _X_Velocity; }
|
|
@@ -41,6 +53,9 @@ namespace TeamAAS_VP.Models.PLC
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private float _Y_Position;
|
|
private float _Y_Position;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Y轴位置
|
|
|
|
|
+ /// </summary>
|
|
|
public float Y_Position
|
|
public float Y_Position
|
|
|
{
|
|
{
|
|
|
get { return _Y_Position; }
|
|
get { return _Y_Position; }
|
|
@@ -48,6 +63,9 @@ namespace TeamAAS_VP.Models.PLC
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private float _Y_Velocity;
|
|
private float _Y_Velocity;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Y轴速度
|
|
|
|
|
+ /// </summary>
|
|
|
public float Y_Velocity
|
|
public float Y_Velocity
|
|
|
{
|
|
{
|
|
|
get { return _Y_Velocity; }
|
|
get { return _Y_Velocity; }
|
|
@@ -55,6 +73,9 @@ namespace TeamAAS_VP.Models.PLC
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private float _Z_Position_Start;
|
|
private float _Z_Position_Start;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Z轴起点位置
|
|
|
|
|
+ /// </summary>
|
|
|
public float Z_Position_Start
|
|
public float Z_Position_Start
|
|
|
{
|
|
{
|
|
|
get { return _Z_Position_Start; }
|
|
get { return _Z_Position_Start; }
|
|
@@ -62,6 +83,9 @@ namespace TeamAAS_VP.Models.PLC
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private float _Z_Velocity_Start;
|
|
private float _Z_Velocity_Start;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Z轴起点速度
|
|
|
|
|
+ /// </summary>
|
|
|
public float Z_Velocity_Start
|
|
public float Z_Velocity_Start
|
|
|
{
|
|
{
|
|
|
get { return _Z_Velocity_Start; }
|
|
get { return _Z_Velocity_Start; }
|
|
@@ -69,6 +93,9 @@ namespace TeamAAS_VP.Models.PLC
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private float _Z_Position_Stop;
|
|
private float _Z_Position_Stop;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Z轴终点位置
|
|
|
|
|
+ /// </summary>
|
|
|
public float Z_Position_Stop
|
|
public float Z_Position_Stop
|
|
|
{
|
|
{
|
|
|
get { return _Z_Position_Stop; }
|
|
get { return _Z_Position_Stop; }
|
|
@@ -76,6 +103,9 @@ namespace TeamAAS_VP.Models.PLC
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private float _Z_Velocity_Stop;
|
|
private float _Z_Velocity_Stop;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Z轴终点速度
|
|
|
|
|
+ /// </summary>
|
|
|
public float Z_Velocity_Stop
|
|
public float Z_Velocity_Stop
|
|
|
{
|
|
{
|
|
|
get { return _Z_Velocity_Stop; }
|
|
get { return _Z_Velocity_Stop; }
|
|
@@ -83,6 +113,9 @@ namespace TeamAAS_VP.Models.PLC
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private float _U_Position;
|
|
private float _U_Position;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// U轴位置
|
|
|
|
|
+ /// </summary>
|
|
|
public float U_Position
|
|
public float U_Position
|
|
|
{
|
|
{
|
|
|
get { return _U_Position; }
|
|
get { return _U_Position; }
|
|
@@ -90,6 +123,9 @@ namespace TeamAAS_VP.Models.PLC
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private float _U_Velocity;
|
|
private float _U_Velocity;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// U轴速度
|
|
|
|
|
+ /// </summary>
|
|
|
public float U_Velocity
|
|
public float U_Velocity
|
|
|
{
|
|
{
|
|
|
get { return _U_Velocity; }
|
|
get { return _U_Velocity; }
|
|
@@ -97,6 +133,9 @@ namespace TeamAAS_VP.Models.PLC
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private float _R_Position;
|
|
private float _R_Position;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// R轴位置
|
|
|
|
|
+ /// </summary>
|
|
|
public float R_Position
|
|
public float R_Position
|
|
|
{
|
|
{
|
|
|
get { return _R_Position; }
|
|
get { return _R_Position; }
|
|
@@ -104,6 +143,9 @@ namespace TeamAAS_VP.Models.PLC
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private float _R_Velocity;
|
|
private float _R_Velocity;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// R轴速度
|
|
|
|
|
+ /// </summary>
|
|
|
public float R_Velocity
|
|
public float R_Velocity
|
|
|
{
|
|
{
|
|
|
get { return _R_Velocity; }
|
|
get { return _R_Velocity; }
|
|
@@ -111,6 +153,9 @@ namespace TeamAAS_VP.Models.PLC
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private float _Torque;
|
|
private float _Torque;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 扭矩值
|
|
|
|
|
+ /// </summary>
|
|
|
public float Torque
|
|
public float Torque
|
|
|
{
|
|
{
|
|
|
get { return _Torque; }
|
|
get { return _Torque; }
|
|
@@ -118,6 +163,9 @@ namespace TeamAAS_VP.Models.PLC
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private Int16 _Feeder;
|
|
private Int16 _Feeder;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Feeder编号
|
|
|
|
|
+ /// </summary>
|
|
|
public Int16 Feeder
|
|
public Int16 Feeder
|
|
|
{
|
|
{
|
|
|
get { return _Feeder; }
|
|
get { return _Feeder; }
|
|
@@ -125,6 +173,9 @@ namespace TeamAAS_VP.Models.PLC
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private Int16 _ScrewProNum;
|
|
private Int16 _ScrewProNum;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 电批程序号
|
|
|
|
|
+ /// </summary>
|
|
|
public Int16 ScrewProNum
|
|
public Int16 ScrewProNum
|
|
|
{
|
|
{
|
|
|
get { return _ScrewProNum; }
|
|
get { return _ScrewProNum; }
|
|
@@ -133,12 +184,95 @@ namespace TeamAAS_VP.Models.PLC
|
|
|
|
|
|
|
|
//描述
|
|
//描述
|
|
|
private string _Description;
|
|
private string _Description;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 点位描述
|
|
|
|
|
+ /// </summary>
|
|
|
public string Description
|
|
public string Description
|
|
|
{
|
|
{
|
|
|
get { return _Description; }
|
|
get { return _Description; }
|
|
|
set { SetProperty(ref _Description, value); }
|
|
set { SetProperty(ref _Description, value); }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private Guid _VisionProcessID;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 视觉流程ID
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public Guid VisionProcessID
|
|
|
|
|
+ {
|
|
|
|
|
+ get { return _VisionProcessID; }
|
|
|
|
|
+ set { SetProperty(ref _VisionProcessID, value); }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private string _VisionProcessName;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 视觉流程名称
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public string VisionProcessName
|
|
|
|
|
+ {
|
|
|
|
|
+ get { return _VisionProcessName; }
|
|
|
|
|
+ set { SetProperty(ref _VisionProcessName, value); }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private float _X_Offset;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// X轴补偿值
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public float X_Offset
|
|
|
|
|
+ {
|
|
|
|
|
+ get { return _X_Offset; }
|
|
|
|
|
+ set { SetProperty(ref _X_Offset, value); }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private float _Y_Offset;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Y轴补偿值
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public float Y_Offset
|
|
|
|
|
+ {
|
|
|
|
|
+ get { return _Y_Offset; }
|
|
|
|
|
+ set { SetProperty(ref _Y_Offset, value); }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private float _Z_Start_Offset;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Z轴起点补偿值
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public float Z_Start_Offset
|
|
|
|
|
+ {
|
|
|
|
|
+ get { return _Z_Start_Offset; }
|
|
|
|
|
+ set { SetProperty(ref _Z_Start_Offset, value); }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private float _Z_Stop_Offset;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Z轴终点补偿值
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public float Z_Stop_Offset
|
|
|
|
|
+ {
|
|
|
|
|
+ get { return _Z_Stop_Offset; }
|
|
|
|
|
+ set { SetProperty(ref _Z_Stop_Offset, value); }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private float _U_Offset;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// U轴补偿值
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public float U_Offset
|
|
|
|
|
+ {
|
|
|
|
|
+ get { return _U_Offset; }
|
|
|
|
|
+ set { SetProperty(ref _U_Offset, value); }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private float _R_Offset;
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// R轴补偿值
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public float R_Offset
|
|
|
|
|
+ {
|
|
|
|
|
+ get { return _R_Offset; }
|
|
|
|
|
+ set { SetProperty(ref _R_Offset, value); }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public PlcPoint()
|
|
public PlcPoint()
|
|
|
{
|
|
{
|
|
|
Number = 0;
|
|
Number = 0;
|
|
@@ -157,6 +291,14 @@ namespace TeamAAS_VP.Models.PLC
|
|
|
Torque = 0;
|
|
Torque = 0;
|
|
|
Feeder = 0;
|
|
Feeder = 0;
|
|
|
ScrewProNum = 0;
|
|
ScrewProNum = 0;
|
|
|
|
|
+ Description = string.Empty;
|
|
|
|
|
+ X_Offset = 0;
|
|
|
|
|
+ Y_Offset = 0;
|
|
|
|
|
+ Z_Start_Offset = 0;
|
|
|
|
|
+ Z_Stop_Offset = 0;
|
|
|
|
|
+ U_Offset = 0;
|
|
|
|
|
+ R_Offset = 0;
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public PlcPoint Clone()
|
|
public PlcPoint Clone()
|
|
@@ -180,7 +322,15 @@ namespace TeamAAS_VP.Models.PLC
|
|
|
Torque = this.Torque,
|
|
Torque = this.Torque,
|
|
|
Feeder = this.Feeder,
|
|
Feeder = this.Feeder,
|
|
|
ScrewProNum = this.ScrewProNum,
|
|
ScrewProNum = this.ScrewProNum,
|
|
|
- Description = this.Description
|
|
|
|
|
|
|
+ Description = this.Description,
|
|
|
|
|
+ VisionProcessID = this.VisionProcessID,
|
|
|
|
|
+ VisionProcessName = this.VisionProcessName,
|
|
|
|
|
+ X_Offset = this.X_Offset,
|
|
|
|
|
+ Y_Offset = this.Y_Offset,
|
|
|
|
|
+ Z_Start_Offset = this.Z_Start_Offset,
|
|
|
|
|
+ Z_Stop_Offset = this.Z_Stop_Offset,
|
|
|
|
|
+ U_Offset = this.U_Offset,
|
|
|
|
|
+ R_Offset = this.R_Offset
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -193,17 +343,17 @@ namespace TeamAAS_VP.Models.PLC
|
|
|
public async Task<bool> WriteToPlcAddress(PlcPointAddress plcAddress, OpcUaClientPLC pLC)
|
|
public async Task<bool> WriteToPlcAddress(PlcPointAddress plcAddress, OpcUaClientPLC pLC)
|
|
|
{
|
|
{
|
|
|
Dictionary<string, object> nodeValues = new Dictionary<string, object>();
|
|
Dictionary<string, object> nodeValues = new Dictionary<string, object>();
|
|
|
- nodeValues.Add(string.Format(plcAddress.X_Position.Address, Number), X_Position);
|
|
|
|
|
|
|
+ nodeValues.Add(string.Format(plcAddress.X_Position.Address, Number), X_Position + X_Offset);
|
|
|
nodeValues.Add(string.Format(plcAddress.X_Velocity.Address, Number), X_Velocity);
|
|
nodeValues.Add(string.Format(plcAddress.X_Velocity.Address, Number), X_Velocity);
|
|
|
- nodeValues.Add(string.Format(plcAddress.Y_Position.Address, Number), Y_Position);
|
|
|
|
|
|
|
+ nodeValues.Add(string.Format(plcAddress.Y_Position.Address, Number), Y_Position + Y_Offset);
|
|
|
nodeValues.Add(string.Format(plcAddress.Y_Velocity.Address, Number), Y_Velocity);
|
|
nodeValues.Add(string.Format(plcAddress.Y_Velocity.Address, Number), Y_Velocity);
|
|
|
- nodeValues.Add(string.Format(plcAddress.Z_Position_Start.Address, Number), Z_Position_Start);
|
|
|
|
|
|
|
+ nodeValues.Add(string.Format(plcAddress.Z_Position_Start.Address, Number), Z_Position_Start + Z_Start_Offset);
|
|
|
nodeValues.Add(string.Format(plcAddress.Z_Velocity_Start.Address, Number), Z_Velocity_Start);
|
|
nodeValues.Add(string.Format(plcAddress.Z_Velocity_Start.Address, Number), Z_Velocity_Start);
|
|
|
- nodeValues.Add(string.Format(plcAddress.Z_Position_Stop.Address, Number), Z_Position_Stop);
|
|
|
|
|
|
|
+ nodeValues.Add(string.Format(plcAddress.Z_Position_Stop.Address, Number), Z_Position_Stop + Z_Stop_Offset);
|
|
|
nodeValues.Add(string.Format(plcAddress.Z_Velocity_Stop.Address, Number), Z_Velocity_Stop);
|
|
nodeValues.Add(string.Format(plcAddress.Z_Velocity_Stop.Address, Number), Z_Velocity_Stop);
|
|
|
- nodeValues.Add(string.Format(plcAddress.U_Position.Address, Number), U_Position);
|
|
|
|
|
|
|
+ nodeValues.Add(string.Format(plcAddress.U_Position.Address, Number), U_Position + U_Offset);
|
|
|
nodeValues.Add(string.Format(plcAddress.U_Velocity.Address, Number), U_Velocity);
|
|
nodeValues.Add(string.Format(plcAddress.U_Velocity.Address, Number), U_Velocity);
|
|
|
- nodeValues.Add(string.Format(plcAddress.R_Position.Address, Number), R_Position);
|
|
|
|
|
|
|
+ nodeValues.Add(string.Format(plcAddress.R_Position.Address, Number), R_Position + R_Offset);
|
|
|
nodeValues.Add(string.Format(plcAddress.R_Velocity.Address, Number), R_Velocity);
|
|
nodeValues.Add(string.Format(plcAddress.R_Velocity.Address, Number), R_Velocity);
|
|
|
nodeValues.Add(string.Format(plcAddress.Torque.Address, Number), Torque);
|
|
nodeValues.Add(string.Format(plcAddress.Torque.Address, Number), Torque);
|
|
|
nodeValues.Add(string.Format(plcAddress.Feeder.Address, Number), Feeder);
|
|
nodeValues.Add(string.Format(plcAddress.Feeder.Address, Number), Feeder);
|