Commit 2929183d LN

压紧轴改为伺服,io改为零点。使用新的IO配置

1 个父辈 a353a455
正在显示 49 个修改的文件 包含 501 行增加615 行删除
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
...@@ -20,31 +20,30 @@ ...@@ -20,31 +20,30 @@
<add key="Store_Position_Config" value="\StoreConfig\AC\linePositions.csv"/> <add key="Store_Position_Config" value="\StoreConfig\AC\linePositions.csv"/>
<add key="Store_ConfigPath" value="\StoreConfig\AC\StoreConfig.csv"/> <add key="Store_ConfigPath" value="\StoreConfig\AC\StoreConfig.csv"/>
<add key="Store_Type" value="RC_AC_SA"/> <add key="Store_Type" value="RC_AC_SA"/>
<add key="Store_CID" value="rc29ac-1"/> <add key="Store_CID" value="rc1258ac-1"/>
<!--end one store config--> <!--end one store config-->
<!--摄像机名称列表配置,用#分割--> <!--摄像机名称列表配置,用#分割-->
<add key="CameraName" value="GigE:MV-CE100-30GC (00C69898483)"/> <add key="CameraName" value="GigE:MV-CE100-30GC (00C69898483)"/>
<!--二维码类型列表配置,用#分割,一维码=Barcode--> <!--二维码类型列表配置,用#分割,二维码:QR Code#Data Matrix ECC 200#Micro QR Code,一维码=Barcode-->
<add key="CodeType" value="QR Code#Data Matrix ECC 200#Micro QR Code"/> <add key="CodeType" value="QR Code"/>
<!--<add key="CodeType" value="Data Matrix ECC 200"/>-->
<!--二维码参数文件所在路径,文件名与二维码类型名一样--> <!--二维码参数文件所在路径,文件名与二维码类型名一样-->
<add key="CodeParamPath" value="\CodeParam\"/> <add key="CodeParamPath" value="\CodeParam\"/>
<add key="AI_ConvertPosition" value="55"/>
<add key="InOutDefaultPosition" value="8000"/> <add key="InOutDefaultPosition" value="8000"/>
<add key="Config_Pwd" value="123456"/> <add key="Config_Pwd" value="123456"/>
<!--出库等待料盘拿走的时间,秒--> <!--出库等待料盘拿走的时间,秒-->
<add key="OutStoreWaitSeconds" value="10"/> <add key="OutStoreWaitSeconds" value="10"/>
<!--压紧轴计量检测亮一次的脉冲-->
<add key="ComAxisChangeValue" value="2400"/>
<!--温控器类型,0=壁挂王字壳温湿度变送器,1=妙昕温湿度记录仪--> <!--温控器类型,0=壁挂王字壳温湿度变送器,1=妙昕温湿度记录仪-->
<add key="HumitureControllerType" value="1"/> <add key="HumitureControllerType" value="1"/>
<!--流水线地址和端口配置--> <!--流水线地址和端口配置-->
<add key="LineServerIp" value="192.168.200.69"/> <add key="LineServerIp" value="192.168.200.69"/>
<add key="LineServerPort" value="1234"/> <add key="LineServerPort" value="1234"/>
<!--解码方式,0=halcon 解码,1=西安料仓 使用zxing解码,2=成都料仓--> <!--解码方式,0=halcon 解码,1=西安料仓 使用zxing解码,2=成都料仓-->
<add key="DeCodeType" value="2"/> <add key="DeCodeType" value="0"/>
<add key ="DefaultPWD" value ="123456"/> <add key ="DefaultPWD" value ="123456"/>
<add key="UseAIOBOX" value="1"/>
<!--是否使用蜂鸣器-->
<add key ="UseBuzzer" value ="1"/>
</appSettings> </appSettings>
<log4net> <log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
......
...@@ -244,7 +244,7 @@ ...@@ -244,7 +244,7 @@
this.btnComMovej.Name = "btnComMovej"; this.btnComMovej.Name = "btnComMovej";
this.btnComMovej.Size = new System.Drawing.Size(131, 36); this.btnComMovej.Size = new System.Drawing.Size(131, 36);
this.btnComMovej.TabIndex = 25; this.btnComMovej.TabIndex = 25;
this.btnComMovej.Text = "压紧轴-(向)"; this.btnComMovej.Text = "压紧轴-(向)";
this.btnComMovej.UseVisualStyleBackColor = false; this.btnComMovej.UseVisualStyleBackColor = false;
this.btnComMovej.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnComMovej_MouseDown); this.btnComMovej.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnComMovej_MouseDown);
this.btnComMovej.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnComMovej_MouseUp); this.btnComMovej.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnComMovej_MouseUp);
...@@ -256,7 +256,7 @@ ...@@ -256,7 +256,7 @@
this.btnComMove.Name = "btnComMove"; this.btnComMove.Name = "btnComMove";
this.btnComMove.Size = new System.Drawing.Size(131, 36); this.btnComMove.Size = new System.Drawing.Size(131, 36);
this.btnComMove.TabIndex = 24; this.btnComMove.TabIndex = 24;
this.btnComMove.Text = "压紧轴+(向)"; this.btnComMove.Text = "压紧轴+(向)";
this.btnComMove.UseVisualStyleBackColor = false; this.btnComMove.UseVisualStyleBackColor = false;
this.btnComMove.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnComMove_MouseDown); this.btnComMove.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnComMove_MouseDown);
this.btnComMove.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnComMove_MouseUp); this.btnComMove.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnComMove_MouseUp);
......
...@@ -23,17 +23,19 @@ namespace OnlineStore.ACSingleStore ...@@ -23,17 +23,19 @@ namespace OnlineStore.ACSingleStore
private ConfigMoveAxis updown = null; private ConfigMoveAxis updown = null;
//private ConfigMoveAxis compress = null; //private ConfigMoveAxis compress = null;
private ConfigMoveAxis inout = null; private ConfigMoveAxis inout = null;
private int compress_Slv = 0; private ConfigMoveAxis comp = null;
//private int compress_Slv = 0;
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public FrmAxisDebug(AC_SA_BoxBean boxBean) public FrmAxisDebug(AC_SA_BoxBean boxBean)
{ {
middle = boxBean.Config.Middle_Axis; middle = boxBean.Config.Middle_Axis;
updown = boxBean.Config.UpDown_Axis; updown = boxBean.Config.UpDown_Axis;
compress_Slv = boxBean.Config.CompressAxis_Slv; //compress_Slv = boxBean.Config.CompressAxis_Slv;
comp = boxBean.Config.Comp_Axis;
inout = boxBean.Config.InOut_Axis; inout = boxBean.Config.InOut_Axis;
InitializeComponent(); InitializeComponent();
txtComSpeed.Text = boxBean.Config.CompressAxis_EndSpeed.ToString();
this.Text = boxBean.StoreName + "_轴点动调试"; this.Text = boxBean.StoreName + "_轴点动调试";
} }
...@@ -45,10 +47,11 @@ namespace OnlineStore.ACSingleStore ...@@ -45,10 +47,11 @@ namespace OnlineStore.ACSingleStore
} }
private void FrmAxisDebug_Load(object sender, EventArgs e) private void FrmAxisDebug_Load(object sender, EventArgs e)
{ {
// ACServerManager.ClearSpeed();
txtMiddleSpeed.Text = (middle.TargetSpeed / 5).ToString(); txtMiddleSpeed.Text = (middle.TargetSpeed / 5).ToString();
txtInOutSpeed.Text = (inout.TargetSpeed / 5).ToString(); txtInOutSpeed.Text = (inout.TargetSpeed / 5).ToString();
txtUpDownSpeed.Text = (updown.TargetSpeed / 5).ToString(); txtUpDownSpeed.Text = (updown.TargetSpeed / 5).ToString();
txtComSpeed.Text = (StoreManager.Config.CompressAxis_EndSpeed).ToString(); txtComSpeed.Text = (comp.TargetSpeed / 5).ToString();
timer1.Start(); timer1.Start();
} }
/// <summary> /// <summary>
...@@ -61,7 +64,7 @@ namespace OnlineStore.ACSingleStore ...@@ -61,7 +64,7 @@ namespace OnlineStore.ACSingleStore
//{ //{
// InOutDefaultPosition = 3000; // InOutDefaultPosition = 3000;
//} //}
int currValue = ACServerManager.GetActualtPosition(inout.DeviceName, inout.GetAxisValue()); int currValue = ACServerManager.GetActualtPosition(inout.DeviceName, inout.GetAxisValue());
if (currValue <= InOutDefaultPosition) if (currValue <= InOutDefaultPosition)
{ {
return true; return true;
...@@ -75,7 +78,7 @@ namespace OnlineStore.ACSingleStore ...@@ -75,7 +78,7 @@ namespace OnlineStore.ACSingleStore
{ {
return; return;
} }
if (btnMiddleMove.BackColor.Equals(System.Drawing.SystemColors.Control)) if (btnMiddleMove.BackColor.Equals(System.Drawing.SystemColors.Control))
{ {
int speed = FormUtil.GetIntValue(txtMiddleSpeed); int speed = FormUtil.GetIntValue(txtMiddleSpeed);
...@@ -122,7 +125,7 @@ namespace OnlineStore.ACSingleStore ...@@ -122,7 +125,7 @@ namespace OnlineStore.ACSingleStore
{ {
if (btnUpDownMove.BackColor == Color.Green) if (btnUpDownMove.BackColor == Color.Green)
{ {
btnUpDownMove.BackColor = System.Drawing.SystemColors.Control; btnUpDownMove.BackColor = System.Drawing.SystemColors.Control;
ACServerManager.SuddenStop(updown.DeviceName, updown.GetAxisValue()); ACServerManager.SuddenStop(updown.DeviceName, updown.GetAxisValue());
UpdateUpdownPosition(); UpdateUpdownPosition();
} }
...@@ -130,7 +133,7 @@ namespace OnlineStore.ACSingleStore ...@@ -130,7 +133,7 @@ namespace OnlineStore.ACSingleStore
private void btnInOutMove_MouseDown(object sender, MouseEventArgs e) private void btnInOutMove_MouseDown(object sender, MouseEventArgs e)
{ {
if (this.btnInOutMove.BackColor .Equals(System.Drawing.SystemColors.Control)) if (this.btnInOutMove.BackColor.Equals(System.Drawing.SystemColors.Control))
{ {
if (StoreManager.Store.InOutAxisCanMove().Equals(false)) if (StoreManager.Store.InOutAxisCanMove().Equals(false))
{ {
...@@ -156,7 +159,7 @@ namespace OnlineStore.ACSingleStore ...@@ -156,7 +159,7 @@ namespace OnlineStore.ACSingleStore
ACServerManager.SuddenStop(inout.DeviceName, inout.GetAxisValue()); ACServerManager.SuddenStop(inout.DeviceName, inout.GetAxisValue());
UpdateInOutPosition(); UpdateInOutPosition();
} }
} }
private void btnMiddleMovej_MouseDown(object sender, MouseEventArgs e) private void btnMiddleMovej_MouseDown(object sender, MouseEventArgs e)
{ {
if (!InOutIsIsP1()) if (!InOutIsIsP1())
...@@ -192,7 +195,7 @@ namespace OnlineStore.ACSingleStore ...@@ -192,7 +195,7 @@ namespace OnlineStore.ACSingleStore
{ {
return; return;
} }
if (btnUpDownMovej.BackColor .Equals( System.Drawing.SystemColors.Control)) if (btnUpDownMovej.BackColor.Equals(System.Drawing.SystemColors.Control))
{ {
int speed = FormUtil.GetIntValue(txtUpDownSpeed); int speed = FormUtil.GetIntValue(txtUpDownSpeed);
if (speed <= 0) if (speed <= 0)
...@@ -242,7 +245,7 @@ namespace OnlineStore.ACSingleStore ...@@ -242,7 +245,7 @@ namespace OnlineStore.ACSingleStore
btnInOutMovej.BackColor = System.Drawing.SystemColors.Control; btnInOutMovej.BackColor = System.Drawing.SystemColors.Control;
ACServerManager.SuddenStop(inout.DeviceName, inout.GetAxisValue()); ACServerManager.SuddenStop(inout.DeviceName, inout.GetAxisValue());
UpdateInOutPosition(); UpdateInOutPosition();
} }
} }
private void btnComMove_MouseDown(object sender, MouseEventArgs e) private void btnComMove_MouseDown(object sender, MouseEventArgs e)
{ {
...@@ -255,10 +258,7 @@ namespace OnlineStore.ACSingleStore ...@@ -255,10 +258,7 @@ namespace OnlineStore.ACSingleStore
return; return;
} }
this.btnComMove.BackColor = Color.Green; this.btnComMove.BackColor = Color.Green;
AxisMove(comp, speed);
ShuoKeControls.SetSpeed(compress_Slv, ShuoKeCMD.SetEndSpeed, speed);
ShuoKeControls.SetSpeed(compress_Slv, ShuoKeCMD.SetMaxSpeed, speed);
ShuoKeControls.VolMove(compress_Slv, speed);
} }
} }
...@@ -266,9 +266,9 @@ namespace OnlineStore.ACSingleStore ...@@ -266,9 +266,9 @@ namespace OnlineStore.ACSingleStore
{ {
if (this.btnComMove.BackColor == Color.Green) if (this.btnComMove.BackColor == Color.Green)
{ {
btnComMove.BackColor = System.Drawing.SystemColors.Control; btnComMove.BackColor = System.Drawing.SystemColors.Control;
ShuoKeControls.SuddownStop(compress_Slv); ACServerManager.SuddenStop(comp.DeviceName, comp.GetAxisValue());
ShuoKeControls.GetABSPosition(compress_Slv); UpdateCompPosition();
} }
} }
private void btnComMovej_MouseDown(object sender, MouseEventArgs e) private void btnComMovej_MouseDown(object sender, MouseEventArgs e)
...@@ -279,10 +279,8 @@ namespace OnlineStore.ACSingleStore ...@@ -279,10 +279,8 @@ namespace OnlineStore.ACSingleStore
MessageBox.Show("提示", "请先输入正确的速度"); MessageBox.Show("提示", "请先输入正确的速度");
return; return;
} }
this.btnComMovej.BackColor = Color.Green; this.btnComMovej.BackColor = Color.Green;
ShuoKeControls.SetSpeed(compress_Slv, ShuoKeCMD.SetEndSpeed, speed); AxisMove(comp, -speed);
ShuoKeControls.SetSpeed(compress_Slv, ShuoKeCMD.SetMaxSpeed, speed);
ShuoKeControls.VolMove(compress_Slv,-speed);
} }
private void btnComMovej_MouseUp(object sender, MouseEventArgs e) private void btnComMovej_MouseUp(object sender, MouseEventArgs e)
...@@ -290,8 +288,8 @@ namespace OnlineStore.ACSingleStore ...@@ -290,8 +288,8 @@ namespace OnlineStore.ACSingleStore
if (btnComMovej.BackColor.Equals(Color.Green)) if (btnComMovej.BackColor.Equals(Color.Green))
{ {
btnComMovej.BackColor = System.Drawing.SystemColors.Control; btnComMovej.BackColor = System.Drawing.SystemColors.Control;
ShuoKeControls.SuddownStop(compress_Slv); ACServerManager.SuddenStop(comp.DeviceName, comp.GetAxisValue());
txtComPosition.Text = ShuoKeControls.GetABSPosition(compress_Slv).ToString(); UpdateCompPosition();
} }
} }
...@@ -299,11 +297,10 @@ namespace OnlineStore.ACSingleStore ...@@ -299,11 +297,10 @@ namespace OnlineStore.ACSingleStore
{ {
this.Close(); this.Close();
} }
private void FrmAxisDebug_Shown(object sender, EventArgs e) private void FrmAxisDebug_Shown(object sender, EventArgs e)
{ {
SetSkin(this);
} }
private void timer1_Tick(object sender, EventArgs e) private void timer1_Tick(object sender, EventArgs e)
...@@ -313,10 +310,18 @@ namespace OnlineStore.ACSingleStore ...@@ -313,10 +310,18 @@ namespace OnlineStore.ACSingleStore
UpdateMiddlePosition(); UpdateMiddlePosition();
UpdateInOutPosition(); UpdateInOutPosition();
UpdateUpdownPosition(); UpdateUpdownPosition();
// txtComPosition.Text = ShuoKeControls.GetLastPosition(compress_Slv).ToString(); UpdateCompPosition();
// txtComPosition.Text = ShuoKeControls.GetLastPosition(compress_Slv).ToString();
}
}
private void UpdateCompPosition()
{
int compPosition = ACServerManager.GetTargetPosition(comp.DeviceName, comp.GetAxisValue());
if (!txtComPosition.Text.Equals(compPosition.ToString()))
{
txtComPosition.Text = compPosition.ToString();
} }
} }
private void UpdateUpdownPosition() private void UpdateUpdownPosition()
{ {
int updownPosition = ACServerManager.GetTargetPosition(updown.DeviceName, updown.GetAxisValue()); int updownPosition = ACServerManager.GetTargetPosition(updown.DeviceName, updown.GetAxisValue());
......
using OnlineStore.Common;
using OnlineStore.DeviceLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace OnlineStore.ACSingleStore
{
public partial class FrmAxisMoveConfig : FrmBase
{
private AC_SA_BoxBean boxBean = null;
public FrmAxisMoveConfig(AC_SA_BoxBean box )
{
this.boxBean = box;
InitializeComponent();
}
private void FrmAxisMoveConfig_Load(object sender, EventArgs e)
{
txtUpdownP1S.Text = boxBean.Config.UpDownAxis_P1_Speed.ToString();
txtUpdownP2S.Text = boxBean.Config.UpDownAxis_P2_Speed.ToString();
txtUpdownP3S.Text = boxBean.Config.UpDownAxis_P3_Speed.ToString();
txtUpdownP4S.Text = boxBean.Config.UpDownAxis_P4_Speed.ToString();
txtUpdownP5S.Text = boxBean.Config.UpDownAxis_P5_Speed.ToString();
txtUpdownP6S.Text = boxBean.Config.UpDownAxis_P6_Speed.ToString();
txtUpdownP7S.Text = boxBean.Config.UpDownAxis_P7_Speed.ToString();
txtUpdownP8S.Text = boxBean.Config.UpDownAxis_P8_Speed.ToString();
txtInOutP1S.Text = boxBean.Config.InOutAxis_P1_Speed.ToString();
txtInOutP2S.Text = boxBean.Config.InOutAxis_P2_Speed.ToString();
txtInOutP3S.Text = boxBean.Config.InOutAxis_P3_Speed.ToString();
txtMiddleP1S.Text = boxBean.Config.MiddleAxis_P1_Speed.ToString();
txtMiddleP2S.Text = boxBean.Config.MiddleAxis_P2_Speed.ToString();
//txtMiddleSpeed.Text = boxBean.Config.MiddleAxis_StartSpeed.ToString();
//txtInOutSpeed.Text = boxBean.Config.InoutAxis_StartSpeed.ToString();
//txtUpDownSpeed.Text = boxBean.Config.UpdownAxis_StartSpeed.ToString();
this.txtMSpeed.Text = boxBean.Config.MiddleAxis_TargetSpeed.ToString();
this.txtISpeed.Text = boxBean.Config.InoutAxis_TargetSpeed.ToString();
this.txtUSpeed.Text = boxBean.Config.UpdownAxis_TargetSpeed.ToString();
this.txtMAtime.Text = boxBean.Config.MiddleAxis_AddSpeed.ToString();
this.txtIAtime.Text = boxBean.Config.InoutAxis_DelSpeed.ToString();
this.txtUAtime.Text = boxBean.Config.UpdownAxis_AddSpeed.ToString();
this.txtMDtime.Text = boxBean.Config.MiddleAxis_DelSpeed.ToString();
this.txtIDtime.Text = boxBean.Config.InoutAxis_DelSpeed.ToString();
this.txtUDtime.Text = boxBean.Config.UpdownAxis_DelSpeed.ToString();
txtMiddleMax.Text = boxBean.Config.MiddleAxis_ErrorCountMax.ToString();
txtUpdownMax.Text = boxBean.Config.UpdownAxis_ErrorCountMax.ToString();
txtInoutMax.Text = boxBean.Config.InoutAxis_ErrorCountMax.ToString();
//txtComMax.Text = boxBean.Config.CompressAxis_ErrorCountMax.ToString();
txtMiddleMin.Text = boxBean.Config.MiddleAxis_ErrorCountMin.ToString();
txtUpdownMin.Text = boxBean.Config.UpdownAxis_ErrorCountMin.ToString();
txtInoutMin.Text = boxBean.Config.InoutAxis_ErrorCountMin.ToString();
//txtComMin.Text = boxBean.Config.CompressAxis_ErrorCountMin.ToString();
txtMRSpeed.Text = boxBean.Config.MiddleAxis_ResolveSpeed.ToString();
txtIRSpeed.Text = boxBean.Config.InoutAxis_ResolveSpeed.ToString();
txtURSpeed.Text = boxBean.Config.UpdownAxis_ResolveSpeed.ToString();
//txtCRSpeed.Text = boxBean.Config.CompressAxis_ResolveSpeed.ToString();
//txtAddSpeed.Text = boxBean.Config.CompressAxis_AddSpeed.ToString();
//txtDelSpeed.Text = boxBean.Config.CompressAxis_DelSpeed.ToString();
//txtMaxSpeed.Text = boxBean.Config.CompressAxis_MaxSpeed.ToString();
//txtBeginSpeed.Text = boxBean.Config.CompressAxis_StartSpeed.ToString();
//txtTargetSpeed.Text = boxBean.Config.CompressAxis_EndSpeed.ToString();
//this.txtCDtime.Text = boxBean.Config.CompressAxis_DecelTime.ToString();
//this.txtCSpeed.Text = boxBean.Config.CompressAxis_TargetSpeed.ToString();
//this.txtCAtime.Text = boxBean.Config.CompressAxis_AccelTime.ToString();
}
private void btnSaveAxisSpeed_Click(object sender, EventArgs e)
{
DialogResult resul = MessageBox.Show("配置使用地方过多,需要重启才能生效,是否确定保存?", "提示", MessageBoxButtons.YesNo);
if (!resul.Equals(DialogResult.Yes))
{
return;
}
boxBean.Config.UpDownAxis_P1_Speed = FormUtil.GetIntValue(txtUpdownP1S);
boxBean.Config.UpDownAxis_P2_Speed = FormUtil.GetIntValue(txtUpdownP2S);
boxBean.Config.UpDownAxis_P3_Speed = FormUtil.GetIntValue(txtUpdownP3S);
boxBean.Config.UpDownAxis_P4_Speed = FormUtil.GetIntValue(txtUpdownP4S);
boxBean.Config.UpDownAxis_P5_Speed = FormUtil.GetIntValue(txtUpdownP5S);
boxBean.Config.UpDownAxis_P6_Speed = FormUtil.GetIntValue(txtUpdownP6S);
boxBean.Config.UpDownAxis_P7_Speed = FormUtil.GetIntValue(txtUpdownP7S);
boxBean.Config.UpDownAxis_P8_Speed = FormUtil.GetIntValue(txtUpdownP8S);
boxBean.Config.InOutAxis_P1_Speed = FormUtil.GetIntValue(txtInOutP1S);
boxBean.Config.InOutAxis_P2_Speed = FormUtil.GetIntValue(txtInOutP2S);
boxBean.Config.InOutAxis_P3_Speed = FormUtil.GetIntValue(txtInOutP3S);
boxBean.Config.MiddleAxis_P1_Speed = FormUtil.GetIntValue(txtMiddleP1S);
boxBean.Config.MiddleAxis_P2_Speed = FormUtil.GetIntValue(txtMiddleP2S);
//boxBean.Config.CompressAxis_P1_Speed = FormUtil.GetIntValue(txtComPressP1S);
//boxBean.Config.CompressAxis_P2_Speed = FormUtil.GetIntValue(txtComPressP2S);
//boxBean.Config.CompressAxis_P3_Speed = FormUtil.GetIntValue(txtComPressP3S);
//boxBean.Config.MiddleAxis_StartSpeed = FormUtil.GetIntValue(txtMiddleSpeed);
//boxBean.Config.InoutAxis_StartSpeed = FormUtil.GetIntValue(txtInOutSpeed);
//boxBean.Config.UpdownAxis_StartSpeed = FormUtil.GetIntValue(txtUpDownSpeed);
//boxBean.Config.CompressAxis_StartSpeed = FormUtil.GetIntValue(txtComSpeed);
boxBean.Config.MiddleAxis_TargetSpeed = FormUtil.GetIntValue(txtMSpeed);
boxBean.Config.InoutAxis_TargetSpeed = FormUtil.GetIntValue(txtISpeed);
boxBean.Config.UpdownAxis_TargetSpeed = FormUtil.GetIntValue(txtUSpeed);
boxBean.Config.MiddleAxis_AddSpeed = FormUtil.GetShortValue(txtMAtime);
boxBean.Config.InoutAxis_AddSpeed = FormUtil.GetShortValue(txtIAtime);
boxBean.Config.UpdownAxis_AddSpeed = FormUtil.GetShortValue(txtUAtime);
boxBean.Config.MiddleAxis_DelSpeed = FormUtil.GetShortValue(txtMDtime);
boxBean.Config.InoutAxis_DelSpeed = FormUtil.GetShortValue(txtIDtime);
boxBean.Config.UpdownAxis_DelSpeed = FormUtil.GetShortValue(txtUDtime);
boxBean.Config.MiddleAxis_ErrorCountMax = FormUtil.GetShortValue(txtMiddleMax);
boxBean.Config.UpdownAxis_ErrorCountMax = FormUtil.GetShortValue(txtUpdownMax);
boxBean.Config.InoutAxis_ErrorCountMax = FormUtil.GetShortValue(txtInoutMax);
boxBean.Config.MiddleAxis_ErrorCountMin = FormUtil.GetShortValue(txtMiddleMin);
boxBean.Config.UpdownAxis_ErrorCountMin = FormUtil.GetShortValue(txtUpdownMin);
boxBean.Config.InoutAxis_ErrorCountMin = FormUtil.GetShortValue(txtInoutMin);
boxBean.Config.MiddleAxis_ResolveSpeed = FormUtil.GetShortValue(txtMRSpeed);
boxBean.Config.InoutAxis_ResolveSpeed = FormUtil.GetShortValue(txtIRSpeed);
boxBean.Config.UpdownAxis_ResolveSpeed = FormUtil.GetShortValue(txtURSpeed);
//boxBean.Config.CompressAxis_StartSpeed = FormUtil.GetIntValue(txtBeginSpeed);
//boxBean.Config.CompressAxis_AddSpeed = FormUtil.GetIntValue(txtAddSpeed);
//boxBean.Config.CompressAxis_DelSpeed = FormUtil.GetIntValue(txtDelSpeed);
//boxBean.Config.CompressAxis_EndSpeed = FormUtil.GetIntValue(txtTargetSpeed);
//boxBean.Config.CompressAxis_MaxSpeed = FormUtil.GetIntValue(txtMaxSpeed);
//boxBean.Config.CompressAxis_TargetSpeed = FormUtil.GetIntValue(txtCSpeed);
//boxBean.Config.CompressAxis_AccelTime = FormUtil.GetShortValue(txtCAtime);
//boxBean.Config.CompressAxis_DecelTime = FormUtil.GetShortValue(txtCDtime);
//更新缓存
ACStoreManager.UpdateBoxConfig(boxBean.Config);
}
private void FrmAxisMoveConfig_Shown(object sender, EventArgs e)
{
SetSkin(this);
}
}
}
...@@ -41,7 +41,7 @@ namespace OnlineStore.ACSingleStore ...@@ -41,7 +41,7 @@ namespace OnlineStore.ACSingleStore
LogUtil.info("版本号[" + version + "][" + str + "][" + GetCodeNum() + "]"); LogUtil.info("版本号[" + version + "][" + str + "][" + GetCodeNum() + "]");
return str; return str;
} }
internal static string GetCodeNum(string codeName = "RC-29-32-ACSingleStore") internal static string GetCodeNum(string codeName = "RC1258-ACSingleStore")
{ {
byte[] byteArray = System.Text.Encoding.ASCII.GetBytes(codeName); byte[] byteArray = System.Text.Encoding.ASCII.GetBytes(codeName);
string result = ""; string result = "";
...@@ -50,13 +50,7 @@ namespace OnlineStore.ACSingleStore ...@@ -50,13 +50,7 @@ namespace OnlineStore.ACSingleStore
} }
public FrmBase() public FrmBase()
{ {
InitializeComponent(); InitializeComponent();
//skinEngine1.SkinAllForm = false; }
}
public void SetSkin(FrmBase preCon)
{
//skinEngine1.SkinFile = FormManager.SkinFileName;
//LogUtil.info("当前皮肤:" + skinEngine1.SkinFile);
}
} }
} }
...@@ -32,11 +32,9 @@ ...@@ -32,11 +32,9 @@
this.label14 = new System.Windows.Forms.Label(); this.label14 = new System.Windows.Forms.Label();
this.btnWriteSingleDO = new System.Windows.Forms.Button(); this.btnWriteSingleDO = new System.Windows.Forms.Button();
this.txtWriteTime = new System.Windows.Forms.TextBox(); this.txtWriteTime = new System.Windows.Forms.TextBox();
this.btnLocationDown = new System.Windows.Forms.Button();
this.label5 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label();
this.btnReadAllDi = new System.Windows.Forms.Button(); this.btnReadAllDi = new System.Windows.Forms.Button();
this.cmbWriteValue = new System.Windows.Forms.ComboBox(); this.cmbWriteValue = new System.Windows.Forms.ComboBox();
this.btnLocationUp = new System.Windows.Forms.Button();
this.label6 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label();
this.btnReadAllDo = new System.Windows.Forms.Button(); this.btnReadAllDo = new System.Windows.Forms.Button();
this.cmbWriteIO = new System.Windows.Forms.ComboBox(); this.cmbWriteIO = new System.Windows.Forms.ComboBox();
...@@ -95,11 +93,9 @@ ...@@ -95,11 +93,9 @@
this.groupBox1.Controls.Add(this.label14); this.groupBox1.Controls.Add(this.label14);
this.groupBox1.Controls.Add(this.btnWriteSingleDO); this.groupBox1.Controls.Add(this.btnWriteSingleDO);
this.groupBox1.Controls.Add(this.txtWriteTime); this.groupBox1.Controls.Add(this.txtWriteTime);
this.groupBox1.Controls.Add(this.btnLocationDown);
this.groupBox1.Controls.Add(this.label5); this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.btnReadAllDi); this.groupBox1.Controls.Add(this.btnReadAllDi);
this.groupBox1.Controls.Add(this.cmbWriteValue); this.groupBox1.Controls.Add(this.cmbWriteValue);
this.groupBox1.Controls.Add(this.btnLocationUp);
this.groupBox1.Controls.Add(this.label6); this.groupBox1.Controls.Add(this.label6);
this.groupBox1.Controls.Add(this.btnReadAllDo); this.groupBox1.Controls.Add(this.btnReadAllDo);
this.groupBox1.Controls.Add(this.cmbWriteIO); this.groupBox1.Controls.Add(this.cmbWriteIO);
...@@ -267,17 +263,6 @@ ...@@ -267,17 +263,6 @@
this.txtWriteTime.TabIndex = 238; this.txtWriteTime.TabIndex = 238;
this.txtWriteTime.Text = "0"; this.txtWriteTime.Text = "0";
// //
// btnLocationDown
//
this.btnLocationDown.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnLocationDown.Location = new System.Drawing.Point(173, 248);
this.btnLocationDown.Name = "btnLocationDown";
this.btnLocationDown.Size = new System.Drawing.Size(102, 34);
this.btnLocationDown.TabIndex = 251;
this.btnLocationDown.Text = "定位气缸下降";
this.btnLocationDown.UseVisualStyleBackColor = true;
this.btnLocationDown.Click += new System.EventHandler(this.btnLocationDown_Click);
//
// label5 // label5
// //
this.label5.AutoSize = true; this.label5.AutoSize = true;
...@@ -316,17 +301,6 @@ ...@@ -316,17 +301,6 @@
this.cmbWriteValue.TabIndex = 236; this.cmbWriteValue.TabIndex = 236;
this.cmbWriteValue.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.cmbWriteValue_DrawItem); this.cmbWriteValue.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.cmbWriteValue_DrawItem);
// //
// btnLocationUp
//
this.btnLocationUp.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnLocationUp.Location = new System.Drawing.Point(56, 248);
this.btnLocationUp.Name = "btnLocationUp";
this.btnLocationUp.Size = new System.Drawing.Size(102, 34);
this.btnLocationUp.TabIndex = 250;
this.btnLocationUp.Text = "定位气缸上升";
this.btnLocationUp.UseVisualStyleBackColor = true;
this.btnLocationUp.Click += new System.EventHandler(this.btnLocationUp_Click);
//
// label6 // label6
// //
this.label6.AutoSize = true; this.label6.AutoSize = true;
...@@ -742,8 +716,6 @@ ...@@ -742,8 +716,6 @@
private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label3;
private System.Windows.Forms.Button btnCloseDoor; private System.Windows.Forms.Button btnCloseDoor;
private System.Windows.Forms.Button btnOpenDoor; private System.Windows.Forms.Button btnOpenDoor;
private System.Windows.Forms.Button btnLocationDown;
private System.Windows.Forms.Button btnLocationUp;
private System.Windows.Forms.Button btnCloseAxisBreak; private System.Windows.Forms.Button btnCloseAxisBreak;
private System.Windows.Forms.Button btnOpenAxisBreak; private System.Windows.Forms.Button btnOpenAxisBreak;
private System.Windows.Forms.Button button1; private System.Windows.Forms.Button button1;
......
...@@ -98,7 +98,7 @@ namespace OnlineStore.ACSingleStore ...@@ -98,7 +98,7 @@ namespace OnlineStore.ACSingleStore
private void FrmTest_FormClosing(object sender, FormClosingEventArgs e) private void FrmTest_FormClosing(object sender, FormClosingEventArgs e)
{ {
KNDAIManager.NeedShow = false; AIManager.Instance.NeedShow = false;
try try
{ {
if (this.timer1.Enabled) if (this.timer1.Enabled)
...@@ -121,11 +121,11 @@ namespace OnlineStore.ACSingleStore ...@@ -121,11 +121,11 @@ namespace OnlineStore.ACSingleStore
int slaveId = FormUtil.GetIntValue(txtSlaveId); int slaveId = FormUtil.GetIntValue(txtSlaveId);
if (time > 0) if (time > 0)
{ {
KNDManager.WriteSingleDO(deviceName, (byte)slaveId, (ushort)index, (IO_VALUE)value, time); IOManager.instance.WriteSingleDO(deviceName, (byte)slaveId, (ushort)index, (IO_VALUE)value, time);
} }
else else
{ {
KNDManager.WriteSingleDO(deviceName, (byte)slaveId, (ushort)index, (IO_VALUE)value); IOManager.instance.WriteSingleDO(deviceName, (byte)slaveId, (ushort)index, (IO_VALUE)value);
} }
} }
...@@ -159,7 +159,7 @@ namespace OnlineStore.ACSingleStore ...@@ -159,7 +159,7 @@ namespace OnlineStore.ACSingleStore
private void FrmStoreIOStatus_Load(object sender, EventArgs e) private void FrmStoreIOStatus_Load(object sender, EventArgs e)
{ {
KNDAIManager.NeedShow = true; AIManager.Instance.NeedShow = true;
} }
private void cmbWriteIO_DrawItem(object sender, DrawItemEventArgs e) private void cmbWriteIO_DrawItem(object sender, DrawItemEventArgs e)
...@@ -201,7 +201,7 @@ namespace OnlineStore.ACSingleStore ...@@ -201,7 +201,7 @@ namespace OnlineStore.ACSingleStore
foreach (string key in DIControlList.Keys) foreach (string key in DIControlList.Keys)
{ {
IOTextControl control = DIControlList[key]; IOTextControl control = DIControlList[key];
int iov = (int)KNDManager.GetIOValue(boxBean.Config.StoreDIList[key]); int iov = (int)IOManager.instance.GetIOValue(boxBean.Config.StoreDIList[key]);
if (iov != control.IOValue) if (iov != control.IOValue)
{ {
control.IOValue = iov; control.IOValue = iov;
...@@ -210,7 +210,7 @@ namespace OnlineStore.ACSingleStore ...@@ -210,7 +210,7 @@ namespace OnlineStore.ACSingleStore
} foreach (string key in this.DOControlList.Keys) } foreach (string key in this.DOControlList.Keys)
{ {
IOTextControl control = DOControlList[key]; IOTextControl control = DOControlList[key];
int iov = (int)KNDManager.GetIOValue(boxBean.Config.StoreDOList[key]); int iov = (int)IOManager.instance.GetIOValue(boxBean.Config.StoreDOList[key]);
if (iov != control.IOValue) if (iov != control.IOValue)
{ {
control.IOValue = iov; control.IOValue = iov;
...@@ -218,11 +218,11 @@ namespace OnlineStore.ACSingleStore ...@@ -218,11 +218,11 @@ namespace OnlineStore.ACSingleStore
} }
} }
double ai1Value = KNDAIManager.GetAIValue(boxBean.Config.AIDevice_IP, StoreManager.Config.AIDI1_Addr); double ai1Value = AIManager.Instance.GetAIValue(boxBean.Config.AIDevice_IP, StoreManager.Config.AIDI1_Addr);
double ai2Value = KNDAIManager.GetAIValue(boxBean.Config.AIDevice_IP, StoreManager.Config.AIDI2_Addr); double ai2Value = AIManager.Instance.GetAIValue(boxBean.Config.AIDevice_IP, StoreManager.Config.AIDI2_Addr);
double ai3Value = KNDAIManager.GetAIValue(boxBean.Config.AIDevice_IP, StoreManager.Config.AIDI3_Addr); double ai3Value = AIManager.Instance.GetAIValue(boxBean.Config.AIDevice_IP, StoreManager.Config.AIDI3_Addr);
double ai4Value = KNDAIManager.GetAIValue(boxBean.Config.AIDevice_IP, StoreManager.Config.AIDI4_Addr); double ai4Value = AIManager.Instance.GetAIValue(boxBean.Config.AIDevice_IP, StoreManager.Config.AIDI4_Addr);
//double ai3Value = KNDAIManager.GetAIValue(boxBean.Config.AIDevice_IP, 3); //double ai3Value = AIManager.Instance.GetAIValue(boxBean.Config.AIDevice_IP, 3);
txtAI1.Text = ai1Value.ToString(); txtAI1.Text = ai1Value.ToString();
txtAI2.Text = ai2Value.ToString(); txtAI2.Text = ai2Value.ToString();
...@@ -230,11 +230,11 @@ namespace OnlineStore.ACSingleStore ...@@ -230,11 +230,11 @@ namespace OnlineStore.ACSingleStore
txtAI4.Text = ai4Value.ToString(); txtAI4.Text = ai4Value.ToString();
//txtAI3.Text = ai3Value.ToString(); //txtAI3.Text = ai3Value.ToString();
txtAIResult1.Text = KNDAIManager.ConvertAI(ai1Value,boxBean.Config.AIDI1_DefaultPosition).ToString(); txtAIResult1.Text = AIManager.ConvertAI(ai1Value,boxBean.Config.AIDI1_DefaultPosition).ToString();
txtAIResult2.Text = KNDAIManager.ConvertAI(ai2Value, boxBean.Config.AIDI2_DefaultPosition).ToString(); txtAIResult2.Text = AIManager.ConvertAI(ai2Value, boxBean.Config.AIDI2_DefaultPosition).ToString();
txtAIResult3.Text = KNDAIManager.ConvertAI(ai3Value, boxBean.Config.AIDI3_DefaultPosition).ToString(); txtAIResult3.Text = AIManager.ConvertAI(ai3Value, boxBean.Config.AIDI3_DefaultPosition).ToString();
txtAIResult4.Text = KNDAIManager.ConvertAI(ai4Value, boxBean.Config.AIDI4_DefaultPosition).ToString(); txtAIResult4.Text = AIManager.ConvertAI(ai4Value, boxBean.Config.AIDI4_DefaultPosition).ToString();
//txtAIResult3.Text = KNDAIManager.ConvertAI(ai3Value, boxBean.Config.AIDI3_DefaultPosition).ToString(); //txtAIResult3.Text = AIManager.ConvertAI(ai3Value, boxBean.Config.AIDI3_DefaultPosition).ToString();
txtHeight.Text = boxBean.GetHeight().ToString(); txtHeight.Text = boxBean.GetHeight().ToString();
txtSize.Text = boxBean.GetSize().ToString(); txtSize.Text = boxBean.GetSize().ToString();
...@@ -246,7 +246,7 @@ namespace OnlineStore.ACSingleStore ...@@ -246,7 +246,7 @@ namespace OnlineStore.ACSingleStore
IO_VALUE value = (IO_VALUE)cmbWriteValue.SelectedIndex; IO_VALUE value = (IO_VALUE)cmbWriteValue.SelectedIndex;
int time = FormUtil.GetIntValue(txtWriteTime); int time = FormUtil.GetIntValue(txtWriteTime);
int slaveId = FormUtil.GetIntValue(txtSlaveId); int slaveId = FormUtil.GetIntValue(txtSlaveId);
KNDManager.ReadMultipleDI(deviceName, (byte)slaveId, (ushort)KNDManager.DIStartAddress, 16); IOManager.instance.ReadAllDI(deviceName, (byte)slaveId );
} }
private void btnReadAllDo_Click(object sender, EventArgs e) private void btnReadAllDo_Click(object sender, EventArgs e)
{ {
...@@ -255,45 +255,32 @@ namespace OnlineStore.ACSingleStore ...@@ -255,45 +255,32 @@ namespace OnlineStore.ACSingleStore
IO_VALUE value = (IO_VALUE)cmbWriteValue.SelectedIndex; IO_VALUE value = (IO_VALUE)cmbWriteValue.SelectedIndex;
int time = FormUtil.GetIntValue(txtWriteTime); int time = FormUtil.GetIntValue(txtWriteTime);
int slaveId = FormUtil.GetIntValue(txtSlaveId); int slaveId = FormUtil.GetIntValue(txtSlaveId);
KNDManager.ReadMultipleDO(deviceName, (byte)slaveId, (ushort)KNDManager.DoStartAddress, 16); IOManager.instance.ReadAllDO(deviceName, (byte)slaveId);
} }
private void btnOpenDoor_Click(object sender, EventArgs e) private void btnOpenDoor_Click(object sender, EventArgs e)
{ {
boxBean.KNDIOMove(IO_Type.Door_Up, IO_VALUE.HIGH); IOManager.IOMove(IO_Type.Door_Up, IO_VALUE.HIGH);
boxBean.KNDIOMove(IO_Type.Door_Down, IO_VALUE.LOW); IOManager.IOMove(IO_Type.Door_Down, IO_VALUE.LOW);
} }
private void btnCloseDoor_Click(object sender, EventArgs e) private void btnCloseDoor_Click(object sender, EventArgs e)
{ {
boxBean.KNDIOMove(IO_Type.Door_Down, IO_VALUE.HIGH); IOManager.IOMove(IO_Type.Door_Down, IO_VALUE.HIGH);
boxBean.KNDIOMove(IO_Type.Door_Up, IO_VALUE.LOW); IOManager.IOMove(IO_Type.Door_Up, IO_VALUE.LOW);
} }
private void btnLocationUp_Click(object sender, EventArgs e)
{
boxBean.KNDIOMove(IO_Type.LocationCylinder_Down, IO_VALUE.LOW);
boxBean.KNDIOMove(IO_Type.LocationCylinder_Up, IO_VALUE.HIGH);
}
private void btnLocationDown_Click(object sender, EventArgs e)
{
boxBean.KNDIOMove(IO_Type.LocationCylinder_Down, IO_VALUE.HIGH);
boxBean.KNDIOMove(IO_Type.LocationCylinder_Up, IO_VALUE.LOW);
}
private void FrmIOStatus_Shown(object sender, EventArgs e) private void FrmIOStatus_Shown(object sender, EventArgs e)
{ {
SetSkin(this);
timer1.Start(); timer1.Start();
} }
private void btnOpenAxisBreak_Click(object sender, EventArgs e) private void btnOpenAxisBreak_Click(object sender, EventArgs e)
{ {
boxBean.KNDIOMove(IO_Type.Axis_Brake, IO_VALUE.HIGH); IOManager.IOMove(IO_Type.Axis_Brake, IO_VALUE.HIGH);
} }
private void btnCloseAxisBreak_Click(object sender, EventArgs e) private void btnCloseAxisBreak_Click(object sender, EventArgs e)
{ {
boxBean.KNDIOMove(IO_Type.Axis_Brake, IO_VALUE.LOW); IOManager.IOMove(IO_Type.Axis_Brake, IO_VALUE.LOW);
} }
private void button1_Click(object sender, EventArgs e) private void button1_Click(object sender, EventArgs e)
...@@ -303,12 +290,12 @@ namespace OnlineStore.ACSingleStore ...@@ -303,12 +290,12 @@ namespace OnlineStore.ACSingleStore
private void btnOpenLed_Click(object sender, EventArgs e) private void btnOpenLed_Click(object sender, EventArgs e)
{ {
boxBean.KNDIOMove(IO_Type.CameraLight_Power, IO_VALUE.HIGH); IOManager.IOMove(IO_Type.Camera_Led, IO_VALUE.HIGH);
} }
private void btnCloseLed_Click(object sender, EventArgs e) private void btnCloseLed_Click(object sender, EventArgs e)
{ {
boxBean.KNDIOMove(IO_Type.CameraLight_Power, IO_VALUE.LOW); IOManager.IOMove(IO_Type.Camera_Led, IO_VALUE.LOW);
} }
} }
} }
using log4net;
using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.ServiceModel;
using System.Text;
namespace OnlineStore.ACSingleStore
{
public class WCFControl
{
//public static bool isRun=false;
//public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
//private static ServiceHost host = null;
//public static void OpenWCF()
//{
// if (isRun)
// {
// return;
// }
// try
// {
// if (host == null)
// {
// host = new ServiceHost(typeof(AcStoreWCF.CWSMDBox));
// }
// if (host.State != CommunicationState.Opening)
// {
// host.Open();
// }
// isRun = true;
// LogUtil.info("打开WCF服务成功");
// }
// catch (Exception ex)
// {
// LogUtil.error("打开WCF服务出错:" + ex.ToString());
// }
//}
//public static void CloseWCF()
//{
// try
// {
// isRun = false;
// if (host != null)
// {
// host.Close();
// }
// LogUtil.info("关闭WCF服务成功");
// }
// catch (Exception ex)
// {
// LogUtil.error("关闭WCF服务出错:" + ex.ToString());
// }
//}
}
}
...@@ -90,4 +90,5 @@ DeCodeType=解码类型,0=halcon,1=zxing解码 西安料仓解析方式。2= ...@@ -90,4 +90,5 @@ DeCodeType=解码类型,0=halcon,1=zxing解码 西安料仓解析方式。2=
20191102修改: 20191102修改:
在RC-29-32-ACSingleStore基础上新建分支:RC1258-ACSingleStore 在RC-29-32-ACSingleStore基础上新建分支:RC1258-ACSingleStore
主要修改内容:压紧轴改为伺服控制。IO模块使用零点模块。
\ No newline at end of file \ No newline at end of file
主要修改内容:压紧轴改为伺服控制。IO模块使用零点模块。
使用新IO定义。增加蜂鸣器处理
\ No newline at end of file \ No newline at end of file
...@@ -61,10 +61,7 @@ namespace OnlineStore.Common ...@@ -61,10 +61,7 @@ namespace OnlineStore.Common
/// 配置文件路径 Data Matrix ECC 200.dcm /// 配置文件路径 Data Matrix ECC 200.dcm
/// </summary> /// </summary>
public static string CodeParamPath = "CodeParamPath"; public static string CodeParamPath = "CodeParamPath";
/// <summary>
/// 高度传感器转换系数
/// </summary>
public static string AI_ConvertPosition = "AI_ConvertPosition";
/// <summary> /// <summary>
/// 进出轴最大待机点,需要小于3000 /// 进出轴最大待机点,需要小于3000
/// </summary> /// </summary>
...@@ -75,10 +72,7 @@ namespace OnlineStore.Common ...@@ -75,10 +72,7 @@ namespace OnlineStore.Common
/// 出库等待料盘拿走的时间,秒 /// 出库等待料盘拿走的时间,秒
/// </summary> /// </summary>
public static string OutStoreWaitSeconds = "OutStoreWaitSeconds"; public static string OutStoreWaitSeconds = "OutStoreWaitSeconds";
/// <summary>
/// 压紧轴1mm对应的脉冲
/// </summary>
public static string ComAxisChangeValue = "ComAxisChangeValue";
/// <summary> /// <summary>
/// 温控器类型,0=壁挂王字壳温湿度变送器,1=妙昕温湿度记录仪 /// 温控器类型,0=壁挂王字壳温湿度变送器,1=妙昕温湿度记录仪
...@@ -90,5 +84,10 @@ namespace OnlineStore.Common ...@@ -90,5 +84,10 @@ namespace OnlineStore.Common
/// </summary> /// </summary>
public static string DeCodeType = "DeCodeType"; public static string DeCodeType = "DeCodeType";
public static string DefaultPWD = "DefaultPWD"; public static string DefaultPWD = "DefaultPWD";
public static string UseAIOBOX = "UseAIOBOX";
/// <summary>
/// 是否打开蜂鸣器
/// </summary>
public static string UseBuzzer = "UseBuzzer";
} }
} }
...@@ -36,6 +36,9 @@ ...@@ -36,6 +36,9 @@
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Asa.IOModule.AIOBOX">
<HintPath>..\..\dll\Asa.IOModule.AIOBOX.dll</HintPath>
</Reference>
<Reference Include="CodeLibrary"> <Reference Include="CodeLibrary">
<HintPath>..\..\dll\CodeLibrary.dll</HintPath> <HintPath>..\..\dll\CodeLibrary.dll</HintPath>
</Reference> </Reference>
...@@ -63,15 +66,17 @@ ...@@ -63,15 +66,17 @@
<Compile Include="acSingleStore\AC_SA_BoxBean_Partial.cs" /> <Compile Include="acSingleStore\AC_SA_BoxBean_Partial.cs" />
<Compile Include="acSingleStore\StoreManager.cs" /> <Compile Include="acSingleStore\StoreManager.cs" />
<Compile Include="halcon\CodeManager.cs" /> <Compile Include="halcon\CodeManager.cs" />
<Compile Include="KangNaiDe\AITcpClient.cs" /> <Compile Include="IO\AIManager.cs" />
<Compile Include="KangNaiDe\KNDAIManager.cs" /> <Compile Include="IO\AIOBOX\AIOAIManager.cs" />
<Compile Include="KangNaiDe\KNDManager.cs" /> <Compile Include="IO\AIOBOX\AIOBOXManager.cs" />
<Compile Include="KangNaiDe\MasterTcpClient.cs" /> <Compile Include="IO\IOManager.cs" />
<Compile Include="IO\KangNaiDe\AITcpClient.cs" />
<Compile Include="IO\KangNaiDe\KNDAIManager.cs" />
<Compile Include="IO\KangNaiDe\KNDManager.cs" />
<Compile Include="IO\KangNaiDe\MasterTcpClient.cs" />
<Compile Include="PanasonicServo\ACCMDManager.cs" /> <Compile Include="PanasonicServo\ACCMDManager.cs" />
<Compile Include="PanasonicServo\ACServerManager.cs" /> <Compile Include="PanasonicServo\ACServerManager.cs" />
<Compile Include="PanasonicServo\ACServerManager_Partial.cs" /> <Compile Include="PanasonicServo\ACServerManager_Partial.cs" />
<Compile Include="ShuoKe\MeteringSignalBean.cs" />
<Compile Include="ShuoKe\ShuoKeController.cs" />
<Compile Include="store\LineMoveP.cs" /> <Compile Include="store\LineMoveP.cs" />
<Compile Include="store\LineAlarm.cs"> <Compile Include="store\LineAlarm.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
......
using Asa.IOModule;
using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
namespace OnlineStore.DeviceLibrary
{
public abstract class AIManager
{
public bool NeedShow = false;
public static AIManager Instance = null;
public static void Init()
{
bool isAIOBox = ConfigAppSettings.GetIntValue(Setting_Init.UseAIOBOX).Equals(1);
if (isAIOBox)
{
Instance = new AIOAIManager();
}
else
{
Instance = new KNDAIManager();
}
}
public static double ConvertAI(double aiValue, double defaultValue)
{
double xishu = (double)StoreManager.Config.AI_ConvertPosition;
double result = Math.Round((aiValue - defaultValue) / xishu, 2);
return result;
}
public abstract void ConnectionIP(string ioIp);
public abstract void CloseConnect();
public abstract double GetAIValue(string ioiP,int index);
}
}
using Asa.IOModule;
using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary
{
public class AIOAIManager:AIManager
{
private object AILock = "";
private List<int> AIValList = null;
private int AILength = 4;
private Asa.IOModule.AIOBOX AIBox = null;
public override void ConnectionIP(string ioIp)
{
int autoMS = 150;
try
{
AIValList = new List<int>();
AIBox = new Asa.IOModule.AIOBOX();
AIBox.IP = ioIp;
// bool rtn = AIBox.AutoIP(ioIp);
AIBox.SetInput(Asa.IOModule.Box_Type.AI, AILength);
AIBox.SetOutput(Asa.IOModule.Box_Type.DO, 0);
AIBox.AutoReadInput(true, autoMS);
AIBox.AI_Changed_Event += Box_AI_Changed_Event;
LogUtil.debug("开始连接AI模块[" + ioIp + "][" + autoMS + "],尝试重连三次");
for (int i = 1; i <= 3; i++)
{
bool result = AIBox.Connect();
if (result)
{
LogUtil.info("第【" + i + "】次连接IO模块[" + ioIp + "][" + autoMS + "]成功:" + AIBox.ErrInfo);
Thread.Sleep(10);
break;
}
else
{
LogUtil.error("第【" + i + "】次连接IO模块[" + ioIp + "][" + autoMS + "]失败:" + AIBox.ErrInfo + "");
}
Thread.Sleep(10);
}
}
catch (Exception error)
{
LogUtil.error("连接IO模块[" + ioIp + "][" + autoMS + "]出错:" + error.ToString());
}
}
public override void CloseConnect()
{
try
{
if (AIBox != null)
{
AIBox.Close();
}
}
catch (Exception ex)
{
LogUtil.error("断开AI连接出错:" + ex.ToString());
}
}
private void Box_AI_Changed_Event(AIOBOX box, int[] val)
{
try
{
if (val != null && val.Length >= AILength)
{
lock (AILock)
{
AIValList = new List<int>();
AIValList.AddRange(val);
}
}
}
catch (Exception ex)
{
LogUtil.error("Box_AI_Changed_Event出错:" + ex.ToString());
}
}
public override double GetAIValue(string ioiP,int index)
{
if (AIValList != null && AIValList.Count > index)
{
return AIValList[index];
}
return -1;
}
//public override double ConvertAI(double aiValue, double defaultValue)
//{
// double xishu = (double)ConfigAppSettings.GetNumValue(Setting_Init.AI_ConvertPosition);
// double result = Math.Round((aiValue - defaultValue) / xishu, 2);
// return result;
//}
}
}
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
namespace OnlineStore.DeviceLibrary
{
public abstract class IOManager
{
public static IOManager instance = null;
public abstract void ConnectionIOList(List<string> dIODeviceNameList);
#region KNDIO
public static void IOMove(string ioType, IO_VALUE ioValue)
{
if (StoreManager.Config.StoreDOList.ContainsKey(ioType))
{
ConfigIO configIo = StoreManager.Config.StoreDOList[ioType];
//DateTime time = DateTime.Now;
instance.WriteSingleDO(configIo.IO_IP, configIo.SlaveID, configIo.GetIOAddr(), ioValue);
//TimeSpan span = DateTime.Now - time;
//if (span.TotalMilliseconds > 100)
//{
// LogUtil.error("IOMove [" + ioType + "] ["+ioValue+"]耗时" + span.TotalMilliseconds);
//}
Thread.Sleep(60);
}
else
{
LogUtil.error("没有DO=" + ioType);
}
}
public static IO_VALUE IOValue(string ioType)
{
IO_VALUE ioValue = IO_VALUE.LOW;
if (StoreManager.Config.StoreDIList.ContainsKey(ioType))
{
ConfigIO configIo = StoreManager.Config.StoreDIList[ioType];
ioValue = instance.GetDIValue(configIo.IO_IP, configIo.SlaveID, configIo.GetIOAddr());
//UpdateDoValue(ioType, ioValue);
}
else if (StoreManager.Config.StoreDOList.ContainsKey(ioType))
{
ConfigIO configIo = StoreManager.Config.StoreDOList[ioType];
ioValue = instance.GetDOValue(configIo.IO_IP, configIo.SlaveID, configIo.GetIOAddr());
}
else
{
LogUtil.error("没有DO=" + ioType);
}
return ioValue;
}
public static IO_VALUE DOValue(string ioType)
{
IO_VALUE ioValue = IO_VALUE.LOW;
if (StoreManager.Config.StoreDOList.ContainsKey(ioType))
{
ConfigIO configIo = StoreManager.Config.StoreDOList[ioType];
ioValue = instance.GetDOValue(configIo.IO_IP, configIo.SlaveID, configIo.GetIOAddr());
}
else
{
LogUtil.error("没有DO=" + ioType);
}
return ioValue;
}
#endregion
public static void Init()
{
bool isAIOBox = ConfigAppSettings.GetIntValue(Setting_Init.UseAIOBOX).Equals(1);
if (isAIOBox)
{
instance = new AIOBOXManager();
}
else
{
instance = new KNDManager();
}
}
public abstract void ReadAllDI(string deviceName, byte slaveId);
public abstract void ReadAllDO(string deviceName, byte slaveId);
public abstract void WriteSingleDO(string deviceName, byte slaveId, ushort index, IO_VALUE value, int time);
public abstract void WriteSingleDO(string deviceName, byte slaveId, ushort index, IO_VALUE value);
public abstract IO_VALUE GetDIValue(string deviceName, byte slaveID, ushort v);
public abstract IO_VALUE GetDOValue(string deviceName, byte slaveID, ushort v);
public abstract IO_VALUE GetIOValue(ConfigIO configIO);
public abstract void CloseAllDO();
public abstract void CloseAllConnection();
}
}
...@@ -15,22 +15,21 @@ namespace OnlineStore.DeviceLibrary ...@@ -15,22 +15,21 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 康奈德IO控制模块 /// 康奈德IO控制模块
/// </summary> /// </summary>
public class KNDAIManager public class KNDAIManager : AIManager
{ {
public static ushort DefaultAILength = 8; public ushort DefaultAILength = 8;
public static byte DefualtSlaveID = 255; public byte DefualtSlaveID = 255;
private static string AIStartAddress = "0258"; private string AIStartAddress = "0258";
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public Dictionary<string, AITcpClient> mastMap = new Dictionary<string, AITcpClient>();
public static Dictionary<string, AITcpClient> mastMap = new Dictionary<string, AITcpClient>(); public Dictionary<string, List<KNDAI>> AIValueMap = new Dictionary<string, List<KNDAI>>();
public static Dictionary<string, List<KNDAI>> AIValueMap = new Dictionary<string, List<KNDAI>>(); private object AIMapLock = "";
private static object AIMapLock = "";
public static System.Timers.Timer timer = null; public System.Timers.Timer timer = null;
private static ushort port = 502; private ushort port = 502;
//public static bool IsNeedReadAI = true; //public static bool IsNeedReadAI = true;
public static void ConnectionIP(string ioIp) public override void ConnectionIP(string ioIp)
{ {
if (timer == null) if (timer == null)
{ {
...@@ -68,22 +67,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -68,22 +67,19 @@ namespace OnlineStore.DeviceLibrary
MBmaster.OnException += new AITcpClient.ExceptionData(MBmaster_OnException); MBmaster.OnException += new AITcpClient.ExceptionData(MBmaster_OnException);
MBmaster.autoConnectOfBreak = false; MBmaster.autoConnectOfBreak = false;
mastMap.Add(ioIp, MBmaster); mastMap.Add(ioIp, MBmaster);
if (MBmaster.ISConnection()) LogUtil.info("连接AI模块[" + ioIp + "]成功");
{ Thread.Sleep(10);
LogUtil.info(LOGGER, "连接AI模块[" + ioIp + "]成功"); WriteAIScope(ioIp, 1);
Thread.Sleep(10); Thread.Sleep(10);
WriteAIScope(ioIp, 1); ReadAll(ioIp);
Thread.Sleep(10);
ReadAll(ioIp);
}
} }
catch (Exception error) catch (Exception error)
{ {
LogUtil.error(LOGGER, "连接AI模块[" + ioIp + "]出错:" + error.ToString()); LogUtil.error("连接AI模块[" + ioIp + "]出错:" + error.ToString());
} }
} }
private static void ReadAll(string ioIp) private void ReadAll(string ioIp)
{ {
//读取所有的DO //读取所有的DO
ReadMultipleAI(ioIp, DefualtSlaveID, AIStartAddress, DefaultAILength); ReadMultipleAI(ioIp, DefualtSlaveID, AIStartAddress, DefaultAILength);
...@@ -92,7 +88,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -92,7 +88,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 判断Io模块是否连接 /// 判断Io模块是否连接
/// </summary> /// </summary>
public static bool IsConnection(string ip) public bool IsConnection(string ip)
{ {
try try
{ {
...@@ -113,14 +109,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -113,14 +109,14 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(LOGGER, "出错啦:" + ex.ToString()); LogUtil.error("出错啦:" + ex.ToString());
} }
return false; return false;
} }
private static DateTime PreCheckTime = DateTime.Now; private DateTime PreCheckTime = DateTime.Now;
private static bool isProcess = false; private bool isProcess = false;
public static bool NeedShow = false;
private static void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) private void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{ {
if (isProcess) if (isProcess)
{ {
...@@ -129,7 +125,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -129,7 +125,7 @@ namespace OnlineStore.DeviceLibrary
try try
{ {
isProcess = true; isProcess = true;
bool IsNeedReadAI = StoreManager.Store.KNDIOValue(IO_Type.TrayCheck_Door).Equals(IO_VALUE.HIGH) || NeedShow; bool IsNeedReadAI = IOManager.IOValue(IO_Type.TrayCheck_Door).Equals(IO_VALUE.HIGH) || NeedShow;
TimeSpan span = DateTime.Now - PreCheckTime; TimeSpan span = DateTime.Now - PreCheckTime;
List<string> list = new List<string>(mastMap.Keys); List<string> list = new List<string>(mastMap.Keys);
foreach (string IP in list) foreach (string IP in list)
...@@ -148,7 +144,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -148,7 +144,7 @@ namespace OnlineStore.DeviceLibrary
} }
else if (span.TotalSeconds > 3) else if (span.TotalSeconds > 3)
{ {
LogUtil.error(LOGGER, "AI模块" + IP + "当前没有连上,重连" + IP); LogUtil.error("AI模块" + IP + "当前没有连上,重连" + IP);
ConnectionIP(IP); ConnectionIP(IP);
PreCheckTime = DateTime.Now; PreCheckTime = DateTime.Now;
} }
...@@ -156,18 +152,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -156,18 +152,18 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(LOGGER, "出错啦:" + ex.ToString()); LogUtil.error("出错啦:" + ex.ToString());
} }
Thread.Sleep(2); Thread.Sleep(2);
isProcess = false; isProcess = false;
} }
private static void WriteAIScope(string ioIp, int value) private void WriteAIScope(string ioIp, int value)
{ {
// 0 表示 0 - 10V, 1 表示 0 - 5V // 0 表示 0 - 10V, 1 表示 0 - 5V
WriteAIScope(ioIp, DefualtSlaveID, "03EA", value); WriteAIScope(ioIp, DefualtSlaveID, "03EA", value);
} }
private static void WriteAIScope(string ioIp, byte slaveId, string Adress, int value) private void WriteAIScope(string ioIp, byte slaveId, string Adress, int value)
{ {
// 写 AI 模块采样范围,可以往寄存器里面写入 0 或 1。 0 表示 0 - 10V, 1 表示 0 - 5V。默 // 写 AI 模块采样范围,可以往寄存器里面写入 0 或 1。 0 表示 0 - 10V, 1 表示 0 - 5V。默
//认 0,写 AI 模块采样范围为 0 - 5V //认 0,写 AI 模块采样范围为 0 - 5V
...@@ -180,10 +176,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -180,10 +176,10 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
LogUtil.error(LOGGER, "WriteAIScope出错没有连接AI模块:" + ioIp); LogUtil.error("WriteAIScope出错没有连接AI模块:" + ioIp);
} }
} }
private static void ReadMultipleAI(string ioIp, byte slaveId, string StartAddress, int length) private void ReadMultipleAI(string ioIp, byte slaveId, string StartAddress, int length)
{ {
ushort ID = 1; ushort ID = 1;
AITcpClient MBmaster = null; AITcpClient MBmaster = null;
...@@ -194,10 +190,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -194,10 +190,10 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
LogUtil.error(LOGGER, "ReadMultipleAI出错没有连接AI模块:" + ioIp); LogUtil.error("ReadMultipleAI出错没有连接AI模块:" + ioIp);
} }
} }
public static void CloseAllConnection() public override void CloseConnect()
{ {
List<AITcpClient> list = new List<AITcpClient>(); List<AITcpClient> list = new List<AITcpClient>();
foreach (AITcpClient tcp in list) foreach (AITcpClient tcp in list)
...@@ -206,20 +202,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -206,20 +202,14 @@ namespace OnlineStore.DeviceLibrary
} }
mastMap.Clear(); mastMap.Clear();
} }
public static double ConvertAI(double aiValue, double defaultValue)
{ public override double GetAIValue(string ioiP, int index)
double xishu = (double)ConfigAppSettings.GetNumValue(Setting_Init.AI_ConvertPosition);
double result = Math.Round((aiValue - defaultValue) / xishu, 2);
return result;
}
public static double GetAIValue(string ioiP, int index)
{ {
double aiValue = GetAIValue(ioiP, DefualtSlaveID, index - 1); double aiValue = GetAIValue(ioiP, DefualtSlaveID, index - 1);
return Math.Round(aiValue, 2); return Math.Round(aiValue, 2);
} }
public static double GetAIValue(string ioIP, byte slaveId, int index) public double GetAIValue(string ioIP, byte slaveId, int index)
{ {
double value = 0; double value = 0;
try try
...@@ -243,7 +233,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -243,7 +233,7 @@ namespace OnlineStore.DeviceLibrary
} }
return value; return value;
} }
private static void ClearAIData(string ioIp) private void ClearAIData(string ioIp)
{ {
byte[] datas = new byte[32]; byte[] datas = new byte[32];
for (int i = 0; i < datas.Length; i++) for (int i = 0; i < datas.Length; i++)
...@@ -252,7 +242,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -252,7 +242,7 @@ namespace OnlineStore.DeviceLibrary
} }
SaveAIData(ioIp, 3, datas); SaveAIData(ioIp, 3, datas);
} }
private static void SaveAIData(string ioIp, ushort ID, byte[] values) private void SaveAIData(string ioIp, ushort ID, byte[] values)
{ {
try try
{ {
...@@ -288,7 +278,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -288,7 +278,7 @@ namespace OnlineStore.DeviceLibrary
} }
try try
{ {
if (StoreManager.Store != null && StoreManager.Store.KNDIOValue(IO_Type.TrayCheck_Door).Equals(IO_VALUE.HIGH)) if (StoreManager.Store != null && IOManager.IOValue(IO_Type.TrayCheck_Door).Equals(IO_VALUE.HIGH))
{ {
if (StoreManager.Config.AIDI1_Addr > 0 && StoreManager.Config.AIDI2_Addr > 0) if (StoreManager.Config.AIDI1_Addr > 0 && StoreManager.Config.AIDI2_Addr > 0)
{ //每次上传后验证下 { //每次上传后验证下
...@@ -325,18 +315,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -325,18 +315,18 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(LOGGER, "SaveAIData出错:" + ex.ToString()); LogUtil.error("SaveAIData出错:" + ex.ToString());
} }
} }
private static float BitToFloat(string hexString) private float BitToFloat(string hexString)
{ {
uint num = uint.Parse(hexString, System.Globalization.NumberStyles.AllowHexSpecifier); uint num = uint.Parse(hexString, System.Globalization.NumberStyles.AllowHexSpecifier);
byte[] floatVals = BitConverter.GetBytes(num); byte[] floatVals = BitConverter.GetBytes(num);
float f = BitConverter.ToSingle(floatVals, 0); float f = BitConverter.ToSingle(floatVals, 0);
return f; return f;
} }
private static void MBmaster_OnResponseData(string ioIp, ushort ID, byte function, byte[] values, byte[] reviceData) private void MBmaster_OnResponseData(string ioIp, ushort ID, byte function, byte[] values, byte[] reviceData)
{ {
try try
{ {
...@@ -397,10 +387,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -397,10 +387,10 @@ namespace OnlineStore.DeviceLibrary
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(LOGGER, "处理接受数据出错:" + ex.ToString()); LogUtil.error("处理接受数据出错:" + ex.ToString());
} }
} }
private static void MBmaster_OnException(string ioIp, ushort id, byte function, byte exception, byte[] reviceData) private void MBmaster_OnException(string ioIp, ushort id, byte function, byte exception, byte[] reviceData)
{ {
string exc = "Modbus says error: "; string exc = "Modbus says error: ";
switch (exception) switch (exception)
...@@ -418,7 +408,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -418,7 +408,7 @@ namespace OnlineStore.DeviceLibrary
default: default:
break; break;
} }
LOGGER.Error("接收数据出错:" + exc); LogUtil.error("接收数据出错:" + exc);
} }
} }
......
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Timers;
namespace OnlineStore.DeviceLibrary
{
/// <summary>
/// 压紧机构计量检测信号处理
/// </summary>
public class MeteringSignal
{
public static int ComAxisChangeValue = ConfigAppSettings.GetIntValue(Setting_Init.ComAxisChangeValue);
/// <summary>
/// 信号变化次数
/// </summary>
public static int SignalChangeCount=0;
public static int TragetChangeCount = 0;
public static IO_VALUE PreSignalValue = IO_VALUE.LOW;
private static System.Timers.Timer timer = null;
public static void StartCheck(int targetPositon, int currPosition)
{
int chazhi = Math.Abs(targetPositon - currPosition);
int count = chazhi / ComAxisChangeValue;
if (count > 0 && chazhi > ComAxisChangeValue)
{
StartCheck(count);
}
}
private static void StartCheck(int targetCount)
{
TragetChangeCount = targetCount;
if (timer == null)
{
timer = new System.Timers.Timer();
timer.Interval = 50;
timer.AutoReset = true;
timer.Elapsed += Timer_Elapsed;
timer.Enabled = false;
}
LogUtil.debug("开始压紧轴计量检测,预计变化" + TragetChangeCount + "次");
IsInProcess = false;
PreSignalValue = IO_VALUE.LOW;
SignalChangeCount = 0;
timer.Start();
}
public static void StopCheck()
{
if(timer==null)
{ return; }
timer.Stop();
}
private static bool IsInProcess = false;
protected static void Timer_Elapsed(object sender, ElapsedEventArgs e)
{
if (IsInProcess) { return; }
IsInProcess = true;
IO_VALUE value = StoreManager.Store.KNDIOValue(IO_Type.CompressAxis_Check);
if (value.Equals(IO_VALUE.HIGH) && PreSignalValue.Equals(IO_VALUE.LOW))
{
SignalChangeCount++;
LogUtil.debug("检测到信号变化,已经变化" + SignalChangeCount + "次");
}
PreSignalValue = value;
if (TragetChangeCount <= SignalChangeCount)
{
timer.Stop();
}
IsInProcess = false;
}
}
}
类型,说明,名称,属性值,设备名称,默认值,描述,电器定义,代码定义,SlaveID, 类型,说明,名称,属性值,设备名称,默认值,描述,电器定义,代码定义,SlaveID,
DI,急停,SuddenStop_BTN,200,192.168.200.11,0,急停,X01,DI-01,0, ,,,,,,,,,,
DI,复位,Reset_BTN,201,192.168.200.11,0,复位,X02,DI-02,0, PRO,IO模块对应的DI数量,IO_DILength,192.168.200.11#16,,,,,,,
DI,自动,AutoRun_Signal,202,192.168.200.11,0,自动,X03,DI-03,0, PRO,模块对应的DO数量,IO_DOLength,192.168.200.11#16,,,,,,,
DI,气压检测,Airpressure_Check,203,192.168.200.11,0,气压检测,X04,DI-04,0, ,,,,,,,,,,
DI,料盘检测1(进料口),TrayCheck_Door,204,192.168.200.11,0,料盘检测1(进料口),X05,DI-05,0, DI,急停,SuddenStop_BTN,0,192.168.200.11,0,急停,X01,DI-01,0,
DI,料盘检测2(料叉),TrayCheck_Fixture,205,192.168.200.11,0,料盘检测2(料叉),X06,DI-06,0, DI,复位,Reset_BTN,1,192.168.200.11,0,复位,X02,DI-02,0,
DI,进料口门上升端,Door_Up,206,192.168.200.11,0,进料口门上升端,X07,DI-07,0, DI,自动,AutoRun_Signal,2,192.168.200.11,0,自动,X03,DI-03,0,
DI,进料口门下降端,Door_Down,207,192.168.200.11,0,进料口门下降端,X08,DI-08,0, DI,气压检测,Airpressure_Check,3,192.168.200.11,0,气压检测,X04,DI-04,0,
,,,208,192.168.200.11,0,,X09,DI-09,0, DI,料盘检测1(进料口),TrayCheck_Door,4,192.168.200.11,0,料盘检测1(进料口),X05,DI-05,0,
,,,209,192.168.200.11,0,,X10,DI-10,0, DI,料盘检测2(料叉),TrayCheck_Fixture,5,192.168.200.11,0,料盘检测2(料叉),X06,DI-06,0,
DI,前门限位,Door_LimitSingle,210,192.168.200.11,0,前门限位,X11,DI-11,0, DI,进料口门上升端,Door_Up,6,192.168.200.11,0,进料口门上升端,X07,DI-07,0,
,,,211,192.168.200.11,0,,X12,DI-12,0, DI,进料口门下降端,Door_Down,7,192.168.200.11,0,进料口门下降端,X08,DI-08,0,
DI,安全光栅,SafetyLightCurtains,212,192.168.200.11,0,安全光栅,X13,DI-13,0, DI,安全光栅,SafetyLightCurtains,8,192.168.200.11,0,安全光栅,X09,DI-09,0,
,,,213,192.168.200.11,0,,X14,DI-14,0, DI,前门限位,Door_Limit,9,192.168.200.11,0,前门限位,X10,DI-10,0,
,,,214,192.168.200.11,0,,X15,DI-15,0, DI,左侧门限位,Door_LeftLimit,10,192.168.200.11,0,左侧门限位,X11,DI-11,0,
DI,压紧机构计量检测,CompressAxis_Check,215,192.168.200.11,0,压紧机构计量检测,X16,DI-16,0, DI,右侧门限位,Door_RightLimit,11,192.168.200.11,0,右侧门限位,X12,DI-12,0,
DO,自动指示灯,AutoRun_HddLed,100,192.168.200.11,0,自动指示灯,Y01,DO-01,0, ,,,12,192.168.200.11,0,,X13,DI-13,0,
DO,故障指示灯,Alarm_HddLed,101,192.168.200.11,0,故障指示灯,Y02,DO-02,0, ,,,13,192.168.200.11,0,,X14,DI-14,0,
DO,待机指示灯,RunSign_HddLed,102,192.168.200.11,0,待机指示灯,Y03,DO-03,0, ,,,14,192.168.200.11,0,,X15,DI-15,0,
DO,吹气SOL ON,StartOrStopBlow,103,192.168.200.11,0,吹气SOL ON,Y04,DO-04,0, ,,,15,192.168.200.11,0,,X16,DI-16,0,
DO,料仓运转ON,Run_Signal,104,192.168.200.11,0,料仓运转ON,Y05,DO-05,0, DO,自动指示灯,AutoRun_HddLed,0,192.168.200.11,0,自动指示灯,Y01,DO-01,0,
DO,轴2刹车电源ON,Axis_Brake,105,192.168.200.11,0,轴2刹车电源ON,Y06,DO-06,0, DO,故障指示灯,Alarm_HddLed,1,192.168.200.11,0,故障指示灯,Y02,DO-02,0,
DO,进料口门上升SOL,Door_Up,106,192.168.200.11,0,进料口门上升SOL,Y07,DO-07,0, DO,待机指示灯,RunSign_HddLed,2,192.168.200.11,0,待机指示灯,Y03,DO-03,0,
DO,进料口门下降SOL,Door_Down,107,192.168.200.11,0,进料口门下降SOL,Y08,DO-08,0, DO,故障蜂鸣器,Alarm_Buzzer,3,192.168.200.11,0,故障蜂鸣器,Y04,DO-04,0,
,,,108,192.168.200.11,0,,Y09,DO-09,0, DO,吹气SOL ON,StartOrStopBlow,4,192.168.200.11,0,吹气SOL ON,Y05,DO-05,0,
,,,109,192.168.200.11,0,,Y10,DO-10,0, DO,料仓运转ON,Run_Signal,5,192.168.200.11,0,料仓运转ON,Y06,DO-06,0,
DO,相机照明开,CameraLight_Power,110,192.168.200.11,0,相机照明开,Y11,DO-11,0, DO,轴2刹车电源ON,Axis_Brake,6,192.168.200.11,0,轴2刹车电源ON,Y07,DO-07,0,
,,,111,192.168.200.11,0,,Y12,DO-12,0, DO,进料口门上升SOL,Door_Up,7,192.168.200.11,0,进料口门上升SOL,Y08,DO-08,0,
,,,112,192.168.200.11,0,,Y13,DO-13,0, DO,进料口门下降SOL,Door_Down,8,192.168.200.11,0,进料口门下降SOL,Y09,DO-09,0,
,,,113,192.168.200.11,0,,Y14,DO-14,0, DO,相机照明开,Camera_Led,9,192.168.200.11,0,相机照明开,Y10,DO-10,0,
,,,114,192.168.200.11,0,,Y15,DO-15,0, ,,,10,192.168.200.11,0,,Y11,DO-11,0,
,,,115,192.168.200.11,0,,Y16,DO-16,0, ,,,11,192.168.200.11,0,,Y12,DO-12,0,
,,,12,192.168.200.11,0,,Y13,DO-13,0,
,,,13,192.168.200.11,0,,Y14,DO-14,0,
,,,14,192.168.200.11,0,,Y15,DO-15,0,
,,,15,192.168.200.11,0,,Y16,DO-16,0,
AXIS,(轴一)旋转轴,Middle_Axis,1,COM1,0,,,,, AXIS,(轴一)旋转轴,Middle_Axis,1,COM1,0,,,,,
AXIS,(轴二)升降轴轴,UpDown_Axis,2,COM1,0,,,,, AXIS,(轴二)升降轴轴,UpDown_Axis,2,COM1,0,,,,,
AXIS,(轴三)进出轴,InOut_Axis,3,COM1,0,,,,, AXIS,(轴三)进出轴,InOut_Axis,3,COM1,0,,,,,
AXIS,(轴四)压紧轴,Comp_Axis,4,COM1,0,,,,,
PRO,升降轴 进料口取料点 P1,UpDownAxis_DoorOPosition_P1,403000,,,,,,, PRO,升降轴 进料口取料点 P1,UpDownAxis_DoorOPosition_P1,403000,,,,,,,
PRO,升降轴 进料口出料前点 P2,UpDownAxis_DoorIPosition_P2,415000,,,,,,, PRO,升降轴 进料口出料前点 P2,UpDownAxis_DoorIPosition_P2,415000,,,,,,,
PRO,升降轴 进料口取料缓冲点 P7,UpDownAxis_DoorOBPosition_P7,415000,,,,,,, PRO,升降轴 进料口取料缓冲点 P7,UpDownAxis_DoorOBPosition_P7,415000,,,,,,,
PRO,升降轴 进料口出料缓冲点 P8,UpDownAxis_DoorIBPosition_P8,403000,,,,,,, PRO,升降轴 进料口出料缓冲点 P8,UpDownAxis_DoorIBPosition_P8,403000,,,,,,,
PRO,旋转轴(轴1)P1 待机原位点,MiddleAxis_P1_Position,268093,,,,,,, PRO,旋转轴(轴1)P1 待机原位点,MiddleAxis_P1_Position,268093,,,,,,,
PRO,进出轴(轴3)P1待机原位点,InOutAxis_P1_Position,1000,,,,,,, PRO,进出轴(轴3)P1待机原位点,InOutAxis_P1_Position,1000,,,,,,,
PRO,压紧轴(轴4)P1待机原位点,CompressAxis_P1_Position,-7500,,,,,,, PRO,压紧轴(轴4)P1待机原位点,CompressAxis_P1_Position,2000,,,,,,,
PRO,是否使用定位气缸,IsHasLocationCylinder,0,,,,,,, PRO,是否使用定位气缸,IsHasLocationCylinder,0,,,,,,,
PRO,是否有左右侧门,IsHasDoorLimit,1,,,,,,, PRO,是否有左右侧门,IsHasDoorLimit,1,,,,,,,
PRO,是否使用压紧轴(1=使用),IsHasCompress_Axis,1,,,,, ,, PRO,是否使用压紧轴(1=使用),IsHasCompress_Axis,1,,,,, ,,
...@@ -67,6 +72,13 @@ PRO,(轴三)进出轴减速度,InoutAxis_DelSpeed,300,,,,,,, ...@@ -67,6 +72,13 @@ PRO,(轴三)进出轴减速度,InoutAxis_DelSpeed,300,,,,,,,
PRO,(轴三)进出轴原点低速,InoutAxis_HomeLowSpeed,20,,,,,,, PRO,(轴三)进出轴原点低速,InoutAxis_HomeLowSpeed,20,,,,,,,
PRO,(轴三)进出轴原点高速,InoutAxis_HomeHighSpeed,60,,,,,,, PRO,(轴三)进出轴原点高速,InoutAxis_HomeHighSpeed,60,,,,,,,
PRO,(轴三)进出轴原点加速度,InoutAxis_HomeAddSpeed,200,,,,,,, PRO,(轴三)进出轴原点加速度,InoutAxis_HomeAddSpeed,200,,,,,,,
PRO,(轴四)压紧轴目标速度,CompAxis_TargetSpeed,100,,,,,,,
PRO,(轴四)压紧轴加速度,CompAxis_AddSpeed,300,,,,,,,
PRO,(轴四)压紧轴减速度,CompAxis_DelSpeed,300,,,,,,,
PRO,(轴四)压紧轴原点低速,CompAxis_HomeLowSpeed,20,,,,,,,
PRO,(轴四)压紧轴原点高速,CompAxis_HomeHighSpeed,60,,,,,,,
PRO,(轴四)压紧轴原点加速度,CompAxis_HomeAddSpeed,200,,,,,,,
,,,,,,,,,,
PRO,升降轴(轴2)P1速度,UpDownAxis_P1_Speed,250,,,,,,, PRO,升降轴(轴2)P1速度,UpDownAxis_P1_Speed,250,,,,,,,
PRO,升降轴(轴2)P2速度,UpDownAxis_P2_Speed,250,,,,,,, PRO,升降轴(轴2)P2速度,UpDownAxis_P2_Speed,250,,,,,,,
PRO,升降轴(轴2)P3速度,UpDownAxis_P3_Speed,250,,,,,,, PRO,升降轴(轴2)P3速度,UpDownAxis_P3_Speed,250,,,,,,,
...@@ -80,6 +92,9 @@ PRO,旋转轴(轴1)P2速度,MiddleAxis_P2_Speed,120,,,,,,, ...@@ -80,6 +92,9 @@ PRO,旋转轴(轴1)P2速度,MiddleAxis_P2_Speed,120,,,,,,,
PRO,进出轴(轴3)P1速度,InOutAxis_P1_Speed,100,,,,,,, PRO,进出轴(轴3)P1速度,InOutAxis_P1_Speed,100,,,,,,,
PRO,进出轴(轴3)P2速度,InOutAxis_P2_Speed,100,,,,,,, PRO,进出轴(轴3)P2速度,InOutAxis_P2_Speed,100,,,,,,,
PRO,进出轴(轴3)P3速度,InOutAxis_P3_Speed,1000,,,,,,, PRO,进出轴(轴3)P3速度,InOutAxis_P3_Speed,1000,,,,,,,
PRO,压紧轴(轴4)P1速度,CompAxis_P1_Speed,100,,,,,,,
PRO,压紧轴(轴4)P2速度,CompAxis_P2_Speed,100,,,,,,,
PRO,压紧轴(轴4)P3速度,CompAxis_P3_Speed,100,,,,,,,
PRO,(轴一)旋转轴停止时可误差的脉冲数的最小值,MiddleAxis_ErrorCountMin,10,,,,,,, PRO,(轴一)旋转轴停止时可误差的脉冲数的最小值,MiddleAxis_ErrorCountMin,10,,,,,,,
PRO,(轴二)升降轴轴停止时可误差的脉冲数的最小值,UpdownAxis_ErrorCountMin,10,,,,,, , PRO,(轴二)升降轴轴停止时可误差的脉冲数的最小值,UpdownAxis_ErrorCountMin,10,,,,,, ,
PRO,(轴三)进出轴停止时可误差的脉冲数的最小值,InoutAxis_ErrorCountMin,10,,,,,,, PRO,(轴三)进出轴停止时可误差的脉冲数的最小值,InoutAxis_ErrorCountMin,10,,,,,,,
...@@ -102,18 +117,6 @@ PRO,每次吹气的时间(分钟),BlowAir_Time,10,,,,,,, ...@@ -102,18 +117,6 @@ PRO,每次吹气的时间(分钟),BlowAir_Time,10,,,,,,,
PRO,两次吹气间隔(分钟),BlowAir_Interval,10,,,,,,, PRO,两次吹气间隔(分钟),BlowAir_Interval,10,,,,,,,
PRO,温湿度端口号,Humiture_Port,COM2,,,,,,, PRO,温湿度端口号,Humiture_Port,COM2,,,,,,,
,,,,,,,,, , ,,,,,,,,, ,
PRO,硕科步进电机(压紧轴)控制端口号,CompressAxis_PortName,COM6,,,,,,,
PRO,硕科步进电机(压紧轴)控制波特率,CompressAxis_PortBaudrate,9600,,,,,,,
PRO,硕科步进电机(压紧轴)控制奇偶校验,CompressAxis_PortParity,0,,,,,,,
PRO,硕科步进电机(压紧轴)控制停止位,CompressAxis_StopBits,1,,,,,,,
PRO,硕科步进电机(压紧轴)控制初速度,CompressAxis_StartSpeed,5000,,,,,,,
PRO,硕科步进电机(压紧轴)控制最大速度,CompressAxis_MaxSpeed,8000,,,,,,,
PRO,硕科步进电机(压紧轴)控制末速度,CompressAxis_EndSpeed,6000,,,,,,,
PRO,硕科步进电机(压紧轴)控制加速度,CompressAxis_AddSpeed,3000,,,,,,,
PRO,硕科步进电机(压紧轴)控制减速度,CompressAxis_DelSpeed,3000,,,,,,,
PRO,硕科步进电机(压紧轴)控制归零速度(原点返回速度),CompressAxis_HomeSpeed,5000,,,,,,,
PRO,硕科步进电机轴地址(压紧轴),CompressAxis_Slv,1,,,,,,,
,,,,,,,,, ,
PRO,模拟量IO模块的IP地址,AIDevice_IP,192.168.200.12,,,,,,, PRO,模拟量IO模块的IP地址,AIDevice_IP,192.168.200.12,,,,,,,
PRO,模拟信号1默认高度,AIDI1_DefaultPosition,2920,,,,,,, PRO,模拟信号1默认高度,AIDI1_DefaultPosition,2920,,,,,,,
PRO,模拟信号2默认高度,AIDI2_DefaultPosition,2960,,,,,,, PRO,模拟信号2默认高度,AIDI2_DefaultPosition,2960,,,,,,,
...@@ -125,5 +128,7 @@ PRO,模拟信号2的地址,AIDI2_Addr,8,,,,,,, ...@@ -125,5 +128,7 @@ PRO,模拟信号2的地址,AIDI2_Addr,8,,,,,,,
PRO,模拟信号3的地址,AIDI3_Addr,5,,,,,,, PRO,模拟信号3的地址,AIDI3_Addr,5,,,,,,,
PRO,模拟信号4的地址,AIDI4_Addr,6,,,,,,, PRO,模拟信号4的地址,AIDI4_Addr,6,,,,,,,
,,,,,,,,, , ,,,,,,,,, ,
PRO,模拟转换系数,AI_ConvertPosition,55,,,,,,,
,,,,,,,,, ,
PRO,默认的料盘宽度(多种尺寸为0),Default_TrayWidth,0,,,,,,, PRO,默认的料盘宽度(多种尺寸为0),Default_TrayWidth,0,,,,,,,
PRO,特殊二维码尺寸配置,CodeSizeConfig,XA=13x48#XB=13x32#FA=7x32,,,,,,, PRO,特殊二维码尺寸配置,CodeSizeConfig,XA=13x48#XB=13x32#FA=7x32,,,,,,,
...@@ -27,25 +27,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -27,25 +27,7 @@ namespace OnlineStore.DeviceLibrary
public static bool IsConnectServer = !ConfigAppSettings.GetValue(Setting_Init.http_server).Equals(""); public static bool IsConnectServer = !ConfigAppSettings.GetValue(Setting_Init.http_server).Equals("");
public StoreManager() public StoreManager()
{ {
} }
public static bool OpenShuoKe(AC_SA_BoxBean box)
{
//打开硕科步进驱动器端口
Parity parity = (Parity)box.Config.CompressAxis_PortParity;
StopBits bit = (StopBits)box.Config.CompressAxis_StopBits;
bool result = ShuoKeControls.InitPort(box.Config.CompressAxis_PortName, box.Config.CompressAxis_PortBaudrate,
box.Config.CompressAxis_PortParity, 8, bit);
if (result)
{
LogUtil.info(box.StoreName + "打开硕科步进控制器【" + box.Config.CompressAxis_PortName + "】成功");
return true;
}
else
{
LogUtil.error(box.StoreName + "打开硕科步进控制器【" + box.Config.CompressAxis_PortName + "】失败,启动失败!");
return false;
}
}
public static void CheckEnum(Type type) public static void CheckEnum(Type type)
{ {
if (type.IsEnum) if (type.IsEnum)
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<Compile Include="storeConfig\ConfigProAttribute.cs" /> <Compile Include="storeConfig\ConfigProAttribute.cs" />
<Compile Include="storeConfig\config\AC_SA_Config.cs" /> <Compile Include="storeConfig\config\AC_SA_Config.cs" />
<Compile Include="storeConfig\config\StoreType.cs" /> <Compile Include="storeConfig\config\StoreType.cs" />
<Compile Include="storeConfig\config\Store_IO_Type.cs" /> <Compile Include="storeConfig\config\IO_Type.cs" />
<Compile Include="CSVAttribute.cs" /> <Compile Include="CSVAttribute.cs" />
<Compile Include="storeConfig\CSVConfigReader.cs" /> <Compile Include="storeConfig\CSVConfigReader.cs" />
<Compile Include="position\CSVPositionReader.cs" /> <Compile Include="position\CSVPositionReader.cs" />
......
...@@ -64,7 +64,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -64,7 +64,7 @@ namespace OnlineStore.LoadCSVLibrary
{ {
if (String.IsNullOrEmpty(ProType) || String.IsNullOrEmpty(ProName) || String.IsNullOrEmpty(ProVale)) if (String.IsNullOrEmpty(ProType) || String.IsNullOrEmpty(ProName) || String.IsNullOrEmpty(ProVale))
{ {
throw new CVSFieldNotMatchingExection(ToString() + ",【类型:ProType】【名称:ProName】【属性值:ProVale】必须配置值!"); throw new CVSFieldNotMatchingExection("["+ToString() + "],【类型:ProType】【名称:ProName】【属性值:ProVale】必须配置值!");
} }
} }
} }
...@@ -253,7 +253,13 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -253,7 +253,13 @@ namespace OnlineStore.LoadCSVLibrary
{ {
return GetIOValue(); return GetIOValue();
} }
public string IO_IP
{
get
{
return DeviceName;
}
}
public int GetIOValue() public int GetIOValue()
{ {
if (IoValue >= -1) if (IoValue >= -1)
......
...@@ -25,120 +25,94 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -25,120 +25,94 @@ namespace OnlineStore.LoadCSVLibrary
} }
return TypeList; return TypeList;
} }
/// <summary> /// <summary>
/// 料仓,DI 急停 SuddenStop_BTN X01 DI-01 /// DI 急停 SuddenStop_BTN X01
/// </summary> /// </summary>
public static string SuddenStop_BTN = "SuddenStop_BTN"; public static string SuddenStop_BTN = "SuddenStop_BTN";
/// <summary> /// <summary>
/// 料仓 DI 复位 Reset_BTN X02 DI-02 /// DI 复位 Reset_BTN X02
/// </summary> /// </summary>
public static string Reset_BTN = "Reset_BTN"; public static string Reset_BTN = "Reset_BTN";
/// <summary> /// <summary>
///DI 自动运行 AutoRun_Signal ///DI 自动 AutoRun_Signal X03
/// </summary> /// </summary>
public static string AutoRun_Signal = "AutoRun_Signal"; public static string AutoRun_Signal = "AutoRun_Signal";
/// <summary> /// <summary>
/// 料仓DI。气压检测(料仓) Airpressure_Check ///DI 气压检测 Airpressure_Check X04
/// </summary> /// </summary>
public static string Airpressure_Check = "Airpressure_Check"; public static string Airpressure_Check = "Airpressure_Check";
/// <summary> /// <summary>
/// DI 料仓门口料盘检测 TrayCheck_1 /// DI 料盘检测1(进料口) TrayCheck_Door X05
/// </summary> /// </summary>
public static string TrayCheck_Door = "TrayCheck_Door"; public static string TrayCheck_Door = "TrayCheck_Door";
/// <summary> /// <summary>
/// DI 叉子料盘检测 TrayCheck_Fixture /// DI 料盘检测2(料叉) TrayCheck_Fixture X06
/// </summary> /// </summary>
public static string TrayCheck_Fixture = "TrayCheck_Fixture"; public static string TrayCheck_Fixture = "TrayCheck_Fixture";
/// <summary> /// <summary>
/// 料仓IO。定位气缸上升端(料仓) LocationCylinder_Up /// DI 进料口门上升端 Door_Up X07
/// </summary> /// </summary>
public static string LocationCylinder_Up = "LocationCylinder_Up"; public static string Door_Up = "Door_Up";
/// <summary>
///料仓IO。 定位气缸下降端(料仓) LocationCylinder_Down
/// </summary>
public static string LocationCylinder_Down = "LocationCylinder_Down";
/// <summary>
/// 料仓IO。定位气缸上升端(料仓) LocationCylinder2_Up
/// </summary>
public static string LocationCylinder2_Up = "LocationCylinder2_Up";
/// <summary> /// <summary>
///料仓IO。 定位气缸下降端(料仓) LocationCylinder2_Down /// DI 进料口门下降端 Door_Down X08
/// </summary> /// </summary>
public static string LocationCylinder2_Down = "LocationCylinder2_Down"; public static string Door_Down = "Door_Down";
/// <summary> /// <summary>
/// 料仓DO 。料仓运转ON Run_Signal /// DI 安全光栅 SafetyLightCurtains X09
/// </summary> /// </summary>
public static string Run_Signal = "Run_Signal"; public static string SafetyLightCurtains = "SafetyLightCurtains";
/// <summary> /// <summary>
/// 料仓DO 。料仓轴2刹车ON Axis_Brake /// DI 前门限位 Door_Limit X10
/// </summary> /// </summary>
public static string Axis_Brake = "Axis_Brake"; public static string Door_Limit = "Door_Limit";
/// <summary> /// <summary>
/// 料仓DO 。料仓吹气SOL ON StartOrStopBlow /// DI 左侧门限位 Door_LeftLimit X11
/// </summary> /// </summary>
public static string StartOrStopBlow = "StartOrStopBlow"; public static string Door_LeftLimit = "Door_LeftLimit";
/// <summary> /// <summary>
/// DO 自动指示灯 AutoRun_HddLed /// DI 右侧门限位 Door_RightLimit X12
/// </summary> /// </summary>
public static string AutoRun_HddLed = "AutoRun_HddLed"; public static string Door_RightLimit = "Door_RightLimit";
/// <summary> /// <summary>
/// DO 待机指示灯 RunSign_HddLed /// DO 自动指示灯 AutoRun_HddLed Y01
/// </summary> /// </summary>
public static string RunSign_HddLed = "RunSign_HddLed"; public static string AutoRun_HddLed = "AutoRun_HddLed";
/// <summary> /// <summary>
///DO 故障指示灯 Alarm_HddLed ///DO 故障指示灯 Alarm_HddLed Y02
/// </summary> /// </summary>
public static string Alarm_HddLed = "Alarm_HddLed"; public static string Alarm_HddLed = "Alarm_HddLed";
/// <summary>
/// 吹气SOL Blow_Single
/// </summary>
public static string Blow_Single = "Blow_Single";
/// <summary>
/// 进出料口门上升端 Door_Up
/// </summary>
public static string Door_Up = "Door_Up";
/// <summary>
/// 进出料口门下降端 Door_Down
/// </summary>
public static string Door_Down = "Door_Down";
/// <summary> /// <summary>
/// 左侧门限位 /// DO 待机指示灯 RunSign_HddLed Y03
/// </summary> /// </summary>
public static string Left_Door_LimitSingle = "Left_Door_LimitSingle"; public static string RunSign_HddLed = "RunSign_HddLed";
/// <summary> /// <summary>
/// 右侧门限位 /// DO 故障蜂鸣器 Alarm_Buzzer Y04
/// </summary> /// </summary>
public static string Right_Door_LimitSingle = "Right_Door_LimitSingle"; public static string Alarm_Buzzer = "Alarm_Buzzer";
/// <summary> /// <summary>
/// 前门限位 /// DO 吹气SOL ON StartOrStopBlow Y05
/// </summary> /// </summary>
public static string Door_LimitSingle = "Door_LimitSingle"; public static string StartOrStopBlow = "StartOrStopBlow";
/// <summary> /// <summary>
/// 安全光栅 /// DO 料仓运转ON Run_Signal Y06
/// </summary> /// </summary>
public static string SafetyLightCurtains = "SafetyLightCurtains"; public static string Run_Signal = "Run_Signal";
/// <summary> /// <summary>
/// 摄像机光源 /// DO 轴2刹车电源ON Axis_Brake Y07
/// </summary> /// </summary>
public static string CameraLight_Power = "CameraLight_Power"; public static string Axis_Brake = "Axis_Brake";
/// <summary> /// <summary>
/// 压紧机构计量检测 CompressAxis_Check X16 DI-16 /// DO 相机照明开 Camera_Led Y10
/// </summary> /// </summary>
public static string CompressAxis_Check = "CompressAxis_Check"; public static string Camera_Led = "Camera_Led";
} }
public enum IO_VALUE public enum IO_VALUE
{ {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!