Commit b117e876 LN

激光对位置功能,间隔2秒以上才记录

1 个父辈 eb2722ae
...@@ -1797,7 +1797,8 @@ namespace OnlineStore.AutoInOutStore ...@@ -1797,7 +1797,8 @@ namespace OnlineStore.AutoInOutStore
int slvAddr = store.Config.UpDown_Axis.GetAxisValue(); int slvAddr = store.Config.UpDown_Axis.GetAxisValue();
string ioIP = "192.168.200.13"; string ioIP = "192.168.200.13";
int ioIndex = 0; int ioIndex = 0;
if (store.Config.StoreDIList.ContainsKey(IO_Type.UpdownPositionSingal)) // if (store.Config.StoreDIList.ContainsKey(IO_Type.UpdownPositionSingal))
if (store.Config.StoreDIList.ContainsKey(IO_Type.TrayCheck_Fixture))
{ {
ioIP = store.Config.StoreDIList[IO_Type.TrayCheck_Fixture].DeviceName; ioIP = store.Config.StoreDIList[IO_Type.TrayCheck_Fixture].DeviceName;
ioIndex = store.Config.StoreDIList[IO_Type.TrayCheck_Fixture].GetIOAddr(); ioIndex = store.Config.StoreDIList[IO_Type.TrayCheck_Fixture].GetIOAddr();
......
...@@ -227,6 +227,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -227,6 +227,7 @@ namespace OnlineStore.AutoInOutStore
private DateTime LastTime = DateTime.Now; private DateTime LastTime = DateTime.Now;
private List<int> PositionList = new List<int>(); private List<int> PositionList = new List<int>();
private IO_VALUE LastValue = IO_VALUE.LOW; private IO_VALUE LastValue = IO_VALUE.LOW;
private DateTime LastGetPTime = DateTime.Now;
private void ToolTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) private void ToolTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{ {
TimeSpan span = DateTime.Now - LastTime; TimeSpan span = DateTime.Now - LastTime;
...@@ -241,7 +242,8 @@ namespace OnlineStore.AutoInOutStore ...@@ -241,7 +242,8 @@ namespace OnlineStore.AutoInOutStore
if (moveS.Equals(1)) if (moveS.Equals(1))
{ {
IO_VALUE currValue = GetSingleValue(); IO_VALUE currValue = GetSingleValue();
if (LastValue.Equals(IO_VALUE.LOW) && currValue.Equals(IO_VALUE.HIGH)) TimeSpan checkSpan = DateTime.Now - LastGetPTime;
if (LastValue.Equals(IO_VALUE.LOW) && currValue.Equals(IO_VALUE.HIGH)&&checkSpan.TotalSeconds>2)
{ {
int currPos = ACServerManager.GetActualtPosition(PortName, SlvAddr); int currPos = ACServerManager.GetActualtPosition(PortName, SlvAddr);
txtActualPosition.Text = currPos.ToString(); txtActualPosition.Text = currPos.ToString();
...@@ -254,6 +256,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -254,6 +256,7 @@ namespace OnlineStore.AutoInOutStore
} }
LogUtil.info(LogName + "收到信号,【"+ num + "】【" + currPos+"】,差值【"+Math.Abs(currPos-preValue)+"】"); LogUtil.info(LogName + "收到信号,【"+ num + "】【" + currPos+"】,差值【"+Math.Abs(currPos-preValue)+"】");
LastValue = IO_VALUE.HIGH; LastValue = IO_VALUE.HIGH;
LastGetPTime = DateTime.Now;
} }
LastValue = currValue; LastValue = currValue;
...@@ -325,10 +328,13 @@ namespace OnlineStore.AutoInOutStore ...@@ -325,10 +328,13 @@ namespace OnlineStore.AutoInOutStore
timer1.Stop(); timer1.Stop();
if (btnServoOff.Enabled) if (btnServoOff.Enabled)
{ {
btnServoOff_Click(null, null); StopTimer();
// toolTimer.Stop();
ACServerManager.SuddenStop(PortName, SlvAddr);
Thread.Sleep(100);
} }
//ACServerManager.CloseAllPort(); //ACServerManager.CloseAllPort();
IOManager.instance.CloseAllConnection(); //IOManager.instance.CloseAllConnection();
} }
private void btnOpenFolder_Click(object sender, EventArgs e) private void btnOpenFolder_Click(object sender, EventArgs e)
......
...@@ -215,6 +215,7 @@ DI9 不要,只判断DI10 ...@@ -215,6 +215,7 @@ DI9 不要,只判断DI10
20190801 新建分支:RC1252-AutoInOutStore 20190801 新建分支:RC1252-AutoInOutStore
压紧轴改为伺服,压紧轴计量检测信号去掉。 压紧轴改为伺服,压紧轴计量检测信号去掉。
增加升降轴对位置功能,间隔2秒以上才记录
IO配置修改,改为新的IO配置。 IO配置修改,改为新的IO配置。
吸盘改为夹爪,代码逻辑修改。 吸盘改为夹爪,代码逻辑修改。
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!